Skip to content

Commit

Permalink
Merge pull request #121 from matq007/issue-120
Browse files Browse the repository at this point in the history
fix: upgrade `STAR` aligner and `STAR-Fusion`
  • Loading branch information
maxulysse committed May 6, 2020
2 parents e594b07 + 49e695b commit 3b2e9e8
Show file tree
Hide file tree
Showing 13 changed files with 42 additions and 77 deletions.
18 changes: 9 additions & 9 deletions build-ctat.nf
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ def helpMessage() {
Mandatory arguments:
--fasta [file] Path to fasta reference
--gtf [file] Path to GTF annotation
--reference_release [int] Release number of Ensembl reference for FASTA and GTF
example: 97 -> ftp://ftp.ensembl.org/pub/release-97
--outdir [path] Output directory for downloading
-profile [str] Configuration profile [https://github.com/nf-core/configs]
""".stripIndent()
Expand All @@ -40,21 +38,22 @@ def helpMessage() {
* SET UP CONFIGURATION VARIABLES
*/

// Show help emssage
// Show help message
if (params.help) exit 0, helpMessage()

if (!params.reference_release) exit 1, "You did not specify the release number of reference!"
if (!params.outdir) exit 1, "Output directory not specified!"
params.fasta = params.genome ? params.genomes[params.genome].fasta ?: null : null
params.gtf = params.genome ? params.genomes[params.genome].gtf ?: null : null

ch_fasta = Channel.value(file(params.fasta)).ifEmpty{exit 1, "Fasta file not found: ${params.fasta}"}
ch_gtf = Channel.value(file(params.gtf)).ifEmpty{exit 1, "GTF annotation file not found: ${params.gtf}"}

if (!params.outdir) exit 1, "Output directory not specified!"

// Header log info
log.info nfcoreHeader()
def summary = [:]
summary['Pipeline Name'] = 'nf-core/rnafusion/download-references.nf'
summary['Pipeline Name'] = 'nf-core/rnafusion/build-ctat.nf'
summary['Pipeline Version'] = workflow.manifest.version
summary['References'] = params.running_tools.size() == 0 ? 'None' : params.running_tools.join(", ")
if(workflow.containerEngine) summary['Container'] = "$workflow.containerEngine - $workflow.container"
summary['Max Resources'] = "$params.max_memory memory, $params.max_cpus cpus, $params.max_time time per job"
summary['Output dir'] = params.outdir
Expand All @@ -73,6 +72,7 @@ checkHostname()

process star_fusion {
label 'process_high'
label 'process_long'
publishDir "${params.outdir}", mode: 'copy'

input:
Expand Down Expand Up @@ -100,7 +100,7 @@ process star_fusion {
prep_genome_lib.pl \\
--genome_fa ${fasta} \\
--gtf ${gtf} \\
--annot_filter_rule /opt/conda/envs/star-fusion_v1.6.0/ctat-genome-lib-builder-2830cd708c5bb9353878ca98069427e83acdd625/AnnotFilterRuleLib/AnnotFilterRule.pm \\
--annot_filter_rule /opt/conda/envs/nf-core-rnafusion-star-fusion_1.8.1/ctat-genome-lib-builder-2830cd708c5bb9353878ca98069427e83acdd625/AnnotFilterRuleLib/AnnotFilterRule.pm \\
--fusion_annot_lib CTAT_HumanFusionLib.dat.gz \\
--pfam_db Pfam-A.hmm \\
--dfam_db homo_sapiens_dfam.hmm \\
Expand Down Expand Up @@ -157,4 +157,4 @@ def checkHostname() {
}
}
}
}
}
20 changes: 8 additions & 12 deletions conf/base.config
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,19 @@

params {
versions {
arriba = '1.1.0'
arriba = '1.1.0-star2.7.2b'
ericscript = '0.5.5'
fusioncatcher = '1.20'
fusion_inspector = '1.3.1-star2.7.0f'
pizzly = '0.37.3'
squid = '1.5-star2.7.0f'
star_fusion = '1.6.0'
squid = '1.5-star2.7.2b'
star_fusion = '1.8.1'
}
}

process {
cpus = { check_max( 1 * task.attempt, 'cpus' ) }
memory = { check_max( 7.GB * task.attempt, 'memory' ) }
time = { check_max( 4.h * task.attempt, 'time' ) }
time = { check_max( 6.h * task.attempt, 'time' ) }

errorStrategy = { task.exitStatus in [143,137,104,134,139] ? 'retry' : 'finish' }
maxRetries = 1
Expand All @@ -38,15 +37,15 @@ process {
withLabel:process_medium {
cpus = { check_max( 6 * task.attempt, 'cpus' ) }
memory = { check_max( 42.GB * task.attempt, 'memory' ) }
time = { check_max( 8.h * task.attempt, 'time' ) }
time = { check_max( 12.h * task.attempt, 'time' ) }
}
withLabel:process_high {
cpus = { check_max( 12 * task.attempt, 'cpus' ) }
memory = { check_max( 84.GB * task.attempt, 'memory' ) }
time = { check_max( 10.h * task.attempt, 'time' ) }
time = { check_max( 24.h * task.attempt, 'time' ) }
}
withLabel:process_long {
time = { check_max( 20.h * task.attempt, 'time' ) }
time = { check_max( 48.h * task.attempt, 'time' ) }
}
withName:get_software_versions {
cache = false
Expand All @@ -62,16 +61,13 @@ process {
withName:fusioncatcher {
container = "nfcore/rnafusion:fusioncatcher_${params.versions.fusioncatcher}"
}
withName:fusion_inspector {
container = "nfcore/rnafusion:fusion-inspector_${params.versions.fusion_inspector}"
}
withName:pizzly {
container = "nfcore/rnafusion:pizzly_${params.versions.pizzly}"
}
withName:squid {
container = "nfcore/rnafusion:squid_${params.versions.squid}"
}
withName:"star_fusion" {
withName:"star_fusion|fusion_inspector" {
container = "nfcore/rnafusion:star-fusion_${params.versions.star_fusion}"
}
}
4 changes: 2 additions & 2 deletions containers/arriba/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ COPY environment.yml /
RUN conda env create -f /environment.yml && conda clean -a

# Add conda installation dir to PATH (instead of doing 'conda activate')
ENV PATH /opt/conda/envs/nf-core-rnafusion-arriba_1.1.0/bin:$PATH
ENV PATH /opt/conda/envs/nf-core-rnafusion-arriba_1.1.0-star2.7.2b/bin:$PATH

# Dump the details of the installed packages to a file for posterity
RUN conda env export --name nf-core-rnafusion-arriba_1.1.0 > nf-core-rnafusion-arriba_1.1.0.yml
RUN conda env export --name nf-core-rnafusion-arriba_1.1.0-star2.7.2b > nf-core-rnafusion-arriba_1.1.0-star2.7.2b.yml
4 changes: 2 additions & 2 deletions containers/arriba/environment.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: nf-core-rnafusion-arriba_1.1.0
name: nf-core-rnafusion-arriba_1.1.0-star2.7.2b
channels:
- conda-forge
- bioconda
Expand All @@ -8,7 +8,7 @@ dependencies:
- bioconda::bioconductor-genomicalignments
- bioconda::bioconductor-genomicranges
- bioconda::samtools=1.9
- bioconda::star=2.7.0f
- bioconda::star=2.7.2b
- conda-forge::openssl=1.0
- conda-forge::r-circlize
- conda-forge::readline=6.2
14 changes: 0 additions & 14 deletions containers/fusion-inspector/Dockerfile

This file was deleted.

8 changes: 0 additions & 8 deletions containers/fusion-inspector/environment.yml

This file was deleted.

10 changes: 5 additions & 5 deletions containers/squid/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ COPY environment.yml /
RUN conda env create -f /environment.yml && conda clean -a

# Add conda installation dir to PATH (instead of doing 'conda activate')
ENV PATH /opt/conda/envs/nf-core-rnafusion-squid_1.5-star2.7.0f/bin:$PATH
ENV PATH /opt/conda/envs/nf-core-rnafusion-squid_1.5-star2.7.2b/bin:$PATH

RUN cd /opt/conda/envs/nf-core-rnafusion-squid_1.5-star2.7.0f/bin \
RUN cd /opt/conda/envs/nf-core-rnafusion-squid_1.5-star2.7.2b/bin \
&& wget https://raw.githubusercontent.com/Kingsford-Group/squid/f45c9025d41cffd982ecbbdd52844e5a4f074de9/utils/AnnotateSQUIDOutput.py \
&& chmod +x /opt/conda/envs/nf-core-rnafusion-squid_1.5-star2.7.0f/bin/AnnotateSQUIDOutput.py \
&& ln -s /opt/conda/envs/nf-core-rnafusion-squid_1.5-star2.7.0f/bin/python3 /bin/python
&& chmod +x /opt/conda/envs/nf-core-rnafusion-squid_1.5-star2.7.2b/bin/AnnotateSQUIDOutput.py \
&& ln -s /opt/conda/envs/nf-core-rnafusion-squid_1.5-star2.7.2b/bin/python3 /bin/python

# Dump the details of the installed packages to a file for posterity
RUN conda env export --name nf-core-rnafusion-squid_1.5-star2.7.0f > nf-core-rnafusion-squid_1.5-star2.7.0f.yml
RUN conda env export --name nf-core-rnafusion-squid_1.5-star2.7.2b > nf-core-rnafusion-squid_1.5-star2.7.2b.yml
4 changes: 2 additions & 2 deletions containers/squid/environment.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: nf-core-rnafusion-squid_1.5-star2.7.0f
name: nf-core-rnafusion-squid_1.5-star2.7.2b
channels:
- conda-forge
- bioconda
- defaults
dependencies:
- bioconda::samtools=1.9
- bioconda::squid=1.5
- bioconda::star=2.7.0f
- bioconda::star=2.7.2b
- conda-forge::numpy=1.18.1
- conda-forge::python=3.7.6
18 changes: 6 additions & 12 deletions containers/star-fusion/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,13 @@ COPY environment.yml /
RUN conda env create -f /environment.yml && conda clean -a

# Add conda installation dir to PATH (instead of doing 'conda activate')
ENV PATH /opt/conda/envs/nf-core-rnafusion-star-fusion_1.6.0/bin:$PATH
ENV PATH /opt/conda/envs/nf-core-rnafusion-star-fusion_1.8.1/bin:$PATH

# ctat-genome-lib-builder
RUN cd /opt/conda/envs/nf-core-rnafusion-star-fusion_1.6.0/ && \
wget https://github.com/NCIP/ctat-genome-lib-builder/archive/2830cd708c5bb9353878ca98069427e83acdd625.zip && \
unzip 2830cd708c5bb9353878ca98069427e83acdd625.zip && \
cd ctat-genome-lib-builder-2830cd708c5bb9353878ca98069427e83acdd625 && \
rm /opt/conda/envs/nf-core-rnafusion-star-fusion_1.6.0/bin/prep_genome_lib.pl

ENV PATH /opt/conda/envs/nf-core-rnafusion-star-fusion_1.6.0/ctat-genome-lib-builder-2830cd708c5bb9353878ca98069427e83acdd625/:$PATH
# FusionInspector
ENV PATH /opt/conda/envs/nf-core-rnafusion-star-fusion_1.8.1/lib/STAR-Fusion/FusionInspector:$PATH

RUN ln -s /opt/conda/envs/nf-core-rnafusion-star-fusion_1.6.0/lib/libssl.so /opt/conda/envs/nf-core-rnafusion-star-fusion_1.6.0/lib/libssl.so.1.0.0 && \
ln -s /opt/conda/envs/nf-core-rnafusion-star-fusion_1.6.0/lib/libcrypto.so /opt/conda/envs/nf-core-rnafusion-star-fusion_1.6.0/lib/libcrypto.so.1.0.0
# ctat-genome-lib-builder
ENV PATH /opt/conda/envs/nf-core-rnafusion-star-fusion_1.8.1/lib/STAR-Fusion/ctat-genome-lib-builder:$PATH

# Dump the details of the installed packages to a file for posterity
RUN conda env export --name nf-core-rnafusion-star-fusion_1.6.0 > nf-core-rnafusion-star-fusion_1.6.0.yml
RUN conda env export --name nf-core-rnafusion-star-fusion_1.8.1 > nf-core-rnafusion-star-fusion_1.8.1.yml
8 changes: 3 additions & 5 deletions containers/star-fusion/environment.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
name: nf-core-rnafusion-star-fusion_1.6.0
name: nf-core-rnafusion-star-fusion_1.8.1
channels:
- conda-forge
- bioconda
- defaults
dependencies:
- bioconda::dfam=2.0
- bioconda::hmmer=3.2.1
- bioconda::star-fusion=1.6.0
- bioconda::star=2.7.0f
- bioconda::star-fusion=1.8.1
- bioconda::trinity=2.6.6
- conda-forge::perl-carp-assert
- conda-forge::unzip=6.0
- conda-forge::perl-carp-assert
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ dependencies:
- bioconda::fastqc=0.11.8
- bioconda::multiqc=1.7
# Custom packages
- bioconda::star=2.7.0f # update STAR-Fusion and Fusion-Inspector, Arriba
- bioconda::star=2.7.1a # has to be for star index
- conda-forge::r-data.table=1.12.8
- conda-forge::r-gplots=3.0.1.2
- bioconda::bioconductor-edger=3.28.0
Expand Down
7 changes: 4 additions & 3 deletions main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ process fusion_inspector {
file(reference) from reference.fusion_inspector

output:
file("*.{fa,gtf,bed,bam,bai,txt}") into fusion_inspector_output
file("*.{fa,gtf,bed,bam,bai,txt,html}") into fusion_inspector_output

when: params.fusion_inspector && (!params.single_end || params.debug)

Expand All @@ -722,8 +722,9 @@ process fusion_inspector {
--left_fq ${reads[0]} \\
--right_fq ${reads[1]} \\
--CPU ${task.cpus} \\
--out_dir . \\
-O . \\
--out_prefix finspector \\
--vis \\
${extra_params}
"""
}
Expand Down Expand Up @@ -754,7 +755,7 @@ process get_software_versions {
multiqc --version > v_multiqc.txt
cat ${baseDir}/containers/arriba/environment.yml > v_arriba.txt
cat ${baseDir}/containers/fusioncatcher/environment.yml > v_fusioncatcher.txt
cat ${baseDir}/containers/fusion-inspector/environment.yml > v_fusion_inspector.txt
cat ${baseDir}/containers/star-fusion/environment.yml > v_fusion_inspector.txt
cat ${baseDir}/containers/star-fusion/environment.yml > v_star_fusion.txt
cat ${baseDir}/containers/ericscript/environment.yml > v_ericscript.txt
cat ${baseDir}/containers/pizzly/environment.yml > v_pizzly.txt
Expand Down
2 changes: 0 additions & 2 deletions scripts/download-singularity-img.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ elif [ -d "$1" ]; then
ARRIBA=$(get_tool_version "arriba")
ERICSCRIPT=$(get_tool_version "ericscript")
FUSIONCATCHER=$(get_tool_version "fusioncatcher")
FUSION_INSPECTOR=$(get_tool_version "fusion_inspector")
PIZZLY=$(get_tool_version "pizzly")
RNAFUSION="$(cat nextflow.config | grep -m1 "container" | cut -d":" -f2 | cut -d "'" -f1)"
SQUID=$(get_tool_version "squid")
Expand All @@ -33,7 +32,6 @@ elif [ -d "$1" ]; then
singularity pull --name "${PREFIX}-arriba_${ARRIBA}.img" docker://nfcore/rnafusion:arriba_${ARRIBA}
singularity pull --name "${PREFIX}-ericscript_${ERICSCRIPT}.img" docker://nfcore/rnafusion:ericscript_${ERICSCRIPT}
singularity pull --name "${PREFIX}-fusioncatcher_${FUSIONCATCHER}.img" docker://nfcore/rnafusion:fusioncatcher_${FUSIONCATCHER}
singularity pull --name "${PREFIX}-fusion-inspector_${FUSION_INSPECTOR}.img" docker://nfcore/rnafusion:fusion-inspector_${FUSION_INSPECTOR}
singularity pull --name "${PREFIX}-pizzly_${PIZZLY}.img" docker://nfcore/rnafusion:pizzly_${PIZZLY}
singularity pull --name "${PREFIX}-${RNAFUSION}.img" docker://nfcore/rnafusion:${RNAFUSION}
singularity pull --name "${PREFIX}-squid_${SQUID}.img" docker://nfcore/rnafusion:squid_${SQUID}
Expand Down

0 comments on commit 3b2e9e8

Please sign in to comment.