From a240f5e8a450855fdf7411ac4c7889d7352388ea Mon Sep 17 00:00:00 2001 From: Phil Ewels Date: Wed, 9 Aug 2017 14:21:21 +0200 Subject: [PATCH 01/11] Minor backwards-compatibility thing --- bismark.nf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bismark.nf b/bismark.nf index f988c72e..ceecd54f 100644 --- a/bismark.nf +++ b/bismark.nf @@ -569,7 +569,7 @@ workflow.onComplete { if(workflow.commitId) email_fields['summary']['Pipeline repository Git Commit'] = workflow.commitId if(workflow.revision) email_fields['summary']['Pipeline Git branch/tag'] = workflow.revision if(workflow.container) email_fields['summary']['Docker image'] = workflow.container - email_fields['summary']['Nextflow Version'] = nextflow.version + email_fields['summary']['Nextflow Version'] = workflow.nextflow.version email_fields['summary']['Nextflow Build'] = workflow.nextflow.build email_fields['summary']['Nextflow Compile Timestamp'] = workflow.nextflow.timestamp From b36dd14ce52cb182f04a5413fb4784efdc47818e Mon Sep 17 00:00:00 2001 From: Phil Ewels Date: Tue, 15 Aug 2017 11:00:06 +0200 Subject: [PATCH 02/11] Remove RNA stuff from MultiQC config. --- conf/multiqc_config.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/conf/multiqc_config.yaml b/conf/multiqc_config.yaml index bf9c4d07..0794c3bf 100644 --- a/conf/multiqc_config.yaml +++ b/conf/multiqc_config.yaml @@ -6,6 +6,3 @@ report_comment: > analysis pipeline. For information about how to interpret these results, please see the documentation. swedac_accredited: false -report_section_order: - ngi-rnaseq: - order: -1000 From 1d9344cf4161a2940d6fd8a5abaca854e351d636 Mon Sep 17 00:00:00 2001 From: Phil Ewels Date: Mon, 28 Aug 2017 10:00:28 +0200 Subject: [PATCH 03/11] Bugfix: Collect bismark index to allow multiple samples to aligngs --- CHANGELOG.md | 1 + bismark.nf | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 732a4716..ae76aadc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## v0.3dev * Fix `--rrbs` mode ([#24](https://github.com/SciLifeLab/NGI-MethylSeq/issues/24)) +* Fixed fairly major bug where only a single sample would run past alignment * Merged test scripts and rewrote to use command line flags / new travis script. * Refactored software version collection code to be more resilient and cleaner / easier to maintain. diff --git a/bismark.nf b/bismark.nf index ceecd54f..caf11163 100644 --- a/bismark.nf +++ b/bismark.nf @@ -67,7 +67,6 @@ if( params.bismark_index ){ bismark_index = Channel .fromPath(params.bismark_index) .ifEmpty { exit 1, "Bismark index not found: ${params.bismark_index}" } - makeBismarkIndex_stderr = Channel.empty() } else if ( params.fasta ){ fasta = file(params.fasta) @@ -279,8 +278,8 @@ process bismark_align { } input: - file index from bismark_index set val(name), file(reads) from trimmed_reads + file index from bismark_index.collect() output: file "*.bam" into bam, bam_2 From f491c8ac80e57dc47d0d5dd1d583bfd5a59867fa Mon Sep 17 00:00:00 2001 From: Phil Ewels Date: Wed, 30 Aug 2017 11:48:09 +0200 Subject: [PATCH 04/11] Don't consume software_versions_yaml channel for MultiQC. Update docker image for MultiQC version. --- Dockerfile | 2 +- bismark.nf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index bc9f191a..7e9da7cb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -105,4 +105,4 @@ RUN mkdir /opt/MethylDackel && \ rm /opt/MethylDackel/MethylDackel.zip # Install MultiQC -RUN pip install git+https://github.com/ewels/MultiQC.git +RUN pip install multiqc diff --git a/bismark.nf b/bismark.nf index caf11163..d7c6d891 100644 --- a/bismark.nf +++ b/bismark.nf @@ -522,7 +522,7 @@ process multiqc { file ('bismark/*') from bismark_reports_results.collect() file ('bismark/*') from bismark_summary_results.collect() file ('qualimap/*') from qualimap_results.collect() - file ('software_versions/*') from software_versions_yaml + file ('software_versions/*') from software_versions_yaml.collect() output: file "*_report.html" into multiqc_report From f5dee4e16792b81176e408174f7e734c4132f226 Mon Sep 17 00:00:00 2001 From: Phil Ewels Date: Wed, 30 Aug 2017 16:47:57 +0200 Subject: [PATCH 05/11] Move docker image back to openjdk:8u121 so bowtie build works Also split bwa tools out into own dockerfile to keep things simple --- Dockerfile | 33 ++---------------- Dockerfile-bwa | 91 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 94 insertions(+), 30 deletions(-) create mode 100644 Dockerfile-bwa diff --git a/Dockerfile b/Dockerfile index 7e9da7cb..a9d21a5c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,5 @@ -FROM openjdk:8 +# openjdk:8 moved from debian jessie to stretch after u131, which breaks everything (bowtie) +FROM openjdk:8u121 LABEL authors="phil.ewels@scilifelab.se,denis.moreno@scilifelab.se" \ description="Docker image containing all requirements for NGI-MethylSeq pipeline" @@ -52,12 +53,6 @@ RUN curl -fsSL https://github.com/samtools/samtools/releases/download/1.5/samtoo make install && \ rm /opt/samtools-1.5.tar.bz2 -# Install PicardTools -RUN curl -fsSL https://github.com/broadinstitute/picard/releases/download/2.0.1/picard-tools-2.0.1.zip -o /opt/picard-tools-2.0.1.zip && \ - unzip /opt/picard-tools-2.0.1.zip -d /opt/ && \ - rm /opt/picard-tools-2.0.1.zip -ENV PICARD_HOME /opt/picard-tools-2.0.1 - # Install Bowtie2 RUN mkdir /opt/bowtie2 && \ curl -fsSL https://downloads.sourceforge.net/project/bowtie-bio/bowtie2/2.3.2/bowtie2-2.3.2-source.zip -o /opt/bowtie2/bowtie2.zip && \ @@ -82,27 +77,5 @@ RUN mkdir /opt/Qualimap && \ ln -s /opt/Qualimap/qualimap_v2.2.1/qualimap /usr/local/bin/qualimap && \ rm /opt/Qualimap/qualimap.zip -# Install BWA -RUN mkdir /opt/bwa && \ - curl -fsSL https://downloads.sourceforge.net/project/bio-bwa/bwa-0.7.15.tar.bz2 -o /opt/bwa/bwa.tar.bz2 && \ - tar xvjf /opt/bwa/bwa.tar.bz2 -C /opt/bwa/ && \ - cd /opt/bwa/bwa-0.7.15/ && \ - make && \ - ln -s /opt/bwa/bwa-0.7.15/bwa /usr/local/bin/bwa && \ - rm /opt/bwa/bwa.tar.bz2 - -# Install bwa-meth -RUN pip install toolshed && \ - pip install git+git://github.com/brentp/bwa-meth.git - -# Install MethylDackel -RUN mkdir /opt/MethylDackel && \ - curl -fsSL https://github.com/dpryan79/MethylDackel/archive/0.2.1.zip -o /opt/MethylDackel/MethylDackel.zip && \ - unzip /opt/MethylDackel/MethylDackel.zip -d /opt/MethylDackel && \ - cd /opt/MethylDackel/MethylDackel-0.2.1 && \ - make && \ - make install prefix=/usr/local/bin && \ - rm /opt/MethylDackel/MethylDackel.zip - # Install MultiQC -RUN pip install multiqc +RUN pip install git+https://github.com/ewels/MultiQC.git diff --git a/Dockerfile-bwa b/Dockerfile-bwa new file mode 100644 index 00000000..fa3aac87 --- /dev/null +++ b/Dockerfile-bwa @@ -0,0 +1,91 @@ +FROM openjdk:8 + +LABEL authors="phil.ewels@scilifelab.se,denis.moreno@scilifelab.se" \ + description="Docker image containing all requirements for NGI-MethylSeq pipeline" + +# Install container-wide requrements gcc, pip, zlib, libssl, make, libncurses, fortran77, g++, R +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ + g++ \ + gcc \ + gfortran \ + libbz2-dev \ + libcurl4-openssl-dev \ + libgsl0-dev \ + liblzma-dev \ + libncurses5-dev \ + libpcre3-dev \ + libreadline-dev \ + libssl-dev \ + libtbb-dev \ + make \ + python-dev \ + zlib1g-dev \ + && rm -rf /var/lib/apt/lists/* + +# Install pip +RUN curl -fsSL https://bootstrap.pypa.io/get-pip.py -o /opt/get-pip.py && \ + python /opt/get-pip.py && \ + rm /opt/get-pip.py + +RUN curl -fsSL http://www.bioinformatics.babraham.ac.uk/projects/fastqc/fastqc_v0.11.5.zip -o /opt/fastqc_v0.11.5.zip && \ + unzip /opt/fastqc_v0.11.5.zip -d /opt/ && \ + chmod 755 /opt/FastQC/fastqc && \ + ln -s /opt/FastQC/fastqc /usr/local/bin/fastqc && \ + rm /opt/fastqc_v0.11.5.zip + +# Install cutadapt +RUN pip install cutadapt + +# Install TrimGalore +RUN mkdir /opt/TrimGalore && \ + curl -fsSL https://github.com/FelixKrueger/TrimGalore/archive/0.4.4.zip -o /opt/TrimGalore/0.4.4.zip && \ + unzip /opt/TrimGalore/0.4.4.zip -d /opt/TrimGalore && \ + ln -s /opt/TrimGalore/TrimGalore-0.4.4/trim_galore /usr/local/bin/trim_galore && \ + rm /opt/TrimGalore/0.4.4.zip + +# Install SAMTools +RUN curl -fsSL https://github.com/samtools/samtools/releases/download/1.5/samtools-1.5.tar.bz2 -o /opt/samtools-1.5.tar.bz2 && \ + tar xvjf /opt/samtools-1.5.tar.bz2 -C /opt/ && \ + cd /opt/samtools-1.5 && \ + make && \ + make install && \ + rm /opt/samtools-1.5.tar.bz2 + +# Install PicardTools +RUN curl -fsSL https://github.com/broadinstitute/picard/releases/download/2.0.1/picard-tools-2.0.1.zip -o /opt/picard-tools-2.0.1.zip && \ + unzip /opt/picard-tools-2.0.1.zip -d /opt/ && \ + rm /opt/picard-tools-2.0.1.zip +ENV PICARD_HOME /opt/picard-tools-2.0.1 + +# Install Qualimap +RUN mkdir /opt/Qualimap && \ + curl -fsSL https://bitbucket.org/kokonech/qualimap/downloads/qualimap_v2.2.1.zip -o /opt/Qualimap/qualimap.zip && \ + unzip /opt/Qualimap/qualimap.zip -d /opt/Qualimap && \ + ln -s /opt/Qualimap/qualimap_v2.2.1/qualimap /usr/local/bin/qualimap && \ + rm /opt/Qualimap/qualimap.zip + +# Install BWA +RUN mkdir /opt/bwa && \ + curl -fsSL https://downloads.sourceforge.net/project/bio-bwa/bwa-0.7.15.tar.bz2 -o /opt/bwa/bwa.tar.bz2 && \ + tar xvjf /opt/bwa/bwa.tar.bz2 -C /opt/bwa/ && \ + cd /opt/bwa/bwa-0.7.15/ && \ + make && \ + ln -s /opt/bwa/bwa-0.7.15/bwa /usr/local/bin/bwa && \ + rm /opt/bwa/bwa.tar.bz2 + +# Install bwa-meth +RUN pip install toolshed && \ + pip install git+git://github.com/brentp/bwa-meth.git + +# Install MethylDackel +RUN mkdir /opt/MethylDackel && \ + curl -fsSL https://github.com/dpryan79/MethylDackel/archive/0.2.1.zip -o /opt/MethylDackel/MethylDackel.zip && \ + unzip /opt/MethylDackel/MethylDackel.zip -d /opt/MethylDackel && \ + cd /opt/MethylDackel/MethylDackel-0.2.1 && \ + make && \ + make install prefix=/usr/local/bin && \ + rm /opt/MethylDackel/MethylDackel.zip + +# Install MultiQC +RUN pip install multiqc From 29331ea2933a9a418201b5d554373a6461e3d959 Mon Sep 17 00:00:00 2001 From: Phil Ewels Date: Thu, 31 Aug 2017 09:45:14 +0200 Subject: [PATCH 06/11] Refactor all configs. Use singularity for UPPMAX. --- Dockerfile | 3 + Dockerfile-bwa | 6 +- conf/aws.config | 152 ++-------------------------- conf/base.config | 92 +++++++++++++++++ conf/docker.config | 23 ----- conf/igenomes.config | 105 ++++++++++++++++++++ conf/testing.config | 3 - conf/uppmax-devel.config | 197 +----------------------------------- conf/uppmax.config | 210 +++------------------------------------ nextflow.config | 27 ++++- 10 files changed, 255 insertions(+), 563 deletions(-) create mode 100644 conf/base.config delete mode 100644 conf/docker.config create mode 100644 conf/igenomes.config diff --git a/Dockerfile b/Dockerfile index a9d21a5c..69ed3418 100644 --- a/Dockerfile +++ b/Dockerfile @@ -79,3 +79,6 @@ RUN mkdir /opt/Qualimap && \ # Install MultiQC RUN pip install git+https://github.com/ewels/MultiQC.git + +# Create UPPMAX directories for Singularity +RUN mkdir /pica /proj /sw diff --git a/Dockerfile-bwa b/Dockerfile-bwa index fa3aac87..431cd9c3 100644 --- a/Dockerfile-bwa +++ b/Dockerfile-bwa @@ -1,4 +1,5 @@ -FROM openjdk:8 +# openjdk:8 moved from debian jessie to stretch after u131, which breaks everything (bowtie) +FROM openjdk:8u121 LABEL authors="phil.ewels@scilifelab.se,denis.moreno@scilifelab.se" \ description="Docker image containing all requirements for NGI-MethylSeq pipeline" @@ -89,3 +90,6 @@ RUN mkdir /opt/MethylDackel && \ # Install MultiQC RUN pip install multiqc + +# Create UPPMAX directories for Singularity +RUN mkdir /pica /proj /sw diff --git a/conf/aws.config b/conf/aws.config index 8795b557..b52c4dec 100644 --- a/conf/aws.config +++ b/conf/aws.config @@ -16,153 +16,15 @@ docker { process { container = 'scilifelab/ngi-methylseq' executor = 'ignite' - time = { 2.h * task.attempt } - errorStrategy = { task.exitStatus == 143 ? 'retry' : 'finish' } - maxRetries = 3 - maxErrors = '-1' - - - errorStrategy = { ( task.exitStatus == 143 || task.exitStatus == 137 ) ? 'retry' : 'finish' } - maxRetries = 3 - maxErrors = '-1' - - // Process resource requirements - $makeBismarkIndex { - time = { 36.h * task.attempt } - } - $fastqc { - errorStrategy = { ( task.exitStatus == 143 || task.exitStatus == 137 ) ? 'retry' : 'ignore' } - } - $trim_galore { - time = { 12.h * task.attempt } - } - $bismark_align { - time = { 36.h * task.attempt } - } - $bismark_deduplicate { - time = { 12.h * task.attempt } - } - $bismark_methXtract { - time = { 8.h * task.attempt } - } - $bismark_report { - errorStrategy = { ( task.exitStatus == 143 || task.exitStatus == 137 ) ? 'retry' : 'ignore' } - } - $bismark_summary { - errorStrategy = { ( task.exitStatus == 143 || task.exitStatus == 137 ) ? 'retry' : 'ignore' } - } - $qualimap { - time = { 6.h * task.attempt } - errorStrategy = { ( task.exitStatus == 143 || task.exitStatus == 137 ) ? 'retry' : 'ignore' } - } - $get_software_versions { - errorStrategy = 'ignore' - } - $multiqc { - errorStrategy = { ( task.exitStatus == 143 || task.exitStatus == 137 ) ? 'retry' : 'ignore' } - } - - $bwamem_align { - time = { 24.h * task.attempt } - } - $samtools_sort { - time = { 8.h * task.attempt } - } - } params { saveReference = true - // illumina iGenomes reference file paths on AWS - genomes { - 'GRCh37' { - bismark = 's3://ngi-igenomes/igenomes/Homo_sapiens/Ensembl/GRCh37/Sequence/BismarkIndex' - fasta = 's3://ngi-igenomes/igenomes/Homo_sapiens/Ensembl/GRCh37/Sequence/WholeGenomeFasta' - } - 'GRCm38' { - bismark = 's3://ngi-igenomes/igenomes/Mus_musculus/Ensembl/GRCm38/Sequence/BismarkIndex' - fasta = 's3://ngi-igenomes/igenomes/Mus_musculus/Ensembl/GRCm38/Sequence/WholeGenomeFasta' - } - 'TAIR10' { - bismark = 's3://ngi-igenomes/igenomes/Arabidopsis_thaliana/Ensembl/TAIR10/Sequence/BismarkIndex' - fasta = 's3://ngi-igenomes/igenomes/Arabidopsis_thaliana/Ensembl/TAIR10/Sequence/WholeGenomeFasta' - } - 'EB2' { - bismark = 's3://ngi-igenomes/igenomes/Bacillus_subtilis_168/Ensembl/EB2/Sequence/BismarkIndex' - fasta = 's3://ngi-igenomes/igenomes/Bacillus_subtilis_168/Ensembl/EB2/Sequence/WholeGenomeFasta' - } - 'UMD3.1' { - bismark = 's3://ngi-igenomes/igenomes/Bos_taurus/Ensembl/UMD3.1/Sequence/BismarkIndex' - fasta = 's3://ngi-igenomes/igenomes/Bos_taurus/Ensembl/UMD3.1/Sequence/WholeGenomeFasta' - } - 'WBcel235' { - bismark = 's3://ngi-igenomes/igenomes/Caenorhabditis_elegans/Ensembl/WBcel235/Sequence/BismarkIndex' - fasta = 's3://ngi-igenomes/igenomes/Caenorhabditis_elegans/Ensembl/WBcel235/Sequence/WholeGenomeFasta' - } - 'CanFam3.1' { - bismark = 's3://ngi-igenomes/igenomes/Canis_familiaris/Ensembl/CanFam3.1/Sequence/BismarkIndex' - fasta = 's3://ngi-igenomes/igenomes/Canis_familiaris/Ensembl/CanFam3.1/Sequence/WholeGenomeFasta' - } - 'GRCz10' { - bismark = 's3://ngi-igenomes/igenomes/Danio_rerio/Ensembl/GRCz10/Sequence/BismarkIndex' - fasta = 's3://ngi-igenomes/igenomes/Danio_rerio/Ensembl/GRCz10/Sequence/WholeGenomeFasta' - } - 'BDGP6' { - bismark = 's3://ngi-igenomes/igenomes/Drosophila_melanogaster/Ensembl/BDGP6/Sequence/BismarkIndex' - fasta = 's3://ngi-igenomes/igenomes/Drosophila_melanogaster/Ensembl/BDGP6/Sequence/WholeGenomeFasta' - } - 'EquCab2' { - bismark = 's3://ngi-igenomes/igenomes/Equus_caballus/Ensembl/EquCab2/Sequence/BismarkIndex' - fasta = 's3://ngi-igenomes/igenomes/Equus_caballus/Ensembl/EquCab2/Sequence/WholeGenomeFasta' - } - 'EB1' { - bismark = 's3://ngi-igenomes/igenomes/Escherichia_coli_K_12_DH10B/Ensembl/EB1/Sequence/BismarkIndex' - fasta = 's3://ngi-igenomes/igenomes/Escherichia_coli_K_12_DH10B/Ensembl/EB1/Sequence/WholeGenomeFasta' - } - 'Galgal4' { - bismark = 's3://ngi-igenomes/igenomes/Gallus_gallus/Ensembl/Galgal4/Sequence/BismarkIndex' - fasta = 's3://ngi-igenomes/igenomes/Gallus_gallus/Ensembl/Galgal4/Sequence/WholeGenomeFasta' - } - 'Gm01' { - bismark = 's3://ngi-igenomes/igenomes/Glycine_max/Ensembl/Gm01/Sequence/BismarkIndex' - fasta = 's3://ngi-igenomes/igenomes/Glycine_max/Ensembl/Gm01/Sequence/WholeGenomeFasta' - } - 'Mmul_1' { - bismark = 's3://ngi-igenomes/igenomes/Macaca_mulatta/Ensembl/Mmul_1/Sequence/BismarkIndex' - fasta = 's3://ngi-igenomes/igenomes/Macaca_mulatta/Ensembl/Mmul_1/Sequence/WholeGenomeFasta' - } - 'IRGSP-1.0' { - bismark = 's3://ngi-igenomes/igenomes/Oryza_sativa_japonica/Ensembl/IRGSP-1.0/Sequence/BismarkIndex' - fasta = 's3://ngi-igenomes/igenomes/Oryza_sativa_japonica/Ensembl/IRGSP-1.0/Sequence/WholeGenomeFasta' - } - 'CHIMP2.1.4' { - bismark = 's3://ngi-igenomes/igenomes/Pan_troglodytes/Ensembl/CHIMP2.1.4/Sequence/BismarkIndex' - fasta = 's3://ngi-igenomes/igenomes/Pan_troglodytes/Ensembl/CHIMP2.1.4/Sequence/WholeGenomeFasta' - } - 'Rnor_6.0' { - bismark = 's3://ngi-igenomes/igenomes/Rattus_norvegicus/Ensembl/Rnor_6.0/Sequence/BismarkIndex' - fasta = 's3://ngi-igenomes/igenomes/Rattus_norvegicus/Ensembl/Rnor_6.0/Sequence/WholeGenomeFasta' - } - 'R64-1-1' { - bismark = 's3://ngi-igenomes/igenomes/Saccharomyces_cerevisiae/Ensembl/R64-1-1/Sequence/BismarkIndex' - fasta = 's3://ngi-igenomes/igenomes/Saccharomyces_cerevisiae/Ensembl/R64-1-1/Sequence/WholeGenomeFasta' - } - 'EF2' { - bismark = 's3://ngi-igenomes/igenomes/Schizosaccharomyces_pombe/Ensembl/EF2/Sequence/BismarkIndex' - fasta = 's3://ngi-igenomes/igenomes/Schizosaccharomyces_pombe/Ensembl/EF2/Sequence/WholeGenomeFasta' - } - 'Sbi1' { - bismark = 's3://ngi-igenomes/igenomes/Sorghum_bicolor/Ensembl/Sbi1/Sequence/BismarkIndex' - fasta = 's3://ngi-igenomes/igenomes/Sorghum_bicolor/Ensembl/Sbi1/Sequence/WholeGenomeFasta' - } - 'Sscrofa10.2' { - bismark = 's3://ngi-igenomes/igenomes/Sus_scrofa/Ensembl/Sscrofa10.2/Sequence/BismarkIndex' - fasta = 's3://ngi-igenomes/igenomes/Sus_scrofa/Ensembl/Sscrofa10.2/Sequence/WholeGenomeFasta' - } - 'AGPv3' { - bismark = 's3://ngi-igenomes/igenomes/Zea_mays/Ensembl/AGPv3/Sequence/BismarkIndex' - fasta = 's3://ngi-igenomes/igenomes/Zea_mays/Ensembl/AGPv3/Sequence/WholeGenomeFasta' - } - } - + igenomes_base = 's3://ngi-igenomes/igenomes/' + // Max resources based on a typical AWS m4.4xlarge EC2 instance + // Customise with --max_memory, --max_cpus and --max_time (or overwrite with another config file) + // For example, for m4.2xlarge, use `--max_cpus 8 --max_memory 32` + max_memory = 64.GB + max_cpus = 16 + max_time = 240.h } diff --git a/conf/base.config b/conf/base.config new file mode 100644 index 00000000..254f32e9 --- /dev/null +++ b/conf/base.config @@ -0,0 +1,92 @@ +/* +vim: syntax=groovy +-*- mode: groovy;-*- + * ------------------------------------------------- + * Base Nextflow config file + * ------------------------------------------------- + * This file contains basic process requirement setup + * It DOES NOT contain any config for cluster, so will run + * in default mode by itself. It should be used with + * the max_memory, max_cpus and max_time params for + * customising hardware limits + */ + +process { + cpus = { check_max(1 * task.attempt, 'cpus') } + memory = { check_max( 8.GB * task.attempt, 'memory') } + time = { check_max(2.h * task.attempt, 'time') } + + errorStrategy = { ( task.exitStatus == 143 || task.exitStatus == 137 ) ? 'retry' : 'finish' } + maxRetries = 3 + maxErrors = '-1' + + // Resource requirements + $makeBismarkIndex { + cpus = { check_max(8 * task.attempt, 'cpus') } + memory = { check_max( 64.GB * task.attempt, 'memory') } + time = { check_max(36.h * task.attempt, 'time') } + } + $fastqc { + errorStrategy = { ( task.exitStatus == 143 || task.exitStatus == 137 ) ? 'retry' : 'ignore' } + } + $trim_galore { + cpus = { check_max(2 * task.attempt, 'cpus') } + memory = { check_max( 16.GB * task.attempt, 'memory') } + time = { check_max(12.h * task.attempt, 'time') } + } + $bismark_align { + cpus = { check_max(8 * task.attempt, 'cpus') } + memory = { check_max( 64.GB * task.attempt, 'memory') } + time = { check_max(36.h * task.attempt, 'time') } + } + $bismark_deduplicate { + cpus = { check_max(8 * task.attempt, 'cpus') } + memory = { check_max( 64.GB * task.attempt, 'memory') } + time = { check_max(12.h * task.attempt, 'time') } + } + $bismark_methXtract { + cpus = { check_max(4 * task.attempt, 'cpus') } + memory = { check_max( 32.GB * task.attempt, 'memory') } + time = { check_max(8.h * task.attempt, 'time') } + } + $bismark_report { + errorStrategy = { ( task.exitStatus == 143 || task.exitStatus == 137 ) ? 'retry' : 'ignore' } + } + $bismark_summary { + errorStrategy = { ( task.exitStatus == 143 || task.exitStatus == 137 ) ? 'retry' : 'ignore' } + } + $qualimap { + cpus = { check_max(4 * task.attempt, 'cpus') } + memory = { check_max( 32.GB * task.attempt, 'memory') } + time = { check_max(6.h * task.attempt, 'time') } + errorStrategy = { ( task.exitStatus == 143 || task.exitStatus == 137 ) ? 'retry' : 'ignore' } + } + $get_software_versions { + executor = 'local' + errorStrategy = 'ignore' + } + $multiqc { + executor = 'local' + errorStrategy = { ( task.exitStatus == 143 || task.exitStatus == 137 ) ? 'retry' : 'ignore' } + } + + $bwamem_align { + cpus = { check_max(8 * task.attempt, 'cpus') } + memory = { check_max( 64.GB * task.attempt, 'memory') } + time = { check_max(24.h * task.attempt, 'time') } + } + $samtools_sort { + cpus = { check_max(4 * task.attempt, 'cpus') } + memory = { check_max( 32.GB * task.attempt, 'memory') } + time = { check_max(8.h * task.attempt, 'time') } + } + $markDuplicates { + cpus = { check_max(4 * task.attempt, 'cpus') } + memory = { check_max( 32.GB * task.attempt, 'memory') } + } + $methyldackel { + cpus = { check_max(6 * task.attempt, 'cpus') } + memory = { check_max( 48.GB * task.attempt, 'memory') } + } + +} \ No newline at end of file diff --git a/conf/docker.config b/conf/docker.config deleted file mode 100644 index a4198b6a..00000000 --- a/conf/docker.config +++ /dev/null @@ -1,23 +0,0 @@ -/* -vim: syntax=groovy --*- mode: groovy;-*- - * ------------------------------------------------- - * Nextflow config file for use with Docker - * ------------------------------------------------- - * Defines basic usage limits and docker image id. - * Imported under the default 'docker' Nextflow - * profile in nextflow.config - * NOTE: Not suitable for production use, assumes - * compute limits of only 16GB memory and 1 CPU core. - */ - -docker { - enabled = true -} - -process { - container = 'scilifelab/ngi-methylseq' - cpus = 1 - memory = 16.GB - time = 48.h -} diff --git a/conf/igenomes.config b/conf/igenomes.config new file mode 100644 index 00000000..8fb82ad8 --- /dev/null +++ b/conf/igenomes.config @@ -0,0 +1,105 @@ +/* +vim: syntax=groovy +-*- mode: groovy;-*- + * ------------------------------------------------- + * Nextflow config file for iGenomes paths + * ------------------------------------------------- + * Defines reference genomes, using iGenome paths + * Can be used by any config that customises the base + * path using $params.igenomes_base / --igenomes_base + */ + +params { + // illumina iGenomes reference file paths on UPPMAX + igenomes_base = './iGenomes/' + genomes { + 'GRCh37' { + bismark = { "${params.igenomes_base}/Homo_sapiens/Ensembl/GRCh37/Sequence/BismarkIndex" } + fasta = { "${params.igenomes_base}/Homo_sapiens/Ensembl/GRCh37/Sequence/WholeGenomeFasta" } + } + 'GRCm38' { + bismark = { "${params.igenomes_base}/Mus_musculus/Ensembl/GRCm38/Sequence/BismarkIndex" } + fasta = { "${params.igenomes_base}/Mus_musculus/Ensembl/GRCm38/Sequence/WholeGenomeFasta" } + } + 'TAIR10' { + bismark = { "${params.igenomes_base}/Arabidopsis_thaliana/Ensembl/TAIR10/Sequence/BismarkIndex" } + fasta = { "${params.igenomes_base}/Arabidopsis_thaliana/Ensembl/TAIR10/Sequence/WholeGenomeFasta" } + } + 'EB2' { + bismark = { "${params.igenomes_base}/Bacillus_subtilis_168/Ensembl/EB2/Sequence/BismarkIndex" } + fasta = { "${params.igenomes_base}/Bacillus_subtilis_168/Ensembl/EB2/Sequence/WholeGenomeFasta" } + } + 'UMD3.1' { + bismark = { "${params.igenomes_base}/Bos_taurus/Ensembl/UMD3.1/Sequence/BismarkIndex" } + fasta = { "${params.igenomes_base}/Bos_taurus/Ensembl/UMD3.1/Sequence/WholeGenomeFasta" } + } + 'WBcel235' { + bismark = { "${params.igenomes_base}/Caenorhabditis_elegans/Ensembl/WBcel235/Sequence/BismarkIndex" } + fasta = { "${params.igenomes_base}/Caenorhabditis_elegans/Ensembl/WBcel235/Sequence/WholeGenomeFasta" } + } + 'CanFam3.1' { + bismark = { "${params.igenomes_base}/Canis_familiaris/Ensembl/CanFam3.1/Sequence/BismarkIndex" } + fasta = { "${params.igenomes_base}/Canis_familiaris/Ensembl/CanFam3.1/Sequence/WholeGenomeFasta" } + } + 'GRCz10' { + bismark = { "${params.igenomes_base}/Danio_rerio/Ensembl/GRCz10/Sequence/BismarkIndex" } + fasta = { "${params.igenomes_base}/Danio_rerio/Ensembl/GRCz10/Sequence/WholeGenomeFasta" } + } + 'BDGP6' { + bismark = { "${params.igenomes_base}/Drosophila_melanogaster/Ensembl/BDGP6/Sequence/BismarkIndex" } + fasta = { "${params.igenomes_base}/Drosophila_melanogaster/Ensembl/BDGP6/Sequence/WholeGenomeFasta" } + } + 'EquCab2' { + bismark = { "${params.igenomes_base}/Equus_caballus/Ensembl/EquCab2/Sequence/BismarkIndex" } + fasta = { "${params.igenomes_base}/Equus_caballus/Ensembl/EquCab2/Sequence/WholeGenomeFasta" } + } + 'EB1' { + bismark = { "${params.igenomes_base}/Escherichia_coli_K_12_DH10B/Ensembl/EB1/Sequence/BismarkIndex" } + fasta = { "${params.igenomes_base}/Escherichia_coli_K_12_DH10B/Ensembl/EB1/Sequence/WholeGenomeFasta" } + } + 'Galgal4' { + bismark = { "${params.igenomes_base}/Gallus_gallus/Ensembl/Galgal4/Sequence/BismarkIndex" } + fasta = { "${params.igenomes_base}/Gallus_gallus/Ensembl/Galgal4/Sequence/WholeGenomeFasta" } + } + 'Gm01' { + bismark = { "${params.igenomes_base}/Glycine_max/Ensembl/Gm01/Sequence/BismarkIndex" } + fasta = { "${params.igenomes_base}/Glycine_max/Ensembl/Gm01/Sequence/WholeGenomeFasta" } + } + 'Mmul_1' { + bismark = { "${params.igenomes_base}/Macaca_mulatta/Ensembl/Mmul_1/Sequence/BismarkIndex" } + fasta = { "${params.igenomes_base}/Macaca_mulatta/Ensembl/Mmul_1/Sequence/WholeGenomeFasta" } + } + 'IRGSP-1.0' { + bismark = { "${params.igenomes_base}/Oryza_sativa_japonica/Ensembl/IRGSP-1.0/Sequence/BismarkIndex" } + fasta = { "${params.igenomes_base}/Oryza_sativa_japonica/Ensembl/IRGSP-1.0/Sequence/WholeGenomeFasta" } + } + 'CHIMP2.1.4' { + bismark = { "${params.igenomes_base}/Pan_troglodytes/Ensembl/CHIMP2.1.4/Sequence/BismarkIndex" } + fasta = { "${params.igenomes_base}/Pan_troglodytes/Ensembl/CHIMP2.1.4/Sequence/WholeGenomeFasta" } + } + 'Rnor_6.0' { + bismark = { "${params.igenomes_base}/Rattus_norvegicus/Ensembl/Rnor_6.0/Sequence/BismarkIndex" } + fasta = { "${params.igenomes_base}/Rattus_norvegicus/Ensembl/Rnor_6.0/Sequence/WholeGenomeFasta" } + } + 'R64-1-1' { + bismark = { "${params.igenomes_base}/Saccharomyces_cerevisiae/Ensembl/R64-1-1/Sequence/BismarkIndex" } + fasta = { "${params.igenomes_base}/Saccharomyces_cerevisiae/Ensembl/R64-1-1/Sequence/WholeGenomeFasta" } + } + 'EF2' { + bismark = { "${params.igenomes_base}/Schizosaccharomyces_pombe/Ensembl/EF2/Sequence/BismarkIndex" } + fasta = { "${params.igenomes_base}/Schizosaccharomyces_pombe/Ensembl/EF2/Sequence/WholeGenomeFasta" } + } + 'Sbi1' { + bismark = { "${params.igenomes_base}/Sorghum_bicolor/Ensembl/Sbi1/Sequence/BismarkIndex" } + fasta = { "${params.igenomes_base}/Sorghum_bicolor/Ensembl/Sbi1/Sequence/WholeGenomeFasta" } + } + 'Sscrofa10.2' { + bismark = { "${params.igenomes_base}/Sus_scrofa/Ensembl/Sscrofa10.2/Sequence/BismarkIndex" } + fasta = { "${params.igenomes_base}/Sus_scrofa/Ensembl/Sscrofa10.2/Sequence/WholeGenomeFasta" } + } + 'AGPv3' { + bismark = { "${params.igenomes_base}/Zea_mays/Ensembl/AGPv3/Sequence/BismarkIndex" } + fasta = { "${params.igenomes_base}/Zea_mays/Ensembl/AGPv3/Sequence/WholeGenomeFasta" } + } + } +} diff --git a/conf/testing.config b/conf/testing.config index e241ce95..f1130102 100644 --- a/conf/testing.config +++ b/conf/testing.config @@ -8,9 +8,6 @@ vim: syntax=groovy docker { enabled = true - // Fixes Docker mount point error on travis. - // Can be removed after Nextflow v0.25.1 is released - writableInputMounts = true } process { container = 'scilifelab/ngi-methylseq' diff --git a/conf/uppmax-devel.config b/conf/uppmax-devel.config index 3126ef40..3239a0ac 100644 --- a/conf/uppmax-devel.config +++ b/conf/uppmax-devel.config @@ -16,202 +16,13 @@ executor { } process { - executor = 'slurm' queue = 'devcore' - cpus = { 1 * task.attempt } - memory = { 8.GB * task.attempt } - time = 1.h - clusterOptions = { "-A $params.project ${params.clusterOptions ?: ''}" } - - errorStrategy = { ( task.exitStatus == 143 || task.exitStatus == 137 ) ? 'retry' : 'finish' } - maxRetries = 3 - maxErrors = '-1' - - // Environment modules and resource requirements - $makeBismarkIndex { - module = ['bioinfo-tools', 'samtools/1.3', 'bismark'] - cpus = { 8 * task.attempt } - memory = { 64.GB * task.attempt } - } - $fastqc { - module = ['bioinfo-tools', 'FastQC'] - errorStrategy = { ( task.exitStatus == 143 || task.exitStatus == 137 ) ? 'retry' : 'ignore' } - } - $trim_galore { - module = ['bioinfo-tools', 'TrimGalore'] - cpus = { 2 * task.attempt } - memory = { 16.GB * task.attempt } - } - $bismark_align { - module = ['bioinfo-tools', 'samtools/1.3', 'bismark'] - cpus = { 8 * task.attempt } - memory = { 64.GB * task.attempt } - } - $bismark_deduplicate { - module = ['bioinfo-tools', 'samtools/1.3', 'bismark'] - cpus = { 8 * task.attempt } - memory = { 64.GB * task.attempt } - } - $bismark_methXtract { - module = ['bioinfo-tools', 'samtools/1.3', 'bismark'] - cpus = { 4 * task.attempt } - memory = { 32.GB * task.attempt } - } - $bismark_report { - module = ['bioinfo-tools', 'bismark'] - errorStrategy = { ( task.exitStatus == 143 || task.exitStatus == 137 ) ? 'retry' : 'ignore' } - } - $bismark_summary { - module = ['bioinfo-tools', 'bismark'] - errorStrategy = { ( task.exitStatus == 143 || task.exitStatus == 137 ) ? 'retry' : 'ignore' } - } - $qualimap { - module = ['bioinfo-tools', 'samtools/1.3', 'QualiMap'] - cpus = { 4 * task.attempt } - memory = { 32.GB * task.attempt } - errorStrategy = { ( task.exitStatus == 143 || task.exitStatus == 137 ) ? 'retry' : 'ignore' } - } - $get_software_versions { - errorStrategy = 'ignore' - module = ['bioinfo-tools', 'FastQC', 'TrimGalore', 'samtools/1.3', 'bismark', 'QualiMap', 'MultiQC'] - } - // NB: Overwrite this in a config file in the working directory (nextflow.config) or with -c - // if you have your own installation of MultiQC outside of the environment module system. - // eg: Add the line: process.$multiqc.module = [] - $multiqc { - module = ['bioinfo-tools', 'MultiQC'] - executor = 'local' - errorStrategy = { ( task.exitStatus == 143 || task.exitStatus == 137 ) ? 'retry' : 'ignore' } - } - - $makeBwaMemIndex { - module = ['bioinfo-tools', 'bwa', 'bwa-meth', 'samtools/1.3'] - } - $makeFastaIndex { - module = ['bioinfo-tools', 'samtools/1.3'] - } - $bwamem_align { - module = ['bioinfo-tools', 'bwa', 'bwa-meth', 'samtools/1.3'] - cpus = { 8 * task.attempt } - memory = { 64.GB * task.attempt } - } - $samtools_flagstat { - module = ['bioinfo-tools', 'samtools/1.3'] - } - $samtools_sort { - module = ['bioinfo-tools', 'samtools/1.3'] - cpus = { 4 * task.attempt } - memory = { 32.GB * task.attempt } - } - $samtools_index { - module = ['bioinfo-tools', 'samtools/1.3'] - } - $markDuplicates { - module = ['bioinfo-tools', 'picard/2.0.1'] - cpus = { 4 * task.attempt } - memory = { 32.GB * task.attempt } - } - $methyldackel { - module = ['bioinfo-tools', 'MethylDackel'] - cpus = { 6 * task.attempt } - memory = { 48.GB * task.attempt } - } - } params { - clusterOptions = false - params.saveReference = true - // illumina iGenomes reference file paths on UPPMAX - genomes { - 'GRCh37' { - bismark = '/sw/data/uppnex/igenomes/Homo_sapiens/Ensembl/GRCh37/Sequence/BismarkIndex' - fasta = '/sw/data/uppnex/igenomes/Homo_sapiens/Ensembl/GRCh37/Sequence/WholeGenomeFasta' - } - 'GRCm38' { - bismark = '/sw/data/uppnex/igenomes/Mus_musculus/Ensembl/GRCm38/Sequence/BismarkIndex' - fasta = '/sw/data/uppnex/igenomes/Mus_musculus/Ensembl/GRCm38/Sequence/WholeGenomeFasta' - } - 'TAIR10' { - bismark = '/sw/data/uppnex/igenomes/Arabidopsis_thaliana/Ensembl/TAIR10/Sequence/BismarkIndex' - fasta = '/sw/data/uppnex/igenomes/Arabidopsis_thaliana/Ensembl/TAIR10/Sequence/WholeGenomeFasta' - } - 'EB2' { - bismark = '/sw/data/uppnex/igenomes/Bacillus_subtilis_168/Ensembl/EB2/Sequence/BismarkIndex' - fasta = '/sw/data/uppnex/igenomes/Bacillus_subtilis_168/Ensembl/EB2/Sequence/WholeGenomeFasta' - } - 'UMD3.1' { - bismark = '/sw/data/uppnex/igenomes/Bos_taurus/Ensembl/UMD3.1/Sequence/BismarkIndex' - fasta = '/sw/data/uppnex/igenomes/Bos_taurus/Ensembl/UMD3.1/Sequence/WholeGenomeFasta' - } - 'WBcel235' { - bismark = '/sw/data/uppnex/igenomes/Caenorhabditis_elegans/Ensembl/WBcel235/Sequence/BismarkIndex' - fasta = '/sw/data/uppnex/igenomes/Caenorhabditis_elegans/Ensembl/WBcel235/Sequence/WholeGenomeFasta' - } - 'CanFam3.1' { - bismark = '/sw/data/uppnex/igenomes/Canis_familiaris/Ensembl/CanFam3.1/Sequence/BismarkIndex' - fasta = '/sw/data/uppnex/igenomes/Canis_familiaris/Ensembl/CanFam3.1/Sequence/WholeGenomeFasta' - } - 'GRCz10' { - bismark = '/sw/data/uppnex/igenomes/Danio_rerio/Ensembl/GRCz10/Sequence/BismarkIndex' - fasta = '/sw/data/uppnex/igenomes/Danio_rerio/Ensembl/GRCz10/Sequence/WholeGenomeFasta' - } - 'BDGP6' { - bismark = '/sw/data/uppnex/igenomes/Drosophila_melanogaster/Ensembl/BDGP6/Sequence/BismarkIndex' - fasta = '/sw/data/uppnex/igenomes/Drosophila_melanogaster/Ensembl/BDGP6/Sequence/WholeGenomeFasta' - } - 'EquCab2' { - bismark = '/sw/data/uppnex/igenomes/Equus_caballus/Ensembl/EquCab2/Sequence/BismarkIndex' - fasta = '/sw/data/uppnex/igenomes/Equus_caballus/Ensembl/EquCab2/Sequence/WholeGenomeFasta' - } - 'EB1' { - bismark = '/sw/data/uppnex/igenomes/Escherichia_coli_K_12_DH10B/Ensembl/EB1/Sequence/BismarkIndex' - fasta = '/sw/data/uppnex/igenomes/Escherichia_coli_K_12_DH10B/Ensembl/EB1/Sequence/WholeGenomeFasta' - } - 'Galgal4' { - bismark = '/sw/data/uppnex/igenomes/Gallus_gallus/Ensembl/Galgal4/Sequence/BismarkIndex' - fasta = '/sw/data/uppnex/igenomes/Gallus_gallus/Ensembl/Galgal4/Sequence/WholeGenomeFasta' - } - 'Gm01' { - bismark = '/sw/data/uppnex/igenomes/Glycine_max/Ensembl/Gm01/Sequence/BismarkIndex' - fasta = '/sw/data/uppnex/igenomes/Glycine_max/Ensembl/Gm01/Sequence/WholeGenomeFasta' - } - 'Mmul_1' { - bismark = '/sw/data/uppnex/igenomes/Macaca_mulatta/Ensembl/Mmul_1/Sequence/BismarkIndex' - fasta = '/sw/data/uppnex/igenomes/Macaca_mulatta/Ensembl/Mmul_1/Sequence/WholeGenomeFasta' - } - 'IRGSP-1.0' { - bismark = '/sw/data/uppnex/igenomes/Oryza_sativa_japonica/Ensembl/IRGSP-1.0/Sequence/BismarkIndex' - fasta = '/sw/data/uppnex/igenomes/Oryza_sativa_japonica/Ensembl/IRGSP-1.0/Sequence/WholeGenomeFasta' - } - 'CHIMP2.1.4' { - bismark = '/sw/data/uppnex/igenomes/Pan_troglodytes/Ensembl/CHIMP2.1.4/Sequence/BismarkIndex' - fasta = '/sw/data/uppnex/igenomes/Pan_troglodytes/Ensembl/CHIMP2.1.4/Sequence/WholeGenomeFasta' - } - 'Rnor_6.0' { - bismark = '/sw/data/uppnex/igenomes/Rattus_norvegicus/Ensembl/Rnor_6.0/Sequence/BismarkIndex' - fasta = '/sw/data/uppnex/igenomes/Rattus_norvegicus/Ensembl/Rnor_6.0/Sequence/WholeGenomeFasta' - } - 'R64-1-1' { - bismark = '/sw/data/uppnex/igenomes/Saccharomyces_cerevisiae/Ensembl/R64-1-1/Sequence/BismarkIndex' - fasta = '/sw/data/uppnex/igenomes/Saccharomyces_cerevisiae/Ensembl/R64-1-1/Sequence/WholeGenomeFasta' - } - 'EF2' { - bismark = '/sw/data/uppnex/igenomes/Schizosaccharomyces_pombe/Ensembl/EF2/Sequence/BismarkIndex' - fasta = '/sw/data/uppnex/igenomes/Schizosaccharomyces_pombe/Ensembl/EF2/Sequence/WholeGenomeFasta' - } - 'Sbi1' { - bismark = '/sw/data/uppnex/igenomes/Sorghum_bicolor/Ensembl/Sbi1/Sequence/BismarkIndex' - fasta = '/sw/data/uppnex/igenomes/Sorghum_bicolor/Ensembl/Sbi1/Sequence/WholeGenomeFasta' - } - 'Sscrofa10.2' { - bismark = '/sw/data/uppnex/igenomes/Sus_scrofa/Ensembl/Sscrofa10.2/Sequence/BismarkIndex' - fasta = '/sw/data/uppnex/igenomes/Sus_scrofa/Ensembl/Sscrofa10.2/Sequence/WholeGenomeFasta' - } - 'AGPv3' { - bismark = '/sw/data/uppnex/igenomes/Zea_mays/Ensembl/AGPv3/Sequence/BismarkIndex' - fasta = '/sw/data/uppnex/igenomes/Zea_mays/Ensembl/AGPv3/Sequence/WholeGenomeFasta' - } - } + // Max resources to be requested by a devel job + max_memory = 120.GB + max_cpus = 16 + max_time = 1.h } diff --git a/conf/uppmax.config b/conf/uppmax.config index be2b3dcc..53b2c9db 100644 --- a/conf/uppmax.config +++ b/conf/uppmax.config @@ -4,215 +4,31 @@ vim: syntax=groovy * ------------------------------------------------- * Nextflow config file for UPPMAX (milou / irma) * ------------------------------------------------- - * Defines reference genomes, using iGenome paths * Imported under the default 'standard' Nextflow * profile in nextflow.config */ +singularity { + autoMounts = true + enabled = true +} process { executor = 'slurm' - cpus = { 1 * task.attempt } - memory = { 8.GB * task.attempt } - time = { 2.h * task.attempt } clusterOptions = { "-A $params.project ${params.clusterOptions ?: ''}" } - errorStrategy = { ( task.exitStatus == 143 || task.exitStatus == 137 ) ? 'retry' : 'finish' } - maxRetries = 3 - maxErrors = '-1' - - // Environment modules and resource requirements - $makeBismarkIndex { - module = ['bioinfo-tools', 'samtools/1.3', 'bismark'] - cpus = { 8 * task.attempt } - memory = { 64.GB * task.attempt } - time = { 36.h * task.attempt } - } - $fastqc { - module = ['bioinfo-tools', 'FastQC'] - errorStrategy = { ( task.exitStatus == 143 || task.exitStatus == 137 ) ? 'retry' : 'ignore' } - } - $trim_galore { - module = ['bioinfo-tools', 'TrimGalore'] - cpus = { 2 * task.attempt } - memory = { 16.GB * task.attempt } - time = { 12.h * task.attempt } - } - $bismark_align { - module = ['bioinfo-tools', 'samtools/1.3', 'bismark'] - cpus = { 8 * task.attempt } - memory = { 64.GB * task.attempt } - time = { 36.h * task.attempt } - } - $bismark_deduplicate { - module = ['bioinfo-tools', 'samtools/1.3', 'bismark'] - cpus = { 8 * task.attempt } - memory = { 64.GB * task.attempt } - time = { 12.h * task.attempt } - } - $bismark_methXtract { - module = ['bioinfo-tools', 'samtools/1.3', 'bismark'] - cpus = { 4 * task.attempt } - memory = { 32.GB * task.attempt } - time = { 8.h * task.attempt } - } - $bismark_report { - module = ['bioinfo-tools', 'bismark'] - errorStrategy = { ( task.exitStatus == 143 || task.exitStatus == 137 ) ? 'retry' : 'ignore' } - } - $bismark_summary { - module = ['bioinfo-tools', 'bismark'] - errorStrategy = { ( task.exitStatus == 143 || task.exitStatus == 137 ) ? 'retry' : 'ignore' } - } - $qualimap { - module = ['bioinfo-tools', 'samtools/1.3', 'QualiMap'] - cpus = { 4 * task.attempt } - memory = { 32.GB * task.attempt } - time = { 6.h * task.attempt } - errorStrategy = { ( task.exitStatus == 143 || task.exitStatus == 137 ) ? 'retry' : 'ignore' } - } - $get_software_versions { - errorStrategy = 'ignore' - module = ['bioinfo-tools', 'FastQC', 'TrimGalore', 'samtools/1.3', 'bismark', 'QualiMap', 'MultiQC'] - } - // NB: Overwrite this in a config file in the working directory (nextflow.config) or with -c - // if you have your own installation of MultiQC outside of the environment module system. - // eg: Add the line: process.$multiqc.module = [] - $multiqc { - module = ['bioinfo-tools', 'MultiQC'] - executor = 'local' - errorStrategy = { ( task.exitStatus == 143 || task.exitStatus == 137 ) ? 'retry' : 'ignore' } - } - - $makeBwaMemIndex { - module = ['bioinfo-tools', 'bwa', 'bwa-meth', 'samtools/1.3'] - } - $makeFastaIndex { - module = ['bioinfo-tools', 'samtools/1.3'] - } - $bwamem_align { - module = ['bioinfo-tools', 'bwa', 'bwa-meth', 'samtools/1.3'] - cpus = { 8 * task.attempt } - memory = { 64.GB * task.attempt } - time = { 24.h * task.attempt } - } - $samtools_flagstat { - module = ['bioinfo-tools', 'samtools/1.3'] - } - $samtools_sort { - module = ['bioinfo-tools', 'samtools/1.3'] - cpus = { 4 * task.attempt } - memory = { 32.GB * task.attempt } - time = { 8.h * task.attempt } - } - $samtools_index { - module = ['bioinfo-tools', 'samtools/1.3'] - } - $markDuplicates { - module = ['bioinfo-tools', 'picard/2.0.1'] - cpus = { 4 * task.attempt } - memory = { 32.GB * task.attempt } - } - $methyldackel { - module = ['bioinfo-tools', 'MethylDackel'] - cpus = { 6 * task.attempt } - memory = { 48.GB * task.attempt } - } - + // Use dockerhub container for singularity + container = 'docker://scilifelab/ngi-methylseq' } params { clusterOptions = false - params.saveReference = true + saveReference = true + // Max resources requested by a normal node on milou. If you need more memory, run on a fat node using: + // --clusterOptions "-C mem512GB" --max_memory "512GB" + max_memory = 128.GB + max_cpus = 16 + max_time = 240.h // illumina iGenomes reference file paths on UPPMAX - genomes { - 'GRCh37' { - bismark = '/sw/data/uppnex/igenomes/Homo_sapiens/Ensembl/GRCh37/Sequence/BismarkIndex' - fasta = '/sw/data/uppnex/igenomes/Homo_sapiens/Ensembl/GRCh37/Sequence/WholeGenomeFasta' - } - 'GRCm38' { - bismark = '/sw/data/uppnex/igenomes/Mus_musculus/Ensembl/GRCm38/Sequence/BismarkIndex' - fasta = '/sw/data/uppnex/igenomes/Mus_musculus/Ensembl/GRCm38/Sequence/WholeGenomeFasta' - } - 'TAIR10' { - bismark = '/sw/data/uppnex/igenomes/Arabidopsis_thaliana/Ensembl/TAIR10/Sequence/BismarkIndex' - fasta = '/sw/data/uppnex/igenomes/Arabidopsis_thaliana/Ensembl/TAIR10/Sequence/WholeGenomeFasta' - } - 'EB2' { - bismark = '/sw/data/uppnex/igenomes/Bacillus_subtilis_168/Ensembl/EB2/Sequence/BismarkIndex' - fasta = '/sw/data/uppnex/igenomes/Bacillus_subtilis_168/Ensembl/EB2/Sequence/WholeGenomeFasta' - } - 'UMD3.1' { - bismark = '/sw/data/uppnex/igenomes/Bos_taurus/Ensembl/UMD3.1/Sequence/BismarkIndex' - fasta = '/sw/data/uppnex/igenomes/Bos_taurus/Ensembl/UMD3.1/Sequence/WholeGenomeFasta' - } - 'WBcel235' { - bismark = '/sw/data/uppnex/igenomes/Caenorhabditis_elegans/Ensembl/WBcel235/Sequence/BismarkIndex' - fasta = '/sw/data/uppnex/igenomes/Caenorhabditis_elegans/Ensembl/WBcel235/Sequence/WholeGenomeFasta' - } - 'CanFam3.1' { - bismark = '/sw/data/uppnex/igenomes/Canis_familiaris/Ensembl/CanFam3.1/Sequence/BismarkIndex' - fasta = '/sw/data/uppnex/igenomes/Canis_familiaris/Ensembl/CanFam3.1/Sequence/WholeGenomeFasta' - } - 'GRCz10' { - bismark = '/sw/data/uppnex/igenomes/Danio_rerio/Ensembl/GRCz10/Sequence/BismarkIndex' - fasta = '/sw/data/uppnex/igenomes/Danio_rerio/Ensembl/GRCz10/Sequence/WholeGenomeFasta' - } - 'BDGP6' { - bismark = '/sw/data/uppnex/igenomes/Drosophila_melanogaster/Ensembl/BDGP6/Sequence/BismarkIndex' - fasta = '/sw/data/uppnex/igenomes/Drosophila_melanogaster/Ensembl/BDGP6/Sequence/WholeGenomeFasta' - } - 'EquCab2' { - bismark = '/sw/data/uppnex/igenomes/Equus_caballus/Ensembl/EquCab2/Sequence/BismarkIndex' - fasta = '/sw/data/uppnex/igenomes/Equus_caballus/Ensembl/EquCab2/Sequence/WholeGenomeFasta' - } - 'EB1' { - bismark = '/sw/data/uppnex/igenomes/Escherichia_coli_K_12_DH10B/Ensembl/EB1/Sequence/BismarkIndex' - fasta = '/sw/data/uppnex/igenomes/Escherichia_coli_K_12_DH10B/Ensembl/EB1/Sequence/WholeGenomeFasta' - } - 'Galgal4' { - bismark = '/sw/data/uppnex/igenomes/Gallus_gallus/Ensembl/Galgal4/Sequence/BismarkIndex' - fasta = '/sw/data/uppnex/igenomes/Gallus_gallus/Ensembl/Galgal4/Sequence/WholeGenomeFasta' - } - 'Gm01' { - bismark = '/sw/data/uppnex/igenomes/Glycine_max/Ensembl/Gm01/Sequence/BismarkIndex' - fasta = '/sw/data/uppnex/igenomes/Glycine_max/Ensembl/Gm01/Sequence/WholeGenomeFasta' - } - 'Mmul_1' { - bismark = '/sw/data/uppnex/igenomes/Macaca_mulatta/Ensembl/Mmul_1/Sequence/BismarkIndex' - fasta = '/sw/data/uppnex/igenomes/Macaca_mulatta/Ensembl/Mmul_1/Sequence/WholeGenomeFasta' - } - 'IRGSP-1.0' { - bismark = '/sw/data/uppnex/igenomes/Oryza_sativa_japonica/Ensembl/IRGSP-1.0/Sequence/BismarkIndex' - fasta = '/sw/data/uppnex/igenomes/Oryza_sativa_japonica/Ensembl/IRGSP-1.0/Sequence/WholeGenomeFasta' - } - 'CHIMP2.1.4' { - bismark = '/sw/data/uppnex/igenomes/Pan_troglodytes/Ensembl/CHIMP2.1.4/Sequence/BismarkIndex' - fasta = '/sw/data/uppnex/igenomes/Pan_troglodytes/Ensembl/CHIMP2.1.4/Sequence/WholeGenomeFasta' - } - 'Rnor_6.0' { - bismark = '/sw/data/uppnex/igenomes/Rattus_norvegicus/Ensembl/Rnor_6.0/Sequence/BismarkIndex' - fasta = '/sw/data/uppnex/igenomes/Rattus_norvegicus/Ensembl/Rnor_6.0/Sequence/WholeGenomeFasta' - } - 'R64-1-1' { - bismark = '/sw/data/uppnex/igenomes/Saccharomyces_cerevisiae/Ensembl/R64-1-1/Sequence/BismarkIndex' - fasta = '/sw/data/uppnex/igenomes/Saccharomyces_cerevisiae/Ensembl/R64-1-1/Sequence/WholeGenomeFasta' - } - 'EF2' { - bismark = '/sw/data/uppnex/igenomes/Schizosaccharomyces_pombe/Ensembl/EF2/Sequence/BismarkIndex' - fasta = '/sw/data/uppnex/igenomes/Schizosaccharomyces_pombe/Ensembl/EF2/Sequence/WholeGenomeFasta' - } - 'Sbi1' { - bismark = '/sw/data/uppnex/igenomes/Sorghum_bicolor/Ensembl/Sbi1/Sequence/BismarkIndex' - fasta = '/sw/data/uppnex/igenomes/Sorghum_bicolor/Ensembl/Sbi1/Sequence/WholeGenomeFasta' - } - 'Sscrofa10.2' { - bismark = '/sw/data/uppnex/igenomes/Sus_scrofa/Ensembl/Sscrofa10.2/Sequence/BismarkIndex' - fasta = '/sw/data/uppnex/igenomes/Sus_scrofa/Ensembl/Sscrofa10.2/Sequence/WholeGenomeFasta' - } - 'AGPv3' { - bismark = '/sw/data/uppnex/igenomes/Zea_mays/Ensembl/AGPv3/Sequence/BismarkIndex' - fasta = '/sw/data/uppnex/igenomes/Zea_mays/Ensembl/AGPv3/Sequence/WholeGenomeFasta' - } - } + igenomes_base = '/sw/data/uppnex/igenomes/' } diff --git a/nextflow.config b/nextflow.config index b0b13a76..bb55f56f 100644 --- a/nextflow.config +++ b/nextflow.config @@ -13,15 +13,22 @@ vim: syntax=groovy profiles { standard { + includeConfig 'conf/base.config' + includeConfig 'conf/igenomes.config' includeConfig 'conf/uppmax.config' } devel { + includeConfig 'conf/base.config' + includeConfig 'conf/igenomes.config' + includeConfig 'conf/uppmax.config' includeConfig 'conf/uppmax-devel.config' } docker { includeConfig 'conf/docker.config' } aws { + includeConfig 'conf/base.config' + includeConfig 'conf/igenomes.config' includeConfig 'conf/aws.config' } testing { @@ -47,4 +54,22 @@ manifest { homePage = 'https://github.com/SciLifeLab/NGI-MethylSeq' description = 'Methylation (Bisulfite-Sequencing) Best Practice analysis pipeline, used at the SciLifeLab National Genomics Infrastructure.' mainScript = 'bismark.nf' -} \ No newline at end of file +} + +// Function to ensure that resource requirements don't go beyond +// a maximum limit +def check_max(obj, type) { + if(type == 'memory'){ + if(obj.compareTo(params.max_memory)) + return params.max_memory + else + return obj + } else if(type == 'time'){ + if(obj.compareTo(params.max_time)) + return params.max_time + else + return obj + } else if(type == 'cpus'){ + return Math.min( obj, params.max_cpus ) + } +} From 924482a7b7bae09cb85dfc7b4929813e7d70747c Mon Sep 17 00:00:00 2001 From: Phil Ewels Date: Thu, 31 Aug 2017 09:52:35 +0200 Subject: [PATCH 07/11] Run travis tests in parallel. Remove docker as requirement in test script. --- .travis.yml | 15 +++++++++------ tests/{docker_test.sh => run_test.sh} | 1 - 2 files changed, 9 insertions(+), 7 deletions(-) rename tests/{docker_test.sh => run_test.sh} (95%) diff --git a/.travis.yml b/.travis.yml index 6e9d9566..8af662f7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,10 +14,13 @@ install: - sudo ln -s /tmp/nextflow/nextflow /usr/local/bin/nextflow - cd ${TRAVIS_BUILD_DIR}/tests/ +env: + - CLFLAGS="" # Basic run + - CLFLAGS="-b" # Run, build reference genome + - CLFLAGS="-r" # Run, RRBS mode + - CLFLAGS="-n" # Run, no-trimming mode + - CLFLAGS="-p" # BWAmeth use existing ref genome + - CLFLAGS="-p -b" # BWAmeth run, build reference genome + script: - - "./docker_test.sh" # Basic run - - "./docker_test.sh -b" # Run, build reference genome - - "./docker_test.sh -r" # Run, RRBS mode - - "./docker_test.sh -n" # Run, no-trimming mode - - "./docker_test.sh -p" # BWAmeth use existing ref genome - - "./docker_test.sh -p -b" # BWAmeth run, build reference genome + - "./run_test.sh $CLFLAGS" diff --git a/tests/docker_test.sh b/tests/run_test.sh similarity index 95% rename from tests/docker_test.sh rename to tests/run_test.sh index c7fb8fb0..9092efb8 100755 --- a/tests/docker_test.sh +++ b/tests/run_test.sh @@ -16,7 +16,6 @@ function print_usage { # Check that we have required commands curl --version >/dev/null 2>&1 || { echo >&2 "I require curl, but it's not installed. Aborting."; exit 1; } tar --version >/dev/null 2>&1 || { echo >&2 "I require tar, but it's not installed. Aborting."; exit 1; } -docker -v >/dev/null 2>&1 || { echo >&2 "I require docker, but it's not installed. Visit https://www.docker.com/products/overview#/install_the_platform ."; exit 1; } nextflow -v >/dev/null 2>&1 || { echo >&2 "I require nextflow, but it's not installed. If you hava Java, run 'curl -fsSL get.nextflow.io | bash'. If not, install Java."; exit 1; } # Detect Travis fork for dockerhub image if we can From f6e4be9668dabb560cb852868a3c7265f70ccf94 Mon Sep 17 00:00:00 2001 From: Phil Ewels Date: Thu, 31 Aug 2017 09:59:32 +0200 Subject: [PATCH 08/11] Added option to specify singularity image in test script. --- tests/run_test.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/run_test.sh b/tests/run_test.sh index 9092efb8..fc909d26 100755 --- a/tests/run_test.sh +++ b/tests/run_test.sh @@ -10,6 +10,7 @@ function print_usage { "\t\t[-u (run UPPMAX test)\n" \ "\t\t[-t ]\n" \ "\t\t[-d ]\n" \ + "\t\t[-s ]\n" \ "\t\t[-h (show this help message)]" >&2 ; } @@ -41,8 +42,9 @@ profile="-profile testing" refs="--bismark_index ${data_dir}/references/BismarkIndex/" rrbs="" notrim="" +singularityfl="" -while getopts ":brnpuht:d:" opt; do +while getopts ":brnpuht:d:s:" opt; do case $opt in b) echo "Building genome references" >&2 @@ -77,6 +79,10 @@ while getopts ":brnpuht:d:" opt; do echo "Using docker image $OPTARG" >&2 dockerfl="-with-docker $OPTARG" ;; + s) + echo "Using singularity image $OPTARG" >&2 + singularityfl="-with-singularity $OPTARG" + ;; h) print_usage exit @@ -113,7 +119,7 @@ fi # Run name run_name="Test MethylSeq Run: "$(date +%s) -cmd="nextflow run $pipelinescript -resume -name \"$run_name\" $profile $notrim $rrbs $dockerfl $refs --singleEnd --reads \"${data_dir}/*.fastq.gz\"" +cmd="nextflow run $pipelinescript -resume -name \"$run_name\" $profile $notrim $rrbs $dockerfl $singularityfl $refs --singleEnd --reads \"${data_dir}/*.fastq.gz\"" echo "Starting nextflow... Command:" echo $cmd echo "-------------------------------------------------------" From 3b0ae668acf578e2475fd21d408c3f9c54093c2f Mon Sep 17 00:00:00 2001 From: Phil Ewels Date: Thu, 31 Aug 2017 10:26:28 +0200 Subject: [PATCH 09/11] Add in default params to base config. --- conf/base.config | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/conf/base.config b/conf/base.config index 254f32e9..c9596269 100644 --- a/conf/base.config +++ b/conf/base.config @@ -88,5 +88,11 @@ process { cpus = { check_max(6 * task.attempt, 'cpus') } memory = { check_max( 48.GB * task.attempt, 'memory') } } +} -} \ No newline at end of file +params { + // Defaults only, expecting to be overwritten + max_memory = 128.GB + max_cpus = 16 + max_time = 240.h +} From 44c30e35f5690124d7b681d60f81f710c36bfc08 Mon Sep 17 00:00:00 2001 From: Phil Ewels Date: Fri, 1 Sep 2017 12:02:22 +0200 Subject: [PATCH 10/11] Removed autoMounts from singularity support. --- conf/uppmax.config | 1 - 1 file changed, 1 deletion(-) diff --git a/conf/uppmax.config b/conf/uppmax.config index 53b2c9db..3268dd4d 100644 --- a/conf/uppmax.config +++ b/conf/uppmax.config @@ -9,7 +9,6 @@ vim: syntax=groovy */ singularity { - autoMounts = true enabled = true } From ae3e5e7004a1729a4688eebc3cd0736615de7047 Mon Sep 17 00:00:00 2001 From: Phil Ewels Date: Fri, 1 Sep 2017 12:23:06 +0200 Subject: [PATCH 11/11] Comment out BWA-meth tests until I figure out how to handle docker images properly. --- .travis.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8af662f7..d45c6220 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,8 +19,9 @@ env: - CLFLAGS="-b" # Run, build reference genome - CLFLAGS="-r" # Run, RRBS mode - CLFLAGS="-n" # Run, no-trimming mode - - CLFLAGS="-p" # BWAmeth use existing ref genome - - CLFLAGS="-p -b" # BWAmeth run, build reference genome + # Commented out until I figure out how to handle multiple docker images nicely + # - CLFLAGS="-p" # BWAmeth use existing ref genome + # - CLFLAGS="-p -b" # BWAmeth run, build reference genome script: - "./run_test.sh $CLFLAGS"