Wednesday, August 10, 2016

install credentials for AWS CLI

mkdir -p $HOME/.aws
aws_key_id=YOUR_KEY_ID
aws_secret_access_key=YOUR_SECRET_KEY
printf "[default]\nregion = us-west-2\n" > $HOME/.aws/config
printf "[default]\naws_access_key_id=${aws_key_id}\naws_secret_access_key=${aws_secret_access_key}\n" > $HOME/.aws/credentials
chmod 600 $HOME/.aws/config $HOME/.aws/credentials

Create a dockerized bcl2fastq

1. Create a working dir with name "bcl2fast_docker"

>mkdir bcl2fast_docker
>cd bcl2fast_docker

2. Download the bcl2fastq package "bcl2fastq2-v2.17.1.14-Linux-x86_64.rpm" from illunima.

>wget ftp://webdata2:webdata2@ussd-ftp.illumina.com/downloads/software/bcl2fastq/bcl2fastq2-v2.17.1.14-Linux-x86_64.zip

>unzip bcl2fastq2-v2.17.1.14-Linux-x86_64.zip

3. Create a wrapper to run the bcl2fastq with name "launcher.py"

4. Create the Docker file

FROM centos:centos7
MAINTAINER yourname@yourcompany.com

COPY src/* /opt/bcl2fastq/
COPY bcl2fastq2-v2.17.1.14-Linux-x86_64.rpm .

RUN yum install -y epel-release \
    && yum install -y python34 bcl2fastq2-v2.17.1.14-Linux-x86_64.rpm \
    && rm bcl2fastq2-v2.17.1.14-Linux-x86_64.rpm \
    && yum install -y pigz \
    && chmod +x /opt/bcl2fastq/launch.py

# User will need to also mount input data at #/data/input/
VOLUME /data/output


ENTRYPOINT ["python", "/opt/bcl2fastq/launch.py"]

5. Build the image with name "bcl2fastq"

>docker build -t bcl2fastq .

6. Run the image

>docker run --rm \
-v /path/to/raw_bcl_input:/data/input:ro \
-v /path/to/fastq_output:/data/output \
bcl2fastq:latest