Workflow for MAG construction
Snakemake arguments
snakemake -p --verbose --keep-remote -j [number of available cores] --kubernetes -s Snakefile --default-remote-provider GS --default-remote-prefix [GCS Bucket] --use-conda --container-image '[Docker image if different than default]'
Examlpe
snakemake -p --verbose --keep-remote -j 400 --kubernetes -s Snakefilev11 --default-remote-provider GS --default-remote-prefix hn-snakemake --use-conda --container-image 'gcr.io/tagareby/snakemake'
Building a custom Docker Image on the
You can start from the sample Dockerfile in this repo which just addes procrps which includes the linux tool free required for megahit -m flag when value less than 1
-
Auth docker using gcloud
gcloud auth configure-docker
-
Build the local DOckerfile
docker build -t [user]/snakemake .
-
Tag the local image
docker tag [user]/snakemake gcr.io/[project_name]/snakemake
-
Push the image to the Google Cloud Container Registery
docker push gcr.io/[project]/snakemake
Code Snippets
17 | shell: "perl scripts/download.pl {params.id} && mv {params.id}*.fastq.gz fastq" |
28 | shell: "cutadapt -a AGATCGGAAGAGC -A AGATCGGAAGAGC -o {output.R1} -p {output.R2} -O 5 --minimum-length=50 {input.R1} {input.R2}" |
40 | shell: "megahit --continue --k-list 27,47,67,87 --kmin-1pass -m 12e+10 --presets meta-large --min-contig-len 1000 -t {threads} -1 {input.R1} -2 {input.R2} -o {output.di}" |
49 50 51 52 | shell: ''' bwa index -p {params.idx} {input} ''' |
64 65 66 67 68 69 70 | shell: ''' bwa mem -t 4 {params.idx} {input.R1} {input.R2} | samtools sort -@4 -m 500M -o {output.bam} - samtools index {output.bam} samtools flagstat {output.bam} > {output.bam}.flagstat ''' |
Support
- Future updates
Related Workflows





