From d69226987ebbca64fcd762de651aa896feea2bed Mon Sep 17 00:00:00 2001 From: CI Date: Thu, 5 Dec 2024 08:52:37 +0000 Subject: [PATCH] Build branch main with version main (4adb388) Build pipeline: viash-hub.rnaseq.main-c9pqm Source commit: https://github.com/viash-hub/rnaseq/commit/4adb388c7d928eea02bccf890214f3b932b08714 Source message: Merge pull request #29 from viash-hub/add-labels Add labels (and then some) --- _viash.yaml | 2 + nextflow.config | 27 +- src/bedtools_genomecov/config.vsh.yaml | 2 +- src/cat_additional_fasta/config.vsh.yaml | 2 +- src/cat_fastq/config.vsh.yaml | 2 +- src/getchromsizes/config.vsh.yaml | 2 +- src/gtf_filter/config.vsh.yaml | 2 +- src/picard_markduplicates/config.vsh.yaml | 2 +- src/prepare_multiqc_input/config.vsh.yaml | 9 +- src/prepare_multiqc_input/script.sh | 18 +- .../rseqc_junctionannotation/config.vsh.yaml | 2 +- .../rseqc_junctionsaturation/config.vsh.yaml | 2 +- .../rseqc_readdistribution/config.vsh.yaml | 2 +- .../rseqc_readduplication/config.vsh.yaml | 2 +- src/rseqc/tin/config.vsh.yaml | 2 +- src/sortmerna/config.vsh.yaml | 2 +- src/summarizedexperiment/config.vsh.yaml | 2 +- src/tx2gene/config.vsh.yaml | 2 +- src/tximport/config.vsh.yaml | 2 +- .../genome_alignment_and_quant/main.nf | 366 ++-- .../merge_quant_results/config.vsh.yaml | 2 +- src/workflows/post_processing/main.nf | 334 ++-- src/workflows/pre_processing/main.nf | 81 +- src/workflows/prepare_genome/main.nf | 543 +++--- .../pseudo_alignment_and_quant/main.nf | 43 +- src/workflows/quality_control/config.vsh.yaml | 4 + src/workflows/quality_control/main.nf | 1558 ++++++++-------- src/workflows/rnaseq/config.vsh.yaml | 28 +- src/workflows/rnaseq/main.nf | 665 +++---- src/workflows/rnaseq/nextflow.config | 14 + src/workflows/rnaseq/test.nf | 53 + src/workflows/utils/labels.config | 44 + .../bbmap/bbmap_bbsplit/.config.vsh.yaml | 6 +- .../main/nextflow/bbmap/bbmap_bbsplit/main.nf | 6 +- .../bbmap/bbmap_bbsplit/nextflow_schema.json | 22 +- .../bedtools_genomecov/.config.vsh.yaml | 6 +- .../bedtools/bedtools_genomecov/main.nf | 6 +- .../bedtools_genomecov/nextflow_schema.json | 26 +- .../main/nextflow/fastp/.config.vsh.yaml | 6 +- .../vsh/biobox/main/nextflow/fastp/main.nf | 6 +- .../main/nextflow/fastp/nextflow_schema.json | 58 +- .../main/nextflow/fastqc/.config.vsh.yaml | 6 +- .../vsh/biobox/main/nextflow/fastqc/main.nf | 6 +- .../main/nextflow/fastqc/nextflow_schema.json | 18 +- .../nextflow/featurecounts/.config.vsh.yaml | 6 +- .../main/nextflow/featurecounts/main.nf | 6 +- .../featurecounts/nextflow_schema.json | 44 +- .../nextflow/fq_subsample/.config.vsh.yaml | 6 +- .../biobox/main/nextflow/fq_subsample/main.nf | 6 +- .../fq_subsample/nextflow_schema.json | 4 +- .../main/nextflow/gffread/.config.vsh.yaml | 6 +- .../vsh/biobox/main/nextflow/gffread/main.nf | 6 +- .../nextflow/gffread/nextflow_schema.json | 92 +- .../kallisto/kallisto_index/.config.vsh.yaml | 6 +- .../nextflow/kallisto/kallisto_index/main.nf | 6 +- .../kallisto_index/nextflow_schema.json | 8 +- .../kallisto/kallisto_quant/.config.vsh.yaml | 6 +- .../nextflow/kallisto/kallisto_quant/main.nf | 6 +- .../kallisto_quant/nextflow_schema.json | 14 +- .../main/nextflow/multiqc/.config.vsh.yaml | 6 +- .../vsh/biobox/main/nextflow/multiqc/main.nf | 6 +- .../nextflow/multiqc/nextflow_schema.json | 42 +- .../qualimap/qualimap_rnaseq/.config.vsh.yaml | 6 +- .../nextflow/qualimap/qualimap_rnaseq/main.nf | 6 +- .../qualimap_rnaseq/nextflow_schema.json | 10 +- .../.config.vsh.yaml | 6 +- .../rsem/rsem_calculate_expression/main.nf | 6 +- .../nextflow_schema.json | 66 +- .../rsem_prepare_reference/.config.vsh.yaml | 6 +- .../rsem/rsem_prepare_reference/main.nf | 6 +- .../nextflow_schema.json | 18 +- .../rseqc/rseqc_bamstat/.config.vsh.yaml | 6 +- .../main/nextflow/rseqc/rseqc_bamstat/main.nf | 6 +- .../rseqc/rseqc_bamstat/nextflow_schema.json | 2 +- .../rseqc_inferexperiment/.config.vsh.yaml | 6 +- .../rseqc/rseqc_inferexperiment/main.nf | 6 +- .../nextflow_schema.json | 2 +- .../rseqc_inner_distance/.config.vsh.yaml | 6 +- .../rseqc/rseqc_inner_distance/main.nf | 6 +- .../rseqc_inner_distance/nextflow_schema.json | 10 +- .../salmon/salmon_index/.config.vsh.yaml | 6 +- .../main/nextflow/salmon/salmon_index/main.nf | 6 +- .../salmon/salmon_index/nextflow_schema.json | 14 +- .../salmon/salmon_quant/.config.vsh.yaml | 6 +- .../main/nextflow/salmon/salmon_quant/main.nf | 6 +- .../salmon/salmon_quant/nextflow_schema.json | 94 +- .../samtools_flagstat/.config.vsh.yaml | 6 +- .../samtools/samtools_flagstat/main.nf | 6 +- .../samtools_flagstat/nextflow_schema.json | 2 +- .../samtools_idxstats/.config.vsh.yaml | 6 +- .../samtools/samtools_idxstats/main.nf | 6 +- .../samtools_idxstats/nextflow_schema.json | 2 +- .../samtools/samtools_index/.config.vsh.yaml | 6 +- .../nextflow/samtools/samtools_index/main.nf | 6 +- .../samtools_index/nextflow_schema.json | 6 +- .../samtools/samtools_sort/.config.vsh.yaml | 6 +- .../nextflow/samtools/samtools_sort/main.nf | 6 +- .../samtools_sort/nextflow_schema.json | 22 +- .../samtools/samtools_stats/.config.vsh.yaml | 6 +- .../nextflow/samtools/samtools_stats/main.nf | 6 +- .../samtools_stats/nextflow_schema.json | 10 +- .../main/nextflow/sortmerna/.config.vsh.yaml | 6 +- .../biobox/main/nextflow/sortmerna/main.nf | 6 +- .../nextflow/sortmerna/nextflow_schema.json | 36 +- .../star/star_align_reads/.config.vsh.yaml | 6 +- .../nextflow/star/star_align_reads/main.nf | 6 +- .../star_align_reads/nextflow_schema.json | 16 +- .../star_genome_generate/.config.vsh.yaml | 6 +- .../star/star_genome_generate/main.nf | 6 +- .../star_genome_generate/nextflow_schema.json | 2 +- .../main/nextflow/trimgalore/.config.vsh.yaml | 6 +- .../biobox/main/nextflow/trimgalore/main.nf | 6 +- .../nextflow/trimgalore/nextflow_schema.json | 62 +- .../umi_tools_dedup/.config.vsh.yaml | 6 +- .../umi_tools/umi_tools_dedup/main.nf | 6 +- .../umi_tools_dedup/nextflow_schema.json | 26 +- .../umi_tools_extract/.config.vsh.yaml | 6 +- .../umi_tools/umi_tools_extract/main.nf | 6 +- .../umi_tools_extract/nextflow_schema.json | 24 +- .../umi_tools_prepareforrsem/.config.vsh.yaml | 6 +- .../umi_tools_prepareforrsem/main.nf | 6 +- .../nextflow_schema.json | 12 +- .../bedtools_genomecov/.config.vsh.yaml | 15 +- .../bedtools_genomecov/bedtools_genomecov | 6 +- .../bedtools_genomecov/nextflow_labels.config | 44 + .../cat_additional_fasta/.config.vsh.yaml | 15 +- .../cat_additional_fasta/cat_additional_fasta | 6 +- .../nextflow_labels.config | 44 + target/executable/cat_fastq/.config.vsh.yaml | 15 +- target/executable/cat_fastq/cat_fastq | 6 +- .../cat_fastq/nextflow_labels.config | 44 + target/executable/deseq2_qc/.config.vsh.yaml | 15 +- target/executable/deseq2_qc/deseq2_qc | 6 +- .../deseq2_qc/nextflow_labels.config | 44 + target/executable/dupradar/.config.vsh.yaml | 15 +- target/executable/dupradar/dupradar | 6 +- .../dupradar/nextflow_labels.config | 44 + .../executable/getchromsizes/.config.vsh.yaml | 15 +- target/executable/getchromsizes/getchromsizes | 6 +- .../getchromsizes/nextflow_labels.config | 44 + target/executable/gtf2bed/.config.vsh.yaml | 15 +- target/executable/gtf2bed/gtf2bed | 6 +- .../executable/gtf2bed/nextflow_labels.config | 44 + target/executable/gtf_filter/.config.vsh.yaml | 15 +- target/executable/gtf_filter/gtf_filter | 6 +- .../gtf_filter/nextflow_labels.config | 44 + target/executable/gunzip/.config.vsh.yaml | 15 +- target/executable/gunzip/gunzip | 6 +- .../executable/gunzip/nextflow_labels.config | 44 + .../multiqc_custom_biotype/.config.vsh.yaml | 15 +- .../multiqc_custom_biotype | 6 +- .../nextflow_labels.config | 44 + .../picard_markduplicates/.config.vsh.yaml | 15 +- .../nextflow_labels.config | 44 + .../picard_markduplicates | 6 +- .../prepare_multiqc_input/.config.vsh.yaml | 18 +- .../prepare_multiqc_input/multiqc_config.yml | 164 ++ .../nextflow_labels.config | 44 + .../prepare_multiqc_input | 25 +- .../.config.vsh.yaml | 15 +- .../nextflow_labels.config | 44 + .../preprocess_transcripts_fasta | 6 +- .../preseq_lcextrap/.config.vsh.yaml | 15 +- .../preseq_lcextrap/nextflow_labels.config | 44 + .../preseq_lcextrap/preseq_lcextrap | 6 +- .../rsem_merge_counts/.config.vsh.yaml | 15 +- .../rsem_merge_counts/nextflow_labels.config | 44 + .../rsem_merge_counts/rsem_merge_counts | 6 +- .../rseqc_junctionannotation/.config.vsh.yaml | 15 +- .../nextflow_labels.config | 44 + .../rseqc_junctionannotation | 6 +- .../rseqc_junctionsaturation/.config.vsh.yaml | 15 +- .../nextflow_labels.config | 44 + .../rseqc_junctionsaturation | 6 +- .../rseqc_readdistribution/.config.vsh.yaml | 15 +- .../nextflow_labels.config | 44 + .../rseqc_readdistribution | 6 +- .../rseqc_readduplication/.config.vsh.yaml | 15 +- .../nextflow_labels.config | 44 + .../rseqc_readduplication | 6 +- .../rseqc/rseqc_tin/.config.vsh.yaml | 15 +- .../rseqc/rseqc_tin/nextflow_labels.config | 44 + target/executable/rseqc/rseqc_tin/rseqc_tin | 6 +- target/executable/sortmerna/.config.vsh.yaml | 15 +- .../sortmerna/nextflow_labels.config | 44 + target/executable/sortmerna/sortmerna | 6 +- target/executable/stringtie/.config.vsh.yaml | 15 +- .../stringtie/nextflow_labels.config | 44 + target/executable/stringtie/stringtie | 6 +- .../summarizedexperiment/.config.vsh.yaml | 15 +- .../nextflow_labels.config | 44 + .../summarizedexperiment/summarizedexperiment | 6 +- target/executable/tx2gene/.config.vsh.yaml | 15 +- .../executable/tx2gene/nextflow_labels.config | 44 + target/executable/tx2gene/tx2gene | 6 +- target/executable/tximport/.config.vsh.yaml | 15 +- .../tximport/nextflow_labels.config | 44 + target/executable/tximport/tximport | 6 +- .../executable/ucsc/bedclip/.config.vsh.yaml | 15 +- target/executable/ucsc/bedclip/bedclip | 6 +- .../ucsc/bedclip/nextflow_labels.config | 44 + .../ucsc/bedgraphtobigwig/.config.vsh.yaml | 15 +- .../ucsc/bedgraphtobigwig/bedgraphtobigwig | 6 +- .../bedgraphtobigwig/nextflow_labels.config | 44 + .../.config.vsh.yaml | 15 +- .../genome_alignment_and_quant | 366 ++-- .../nextflow_labels.config | 44 + .../merge_quant_results/.config.vsh.yaml | 15 +- .../nextflow_labels.config | 44 + .../post_processing/.config.vsh.yaml | 15 +- .../post_processing/nextflow_labels.config | 44 + .../workflows/post_processing/post_processing | 334 ++-- .../workflows/pre_processing/.config.vsh.yaml | 15 +- .../pre_processing/nextflow_labels.config | 44 + .../workflows/pre_processing/pre_processing | 81 +- .../workflows/prepare_genome/.config.vsh.yaml | 15 +- .../prepare_genome/nextflow_labels.config | 44 + .../workflows/prepare_genome/prepare_genome | 543 +++--- .../.config.vsh.yaml | 15 +- .../nextflow_labels.config | 44 + .../pseudo_alignment_and_quant | 43 +- .../quality_control/.config.vsh.yaml | 17 +- .../quality_control/nextflow_labels.config | 44 + .../workflows/quality_control/quality_control | 1558 ++++++++-------- .../workflows/rnaseq/.config.vsh.yaml | 36 +- .../workflows/rnaseq/nextflow_labels.config | 44 + target/executable/workflows/rnaseq/rnaseq | 711 ++++---- .../bedtools_genomecov/.config.vsh.yaml | 15 +- target/nextflow/bedtools_genomecov/main.nf | 16 +- .../bedtools_genomecov/nextflow.config | 2 +- .../bedtools_genomecov/nextflow_labels.config | 44 + .../cat_additional_fasta/.config.vsh.yaml | 15 +- target/nextflow/cat_additional_fasta/main.nf | 16 +- .../cat_additional_fasta/nextflow.config | 2 +- .../nextflow_labels.config | 44 + target/nextflow/cat_fastq/.config.vsh.yaml | 15 +- target/nextflow/cat_fastq/main.nf | 16 +- target/nextflow/cat_fastq/nextflow.config | 2 +- .../nextflow/cat_fastq/nextflow_labels.config | 44 + target/nextflow/deseq2_qc/.config.vsh.yaml | 15 +- target/nextflow/deseq2_qc/main.nf | 16 +- target/nextflow/deseq2_qc/nextflow.config | 2 +- .../nextflow/deseq2_qc/nextflow_labels.config | 44 + target/nextflow/dupradar/.config.vsh.yaml | 15 +- target/nextflow/dupradar/main.nf | 16 +- target/nextflow/dupradar/nextflow.config | 2 +- .../nextflow/dupradar/nextflow_labels.config | 44 + .../nextflow/getchromsizes/.config.vsh.yaml | 15 +- target/nextflow/getchromsizes/main.nf | 16 +- target/nextflow/getchromsizes/nextflow.config | 2 +- .../getchromsizes/nextflow_labels.config | 44 + target/nextflow/gtf2bed/.config.vsh.yaml | 15 +- target/nextflow/gtf2bed/main.nf | 16 +- target/nextflow/gtf2bed/nextflow.config | 2 +- .../nextflow/gtf2bed/nextflow_labels.config | 44 + target/nextflow/gtf_filter/.config.vsh.yaml | 15 +- target/nextflow/gtf_filter/main.nf | 16 +- target/nextflow/gtf_filter/nextflow.config | 2 +- .../gtf_filter/nextflow_labels.config | 44 + target/nextflow/gunzip/.config.vsh.yaml | 15 +- target/nextflow/gunzip/main.nf | 16 +- target/nextflow/gunzip/nextflow.config | 2 +- target/nextflow/gunzip/nextflow_labels.config | 44 + .../multiqc_custom_biotype/.config.vsh.yaml | 15 +- .../nextflow/multiqc_custom_biotype/main.nf | 16 +- .../multiqc_custom_biotype/nextflow.config | 2 +- .../nextflow_labels.config | 44 + .../picard_markduplicates/.config.vsh.yaml | 15 +- target/nextflow/picard_markduplicates/main.nf | 16 +- .../picard_markduplicates/nextflow.config | 2 +- .../nextflow_labels.config | 44 + .../prepare_multiqc_input/.config.vsh.yaml | 18 +- target/nextflow/prepare_multiqc_input/main.nf | 39 +- .../prepare_multiqc_input/multiqc_config.yml | 164 ++ .../prepare_multiqc_input/nextflow.config | 2 +- .../nextflow_labels.config | 44 + .../nextflow_schema.json | 4 +- .../.config.vsh.yaml | 15 +- .../preprocess_transcripts_fasta/main.nf | 16 +- .../nextflow.config | 2 +- .../nextflow_labels.config | 44 + .../nextflow/preseq_lcextrap/.config.vsh.yaml | 15 +- target/nextflow/preseq_lcextrap/main.nf | 16 +- .../nextflow/preseq_lcextrap/nextflow.config | 2 +- .../preseq_lcextrap/nextflow_labels.config | 44 + .../rsem_merge_counts/.config.vsh.yaml | 15 +- target/nextflow/rsem_merge_counts/main.nf | 16 +- .../rsem_merge_counts/nextflow.config | 2 +- .../rsem_merge_counts/nextflow_labels.config | 44 + .../rseqc_junctionannotation/.config.vsh.yaml | 15 +- .../rseqc/rseqc_junctionannotation/main.nf | 16 +- .../rseqc_junctionannotation/nextflow.config | 2 +- .../nextflow_labels.config | 44 + .../rseqc_junctionsaturation/.config.vsh.yaml | 15 +- .../rseqc/rseqc_junctionsaturation/main.nf | 16 +- .../rseqc_junctionsaturation/nextflow.config | 2 +- .../nextflow_labels.config | 44 + .../rseqc_readdistribution/.config.vsh.yaml | 15 +- .../rseqc/rseqc_readdistribution/main.nf | 16 +- .../rseqc_readdistribution/nextflow.config | 2 +- .../nextflow_labels.config | 44 + .../rseqc_readduplication/.config.vsh.yaml | 15 +- .../rseqc/rseqc_readduplication/main.nf | 16 +- .../rseqc_readduplication/nextflow.config | 2 +- .../nextflow_labels.config | 44 + .../nextflow/rseqc/rseqc_tin/.config.vsh.yaml | 15 +- target/nextflow/rseqc/rseqc_tin/main.nf | 16 +- .../nextflow/rseqc/rseqc_tin/nextflow.config | 2 +- .../rseqc/rseqc_tin/nextflow_labels.config | 44 + target/nextflow/sortmerna/.config.vsh.yaml | 15 +- target/nextflow/sortmerna/main.nf | 16 +- target/nextflow/sortmerna/nextflow.config | 2 +- .../nextflow/sortmerna/nextflow_labels.config | 44 + target/nextflow/stringtie/.config.vsh.yaml | 15 +- target/nextflow/stringtie/main.nf | 16 +- target/nextflow/stringtie/nextflow.config | 2 +- .../nextflow/stringtie/nextflow_labels.config | 44 + .../summarizedexperiment/.config.vsh.yaml | 15 +- target/nextflow/summarizedexperiment/main.nf | 16 +- .../summarizedexperiment/nextflow.config | 2 +- .../nextflow_labels.config | 44 + target/nextflow/tx2gene/.config.vsh.yaml | 15 +- target/nextflow/tx2gene/main.nf | 16 +- target/nextflow/tx2gene/nextflow.config | 2 +- .../nextflow/tx2gene/nextflow_labels.config | 44 + target/nextflow/tximport/.config.vsh.yaml | 15 +- target/nextflow/tximport/main.nf | 16 +- target/nextflow/tximport/nextflow.config | 2 +- .../nextflow/tximport/nextflow_labels.config | 44 + target/nextflow/ucsc/bedclip/.config.vsh.yaml | 15 +- target/nextflow/ucsc/bedclip/main.nf | 16 +- target/nextflow/ucsc/bedclip/nextflow.config | 2 +- .../ucsc/bedclip/nextflow_labels.config | 44 + .../ucsc/bedgraphtobigwig/.config.vsh.yaml | 15 +- target/nextflow/ucsc/bedgraphtobigwig/main.nf | 16 +- .../ucsc/bedgraphtobigwig/nextflow.config | 2 +- .../bedgraphtobigwig/nextflow_labels.config | 44 + .../.config.vsh.yaml | 15 +- .../genome_alignment_and_quant/main.nf | 382 ++-- .../nextflow.config | 2 +- .../nextflow_labels.config | 44 + .../merge_quant_results/.config.vsh.yaml | 15 +- .../workflows/merge_quant_results/main.nf | 16 +- .../merge_quant_results/nextflow.config | 2 +- .../nextflow_labels.config | 44 + .../post_processing/.config.vsh.yaml | 15 +- .../workflows/post_processing/main.nf | 350 ++-- .../workflows/post_processing/nextflow.config | 2 +- .../post_processing/nextflow_labels.config | 44 + .../workflows/pre_processing/.config.vsh.yaml | 15 +- .../nextflow/workflows/pre_processing/main.nf | 97 +- .../workflows/pre_processing/nextflow.config | 2 +- .../pre_processing/nextflow_labels.config | 44 + .../workflows/prepare_genome/.config.vsh.yaml | 15 +- .../nextflow/workflows/prepare_genome/main.nf | 559 +++--- .../workflows/prepare_genome/nextflow.config | 2 +- .../prepare_genome/nextflow_labels.config | 44 + .../.config.vsh.yaml | 15 +- .../pseudo_alignment_and_quant/main.nf | 59 +- .../nextflow.config | 2 +- .../nextflow_labels.config | 44 + .../quality_control/.config.vsh.yaml | 17 +- .../workflows/quality_control/main.nf | 1574 +++++++++-------- .../workflows/quality_control/nextflow.config | 2 +- .../quality_control/nextflow_labels.config | 44 + .../quality_control/nextflow_schema.json | 8 +- .../workflows/rnaseq/.config.vsh.yaml | 36 +- target/nextflow/workflows/rnaseq/main.nf | 713 ++++---- .../nextflow/workflows/rnaseq/nextflow.config | 2 +- .../workflows/rnaseq/nextflow_labels.config | 44 + .../workflows/rnaseq/nextflow_schema.json | 40 +- 371 files changed, 11102 insertions(+), 6497 deletions(-) create mode 100644 src/workflows/rnaseq/nextflow.config create mode 100644 src/workflows/rnaseq/test.nf create mode 100644 src/workflows/utils/labels.config create mode 100644 target/executable/bedtools_genomecov/nextflow_labels.config create mode 100644 target/executable/cat_additional_fasta/nextflow_labels.config create mode 100644 target/executable/cat_fastq/nextflow_labels.config create mode 100644 target/executable/deseq2_qc/nextflow_labels.config create mode 100644 target/executable/dupradar/nextflow_labels.config create mode 100644 target/executable/getchromsizes/nextflow_labels.config create mode 100644 target/executable/gtf2bed/nextflow_labels.config create mode 100644 target/executable/gtf_filter/nextflow_labels.config create mode 100644 target/executable/gunzip/nextflow_labels.config create mode 100644 target/executable/multiqc_custom_biotype/nextflow_labels.config create mode 100644 target/executable/picard_markduplicates/nextflow_labels.config create mode 100644 target/executable/prepare_multiqc_input/multiqc_config.yml create mode 100644 target/executable/prepare_multiqc_input/nextflow_labels.config create mode 100644 target/executable/preprocess_transcripts_fasta/nextflow_labels.config create mode 100644 target/executable/preseq_lcextrap/nextflow_labels.config create mode 100644 target/executable/rsem_merge_counts/nextflow_labels.config create mode 100644 target/executable/rseqc/rseqc_junctionannotation/nextflow_labels.config create mode 100644 target/executable/rseqc/rseqc_junctionsaturation/nextflow_labels.config create mode 100644 target/executable/rseqc/rseqc_readdistribution/nextflow_labels.config create mode 100644 target/executable/rseqc/rseqc_readduplication/nextflow_labels.config create mode 100644 target/executable/rseqc/rseqc_tin/nextflow_labels.config create mode 100644 target/executable/sortmerna/nextflow_labels.config create mode 100644 target/executable/stringtie/nextflow_labels.config create mode 100644 target/executable/summarizedexperiment/nextflow_labels.config create mode 100644 target/executable/tx2gene/nextflow_labels.config create mode 100644 target/executable/tximport/nextflow_labels.config create mode 100644 target/executable/ucsc/bedclip/nextflow_labels.config create mode 100644 target/executable/ucsc/bedgraphtobigwig/nextflow_labels.config create mode 100644 target/executable/workflows/genome_alignment_and_quant/nextflow_labels.config create mode 100644 target/executable/workflows/merge_quant_results/nextflow_labels.config create mode 100644 target/executable/workflows/post_processing/nextflow_labels.config create mode 100644 target/executable/workflows/pre_processing/nextflow_labels.config create mode 100644 target/executable/workflows/prepare_genome/nextflow_labels.config create mode 100644 target/executable/workflows/pseudo_alignment_and_quant/nextflow_labels.config create mode 100644 target/executable/workflows/quality_control/nextflow_labels.config create mode 100644 target/executable/workflows/rnaseq/nextflow_labels.config create mode 100644 target/nextflow/bedtools_genomecov/nextflow_labels.config create mode 100644 target/nextflow/cat_additional_fasta/nextflow_labels.config create mode 100644 target/nextflow/cat_fastq/nextflow_labels.config create mode 100644 target/nextflow/deseq2_qc/nextflow_labels.config create mode 100644 target/nextflow/dupradar/nextflow_labels.config create mode 100644 target/nextflow/getchromsizes/nextflow_labels.config create mode 100644 target/nextflow/gtf2bed/nextflow_labels.config create mode 100644 target/nextflow/gtf_filter/nextflow_labels.config create mode 100644 target/nextflow/gunzip/nextflow_labels.config create mode 100644 target/nextflow/multiqc_custom_biotype/nextflow_labels.config create mode 100644 target/nextflow/picard_markduplicates/nextflow_labels.config create mode 100644 target/nextflow/prepare_multiqc_input/multiqc_config.yml create mode 100644 target/nextflow/prepare_multiqc_input/nextflow_labels.config create mode 100644 target/nextflow/preprocess_transcripts_fasta/nextflow_labels.config create mode 100644 target/nextflow/preseq_lcextrap/nextflow_labels.config create mode 100644 target/nextflow/rsem_merge_counts/nextflow_labels.config create mode 100644 target/nextflow/rseqc/rseqc_junctionannotation/nextflow_labels.config create mode 100644 target/nextflow/rseqc/rseqc_junctionsaturation/nextflow_labels.config create mode 100644 target/nextflow/rseqc/rseqc_readdistribution/nextflow_labels.config create mode 100644 target/nextflow/rseqc/rseqc_readduplication/nextflow_labels.config create mode 100644 target/nextflow/rseqc/rseqc_tin/nextflow_labels.config create mode 100644 target/nextflow/sortmerna/nextflow_labels.config create mode 100644 target/nextflow/stringtie/nextflow_labels.config create mode 100644 target/nextflow/summarizedexperiment/nextflow_labels.config create mode 100644 target/nextflow/tx2gene/nextflow_labels.config create mode 100644 target/nextflow/tximport/nextflow_labels.config create mode 100644 target/nextflow/ucsc/bedclip/nextflow_labels.config create mode 100644 target/nextflow/ucsc/bedgraphtobigwig/nextflow_labels.config create mode 100644 target/nextflow/workflows/genome_alignment_and_quant/nextflow_labels.config create mode 100644 target/nextflow/workflows/merge_quant_results/nextflow_labels.config create mode 100644 target/nextflow/workflows/post_processing/nextflow_labels.config create mode 100644 target/nextflow/workflows/pre_processing/nextflow_labels.config create mode 100644 target/nextflow/workflows/prepare_genome/nextflow_labels.config create mode 100644 target/nextflow/workflows/pseudo_alignment_and_quant/nextflow_labels.config create mode 100644 target/nextflow/workflows/quality_control/nextflow_labels.config create mode 100644 target/nextflow/workflows/rnaseq/nextflow_labels.config diff --git a/_viash.yaml b/_viash.yaml index 15f3b5d..1a91a45 100644 --- a/_viash.yaml +++ b/_viash.yaml @@ -12,7 +12,9 @@ info: config_mods: | .requirements.commands := ['ps'] + .resources += {path: '/src/workflows/utils/labels.config', dest: 'nextflow_labels.config'} .runners[.type == 'nextflow'].directives.tag := '$id' + .runners[.type == 'nextflow'].config.script := 'includeConfig("nextflow_labels.config")' repositories: - name: biobox diff --git a/nextflow.config b/nextflow.config index c7ece29..a8b8d2d 100644 --- a/nextflow.config +++ b/nextflow.config @@ -1,27 +1,6 @@ -// template nextflow.config for nested workflows - manifest { nextflowVersion = '!>=20.12.1-edge' + homePage = 'https://github.com/viash-hub/rnaseq' + description = 'Bulk RNAseq pipeline' + mainScript = 'target/nextflow/workflows/rnaseq/main.nf' } - -docker { - fixOwnership = true -} - - -// TODO 1: unquote and adapt `rootDir` according to relative path within project -// params { -// rootDir = "$projectDir/../.." -// } -// -// workflowDir = "${params.rootDir}/workflows" -// targetDir = "${params.rootDir}/target/nextflow" - -// TODO 2: insert custom imports here - -// TODO 3: unquote -// docker { -// runOptions = "-v \$(realpath ${params.rootDir}):\$(realpath ${params.rootDir})" -// } - - diff --git a/src/bedtools_genomecov/config.vsh.yaml b/src/bedtools_genomecov/config.vsh.yaml index 05e0fdc..9ec2c31 100644 --- a/src/bedtools_genomecov/config.vsh.yaml +++ b/src/bedtools_genomecov/config.vsh.yaml @@ -53,4 +53,4 @@ engines: chmod a+x /usr/local/bin/bedtools runners: - type: executable - - type: nextflow \ No newline at end of file + - type: nextflow diff --git a/src/cat_additional_fasta/config.vsh.yaml b/src/cat_additional_fasta/config.vsh.yaml index 1ee0e42..3235b23 100644 --- a/src/cat_additional_fasta/config.vsh.yaml +++ b/src/cat_additional_fasta/config.vsh.yaml @@ -51,4 +51,4 @@ engines: image: python runners: - type: executable - - type: nextflow \ No newline at end of file + - type: nextflow diff --git a/src/cat_fastq/config.vsh.yaml b/src/cat_fastq/config.vsh.yaml index 4f8b77b..d76ade7 100644 --- a/src/cat_fastq/config.vsh.yaml +++ b/src/cat_fastq/config.vsh.yaml @@ -51,4 +51,4 @@ engines: image: ubuntu:22.04 runners: - type: executable - - type: nextflow \ No newline at end of file + - type: nextflow diff --git a/src/getchromsizes/config.vsh.yaml b/src/getchromsizes/config.vsh.yaml index 6353946..687e43b 100644 --- a/src/getchromsizes/config.vsh.yaml +++ b/src/getchromsizes/config.vsh.yaml @@ -54,4 +54,4 @@ engines: make install runners: - type: executable - - type: nextflow \ No newline at end of file + - type: nextflow diff --git a/src/gtf_filter/config.vsh.yaml b/src/gtf_filter/config.vsh.yaml index 0763cac..da4b3af 100644 --- a/src/gtf_filter/config.vsh.yaml +++ b/src/gtf_filter/config.vsh.yaml @@ -42,4 +42,4 @@ engines: image: python runners: - type: executable - - type: nextflow \ No newline at end of file + - type: nextflow diff --git a/src/picard_markduplicates/config.vsh.yaml b/src/picard_markduplicates/config.vsh.yaml index 5acdd80..67f5069 100644 --- a/src/picard_markduplicates/config.vsh.yaml +++ b/src/picard_markduplicates/config.vsh.yaml @@ -66,4 +66,4 @@ engines: env: [ PICARD=/usr/local/bin/picard.jar ] runners: - type: executable - - type: nextflow \ No newline at end of file + - type: nextflow diff --git a/src/prepare_multiqc_input/config.vsh.yaml b/src/prepare_multiqc_input/config.vsh.yaml index a50338c..5c7ce5f 100644 --- a/src/prepare_multiqc_input/config.vsh.yaml +++ b/src/prepare_multiqc_input/config.vsh.yaml @@ -125,7 +125,8 @@ argument_groups: multiple_sep: "," - name: "--multiqc_config" type: file - + description: | + Custom multiqc configuration file - name: "Ouput" arguments: @@ -133,14 +134,16 @@ argument_groups: type: file direction: output default: multiqc_input - + resources: - type: bash_script path: script.sh + - path: /src/assets/multiqc_config.yml engines: - type: docker image: ubuntu:22.04 + runners: - type: executable - - type: nextflow \ No newline at end of file + - type: nextflow diff --git a/src/prepare_multiqc_input/script.sh b/src/prepare_multiqc_input/script.sh index daa63e2..3aa7b6f 100644 --- a/src/prepare_multiqc_input/script.sh +++ b/src/prepare_multiqc_input/script.sh @@ -70,4 +70,20 @@ IFS="," read -ra readduplication_multiqc <<< $par_readduplication_multiqc && for IFS="," read -ra tin_multiqc <<< $par_tin_multiqc && for file in "${tin_multiqc[@]}"; do [ -e "$file" ] && cp -r "$file" "$par_output/"; done -[ -e "$par_multiqc_config" ] && cp -r $par_multiqc_config "$par_output/" +echo "Checking for custom multiqc_config" +# If the variable is empty, we use the default one (registered as a resource) +if [ -z $par_multiqc_config ]; then + echo "No multiqc_config provided, using the default" + cp $meta_resources_dir/multiqc_config.yml "$par_output" +else + echo "Optional file provided" + if [ -f $par_multiqc_config ]; then + cp $par_multiqc_config "$par_output"/multiqc_config.yml + else + # Unreachable: the Viash-generated module checks this + echo "Optional file does not exist" + exit 1 + fi +fi + +echo "Done" diff --git a/src/rseqc/rseqc_junctionannotation/config.vsh.yaml b/src/rseqc/rseqc_junctionannotation/config.vsh.yaml index 488e3c2..f43a8f1 100644 --- a/src/rseqc/rseqc_junctionannotation/config.vsh.yaml +++ b/src/rseqc/rseqc_junctionannotation/config.vsh.yaml @@ -105,4 +105,4 @@ engines: packages: [ RSeQC ] runners: - type: executable -- type: nextflow \ No newline at end of file +- type: nextflow diff --git a/src/rseqc/rseqc_junctionsaturation/config.vsh.yaml b/src/rseqc/rseqc_junctionsaturation/config.vsh.yaml index 0cee06d..09cbf6d 100644 --- a/src/rseqc/rseqc_junctionsaturation/config.vsh.yaml +++ b/src/rseqc/rseqc_junctionsaturation/config.vsh.yaml @@ -102,4 +102,4 @@ engines: packages: [ RSeQC ] runners: - type: executable -- type: nextflow \ No newline at end of file +- type: nextflow diff --git a/src/rseqc/rseqc_readdistribution/config.vsh.yaml b/src/rseqc/rseqc_readdistribution/config.vsh.yaml index 0585a45..c1a73b5 100644 --- a/src/rseqc/rseqc_readdistribution/config.vsh.yaml +++ b/src/rseqc/rseqc_readdistribution/config.vsh.yaml @@ -49,4 +49,4 @@ engines: packages: [ RSeQC ] runners: - type: executable -- type: nextflow \ No newline at end of file +- type: nextflow diff --git a/src/rseqc/rseqc_readduplication/config.vsh.yaml b/src/rseqc/rseqc_readduplication/config.vsh.yaml index 3bcf8d2..5db8a72 100644 --- a/src/rseqc/rseqc_readduplication/config.vsh.yaml +++ b/src/rseqc/rseqc_readduplication/config.vsh.yaml @@ -79,4 +79,4 @@ engines: packages: [RSeQC] runners: - type: executable -- type: nextflow \ No newline at end of file +- type: nextflow diff --git a/src/rseqc/tin/config.vsh.yaml b/src/rseqc/tin/config.vsh.yaml index 266d0f9..f841533 100644 --- a/src/rseqc/tin/config.vsh.yaml +++ b/src/rseqc/tin/config.vsh.yaml @@ -82,4 +82,4 @@ engines: pip3 install RSeQC runners: - type: executable -- type: nextflow \ No newline at end of file +- type: nextflow diff --git a/src/sortmerna/config.vsh.yaml b/src/sortmerna/config.vsh.yaml index 4df6fde..3c1cd29 100644 --- a/src/sortmerna/config.vsh.yaml +++ b/src/sortmerna/config.vsh.yaml @@ -62,4 +62,4 @@ engines: image: quay.io/biocontainers/sortmerna:4.3.6--h9ee0642_0 runners: - type: executable -- type: nextflow +- type: nextflow diff --git a/src/summarizedexperiment/config.vsh.yaml b/src/summarizedexperiment/config.vsh.yaml index f226e01..596d2db 100644 --- a/src/summarizedexperiment/config.vsh.yaml +++ b/src/summarizedexperiment/config.vsh.yaml @@ -47,4 +47,4 @@ engines: bioc: [ SummarizedExperiment, tximeta ] runners: - type: executable -- type: nextflow \ No newline at end of file +- type: nextflow diff --git a/src/tx2gene/config.vsh.yaml b/src/tx2gene/config.vsh.yaml index 567510b..727f659 100644 --- a/src/tx2gene/config.vsh.yaml +++ b/src/tx2gene/config.vsh.yaml @@ -52,4 +52,4 @@ engines: - type: python runners: - type: executable -- type: nextflow \ No newline at end of file +- type: nextflow diff --git a/src/tximport/config.vsh.yaml b/src/tximport/config.vsh.yaml index 82cdd9a..6304033 100644 --- a/src/tximport/config.vsh.yaml +++ b/src/tximport/config.vsh.yaml @@ -76,4 +76,4 @@ engines: cran: [ jsonlite ] runners: - type: executable -- type: nextflow \ No newline at end of file +- type: nextflow diff --git a/src/workflows/genome_alignment_and_quant/main.nf b/src/workflows/genome_alignment_and_quant/main.nf index 15102e6..70cdffd 100644 --- a/src/workflows/genome_alignment_and_quant/main.nf +++ b/src/workflows/genome_alignment_and_quant/main.nf @@ -10,86 +10,92 @@ workflow run_wf { [ id, state + [ paired: paired, input: input ] ] } - | star_align_reads.run ( - runIf: { id, state -> state.aligner == 'star_salmon' }, - fromState: [ - "input": "fastq_1", - "input_r2": "fastq_2", - "genome_dir": "star_index", - "sjdb_gtf_file": "gtf", - "out_sam_attr_rg_line": "star_sam_attr_rg_line", - "sjdb_gtf_feature_exon": "star_sjdb_gtf_feature_exon" - ], - toState: [ - "genome_bam": "aligned_reads", - "transcriptome_bam": "reads_aligned_to_transcriptome", - "star_multiqc": "log" - ], - args: [ - quant_mode: "TranscriptomeSAM", - twopass_mode: "Basic", - out_sam_type: "BAM;Unsorted", - run_rng_seed: 0, - out_filter_multimap_nmax: 20, - align_sjdb_overhang_min: 1, - out_sam_attributes: "NH;HI;AS;NM;MD", - quant_transcriptome_sam_output: "BanSingleEnd" - ] + | star_align_reads.run( + runIf: { id, state -> state.aligner == 'star_salmon' }, + fromState: [ + "input": "fastq_1", + "input_r2": "fastq_2", + "genome_dir": "star_index", + "sjdb_gtf_file": "gtf", + "out_sam_attr_rg_line": "star_sam_attr_rg_line", + "sjdb_gtf_feature_exon": "star_sjdb_gtf_feature_exon" + ], + toState: [ + "genome_bam": "aligned_reads", + "transcriptome_bam": "reads_aligned_to_transcriptome", + "star_multiqc": "log" + ], + args: [ + quant_mode: "TranscriptomeSAM", + twopass_mode: "Basic", + out_sam_type: "BAM;Unsorted", + run_rng_seed: 0, + out_filter_multimap_nmax: 20, + align_sjdb_overhang_min: 1, + out_sam_attributes: "NH;HI;AS;NM;MD", + quant_transcriptome_sam_output: "BanSingleEnd" + ], + directives: [ label: [ "highmem", "midcpu" ] ] ) // GENOME BAM - | samtools_sort.run ( - runIf: { id, state -> state.aligner == 'star_salmon' }, - fromState: ["input": "genome_bam"], - toState: ["genome_bam_sorted": "output"], - key: "genome_sorted" + | samtools_sort.run( + runIf: { id, state -> state.aligner == 'star_salmon' }, + fromState: ["input": "genome_bam"], + toState: ["genome_bam_sorted": "output"], + key: "genome_sorted", + directives: [ label: [ "highmem", "midcpu" ] ] ) - | samtools_index.run ( - runIf: { id, state -> state.aligner == 'star_salmon' }, - fromState: [ - "input": "genome_bam_sorted", - "csi": "bam_csi_index" - ], - toState: [ "genome_bam_index": "output" ], - key: "genome_sorted" + | samtools_index.run( + runIf: { id, state -> state.aligner == 'star_salmon' }, + fromState: [ + "input": "genome_bam_sorted", + "csi": "bam_csi_index" + ], + toState: [ "genome_bam_index": "output" ], + key: "genome_sorted", + directives: [ label: [ "highmem", "midcpu" ] ] ) - | samtools_stats.run ( - runIf: { id, state -> state.aligner == 'star_salmon' }, - fromState: [ - "input": "genome_bam_sorted", - "bai": "genome_bam_index", - "fasta": "fasta" - ], - toState: [ "genome_bam_stats": "output" ], - key: "genome_stats" + | samtools_stats.run( + runIf: { id, state -> state.aligner == 'star_salmon' }, + fromState: [ + "input": "genome_bam_sorted", + "bai": "genome_bam_index", + "fasta": "fasta" + ], + toState: [ "genome_bam_stats": "output" ], + key: "genome_stats", + directives: [ label: [ "highmem", "midcpu" ] ] ) - | samtools_flagstat.run ( - runIf: { id, state -> state.aligner == 'star_salmon' }, - fromState: [ - "bam": "genome_bam_sorted", - "bai": "genome_bam_index", - "fasta": "fasta" - ], - toState: [ "genome_bam_flagstat": "output" ], - key: "genome_flagstat" + | samtools_flagstat.run( + runIf: { id, state -> state.aligner == 'star_salmon' }, + fromState: [ + "bam": "genome_bam_sorted", + "bai": "genome_bam_index", + "fasta": "fasta" + ], + toState: [ "genome_bam_flagstat": "output" ], + key: "genome_flagstat", + directives: [ label: [ "highmem", "midcpu" ] ] ) | samtools_idxstats.run( - runIf: { id, state -> state.aligner == 'star_salmon' }, - fromState: [ - "bam": "genome_bam_sorted", - "bai": "genome_bam_index", - "fasta": "fasta" - ], - toState: [ "genome_bam_idxstats": "output" ], - key: "genome_idxstats" + runIf: { id, state -> state.aligner == 'star_salmon' }, + fromState: [ + "bam": "genome_bam_sorted", + "bai": "genome_bam_index", + "fasta": "fasta" + ], + toState: [ "genome_bam_idxstats": "output" ], + key: "genome_idxstats", + directives: [ label: [ "highmem", "midcpu" ] ] ) - // - // Remove duplicate reads from BAM file based on UMIs - // - - // Deduplicate genome BAM file - | umi_tools_dedup.run ( + // + // Remove duplicate reads from BAM file based on UMIs + // + + // Deduplicate genome BAM file + | umi_tools_dedup.run( runIf: { id, state -> state.with_umi && state.aligner == 'star_salmon' }, fromState: { id, state -> def output_stats = state.umi_dedup_stats ? state.id : @@ -99,18 +105,20 @@ workflow run_wf { output_stats: output_stats] }, toState: [ "genome_bam_sorted": "output" ], - key: "genome_deduped" - ) - | samtools_index.run ( + key: "genome_deduped", + directives: [ label: [ "highmem", "midcpu" ] ] + ) + | samtools_index.run( runIf: { id, state -> state.with_umi && state.aligner == 'star_salmon' }, fromState: [ "input": "genome_bam_sorted", "csi": "bam_csi_index" ], toState: [ "genome_bam_index": "output" ], - key: "genome_deduped" - ) - | samtools_stats.run ( + key: "genome_deduped", + directives: [ label: [ "highmem", "midcpu" ] ] + ) + | samtools_stats.run( runIf: { id, state -> state.with_umi && state.aligner == 'star_salmon' }, fromState: [ "input": "genome_bam_sorted", @@ -118,9 +126,10 @@ workflow run_wf { "fasta": "fasta" ], toState: [ "genome_bam_stats": "output" ], - key: "genome_deduped_stats" - ) - | samtools_flagstat.run ( + key: "genome_deduped_stats", + directives: [ label: [ "highmem", "midcpu" ] ] + ) + | samtools_flagstat.run( runIf: { id, state -> state.with_umi && state.aligner == 'star_salmon' }, fromState: [ "bam": "genome_bam_sorted", @@ -128,9 +137,10 @@ workflow run_wf { "fasta": "fasta" ], toState: [ "genome_bam_flagstat": "output" ], - key: "genome_deduped_flagstat" - ) - | samtools_idxstats.run( + key: "genome_deduped_flagstat", + directives: [ label: [ "highmem", "midcpu" ] ] + ) + | samtools_idxstats.run( runIf: { id, state -> state.with_umi && state.aligner == 'star_salmon' }, fromState: [ "bam": "genome_bam_sorted", @@ -138,55 +148,61 @@ workflow run_wf { "fasta": "fasta", ], toState: [ "genome_bam_idxstats": "output" ], - key: "genome_deduped_idxstats" - ) + key: "genome_deduped_idxstats", + directives: [ label: [ "highmem", "midcpu" ] ] + ) // Deduplicate transcriptome BAM file - | samtools_sort.run ( + | samtools_sort.run( runIf: { id, state -> state.with_umi && state.aligner == 'star_salmon' }, fromState: [ "input": "transcriptome_bam" ], toState: [ "transcriptome_bam": "output" ], - key: "transcriptome_sorted" - ) - | samtools_index.run ( + key: "transcriptome_sorted", + directives: [ label: [ "highmem", "midcpu" ] ] + ) + | samtools_index.run( runIf: { id, state -> state.with_umi && state.aligner == 'star_salmon' }, fromState: [ "input": "transcriptome_bam", "csi": "bam_csi_index" ], toState: [ "transcriptome_bam_index": "output" ], - key: "transcriptome_sorted" - ) - | samtools_stats.run ( + key: "transcriptome_sorted", + directives: [ label: [ "highmem", "midcpu" ] ] + ) + | samtools_stats.run( runIf: { id, state -> state.with_umi && state.aligner == 'star_salmon' }, fromState: [ "input": "transcriptome_bam", "bai": "transcriptome_bam_index", ], toState: [ "transcriptome_bam_stats": "output" ], - key: "transcriptome_stats" - ) - | samtools_flagstat.run ( + key: "transcriptome_stats", + directives: [ label: [ "highmem", "midcpu" ] ] + ) + | samtools_flagstat.run( runIf: { id, state -> state.with_umi && state.aligner == 'star_salmon' }, fromState: [ "bam": "transcriptome_bam", "bai": "transcriptome_bam_index" ], toState: [ "transcriptome_bam_flagstat": "output" ], - key: "transcriptome_flagstat" - ) - | samtools_idxstats.run( + key: "transcriptome_flagstat", + directives: [ label: [ "highmem", "midcpu" ] ] + ) + | samtools_idxstats.run( runIf: { id, state -> state.with_umi && state.aligner == 'star_salmon' }, fromState: [ "bam": "transcriptome_bam", "bai": "transcriptome_bam_index" ], toState: [ "transcriptome_bam_idxstats": "output" ], - key: "transcriptome_idxstats" - ) - - | umi_tools_dedup.run ( + key: "transcriptome_idxstats", + directives: [ label: [ "highmem", "midcpu" ] ] + ) + + | umi_tools_dedup.run( runIf: { id, state -> state.with_umi && state.aligner == 'star_salmon' }, fromState: { id, state -> def output_stats = state.umi_dedup_stats ? state.id : @@ -196,57 +212,64 @@ workflow run_wf { output_stats: output_stats] }, toState: [ "transcriptome_bam_deduped": "output" ], - key: "transcriptome_deduped" - ) - | samtools_sort.run ( + key: "transcriptome_deduped", + directives: [ label: [ "highmem", "midcpu" ] ] + ) + | samtools_sort.run( runIf: { id, state -> state.with_umi && state.aligner == 'star_salmon' }, fromState: [ "input": "transcriptome_bam_deduped" ], toState: [ "transcriptome_bam": "output" ], - key: "transcriptome_deduped_sorted" - ) - | samtools_index.run ( - runIf: { id, state -> state.with_umi && state.aligner == 'star_salmon' }, - fromState: [ - "input": "transcriptome_bam", - "csi": "bam_csi_index" - ], - toState: [ "transcriptome_bam_index": "output" ], - key: "transcriptome_deduped_sorted" - ) - | samtools_stats.run ( + key: "transcriptome_deduped_sorted", + directives: [ label: [ "highmem", "midcpu" ] ] + ) + | samtools_index.run( + runIf: { id, state -> state.with_umi && state.aligner == 'star_salmon' }, + fromState: [ + "input": "transcriptome_bam", + "csi": "bam_csi_index" + ], + toState: [ "transcriptome_bam_index": "output" ], + key: "transcriptome_deduped_sorted", + directives: [ label: [ "highmem", "midcpu" ] ] + ) + | samtools_stats.run( runIf: { id, state -> state.with_umi && state.aligner == 'star_salmon' }, fromState: [ "input": "transcriptome_bam", "bai": "transcriptome_bam_index" ], toState: [ "transcriptome_bam_stats": "output" ], - key: "transcriptome_deduped_stats" - ) - | samtools_flagstat.run ( + key: "transcriptome_deduped_stats", + directives: [ label: [ "highmem", "midcpu" ] ] + ) + | samtools_flagstat.run( runIf: { id, state -> state.with_umi && state.aligner == 'star_salmon' }, fromState: [ "bam": "transcriptome_bam", "bai": "transcriptome_bam_index" ], toState: [ "transcriptome_bam_flagstat": "output" ], - key: "transcriptome_deduped_flagstat" - ) - | samtools_idxstats.run( + key: "transcriptome_deduped_flagstat", + directives: [ label: [ "highmem", "midcpu" ] ] + ) + | samtools_idxstats.run( runIf: { id, state -> state.with_umi && state.aligner == 'star_salmon' }, fromState: [ "bam": "transcriptome_bam", "bai": "transcriptome_bam_index" ], toState: [ "transcriptome_bam_idxstats": "output" ], - key: "transcriptome_deduped_idxstats" - ) + key: "transcriptome_deduped_idxstats", + directives: [ label: [ "highmem", "midcpu" ] ] + ) - // Fix paired-end reads in name sorted BAM file - | umi_tools_prepareforrsem.run ( + // Fix paired-end reads in name sorted BAM file + | umi_tools_prepareforrsem.run( runIf: { id, state -> state.with_umi && state.paired && state.aligner == 'star_salmon' }, fromState: [ "input": "transcriptome_bam" ], - toState: [ "transcriptome_bam": "output" ] - ) + toState: [ "transcriptome_bam": "output" ], + directives: [ label: [ "highmem", "midcpu" ] ] + ) // Infer lib-type for salmon quant | map { id, state -> @@ -269,26 +292,27 @@ workflow run_wf { } // Count reads from BAM alignments using Salmon - | salmon_quant.run ( - runIf: { id, state -> state.aligner == 'star_salmon' }, - fromState: [ - "lib_type": "lib_type", - "alignments": "transcriptome_bam", - "targets": "transcript_fasta", - "gene_map": "gtf" - ], - toState: [ - "quant_out_dir": "output", - "quant_results_file": "quant_results" - ] + | salmon_quant.run( + runIf: { id, state -> state.aligner == 'star_salmon' }, + fromState: [ + "lib_type": "lib_type", + "alignments": "transcriptome_bam", + "targets": "transcript_fasta", + "gene_map": "gtf" + ], + toState: [ + "quant_out_dir": "output", + "quant_results_file": "quant_results" + ], + directives: [ label: [ "highmem", "midcpu" ] ] ) - | map { id, state -> - def mod_state = (state.aligner == 'star_salmon') ? state + [salmon_multiqc: state.quant_out_dir] : state - [ id, mod_state ] - } - - | rsem_calculate_expression.run ( + | map { id, state -> + def mod_state = (state.aligner == 'star_salmon') ? state + [salmon_multiqc: state.quant_out_dir] : state + [ id, mod_state ] + } + + | rsem_calculate_expression.run( runIf: { id, state -> state.aligner == 'star_rsem' }, fromState: [ "id": "id", @@ -319,26 +343,29 @@ workflow run_wf { "bam_star_rsem": "bam_star", "bam_genome_rsem": "bam_genome", "bam_transcript_rsem": "bam_transcript" - ] - ) - - // RSEM_Star BAM - | samtools_sort.run ( + ], + directives: [ label: [ "highmem", "midcpu" ] ] + ) + + // RSEM_Star BAM + | samtools_sort.run( runIf: { id, state -> state.aligner == 'star_rsem' }, fromState: ["input": "bam_star_rsem"], toState: ["genome_bam_sorted": "output"], - key: "genome_sorted" - ) - | samtools_index.run ( + key: "genome_sorted", + directives: [ label: [ "highmem", "midcpu" ] ] + ) + | samtools_index.run( runIf: { id, state -> state.aligner == 'star_rsem' }, fromState: [ "input": "genome_bam_sorted", "csi": "bam_csi_index" ], toState: [ "genome_bam_index": "output" ], - key: "genome_sorted" - ) - | samtools_stats.run ( + key: "genome_sorted", + directives: [ label: [ "highmem", "midcpu" ] ] + ) + | samtools_stats.run( runIf: { id, state -> state.aligner == 'star_rsem' }, fromState: [ "input": "genome_bam_sorted", @@ -346,9 +373,10 @@ workflow run_wf { "fasta": "fasta" ], toState: [ "genome_bam_stats": "output" ], - key: "genome_stats" - ) - | samtools_flagstat.run ( + key: "genome_stats", + directives: [ label: [ "highmem", "midcpu" ] ] + ) + | samtools_flagstat.run( runIf: { id, state -> state.aligner == 'star_rsem' }, fromState: [ "bam": "genome_bam_sorted", @@ -356,9 +384,10 @@ workflow run_wf { "fasta": "fasta" ], toState: [ "genome_bam_flagstat": "output" ], - key: "genome_flagstat" - ) - | samtools_idxstats.run( + key: "genome_flagstat", + directives: [ label: [ "highmem", "midcpu" ] ] + ) + | samtools_idxstats.run( runIf: { id, state -> state.aligner == 'star_rsem' }, fromState: [ "bam": "genome_bam_sorted", @@ -366,9 +395,9 @@ workflow run_wf { "fasta": "fasta" ], toState: [ "genome_bam_idxstats": "output" ], - key: "genome_idxstats" - ) - + key: "genome_idxstats", + directives: [ label: [ "highmem", "midcpu" ] ] + ) | map { id, state -> def mod_state = state.findAll { key, value -> value instanceof java.nio.file.Path && value.exists() } [ id, mod_state ] @@ -393,9 +422,10 @@ workflow run_wf { "rsem_counts_gene": "rsem_counts_gene", "rsem_counts_transcripts": "rsem_counts_transcripts", "bam_genome_rsem": "bam_genome_rsem", - "bam_transcript_rsem": "bam_transcript_rsem" ] + "bam_transcript_rsem": "bam_transcript_rsem" + ] ) - + emit: output_ch } diff --git a/src/workflows/merge_quant_results/config.vsh.yaml b/src/workflows/merge_quant_results/config.vsh.yaml index 7d4b6ee..a4809cd 100644 --- a/src/workflows/merge_quant_results/config.vsh.yaml +++ b/src/workflows/merge_quant_results/config.vsh.yaml @@ -81,4 +81,4 @@ dependencies: runners: - type: executable -- type: nextflow \ No newline at end of file +- type: nextflow diff --git a/src/workflows/post_processing/main.nf b/src/workflows/post_processing/main.nf index d7e15f8..844ec9d 100644 --- a/src/workflows/post_processing/main.nf +++ b/src/workflows/post_processing/main.nf @@ -1,178 +1,192 @@ // Note: some helper functionality is added at the end of this file workflow run_wf { - take: + take: input_ch - main: - output_ch = input_ch + main: - | picard_markduplicates.run ( - runIf: { id, state -> !state.skip_markduplicates && !state.with_umi }, - fromState: [ - "bam": "genome_bam", - "fasta": "fasta", - "fai": "fai", - "extra_picard_args": "extra_picard_args" - ], - toState: [ - "processed_genome_bam": "output_bam", - "markduplicates_metrics": "metrics" - ] - ) - | samtools_sort.run ( - runIf: { id, state -> !state.skip_markduplicates && !state.with_umi }, - fromState: [ "input": "processed_genome_bam" ], - toState: [ "processed_genome_bam": "output" ], - key: "genome_sorted_MarkDuplicates" - ) - | samtools_index.run ( - runIf: { id, state -> !state.skip_markduplicates && !state.with_umi }, - fromState: [ - "input": "processed_genome_bam", - "csi": "bam_csi_index" - ], - toState: [ "genome_bam_index": "output" ], - key: "genome_sorted_MarkDuplicates", - ) - | samtools_stats.run ( - runIf: { id, state -> !state.skip_markduplicates && !state.with_umi }, - fromState: [ - "input": "processed_genome_bam", - "bai": "genome_bam_index" - ], - toState: [ "genome_bam_stats": "output" ], - key: "MarkDuplicates_stats" - ) - | samtools_flagstat.run ( - runIf: { id, state -> !state.skip_markduplicates && !state.with_umi }, - fromState: [ - "bam": "processed_genome_bam", - "bai": "genome_bam_index" - ], - toState: [ "genome_bam_flagstat": "output" ], - key: "MarkDuplicates_flagstat" - ) - | samtools_idxstats.run( - runIf: { id, state -> !state.skip_markduplicates && !state.with_umi }, - fromState: [ - "bam": "processed_genome_bam", - "bai": "genome_bam_index" - ], - toState: [ "genome_bam_idxstats": "output" ], - key: "MarkDuplicates_idxstats" - ) + output_ch = input_ch - | stringtie.run ( - runIf: { id, state -> !state.skip_stringtie }, - fromState: [ - "strandedness": "strandedness", - "bam": "processed_genome_bam", - "annotation_gtf": "gtf", - "extra_stringtie_args": "extra_stringtie_args" - ], - toState: [ - "stringtie_transcript_gtf": "transcript_gtf", - "stringtie_coverage_gtf": "coverage_gtf", - "stringtie_abundance": "abundance", - "stringtie_ballgown": "ballgown" - ] - ) + | picard_markduplicates.run ( + runIf: { id, state -> !state.skip_markduplicates && !state.with_umi }, + fromState: [ + "bam": "genome_bam", + "fasta": "fasta", + "fai": "fai", + "extra_picard_args": "extra_picard_args" + ], + toState: [ + "processed_genome_bam": "output_bam", + "markduplicates_metrics": "metrics" + ], + directives: [ label: [ "midmem", "midcpu" ] ] + ) + | samtools_sort.run ( + runIf: { id, state -> !state.skip_markduplicates && !state.with_umi }, + fromState: [ "input": "processed_genome_bam" ], + toState: [ "processed_genome_bam": "output" ], + key: "genome_sorted_MarkDuplicates", + directives: [ label: [ "midmem", "midcpu" ] ] + ) + | samtools_index.run ( + runIf: { id, state -> !state.skip_markduplicates && !state.with_umi }, + fromState: [ + "input": "processed_genome_bam", + "csi": "bam_csi_index" + ], + toState: [ "genome_bam_index": "output" ], + key: "genome_sorted_MarkDuplicates", + directives: [ label: [ "midmem", "midcpu" ] ] + ) + | samtools_stats.run ( + runIf: { id, state -> !state.skip_markduplicates && !state.with_umi }, + fromState: [ + "input": "processed_genome_bam", + "bai": "genome_bam_index" + ], + toState: [ "genome_bam_stats": "output" ], + key: "MarkDuplicates_stats", + directives: [ label: [ "midmem", "midcpu" ] ] + ) + | samtools_flagstat.run ( + runIf: { id, state -> !state.skip_markduplicates && !state.with_umi }, + fromState: [ + "bam": "processed_genome_bam", + "bai": "genome_bam_index" + ], + toState: [ "genome_bam_flagstat": "output" ], + key: "MarkDuplicates_flagstat", + directives: [ label: [ "midmem", "midcpu" ] ] + ) + | samtools_idxstats.run( + runIf: { id, state -> !state.skip_markduplicates && !state.with_umi }, + fromState: [ + "bam": "processed_genome_bam", + "bai": "genome_bam_index" + ], + toState: [ "genome_bam_idxstats": "output" ], + key: "MarkDuplicates_idxstats", + directives: [ label: [ "midmem", "midcpu" ] ] + ) - // Genome-wide coverage with BEDTools + | stringtie.run ( + runIf: { id, state -> !state.skip_stringtie }, + fromState: [ + "strandedness": "strandedness", + "bam": "processed_genome_bam", + "annotation_gtf": "gtf", + "extra_stringtie_args": "extra_stringtie_args" + ], + toState: [ + "stringtie_transcript_gtf": "transcript_gtf", + "stringtie_coverage_gtf": "coverage_gtf", + "stringtie_abundance": "abundance", + "stringtie_ballgown": "ballgown" + ], + directives: [ label: [ "midmem", "midcpu" ] ] + ) - | bedtools_genomecov.run ( - runIf: { id, state -> !state.skip_bigwig }, - fromState: [ - "input_bam": "processed_genome_bam", - ], - args: [ - split: true, - du: true, - bed_graph: true, - strand: "+" - ], - toState: [ "bedgraph_forward": "output" ], - key: "bedtools_genomecov_forward" - ) + // Genome-wide coverage with BEDTools - | bedtools_genomecov.run ( - runIf: { id, state -> !state.skip_bigwig }, - fromState: [ - "input_bam": "processed_genome_bam", - ], - args: [ - split: true, - du: true, - bed_graph: true, - strand: "-" - ], - toState: [ "bedgraph_reverse": "output" ], - key: "bedtools_genomecov_reverse" - ) + | bedtools_genomecov.run ( + runIf: { id, state -> !state.skip_bigwig }, + fromState: [ + "input_bam": "processed_genome_bam", + ], + args: [ + split: true, + du: true, + bed_graph: true, + strand: "+" + ], + toState: [ "bedgraph_forward": "output" ], + key: "bedtools_genomecov_forward", + directives: [ label: [ "midmem", "midcpu" ] ] + ) - | bedclip.run ( - runIf: { id, state -> !state.skip_bigwig }, - fromState: [ - "input_bedgraph": "bedgraph_forward", - "sizes": "chrom_sizes" - ], - toState: [ "bedgraph_forward": "output_bedgraph" ], - key: "bedclip_forward" - ) + | bedtools_genomecov.run ( + runIf: { id, state -> !state.skip_bigwig }, + fromState: [ + "input_bam": "processed_genome_bam", + ], + args: [ + split: true, + du: true, + bed_graph: true, + strand: "-" + ], + toState: [ "bedgraph_reverse": "output" ], + key: "bedtools_genomecov_reverse", + directives: [ label: [ "midmem", "midcpu" ] ] + ) - | bedgraphtobigwig.run ( - runIf: { id, state -> !state.skip_bigwig }, - fromState: [ - "bedgraph": "bedgraph_forward", - "sizes": "chrom_sizes" - ], - toState: [ "bigwig_forward": "bigwig" ], - key: "bedgraphtobigwig_forward" - ) + | bedclip.run ( + runIf: { id, state -> !state.skip_bigwig }, + fromState: [ + "input_bedgraph": "bedgraph_forward", + "sizes": "chrom_sizes" + ], + toState: [ "bedgraph_forward": "output_bedgraph" ], + key: "bedclip_forward", + directives: [ label: [ "midmem", "midcpu" ] ] + ) - | bedclip.run ( - runIf: { id, state -> !state.skip_bigwig }, - fromState: [ - "input_bedgraph": "bedgraph_reverse", - "sizes": "chrom_sizes", - ], - toState: [ "bedgraph_reverse": "output_bedgraph" ], - key: "bedclip_reverse" - ) + | bedgraphtobigwig.run ( + runIf: { id, state -> !state.skip_bigwig }, + fromState: [ + "bedgraph": "bedgraph_forward", + "sizes": "chrom_sizes" + ], + toState: [ "bigwig_forward": "bigwig" ], + key: "bedgraphtobigwig_forward", + directives: [ label: [ "midmem", "midcpu" ] ] + ) - | bedgraphtobigwig.run ( - runIf: { id, state -> !state.skip_bigwig }, - fromState: [ - "bedgraph": "bedgraph_reverse", - "sizes": "chrom_sizes" - ], - toState: [ "bigwig_reverse": "bigwig" ], - key: "bedgraphtobigwig_reverse" - ) + | bedclip.run ( + runIf: { id, state -> !state.skip_bigwig }, + fromState: [ + "input_bedgraph": "bedgraph_reverse", + "sizes": "chrom_sizes", + ], + toState: [ "bedgraph_reverse": "output_bedgraph" ], + key: "bedclip_reverse", + directives: [ label: [ "midmem", "midcpu" ] ] + ) - | map { id, state -> - def mod_state = state.findAll { key, value -> value instanceof java.nio.file.Path && value.exists() } - [ id, mod_state ] - } + | bedgraphtobigwig.run ( + runIf: { id, state -> !state.skip_bigwig }, + fromState: [ + "bedgraph": "bedgraph_reverse", + "sizes": "chrom_sizes" + ], + toState: [ "bigwig_reverse": "bigwig" ], + key: "bedgraphtobigwig_reverse", + directives: [ label: [ "midmem", "midcpu" ] ] + ) - | setState ( - "processed_genome_bam": "processed_genome_bam", - "genome_bam_index": "genome_bam_index", - "genome_bam_stats": "genome_bam_stats", - "genome_bam_flagstat": "genome_bam_flagstat", - "genome_bam_idxstats": "genome_bam_idxstats", - "markduplicates_metrics": "markduplicates_metrics", - "stringtie_transcript_gtf": "stringtie_transcript_gtf", - "stringtie_coverage_gtf": "stringtie_coverage_gtf", - "stringtie_abundance": "stringtie_abundance", - "stringtie_ballgown": "stringtie_ballgown", - "bedgraph_forward": "bedgraph_forward", - "bedgraph_reverse": "bedgraph_reverse", - "bigwig_forward": "bigwig_forward", - "bigwig_reverse": "bigwig_reverse" - ) + | map { id, state -> + def mod_state = state.findAll { key, value -> value instanceof java.nio.file.Path && value.exists() } + [ id, mod_state ] + } - emit: - output_ch + | setState ( + "processed_genome_bam": "processed_genome_bam", + "genome_bam_index": "genome_bam_index", + "genome_bam_stats": "genome_bam_stats", + "genome_bam_flagstat": "genome_bam_flagstat", + "genome_bam_idxstats": "genome_bam_idxstats", + "markduplicates_metrics": "markduplicates_metrics", + "stringtie_transcript_gtf": "stringtie_transcript_gtf", + "stringtie_coverage_gtf": "stringtie_coverage_gtf", + "stringtie_abundance": "stringtie_abundance", + "stringtie_ballgown": "stringtie_ballgown", + "bedgraph_forward": "bedgraph_forward", + "bedgraph_reverse": "bedgraph_reverse", + "bigwig_forward": "bigwig_forward", + "bigwig_reverse": "bigwig_reverse" + ) + + emit: + output_ch } diff --git a/src/workflows/pre_processing/main.nf b/src/workflows/pre_processing/main.nf index 8c451c8..c115390 100644 --- a/src/workflows/pre_processing/main.nf +++ b/src/workflows/pre_processing/main.nf @@ -25,7 +25,8 @@ workflow run_wf { def new_state = state + newKeys return new_state }, - args: [html: "*.html", zip: "*.zip"] + args: [html: "*.html", zip: "*.zip"], + directives: [ label: [ "midmem", "highcpu" ] ] ) // Extract UMIs from fastq files and discard read 1 or read 2 if required @@ -48,7 +49,8 @@ workflow run_wf { toState: [ "fastq_1": "output", "fastq_2": "read2_out" - ] + ], + directives: [ label: [ "midmem", "midcpu" ] ] ) // Discard read if required @@ -87,7 +89,8 @@ workflow run_wf { "trim_zip_2": "trimmed_fastqc_zip_2", "trim_html_1": "trimmed_fastqc_html_1", "trim_html_2": "trimmed_fastqc_html_2" - ] + ], + directives: [ label: [ "midmem", "midcpu" ] ] ) // Trim reads using fastp @@ -112,7 +115,8 @@ workflow run_wf { "trim_json": "json", "trim_html": "html", "trim_merged_out": "merged_out" - ] + ], + directives: [ label: [ "midmem", "midcpu" ] ] ) // Perform FASTQC on reads trimmed using fastp @@ -133,7 +137,8 @@ workflow run_wf { return new_state }, args: [html: "*.html", zip: "*.zip"], - key: "fastqc_trimming" + key: "fastqc_trimming", + directives: [ label: [ "midmem", "midcpu" ] ] ) // Filter out contaminant RNA @@ -149,7 +154,8 @@ workflow run_wf { toState: [ "fastq_1": "fastq_1", "fastq_2": "fastq_2" - ] + ], + directives: [ label: [ "midmem", "midcpu" ] ] ) // Sort reads by rRNA and non-rRNA @@ -174,7 +180,8 @@ workflow run_wf { ] def new_state = state + newKeys return new_state - } + }, + directives: [ label: [ "highmem", "midcpu" ] ] ) | map { id, state -> if (state.remove_ribo_rna) { @@ -200,7 +207,8 @@ workflow run_wf { toState: [ "subsampled_fastq_1": "output_1", "subsampled_fastq_2": "output_2" - ] + ], + directives: [ label: [ "midmem", "midcpu" ] ] ) // Infer lib-type for salmon quant @@ -237,39 +245,40 @@ workflow run_wf { lib_type: state.lib_type ] }, args: [ "skip_quant": true ], - toState: [ "salmon_quant_output": "output" ] + toState: [ "salmon_quant_output": "output" ], + directives: [ label: [ "highmem", "highcpu" ] ] ) - | map { id, state -> - def mod_state = (!state.paired) ? - [trim_log_2: state.remove(state.trim_log_2), trim_zip_2: state.remove(state.trim_zip_2), trim_html_2: state.remove(state.trim_html_2), failed_trim_unpaired2: state.remove(state.failed_trim_unpaired2)] : - [] - [ id, state + mod_state ] - } + | map { id, state -> + def mod_state = (!state.paired) ? + [trim_log_2: state.remove(state.trim_log_2), trim_zip_2: state.remove(state.trim_zip_2), trim_html_2: state.remove(state.trim_html_2), failed_trim_unpaired2: state.remove(state.failed_trim_unpaired2)] : + [] + [ id, state + mod_state ] + } - | map { id, state -> - def mod_state = state.findAll { key, value -> value instanceof java.nio.file.Path && value.exists() } - [ id, mod_state ] - } + | map { id, state -> + def mod_state = state.findAll { key, value -> value instanceof java.nio.file.Path && value.exists() } + [ id, mod_state ] + } | setState ( - "fastqc_html_1": "fastqc_html_1", - "fastqc_html_2": "fastqc_html_2", - "fastqc_zip_1": "fastqc_zip_1", - "fastqc_zip_2": "fastqc_zip_2", - "qc_output1": "fastq_1", - "qc_output2": "fastq_2", - "trim_log_1": "trim_log_1", - "trim_log_2": "trim_log_2", - "trim_zip_1": "trim_zip_1", - "trim_zip_2": "trim_zip_2", - "trim_html_1": "trim_html_1", - "trim_html_2": "trim_html_2", - "sortmerna_log": "sortmerna_log", - "trim_json": "trim_json", - "trim_html": "trim_html", - "trim_merged_out": "trim_merged_out", - "salmon_quant_output": "salmon_quant_output" + "fastqc_html_1": "fastqc_html_1", + "fastqc_html_2": "fastqc_html_2", + "fastqc_zip_1": "fastqc_zip_1", + "fastqc_zip_2": "fastqc_zip_2", + "qc_output1": "fastq_1", + "qc_output2": "fastq_2", + "trim_log_1": "trim_log_1", + "trim_log_2": "trim_log_2", + "trim_zip_1": "trim_zip_1", + "trim_zip_2": "trim_zip_2", + "trim_html_1": "trim_html_1", + "trim_html_2": "trim_html_2", + "sortmerna_log": "sortmerna_log", + "trim_json": "trim_json", + "trim_html": "trim_html", + "trim_merged_out": "trim_merged_out", + "salmon_quant_output": "salmon_quant_output" ) emit: diff --git a/src/workflows/prepare_genome/main.nf b/src/workflows/prepare_genome/main.nf index 92ed037..a06390a 100644 --- a/src/workflows/prepare_genome/main.nf +++ b/src/workflows/prepare_genome/main.nf @@ -1,288 +1,311 @@ workflow run_wf { - take: - input_ch + take: + input_ch - main: - output_ch = input_ch - - // Uncompress fasta - | gunzip.run ( - fromState: [ "input": "fasta" ], - toState: [ "fasta": "output" ], - key: "gunzip_fasta", - args: [ output: "reference_genome.fasta" ] - ) + main: + output_ch = input_ch - // uncompress gtf - | gunzip.run ( - runIf: {id, state -> state.gtf}, - fromState: [ "input": "gtf" ], - toState: [ "gtf": "output" ], - key: "gunzip_gtf", - args: [output: "gene_annotation.gtf"] - ) + // Uncompress fasta + | gunzip.run ( + fromState: [ "input": "fasta" ], + toState: [ "fasta": "output" ], + key: "gunzip_fasta", + args: [ output: "reference_genome.fasta" ], + directives: [ label: [ "lowmem", "midcpu" ] ] + ) - // uncompress gff - | gunzip.run ( - runIf: {id, state -> !state.gtf && state.gff}, - fromState: [ "input": "gff" ], - toState: [ "gff": "output" ], - key: "gunzip_gff", - args: [output: "gene_annotation.gff"] - ) + // uncompress gtf + | gunzip.run ( + runIf: {id, state -> state.gtf}, + fromState: [ "input": "gtf" ], + toState: [ "gtf": "output" ], + key: "gunzip_gtf", + args: [output: "gene_annotation.gtf"], + directives: [ label: [ "lowmem", "midcpu" ] ] + ) - // gff to gtf - | gffread.run ( - runIf: {id, state -> !state.gtf && state.gff}, - fromState: [ - "input": "gff", - "genome": "fasta" - ], - toState: [ "gtf": "outfile" ], - args: [ - outfile: "gene_annotation.gtf", - gtf_output: true, - keep_attrs: true, - keep_exon_attrs: true - ] - ) + // uncompress gff + | gunzip.run ( + runIf: {id, state -> !state.gtf && state.gff}, + fromState: [ "input": "gff" ], + toState: [ "gff": "output" ], + key: "gunzip_gff", + args: [output: "gene_annotation.gff"], + directives: [ label: [ "lowmem", "midcpu" ] ] + ) - | gtf_filter.run( - runIf: {id, state -> state.gtf && state.filter_gtf}, - fromState: [ - "fasta": "fasta", - "gtf": "gtf" - ], - toState: [ "gtf": "filtered_gtf" ], - args: [filtered_gtf: "gene_annotation.gtf"] - ) + // gff to gtf + | gffread.run ( + runIf: {id, state -> !state.gtf && state.gff}, + fromState: [ + "input": "gff", + "genome": "fasta" + ], + toState: [ "gtf": "outfile" ], + args: [ + outfile: "gene_annotation.gtf", + gtf_output: true, + keep_attrs: true, + keep_exon_attrs: true + ], + directives: [ label: [ "lowmem", "midcpu" ] ] + ) - // uncompress additional fasta - | gunzip.run ( - runIf: {id, state -> state.additional_fasta}, - fromState: [ "input": "additional_fasta" ], - toState: [ "additional_fasta": "output" ], - key: "gunzip_additional_fasta", - args: [output: "additional.fasta"] - ) + | gtf_filter.run( + runIf: {id, state -> state.gtf && state.filter_gtf}, + fromState: [ + "fasta": "fasta", + "gtf": "gtf" + ], + toState: [ "gtf": "filtered_gtf" ], + args: [filtered_gtf: "gene_annotation.gtf"], + directives: [ label: [ "lowmem", "midcpu" ] ] + ) - // concatenate additional fasta - | cat_additional_fasta.run ( - runIf: {id, state -> state.additional_fasta}, - fromState: [ - "fasta": "fasta", - "gtf": "gtf", - "additional_fasta": "additional_fasta", - "biotype": "biotype" - ], - toState: [ - "fasta": "fasta_output", - "gtf": "gtf_output" - ], - args: [ - fasta_output: "genome_additional.fasta", - gtf_output: "genome_additional.gtf" - ] - ) + // uncompress additional fasta + | gunzip.run ( + runIf: {id, state -> state.additional_fasta}, + fromState: [ "input": "additional_fasta" ], + toState: [ "additional_fasta": "output" ], + key: "gunzip_additional_fasta", + args: [output: "additional.fasta"], + directives: [ label: [ "lowmem", "midcpu" ] ] + ) - // uncompress bed file - | gunzip.run ( - runIf: {id, state -> state.gene_bed}, - fromState: [ "input": "gene_bed" ], - toState: [ "gene_bed": "output" ], - key: "gunzip_gene_bed", - args: [output: "genome_additional.bed"] - ) + // concatenate additional fasta + | cat_additional_fasta.run ( + runIf: {id, state -> state.additional_fasta}, + fromState: [ + "fasta": "fasta", + "gtf": "gtf", + "additional_fasta": "additional_fasta", + "biotype": "biotype" + ], + toState: [ + "fasta": "fasta_output", + "gtf": "gtf_output" + ], + args: [ + fasta_output: "genome_additional.fasta", + gtf_output: "genome_additional.gtf" + ], + directives: [ label: [ "lowmem", "midcpu" ] ] + ) - // gtf to bed - | gtf2bed.run ( - runIf: { id, state -> !state.gene_bed}, - fromState: [ "gtf": "gtf" ], - toState: [ "gene_bed": "bed_output" ], - args: [bed_output: "genome_additional.bed"] - ) + // uncompress bed file + | gunzip.run ( + runIf: {id, state -> state.gene_bed}, + fromState: [ "input": "gene_bed" ], + toState: [ "gene_bed": "output" ], + key: "gunzip_gene_bed", + args: [output: "genome_additional.bed"], + directives: [ label: [ "lowmem", "midcpu" ] ] + ) - // uncompress transcript fasta - | gunzip.run ( - runIf: {id, state -> state.transcript_fasta}, - fromState: [ "input": "transcript_fasta" ], - toState: [ "transcript_fasta": "output" ], - key: "transcript_fasta", - args: [output: "transcriptome.fasta"] - ) + // gtf to bed + | gtf2bed.run ( + runIf: { id, state -> !state.gene_bed}, + fromState: [ "gtf": "gtf" ], + toState: [ "gene_bed": "bed_output" ], + args: [bed_output: "genome_additional.bed"], + directives: [ label: [ "lowmem", "midcpu" ] ] + ) - // preprocess transcripts fasta if gtf is in gencode format - | preprocess_transcripts_fasta.run ( - runIf: {id, state -> state.transcript_fasta && state.gencode}, - fromState: [ "transcript_fasta": "transcript_fasta" ], - toState: [ "transcript_fasta": "output" ], - args: [output: "transcriptome.fasta"] - ) + // uncompress transcript fasta + | gunzip.run ( + runIf: {id, state -> state.transcript_fasta}, + fromState: [ "input": "transcript_fasta" ], + toState: [ "transcript_fasta": "output" ], + key: "transcript_fasta", + args: [output: "transcriptome.fasta"], + directives: [ label: [ "lowmem", "midcpu" ] ] + ) - // make transcript FASTA if not provided - | rsem_prepare_reference.run ( - runIf: {id, state -> !state.transcript_fasta}, - fromState: [ - "reference_fasta_files": "fasta", - "gtf": "gtf" - ], - toState: [ "make_transcript_fasta_output": "output" ], - key: "make_transcript_fasta", - args: [reference_name: "genome"] - ) - | map { id, state -> - def transcript_fasta = (!state.transcript_fasta) ? - state.make_transcript_fasta_output.listFiles().find{it.name == "genome.transcripts.fa"} : - state.transcript_fasta - [ id, state + [transcript_fasta: transcript_fasta] ] - } + // preprocess transcripts fasta if gtf is in gencode format + | preprocess_transcripts_fasta.run ( + runIf: {id, state -> state.transcript_fasta && state.gencode}, + fromState: [ "transcript_fasta": "transcript_fasta" ], + toState: [ "transcript_fasta": "output" ], + args: [output: "transcriptome.fasta"], + directives: [ label: [ "lowmem", "midcpu" ] ] + ) - // chromosome size and fai index - | getchromsizes.run ( - fromState: [ "fasta": "fasta" ], - toState: [ - "fai": "fai", - "sizes": "sizes" - ], - key: "chromsizes", - args: [ - fai: "genome_additional.fasta.fai", - sizes: "genome_additional.fasta.sizes" - ] - ) - - // untar bbsplit index, if available - | untar.run ( - runIf: {id, state -> state.bbsplit_index}, - fromState: [ "input": "bbsplit_index" ], - toState: [ "bbsplit_index": "output" ], - key: "untar_bbsplit_index", - args: [output: "BBSplit_index"] - ) + // make transcript FASTA if not provided + | rsem_prepare_reference.run ( + runIf: {id, state -> !state.transcript_fasta}, + fromState: [ + "reference_fasta_files": "fasta", + "gtf": "gtf" + ], + toState: [ "make_transcript_fasta_output": "output" ], + key: "make_transcript_fasta", + args: [reference_name: "genome"], + directives: [ label: [ "lowmem", "midcpu" ] ] + ) + | map { id, state -> + def transcript_fasta = (!state.transcript_fasta) ? + state.make_transcript_fasta_output.listFiles().find{it.name == "genome.transcripts.fa"} : + state.transcript_fasta + [ id, state + [transcript_fasta: transcript_fasta] ] + } - | map {id, state -> - def ref = [state.fasta] + state.bbsplit_fasta_list - [id, state + [bbsplit_ref: ref] ] - } + // chromosome size and fai index + | getchromsizes.run ( + fromState: [ "fasta": "fasta" ], + toState: [ + "fai": "fai", + "sizes": "sizes" + ], + key: "chromsizes", + args: [ + fai: "genome_additional.fasta.fai", + sizes: "genome_additional.fasta.sizes" + ], + directives: [ label: [ "lowmem", "midcpu" ] ] + ) - // create bbsplit index, if not already availble - | bbmap_bbsplit.run ( - runIf: {id, state -> !state.skip_bbsplit && !state.bbsplit_index}, - fromState: ["ref": "bbsplit_ref"], - toState: [ "bbsplit_index": "index" ], - args: [ - only_build_index: true, - index: "BBSplit_index" - ], - key: "generate_bbsplit_index" - ) + // untar bbsplit index, if available + | untar.run ( + runIf: {id, state -> state.bbsplit_index}, + fromState: [ "input": "bbsplit_index" ], + toState: [ "bbsplit_index": "output" ], + key: "untar_bbsplit_index", + directives: [ label: [ "lowmem", "midcpu" ] ] + ) - // Uncompress STAR index or generate from scratch if required - | untar.run ( - runIf: {id, state -> state.star_index}, - fromState: [ "input": "star_index" ], - toState: [ "star_index": "output" ], - key: "untar_star_index", - args: [output: "STAR_index"] - ) - - // TODO: Add to viah-hub or adapt star_align_reads to enable the generateGenome runMode - | star_genome_generate.run ( - runIf: {id, state -> !state.star_index && !state.skip_alignment}, - fromState: [ - "genome_fasta_files": "fasta", - "sjdb_gtf_file": "gtf", - "sjdb_gtf_feature_exon": "star_sjdb_gtf_feature_exon" - ], - toState: [ "star_index": "index" ], - key: "generate_star_index", - args: [index: "STAR_index"] - ) + | map { id, state -> + // Check if bbsplit_fasta_list is defined + def ref = (state.bbsplit_fasta_list) ? + [state.fasta] + state.bbsplit_fasta_list : + [state.fasta] + [id, state + [bbsplit_ref: ref] ] + } - // Uncompress RSEM index or generate from scratch if required - | untar.run ( - runIf: {id, state -> state.rsem_index}, - fromState: [ "input": "rsem_index" ], - toState: [ "rsem_index": "output" ], - key: "untar_rsem_index", - args: [output: "RSEM_index"] - ) + // create bbsplit index, if not already available + | bbmap_bbsplit.run ( + runIf: {id, state -> !state.skip_bbsplit && !state.bbsplit_index}, + fromState: ["ref": "bbsplit_ref"], + toState: [ "bbsplit_index": "index" ], + args: [ + only_build_index: true, + index: "BBSplit_index" + ], + key: "generate_bbsplit_index" + ) - | rsem_prepare_reference.run ( - runIf: {id, state -> !state.rsem_index && state.aligner == 'star_rsem'}, - fromState: [ - "reference_fasta_files": "fasta", - "gtf": "gtf" - ], - toState: [ "rsem_index": "output" ], - key: "generate_rsem_index", - args: [reference_name: "genome"] - ) - - // TODO: Uncompress HISAT2 index or generate from scratch if required + // Uncompress STAR index or generate from scratch if required + | untar.run ( + runIf: {id, state -> state.star_index}, + fromState: [ "input": "star_index" ], + toState: [ "star_index": "output" ], + key: "untar_star_index", + args: [output: "STAR_index"], + directives: [ label: [ "lowmem", "midcpu" ] ] + ) - // Uncompress Salmon index or generate from scratch if required - | untar.run ( - runIf: {id, state -> state.salmon_index}, - fromState: [ "input": "salmon_index" ], - toState: [ "salmon_index": "output" ], - key: "untar_salmon_index", - args: [output: "Salmon_index"] - ) + | star_genome_generate.run ( + runIf: {id, state -> !state.star_index && !state.skip_alignment}, + fromState: [ + "genome_fasta_files": "fasta", + "sjdb_gtf_file": "gtf", + "sjdb_gtf_feature_exon": "star_sjdb_gtf_feature_exon" + ], + toState: [ "star_index": "index" ], + key: "generate_star_index", + args: [index: "STAR_index"], + directives: [ label: [ "highmem", "highcpu" ] ] + ) - | salmon_index.run ( - runIf: {id, state -> (state.aligner == 'star_salmon' || state.pseudo_aligner == "salmon") && !state.salmon_index}, - fromState: [ - "genome": "fasta", - "transcripts": "transcript_fasta", - "kmer_len": "pseudo_aligner_kmer_size", - "gencode": "gencode" - ], - toState: [ "salmon_index": "index" ], - key: "generate_salmon_index", - args: [index: "Salmon_index"] - ) + // Uncompress RSEM index or generate from scratch if required + | untar.run ( + runIf: {id, state -> state.rsem_index}, + fromState: [ "input": "rsem_index" ], + toState: [ "rsem_index": "output" ], + key: "untar_rsem_index", + args: [output: "RSEM_index"], + directives: [ label: [ "lowmem", "midcpu" ] ] + ) - // Uncompress Kallisto index or generate from scratch if required - | untar.run ( - runIf: {id, state -> state.kallisto_index}, - fromState: [ "input": "kallisto_index" ], - toState: [ "kallisto_index": "output" ], - key: "untar_kallisto_index", - args: [output: "Kallisto_index"] - ) + | rsem_prepare_reference.run ( + runIf: {id, state -> !state.rsem_index && state.aligner == 'star_rsem'}, + fromState: [ + "reference_fasta_files": "fasta", + "gtf": "gtf" + ], + toState: [ "rsem_index": "output" ], + key: "generate_rsem_index", + args: [reference_name: "genome"], + directives: [ label: [ "lowmem", "midcpu" ] ] + ) + + // TODO: Uncompress HISAT2 index or generate from scratch if required - | kallisto_index.run( - runIf: {id, state -> state.pseudo_aligner == "kallisto" && !state.kallisto_index}, - fromState: [ - "input": "transcript_fasta", - "kmer_size": "pseudo_aligner_kmer_size" - ], - toState: [ "kallisto_index": "index" ], - key: "generate_kallisto_index", - args: [index: "Kallisto_index"] - ) + // Uncompress Salmon index or generate from scratch if required + | untar.run ( + runIf: {id, state -> state.salmon_index}, + fromState: [ "input": "salmon_index" ], + toState: [ "salmon_index": "output" ], + key: "untar_salmon_index", + args: [output: "Salmon_index"], + directives: [ label: [ "lowmem", "midcpu" ] ] + ) - | map { id, state -> - def mod_state = state.findAll { key, value -> value instanceof java.nio.file.Path && value.exists() } - [ id, mod_state ] - } + | salmon_index.run ( + runIf: {id, state -> (state.aligner == 'star_salmon' || state.pseudo_aligner == "salmon") && !state.salmon_index}, + fromState: [ + "genome": "fasta", + "transcripts": "transcript_fasta", + "kmer_len": "pseudo_aligner_kmer_size", + "gencode": "gencode" + ], + toState: [ "salmon_index": "index" ], + key: "generate_salmon_index", + args: [index: "Salmon_index"], + directives: [ label: [ "lowmem", "midcpu" ] ] + ) - | setState ( - "fasta_uncompressed": "fasta", - "gtf_uncompressed": "gtf", - "transcript_fasta_uncompressed": "transcript_fasta", - "gene_bed_uncompressed": "gene_bed", - "star_index_uncompressed": "star_index", - "salmon_index_uncompressed": "salmon_index", - "kallisto_index_uncompressed": "kallisto_index", - "bbsplit_index_uncompressed": "bbsplit_index", - "rsem_index_uncompressed": "rsem_index", - "chrom_sizes": "sizes", - "fai": "fai" - ) + // Uncompress Kallisto index or generate from scratch if required + | untar.run ( + runIf: {id, state -> state.kallisto_index}, + fromState: [ "input": "kallisto_index" ], + toState: [ "kallisto_index": "output" ], + key: "untar_kallisto_index", + args: [output: "Kallisto_index"], + directives: [ label: [ "lowmem", "midcpu" ] ] + ) - emit: - output_ch + | kallisto_index.run( + runIf: {id, state -> state.pseudo_aligner == "kallisto" && !state.kallisto_index}, + fromState: [ + "input": "transcript_fasta", + "kmer_size": "pseudo_aligner_kmer_size" + ], + toState: [ "kallisto_index": "index" ], + key: "generate_kallisto_index", + args: [index: "Kallisto_index"], + directives: [ label: [ "lowmem", "midcpu" ] ] + ) + + | map { id, state -> + def mod_state = state.findAll { key, value -> value instanceof java.nio.file.Path && value.exists() } + [ id, mod_state ] + } + + | setState ( + "fasta_uncompressed": "fasta", + "gtf_uncompressed": "gtf", + "transcript_fasta_uncompressed": "transcript_fasta", + "gene_bed_uncompressed": "gene_bed", + "star_index_uncompressed": "star_index", + "salmon_index_uncompressed": "salmon_index", + "kallisto_index_uncompressed": "kallisto_index", + "bbsplit_index_uncompressed": "bbsplit_index", + "rsem_index_uncompressed": "rsem_index", + "chrom_sizes": "sizes", + "fai": "fai" + ) + + emit: + output_ch } diff --git a/src/workflows/pseudo_alignment_and_quant/main.nf b/src/workflows/pseudo_alignment_and_quant/main.nf index 82f1aa9..0c57f2e 100644 --- a/src/workflows/pseudo_alignment_and_quant/main.nf +++ b/src/workflows/pseudo_alignment_and_quant/main.nf @@ -34,22 +34,23 @@ workflow run_wf { // Count reads from BAM alignments using Salmon | salmon_quant.run ( - runIf: { id, state -> state.pseudo_aligner == 'salmon' }, - fromState: { id, state -> - def unmated_reads = !state.paired ? state.fastq_1 : null - def mates1 = state.paired ? state.fastq_1 : null - def mates2 = state.paired ? state.fastq_2 : null - [ unmated_reads: unmated_reads, - mates1: mates1, - mates2: mates2, - gene_map: state.gtf, - index: state.salmon_index, - lib_type: state.lib_type ] - }, - toState: [ - "quant_out_dir": "output", - "salmon_quant_results_file": "quant_results" - ] + runIf: { id, state -> state.pseudo_aligner == 'salmon' }, + fromState: { id, state -> + def unmated_reads = !state.paired ? state.fastq_1 : null + def mates1 = state.paired ? state.fastq_1 : null + def mates2 = state.paired ? state.fastq_2 : null + [ unmated_reads: unmated_reads, + mates1: mates1, + mates2: mates2, + gene_map: state.gtf, + index: state.salmon_index, + lib_type: state.lib_type ] + }, + toState: [ + "quant_out_dir": "output", + "salmon_quant_results_file": "quant_results" + ], + directives: [ label: [ "midmem", "highcpu" ] ] ) | map { id, state -> @@ -57,7 +58,7 @@ workflow run_wf { [ id, mod_state ] } - | kallisto_quant.run ( + | kallisto_quant.run ( runIf: { id, state -> state.pseudo_aligner == 'kallisto'}, fromState: { id, state -> def fr_stranded = state.strandedness == 'forward' @@ -81,8 +82,9 @@ workflow run_wf { ] def new_state = state + newKeys return new_state - } - ) + }, + directives: [ label: [ "midmem", "highcpu" ] ] + ) | map { id, state -> def mod_state = state.findAll { key, value -> value instanceof java.nio.file.Path && value.exists() } @@ -93,7 +95,8 @@ workflow run_wf { [ "pseudo_multiqc": "quant_results", "quant_out_dir": "quant_out_dir", "salmon_quant_results_file": "salmon_quant_results_file", - "kallisto_quant_results_file": "kallisto_quant_results_file" ] + "kallisto_quant_results_file": "kallisto_quant_results_file" + ] ) emit: diff --git a/src/workflows/quality_control/config.vsh.yaml b/src/workflows/quality_control/config.vsh.yaml index 97ade9e..2c3aee2 100644 --- a/src/workflows/quality_control/config.vsh.yaml +++ b/src/workflows/quality_control/config.vsh.yaml @@ -246,8 +246,12 @@ argument_groups: # MultiQC - name: "--multiqc_custom_config" type: file + description: | + Custom multiqc configuration file - name: "--multiqc_title" type: string + description: | + Custom multiqc title - name: "--multiqc_methods_description" type: file - name: "--passed_trimmed_reads" diff --git a/src/workflows/quality_control/main.nf b/src/workflows/quality_control/main.nf index 180a690..4b2ecd2 100644 --- a/src/workflows/quality_control/main.nf +++ b/src/workflows/quality_control/main.nf @@ -1,801 +1,825 @@ workflow run_wf { - - take: - input_ch - main: + take: + input_ch - qc_ch = input_ch + main: - // temporary fix to force assignment when alignment in skipped - | map {it} + qc_ch = input_ch - // Feature biotype QC using featureCounts - | map { id, state -> - def biotype_in_gtf = biotypeInGtf(state.gtf, state.biotype) - def attribute_type = state.gencode ? "gene_type" : state.featurecounts_group_type - def strand = (state.strandedness == "forward") ? 1 : ((state.strandedness == "reverse") ? 2 : 0) - [ id, state + [biotype_in_gtf: biotype_in_gtf, attribute_type: attribute_type, strand: strand] ] + // temporary fix to force assignment when alignment is skipped + | map {it} + + // Feature biotype QC using featureCounts + | map { id, state -> + def biotype_in_gtf = biotypeInGtf(state.gtf, state.biotype) + def attribute_type = state.gencode ? "gene_type" : state.featurecounts_group_type + def strand = (state.strandedness == "forward") ? 1 : ((state.strandedness == "reverse") ? 2 : 0) + [ id, state + [biotype_in_gtf: biotype_in_gtf, attribute_type: attribute_type, strand: strand] ] + } + + | featurecounts.run ( + runIf: { id, state -> !state.skip_qc && !state.skip_biotype_qc && state.biotype && state.biotype_in_gtf && !state.skip_align }, + fromState: [ + "paired": "paired", + "strand": "strand", + "annotation": "gtf", + "input": "genome_bam", + "attribute_type": "attribute_type", + "feature_type": "featurecounts_feature_type", + "count_read_pairs": "paired" + ], + toState: [ + "featurecounts": "counts", + "featurecounts_summary": "summary" + ], + args: [ + both_aligned: true, + same_strand: true + ], + directives: [ label: [ "midmem", "midcpu" ] ] + ) + + | multiqc_custom_biotype.run ( + runIf: { id, state -> !state.skip_qc && !state.skip_biotype_qc && state.biotype && state.featurecounts && !state.skip_align }, + fromState: [ + "id": "id", + "biocounts": "featurecounts", + "biotypes_header": "biotypes_header" + ], + toState: [ + "featurecounts_multiqc": "featurecounts_multiqc", + "featurecounts_rrna_multiqc": "featurecounts_rrna_multiqc" + ], + directives: [ label: [ "midmem", "midcpu" ] ] + ) + + | preseq_lcextrap.run ( + runIf: { id, state -> !state.skip_qc && !state.skip_preseq && !state.skip_align }, + fromState: [ + "paired": "paired", + "input": "genome_bam", + "extra_preseq_args": "extra_preseq_args" + ], + toState: [ "preseq_output": "output" ], + directives: [ label: [ "midmem", "midcpu" ] ] + ) + + | rseqc_bamstat.run ( + runIf: { id, state -> !state.skip_qc && !state.skip_rseqc && "bam_stat" in state.rseqc_modules && !state.skip_align }, + fromState: [ + "input_file": "genome_bam", + "mapq": "map_qual" + ], + toState: [ "bamstat_output": "output" ], + directives: [ label: [ "midmem", "midcpu" ] ] + ) + | rseqc_inferexperiment.run( + runIf: { id, state -> !state.skip_qc && !state.skip_rseqc && "infer_experiment" in state.rseqc_modules && !state.skip_align }, + fromState: [ + "input_file": "genome_bam", + "refgene": "gene_bed", + "sample_size": "sample_size", + "mapq": "map_qual" + ], + toState: [ "strandedness_output": "output" ], + directives: [ label: [ "midmem", "midcpu" ] ] + ) + // Get predicted strandedness from the RSeQC infer_experiment.py output + | map { id, state -> + def inferred_strand = getInferexperimentStrandedness(state.strandedness_output, 30) + def passed_strand_check = (state.strandedness != inferred_strand[0]) ? false : true + [ id, state + [ inferred_strand: inferred_strand, passed_strand_check: passed_strand_check ] ] + } + | rseqc_inner_distance.run( + runIf: { id, state -> !state.skip_qc && !state.skip_rseqc && state.paired && "inner_distance" in state.rseqc_modules && !state.skip_align }, + key: "inner_distance", + args: ["output_prefix": "output"], + fromState: [ + "input_file": "genome_bam", + "refgene": "gene_bed", + "sample_size": "sample_size", + "mapq": "map_qual", + "lower_bound": "lower_bound_size", + "upper_bound": "upper_bound_size", + "step": "step_size", + ], + toState: [ + "inner_dist_output_stats": "output_stats", + "inner_dist_output_dist": "output_dist", + "inner_dist_output_freq": "output_freq", + "inner_dist_output_plot": "output_plot", + "inner_dist_output_plot_r": "output_plot_r" + ], + directives: [ label: [ "midmem", "midcpu" ] ] + ) + | rseqc_junctionannotation.run( + runIf: { id, state -> !state.skip_qc && !state.skip_rseqc && "junction_annotation" in state.rseqc_modules && !state.skip_align }, + fromState: [ + "input": "genome_bam", + "refgene": "gene_bed", + "map_qual": "map_qual", + "min_intron": "min_intron" + ], + toState: [ + "junction_annotation_output_log": "output_log", + "junction_annotation_output_plot_r": "output_plot_r", + "junction_annotation_output_junction_bed": "output_junction_bed", + "junction_annotation_output_junction_interact": "output_junction_interact", + "junction_annotation_output_junction_sheet": "output_junction_sheet", + "junction_annotation_output_splice_events_plot": "output_splice_events_plot", + "junction_annotation_output_splice_junctions_plot": "output_splice_junctions_plot" + ], + directives: [ label: [ "midmem", "midcpu" ] ] + ) + | rseqc_junctionsaturation.run( + runIf: { id, state -> !state.skip_qc && !state.skip_rseqc && "junction_saturation" in state.rseqc_modules && !state.skip_align }, + fromState: [ + "input": "genome_bam", + "refgene": "gene_bed", + "sampling_percentile_lower_bound": "sampling_percentile_lower_bound", + "sampling_percentile_upper_bound": "sampling_percentile_upper_bound", + "sampling_percentile_step": "sampling_percentile_step", + "min_intron": "min_intron", + "min_splice_read": "min_splice_read", + "map_qual": "map_qual" + ], + toState: [ + "junction_saturation_output_plot_r": "output_plot_r", + "junction_saturation_output_plot": "output_plot" + ], + directives: [ label: [ "midmem", "midcpu" ] ] + ) + | rseqc_readdistribution.run( + runIf: { id, state -> !state.skip_qc && !state.skip_rseqc && "read_distribution" in state.rseqc_modules && !state.skip_align }, + fromState: [ + "input": "genome_bam", + "refgene": "gene_bed", + ], + toState: [ "read_distribution_output": "output" ], + directives: [ label: [ "midmem", "midcpu" ] ] + ) + | rseqc_readduplication.run( + runIf: { id, state -> !state.skip_qc && !state.skip_rseqc && "read_duplication" in state.rseqc_modules && !state.skip_align }, + fromState: [ + "input": "genome_bam", + "read_count_upper_limit": "read_count_upper_limit", + "map_qual": "map_qual" + ], + toState: [ + "read_duplication_output_duplication_rate_plot_r": "output_duplication_rate_plot_r", + "read_duplication_output_duplication_rate_plot": "output_duplication_rate_plot", + "read_duplication_output_duplication_rate_mapping": "output_duplication_rate_mapping", + "read_duplication_output_duplication_rate_sequence": "output_duplication_rate_sequence" + ], + directives: [ label: [ "midmem", "midcpu" ] ] + ) + | rseqc_tin.run( + runIf: { id, state -> !state.skip_qc && !state.skip_rseqc && "tin" in state.rseqc_modules && !state.skip_align }, + fromState: [ + "bam_input": "genome_bam", + "bai_input": "genome_bam_index", + "refgene": "gene_bed", + "minimum_coverage": "minimum_coverage", + "sample_size": "tin_sample_size", + "subtract_background": "subtract_background" + ], + toState: [ + "tin_output_summary": "output_tin_summary", + "tin_output_metrics": "output_tin" + ], + directives: [ label: [ "midmem", "midcpu" ] ] + ) + + | dupradar.run( + runIf: { id, state -> !state.skip_qc && !state.skip_dupradar && !state.skip_align }, + fromState: [ + "id": "id", + "input": "genome_bam", + "gtf_annotation": "gtf", + "paired": "paired", + "strandedness": "strandedness" + ], + toState: [ + "dupradar_output_dupmatrix": "output_dupmatrix", + "dupradar_output_dup_intercept_mqc": "output_dup_intercept_mqc", + "dupradar_output_duprate_exp_boxplot": "output_duprate_exp_boxplot", + "dupradar_output_duprate_exp_densplot": "output_duprate_exp_densplot", + "dupradar_output_duprate_exp_denscurve_mqc": "output_duprate_exp_denscurve_mqc", + "dupradar_output_expression_histogram": "output_expression_histogram", + "dupradar_output_intercept_slope": "output_intercept_slope" + ], + directives: [ label: [ "midmem", "midcpu" ] ] + ) + + // TODO: Add outdir as an output argument to the qualimap module on biobox. + // Qualimap ouputs a few more raw data files to outdir but since the module is using a temporary directory as output dir these files are lost. + | qualimap_rnaseq.run( + runIf: { id, state -> !state.skip_qc && !state.skip_qualimap && !state.skip_align }, + fromState: [ + "bam": "genome_bam", + "gtf": "gtf", + "num_pr_bases": "pr_bases", + "num_tr_bias": "tr_bias", + "algorithm": "algorithm", + "sequencing_protocol": "sequencing_protocol", + "sorted": "sorted", + "java_memory_size": "java_memory_size", + ], + toState: [ + "qualimap_report": "report", + "qualimap_qc_report": "qc_report", + "qualimap_counts": "counts" + ], + directives: [ label: [ "midmem", "midcpu" ] ] + ) + + merged_ch = qc_ch + | toSortedList + | map { list -> + def ids = list.collect { id, state -> id } + def strandedness = list.collect { id, state -> state.strandedness } + def num_trimmed_reads = list.collect { id, state -> state.num_trimmed_reads } + def passed_trimmed_reads = list.collect { id, state -> state.passed_trimmed_reads } + def passed_mapping = list.collect { id, state -> state.passed_mapping } + def percent_mapped = list.collect { id, state -> state.percent_mapped } + def inferred_strand = list.collect { id, state -> state.inferred_strand } + def passed_strand_check = list.collect { id, state -> state.passed_strand_check } + def gtf = list.collect { id, state -> state.gtf }.unique()[0] + def gtf_extra_attributes = list.collect { id, state -> state.gtf_extra_attributes }.unique()[0] + def gtf_group_features = list.collect { id, state -> state.gtf_group_features }.unique()[0] + def pca_header_multiqc = list.collect { id, state -> state.pca_header_multiqc }.unique()[0] + def clustering_header_multiqc = list.collect { id, state -> state.clustering_header_multiqc }.unique()[0] + def aligner = list.collect { id, state -> state.aligner }.unique()[0] + def pseudo_aligner = list.collect { id, state -> state.pseudo_aligner }.unique()[0] + def deseq2_vst = list.collect { id, state -> state.deseq2_vst }.unique()[0] + def extra_deseq2_args = list.collect { id, state -> state.extra_deseq2_args }.unique()[0] + def extra_deseq2_args2 = list.collect { id, state -> state.extra_deseq2_args2 }.unique()[0] + def skip_deseq2_qc = list.collect { id, state -> state.skip_deseq2_qc }.unique()[0] + def skip_qc = list.collect { id, state -> state.skip_qc }.unique()[0] + def skip_align = list.collect { id, state -> state.skip_align }.unique()[0] + def skip_pseudo_align = list.collect { id, state -> state.skip_pseudo_align }.unique()[0] + def quant_results = list.collect { id, state -> + (state.quant_results_file instanceof java.nio.file.Path && state.quant_results_file.exists()) ? + state.quant_results_file : + null } + def rsem_counts_gene = list.collect { id, state -> + (state.rsem_counts_gene instanceof java.nio.file.Path && state.rsem_counts_gene.exists()) ? + state.rsem_counts_gene : + null } + def rsem_counts_transcripts = list.collect { id, state -> + (state.rsem_counts_transcripts instanceof java.nio.file.Path && state.rsem_counts_transcripts.exists()) ? + state.rsem_counts_transcripts : + null } + def pseudo_quant_out_dir = list.collect { id, state -> + (state.pseudo_quant_out_dir instanceof java.nio.file.Path && state.pseudo_quant_out_dir.exists()) ? + state.pseudo_quant_out_dir : + null } + def pseudo_salmon_quant_results = list.collect { id, state -> + (state.pseudo_salmon_quant_results_file instanceof java.nio.file.Path && state.pseudo_salmon_quant_results_file.exists()) ? + state.pseudo_salmon_quant_results_file : + null } + def pseudo_kallisto_quant_results = list.collect { id, state -> + (state.pseudo_kallisto_quant_results_file instanceof java.nio.file.Path && state.pseudo_kallisto_quant_results_file.exists()) ? + state.pseudo_kallisto_quant_results_file : + null } + def fastqc_zip_1 = list.collect { id, state -> + (state.fastqc_zip_1 instanceof java.nio.file.Path && state.fastqc_zip_1.exists()) ? + state.fastqc_zip_1 : + null } + def fastqc_zip_2 = list.collect { id, state -> + (state.fastqc_zip_2 instanceof java.nio.file.Path && state.fastqc_zip_2.exists()) ? + state.fastqc_zip_2 : + null } + def trim_zip_1 = list.collect { id, state -> + (state.trim_zip_1 instanceof java.nio.file.Path && state.trim_zip_1.exists()) ? + state.trim_zip_1 : + null } + def trim_zip_2 = list.collect { id, state -> + (state.trim_zip_2 instanceof java.nio.file.Path && state.trim_zip_2.exists()) ? + state.trim_zip_2 : + null } + def trim_log_1 = list.collect { id, state -> + (state.trim_log_1 instanceof java.nio.file.Path && state.trim_log_1.exists()) ? + state.trim_log_1 : + null } + def trim_log_2 = list.collect { id, state -> + (state.trim_log_2 instanceof java.nio.file.Path && state.trim_log_2.exists()) ? + state.trim_log_2 : + null } + def sortmerna_multiqc = list.collect { id, state -> + (state.sortmerna_multiqc instanceof java.nio.file.Path && state.sortmerna_multiqc.exists()) ? + state.sortmerna_multiqc : + null } + def star_multiqc = list.collect { id, state -> + (state.star_multiqc instanceof java.nio.file.Path && state.star_multiqc.exists()) ? + state.star_multiqc : + null } + def genome_bam_stats = list.collect { id, state -> + (state.genome_bam_stats instanceof java.nio.file.Path && state.genome_bam_stats.exists()) ? + state.genome_bam_stats : + null } + def genome_bam_flagstat = list.collect { id, state -> + (state.genome_bam_flagstat instanceof java.nio.file.Path && state.genome_bam_flagstat.exists()) ? + state.genome_bam_flagstat : + null } + def genome_bam_idxstats = list.collect { id, state -> + (state.genome_bam_idxstats instanceof java.nio.file.Path && state.genome_bam_idxstats.exists()) ? + state.genome_bam_idxstats : + null } + def markduplicates_multiqc = list.collect { id, state -> + (state.markduplicates_multiqc instanceof java.nio.file.Path && state.markduplicates_multiqc.exists()) ? + state.markduplicates_multiqc : + null } + def salmon_multiqc = list.collect { id, state -> + (state.salmon_multiqc instanceof java.nio.file.Path && state.salmon_multiqc.exists()) ? + state.salmon_multiqc : + null } + def rsem_multiqc = list.collect { id, state -> + (state.rsem_multiqc instanceof java.nio.file.Path && state.rsem_multiqc.exists()) ? + state.rsem_multiqc : + null } + def pseudo_multiqc = list.collect { id, state -> + (state.pseudo_multiqc instanceof java.nio.file.Path && state.pseudo_multiqc.exists()) ? + state.pseudo_multiqc : + null } + def featurecounts_multiqc = list.collect { id, state -> + (state.featurecounts_multiqc instanceof java.nio.file.Path && state.featurecounts_multiqc.exists()) ? + state.featurecounts_multiqc : + null } + def featurecounts_rrna_multiqc = list.collect { id, state -> + (state.featurecounts_rrna_multiqc instanceof java.nio.file.Path && state.featurecounts_rrna_multiqc.exists()) ? + state.featurecounts_rrna_multiqc : + null } + def preseq_output = list.collect { id, state -> + (state.preseq_output instanceof java.nio.file.Path && state.preseq_output.exists()) ? + state.preseq_output : + null } + // def qualimap_output_dir = list.collect { id, state -> + // (state.qualimap_output_dir instanceof java.nio.file.Path && state.qualimap_output_dir.exists()) ? + // state.qualimap_output_dir : + // null } + def dupradar_output_dup_intercept_mqc = list.collect { id, state -> + (state.dupradar_output_dup_intercept_mqc instanceof java.nio.file.Path && state.dupradar_output_dup_intercept_mqc.exists()) ? + state.dupradar_output_dup_intercept_mqc : + null } + def dupradar_output_duprate_exp_denscurve_mqc = list.collect { id, state -> + (state.dupradar_output_duprate_exp_denscurve_mqc instanceof java.nio.file.Path && state.dupradar_output_duprate_exp_denscurve_mqc.exists()) ? + state.dupradar_output_duprate_exp_denscurve_mqc : + null } + def bamstat_output = list.collect { id, state -> + (state.bamstat_output instanceof java.nio.file.Path && state.bamstat_output.exists()) ? + state.bamstat_output : + null } + def inferexperiment_multiqc = list.collect { id, state -> + (state.strandedness_output instanceof java.nio.file.Path && state.strandedness_output.exists()) ? + state.strandedness_output : + null } + def inner_dist_output_freq = list.collect { id, state -> + (state.inner_dist_output_freq instanceof java.nio.file.Path && state.inner_dist_output_freq.exists()) ? + state.inner_dist_output_freq : + null } + def junction_annotation_output_log = list.collect { id, state -> + (state.junction_annotation_output_log instanceof java.nio.file.Path && state.junction_annotation_output_log.exists()) ? + state.junction_annotation_output_log : + null } + def junction_saturation_output_plot_r = list.collect { id, state -> + (state.junction_saturation_output_plot_r instanceof java.nio.file.Path && state.junction_saturation_output_plot_r.exists()) ? + state.junction_saturation_output_plot_r : + null } + def read_distribution_output = list.collect { id, state -> + (state.read_distribution_output instanceof java.nio.file.Path && state.read_distribution_output.exists()) ? + state.read_distribution_output : + null } + def read_duplication_output_duplication_rate_mapping = list.collect { id, state -> + (state.read_duplication_output_duplication_rate_mapping instanceof java.nio.file.Path && state.read_duplication_output_duplication_rate_mapping.exists()) ? + state.read_duplication_output_duplication_rate_mapping : + null } + def tin_output_summary = list.collect { id, state -> + (state.tin_output_summary instanceof java.nio.file.Path && state.tin_output_summary.exists()) ? + state.tin_output_summary : + null } + def multiqc_custom_config = list.collect { id, state -> state.multiqc_custom_config }.unique()[0] + + ["merged", + [ + ids: ids, + strandedness: strandedness, + num_trimmed_reads: num_trimmed_reads, + passed_trimmed_reads: passed_trimmed_reads, + passed_mapping: passed_mapping, + percent_mapped: percent_mapped, + inferred_strand: inferred_strand, + passed_strand_check: passed_strand_check, + skip_align: skip_align, + skip_pseudo_align: skip_pseudo_align, + quant_results: quant_results.findAll { it != null }, + rsem_counts_gene: rsem_counts_gene.findAll { it != null }, + rsem_counts_transcripts: rsem_counts_transcripts.findAll { it != null }, + pseudo_quant_out_dir: pseudo_quant_out_dir.findAll { it != null }, + pseudo_salmon_quant_results: pseudo_salmon_quant_results.findAll { it != null }, + pseudo_kallisto_quant_results: pseudo_kallisto_quant_results.findAll { it != null }, + gtf: gtf, + gtf_extra_attributes: gtf_extra_attributes, + gtf_group_features: gtf_group_features, + pca_header_multiqc: pca_header_multiqc, + clustering_header_multiqc: clustering_header_multiqc, + aligner: aligner, + pseudo_aligner: pseudo_aligner, + deseq2_vst: deseq2_vst, + extra_deseq2_args: extra_deseq2_args, + extra_deseq2_args2: extra_deseq2_args2, + skip_deseq2_qc: skip_deseq2_qc, + fastqc_zip: fastqc_zip_1 + fastqc_zip_2, + trim_zip: trim_zip_1 + trim_zip_2, + trim_log: trim_log_1 + trim_log_2, + sortmerna_multiqc: sortmerna_multiqc, + star_multiqc: star_multiqc, + genome_bam_stats: genome_bam_stats, + genome_bam_flagstat: genome_bam_flagstat, + genome_bam_idxstats: genome_bam_idxstats, + markduplicates_multiqc: markduplicates_multiqc, + salmon_multiqc: salmon_multiqc, + rsem_multiqc: rsem_multiqc, + pseudo_multiqc: pseudo_multiqc, + featurecounts_multiqc: featurecounts_multiqc, + featurecounts_rrna_multiqc: featurecounts_rrna_multiqc, + preseq_output: preseq_output, + // qualimap_output_dir: qualimap_output_dir, + dupradar_output_dup_intercept_mqc: dupradar_output_dup_intercept_mqc, + dupradar_output_duprate_exp_denscurve_mqc: dupradar_output_duprate_exp_denscurve_mqc, + bamstat_output: bamstat_output, + inner_dist_output_freq: inner_dist_output_freq, + inferexperiment_multiqc: inferexperiment_multiqc, + junction_annotation_output_log: junction_annotation_output_log, + junction_saturation_output_plot_r: junction_saturation_output_plot_r, + read_distribution_output: read_distribution_output, + read_duplication_output_duplication_rate_mapping: read_duplication_output_duplication_rate_mapping, + tin_output_summary: tin_output_summary, + multiqc_custom_config: multiqc_custom_config + ] + ] + } + + // Merge quantification results of alignment + | merge_quant_results.run ( + runIf: { id, state -> !state.skip_align && state.aligner == 'star_salmon' }, + fromState: [ + "salmon_quant_results": "quant_results", + "gtf": "gtf", + "gtf_extra_attributes": "gtf_extra_attributes", + "gtf_group_features": "gtf_group_features" + ], + args: [ quant_type: "salmon"], + toState: [ + "tpm_gene": "tpm_gene", + "counts_gene": "counts_gene", + "counts_gene_length_scaled": "counts_gene_length_scaled", + "counts_gene_scaled": "counts_gene_scaled", + "tpm_transcript": "tpm_transcript", + "counts_transcript": "counts_transcript", + "lengths_gene": "lengths_gene", + "lengths_transcript": "lengths_transcript", + "quant_merged_summarizedexperiment": "quant_merged_summarizedexperiment" + ], + key: "merge_quant_results", + directives: [ label: [ "midmem", "midcpu" ] ] + ) + + | rsem_merge_counts.run ( + runIf: { id, state -> state.aligner == 'star_rsem' }, + fromState: [ + "counts_gene": "rsem_counts_gene", + "counts_transcripts": "rsem_counts_transcripts" + ], + toState: [ + "tpm_gene": "merged_gene_tpm", + "counts_gene": "merged_gene_counts", + "tpm_transcript": "merged_transcript_tpm", + "counts_transcript": "merged_transcript_counts" + ], + directives: [ label: [ "midmem", "midcpu" ] ] + ) + + | deseq2_qc.run ( + runIf: { id, state -> !state.skip_qc && !state.skip_deseq2_qc && !state.skip_align }, + fromState: { id, state -> + def counts = (state.aligner == "star_rsem") ? state.counts_gene : state.counts_gene_length_scaled + [ + counts: counts, + vst: state.deseq2_vst, + label: state.aligner + ] + }, + args: [count_col: 3, id_col: 1, outprefix: "deseq2"], + toState: [ + "deseq2_output": "outdir", + "deseq2_pca_multiqc": "pca_multiqc", + "deseq2_dists_multiqc": "dists_multiqc" + ], + key: "deseq2_qc_align_quant", + directives: [ label: [ "midmem", "midcpu" ] ] + ) + + // Merge quantification results of pseudo alignment + | merge_quant_results.run ( + runIf: { id, state -> !state.skip_pseudo_align }, + fromState: [ + "salmon_quant_results": "pseudo_salmon_quant_results", + "kallisto_quant_results": "pseudo_kallisto_quant_results", + "gtf": "gtf", + "gtf_extra_attributes": "gtf_extra_attributes", + "gtf_group_features": "gtf_group_features", + "quant_type": "pseudo_aligner" + ], + toState: [ + "pseudo_tpm_gene": "tpm_gene", + "pseudo_counts_gene": "counts_gene", + "pseudo_counts_gene_length_scaled": "counts_gene_length_scaled", + "pseudo_counts_gene_scaled": "counts_gene_scaled", + "pseudo_tpm_transcript": "tpm_transcript", + "pseudo_counts_transcript": "counts_transcript", + "pseudo_lengths_gene": "lengths_gene", + "pseudo_lengths_transcript": "lengths_transcript", + "pseudo_quant_merged_summarizedexperiment": "quant_merged_summarizedexperiment" + ], + key: "merge_pseudo_quant_results", + directives: [ label: [ "midmem", "midcpu" ] ] + ) + + | deseq2_qc.run ( + runIf: { id, state -> !state.skip_qc && !state.skip_deseq2_qc && !state.skip_pseudo_align }, + fromState: [ + "counts": "pseudo_counts_gene_length_scaled", + "vst": "deseq2_vst", + "label": "pseudo_aligner" + ], + args: [count_col: 3, id_col: 1, outprefix: "deseq2"], + toState: [ + "deseq2_output_pseudo": "outdir", + "deseq2_pca_multiqc_pseudo": "pca_multiqc", + "deseq2_dists_multiqc_pseudo": "dists_multiqc" + ], + key: "deseq2_qc_pseuso_align_quant", + directives: [ label: [ "midmem", "midcpu" ] ] + ) + + // Get list of samples that failed trimming, mapping, and strand check for MultiQC report + | map { id, state -> + def fail_trimming_header = ["Sample", "Reads after trimming"] + def fail_trimming_multiqc = "" + def star_mapping_header = ["Sample", "STAR uniquely mapped reads (%)"] + def fail_mapping_multiqc = "" + def strand_check_header = ["Sample", "Provided strandedness", "Inferred strandedness", "Sense (%)", "Antisense (%)", "Undetermined (%)"] + def fail_strand_multiqc = "" + if (state.ids.size() > 0) { + fail_trimming_multiqc += "${fail_trimming_header.join('\t')}\n" + fail_mapping_multiqc += "${star_mapping_header.join('\t')}\n" + fail_strand_multiqc += "${strand_check_header.join('\t')}\n" + for (i=0; i !state.skip_qc && !state.skip_biotype_qc && state.biotype && state.biotype_in_gtf && !state.skip_align }, - fromState: [ - "paired": "paired", - "strand": "strand", - "annotation": "gtf", - "input": "genome_bam", - "attribute_type": "attribute_type", - "feature_type": "featurecounts_feature_type", - "count_read_pairs": "paired" - ], - toState: [ - "featurecounts": "counts", - "featurecounts_summary": "summary" - ], - args: [ - both_aligned: true, - same_strand: true - ] - ) - - | multiqc_custom_biotype.run ( - runIf: { id, state -> !state.skip_qc && !state.skip_biotype_qc && state.biotype && state.featurecounts && !state.skip_align }, - fromState: [ - "id": "id", - "biocounts": "featurecounts", - "biotypes_header": "biotypes_header" - ], - toState: [ - "featurecounts_multiqc": "featurecounts_multiqc", - "featurecounts_rrna_multiqc": "featurecounts_rrna_multiqc" - ] - ) - - | preseq_lcextrap.run ( - runIf: { id, state -> !state.skip_qc && !state.skip_preseq && !state.skip_align }, - fromState: [ - "paired": "paired", - "input": "genome_bam", - "extra_preseq_args": "extra_preseq_args" - ], - toState: [ "preseq_output": "output" ] - ) - - | rseqc_bamstat.run ( - runIf: { id, state -> !state.skip_qc && !state.skip_rseqc && "bam_stat" in state.rseqc_modules && !state.skip_align }, - fromState: [ - "input_file": "genome_bam", - "mapq": "map_qual" - ], - toState: [ "bamstat_output": "output" ] - ) - | rseqc_inferexperiment.run( - runIf: { id, state -> !state.skip_qc && !state.skip_rseqc && "infer_experiment" in state.rseqc_modules && !state.skip_align }, - fromState: [ - "input_file": "genome_bam", - "refgene": "gene_bed", - "sample_size": "sample_size", - "mapq": "map_qual" - ], - toState: [ "strandedness_output": "output" ] - ) - // Get predicted strandedness from the RSeQC infer_experiment.py output - | map { id, state -> - def inferred_strand = getInferexperimentStrandedness(state.strandedness_output, 30) - def passed_strand_check = (state.strandedness != inferred_strand[0]) ? false : true - [ id, state + [ inferred_strand: inferred_strand, passed_strand_check: passed_strand_check ] ] + if (!state.passed_mapping[i]) { + tsv_data = [state.ids[i], state.percent_mapped[i]].join('\t') + fail_mapping_multiqc += tsv_data.join('\n') + } + if (!state.passed_strand_check[i]) { + tsv_data = ([state.ids[i], state.strandedness[i]] + state.inferred_strand[i]).join('\t') + fail_strand_multiqc += tsv_data.join('\n') + } + } } - | rseqc_inner_distance.run( - runIf: { id, state -> !state.skip_qc && !state.skip_rseqc && state.paired && "inner_distance" in state.rseqc_modules && !state.skip_align }, - key: "inner_distance", - fromState: [ - "input_file": "genome_bam", - "refgene": "gene_bed", - "sample_size": "sample_size", - "mapq": "map_qual", - "lower_bound": "lower_bound_size", - "upper_bound": "upper_bound_size", - "step": "step_size" - ], - toState: [ - "inner_dist_output_stats": "output_stats", - "inner_dist_output_dist": "output_dist", - "inner_dist_output_freq": "output_freq", - "inner_dist_output_plot": "output_plot", - "inner_dist_output_plot_r": "output_plot_r" - ] - ) - | rseqc_junctionannotation.run( - runIf: { id, state -> !state.skip_qc && !state.skip_rseqc && "junction_annotation" in state.rseqc_modules && !state.skip_align }, - fromState: [ - "input": "genome_bam", - "refgene": "gene_bed", - "map_qual": "map_qual", - "min_intron": "min_intron" - ], - toState: [ - "junction_annotation_output_log": "output_log", - "junction_annotation_output_plot_r": "output_plot_r", - "junction_annotation_output_junction_bed": "output_junction_bed", - "junction_annotation_output_junction_interact": "output_junction_interact", - "junction_annotation_output_junction_sheet": "output_junction_sheet", - "junction_annotation_output_splice_events_plot": "output_splice_events_plot", - "junction_annotation_output_splice_junctions_plot": "output_splice_junctions_plot" - ] - ) - | rseqc_junctionsaturation.run( - runIf: { id, state -> !state.skip_qc && !state.skip_rseqc && "junction_saturation" in state.rseqc_modules && !state.skip_align }, - fromState: [ - "input": "genome_bam", - "refgene": "gene_bed", - "sampling_percentile_lower_bound": "sampling_percentile_lower_bound", - "sampling_percentile_upper_bound": "sampling_percentile_upper_bound", - "sampling_percentile_step": "sampling_percentile_step", - "min_intron": "min_intron", - "min_splice_read": "min_splice_read", - "map_qual": "map_qual" - ], - toState: [ - "junction_saturation_output_plot_r": "output_plot_r", - "junction_saturation_output_plot": "output_plot" - ] - ) - | rseqc_readdistribution.run( - runIf: { id, state -> !state.skip_qc && !state.skip_rseqc && "read_distribution" in state.rseqc_modules && !state.skip_align }, - fromState: [ - "input": "genome_bam", - "refgene": "gene_bed", - ], - toState: [ "read_distribution_output": "output" ] - ) - | rseqc_readduplication.run( - runIf: { id, state -> !state.skip_qc && !state.skip_rseqc && "read_duplication" in state.rseqc_modules && !state.skip_align }, - fromState: [ - "input": "genome_bam", - "read_count_upper_limit": "read_count_upper_limit", - "map_qual": "map_qual" - ], - toState: [ - "read_duplication_output_duplication_rate_plot_r": "output_duplication_rate_plot_r", - "read_duplication_output_duplication_rate_plot": "output_duplication_rate_plot", - "read_duplication_output_duplication_rate_mapping": "output_duplication_rate_mapping", - "read_duplication_output_duplication_rate_sequence": "output_duplication_rate_sequence" - ] - ) - | rseqc_tin.run( - runIf: { id, state -> !state.skip_qc && !state.skip_rseqc && "tin" in state.rseqc_modules && !state.skip_align }, - fromState: [ - "bam_input": "genome_bam", - "bai_input": "genome_bam_index", - "refgene": "gene_bed", - "minimum_coverage": "minimum_coverage", - "sample_size": "tin_sample_size", - "subtract_background": "subtract_background" - ], - toState: [ - "tin_output_summary": "output_tin_summary", - "tin_output_metrics": "output_tin" - ] - ) - | dupradar.run( - runIf: { id, state -> !state.skip_qc && !state.skip_dupradar && !state.skip_align }, - fromState: [ - "id": "id", - "input": "genome_bam", - "gtf_annotation": "gtf", - "paired": "paired", - "strandedness": "strandedness" - ], - toState: [ - "dupradar_output_dupmatrix": "output_dupmatrix", - "dupradar_output_dup_intercept_mqc": "output_dup_intercept_mqc", - "dupradar_output_duprate_exp_boxplot": "output_duprate_exp_boxplot", - "dupradar_output_duprate_exp_densplot": "output_duprate_exp_densplot", - "dupradar_output_duprate_exp_denscurve_mqc": "output_duprate_exp_denscurve_mqc", - "dupradar_output_expression_histogram": "output_expression_histogram", - "dupradar_output_intercept_slope": "output_intercept_slope" - ] - ) + [ id, state + [fail_trimming_multiqc: fail_trimming_multiqc, fail_mapping_multiqc: fail_mapping_multiqc, fail_strand_multiqc: fail_strand_multiqc] ] + } - // TODO: Add outdir as an output argument to the qualimap module on biobox. - // Qualimap ouputs a few more raw data files to outdir but since the module is using a temporary directory as output dir these files are lost. - | qualimap_rnaseq.run( - runIf: { id, state -> !state.skip_qc && !state.skip_qualimap && !state.skip_align }, - fromState: [ - "bam": "genome_bam", - "gtf": "gtf", - "num_pr_bases": "pr_bases", - "num_tr_bias": "tr_bias", - "algorithm": "algorithm", - "sequencing_protocol": "sequencing_protocol", - "sorted": "sorted", - "java_memory_size": "java_memory_size", - ], - toState: [ - "qualimap_report": "report", - "qualimap_qc_report": "qc_report", - "qualimap_counts": "counts" - ] - ) + | map { id, state -> + state.each { key, value -> + if (value instanceof ArrayList) { + value.removeAll { it == null } + } + } + mod_state = state.findAll { key, value -> value != null } + [ id, mod_state ] + } - merged_ch = qc_ch - | toSortedList - | map { list -> - def ids = list.collect { id, state -> id } - def strandedness = list.collect { id, state -> state.strandedness } - def num_trimmed_reads = list.collect { id, state -> state.num_trimmed_reads } - def passed_trimmed_reads = list.collect { id, state -> state.passed_trimmed_reads } - def passed_mapping = list.collect { id, state -> state.passed_mapping } - def percent_mapped = list.collect { id, state -> state.percent_mapped } - def inferred_strand = list.collect { id, state -> state.inferred_strand } - def passed_strand_check = list.collect { id, state -> state.passed_strand_check } - def gtf = list.collect { id, state -> state.gtf }.unique()[0] - def gtf_extra_attributes = list.collect { id, state -> state.gtf_extra_attributes }.unique()[0] - def gtf_group_features = list.collect { id, state -> state.gtf_group_features }.unique()[0] - def pca_header_multiqc = list.collect { id, state -> state.pca_header_multiqc }.unique()[0] - def clustering_header_multiqc = list.collect { id, state -> state.clustering_header_multiqc }.unique()[0] - def aligner = list.collect { id, state -> state.aligner }.unique()[0] - def pseudo_aligner = list.collect { id, state -> state.pseudo_aligner }.unique()[0] - def deseq2_vst = list.collect { id, state -> state.deseq2_vst }.unique()[0] - def extra_deseq2_args = list.collect { id, state -> state.extra_deseq2_args }.unique()[0] - def extra_deseq2_args2 = list.collect { id, state -> state.extra_deseq2_args2 }.unique()[0] - def skip_deseq2_qc = list.collect { id, state -> state.skip_deseq2_qc }.unique()[0] - def skip_qc = list.collect { id, state -> state.skip_qc }.unique()[0] - def skip_align = list.collect { id, state -> state.skip_align }.unique()[0] - def skip_pseudo_align = list.collect { id, state -> state.skip_pseudo_align }.unique()[0] - def quant_results = list.collect { id, state -> - (state.quant_results_file instanceof java.nio.file.Path && state.quant_results_file.exists()) ? - state.quant_results_file : - null } - def rsem_counts_gene = list.collect { id, state -> - (state.rsem_counts_gene instanceof java.nio.file.Path && state.rsem_counts_gene.exists()) ? - state.rsem_counts_gene : - null } - def rsem_counts_transcripts = list.collect { id, state -> - (state.rsem_counts_transcripts instanceof java.nio.file.Path && state.rsem_counts_transcripts.exists()) ? - state.rsem_counts_transcripts : - null } - def pseudo_quant_out_dir = list.collect { id, state -> - (state.pseudo_quant_out_dir instanceof java.nio.file.Path && state.pseudo_quant_out_dir.exists()) ? - state.pseudo_quant_out_dir : - null } - def pseudo_salmon_quant_results = list.collect { id, state -> - (state.pseudo_salmon_quant_results_file instanceof java.nio.file.Path && state.pseudo_salmon_quant_results_file.exists()) ? - state.pseudo_salmon_quant_results_file : - null } - def pseudo_kallisto_quant_results = list.collect { id, state -> - (state.pseudo_kallisto_quant_results_file instanceof java.nio.file.Path && state.pseudo_kallisto_quant_results_file.exists()) ? - state.pseudo_kallisto_quant_results_file : - null } - def fastqc_zip_1 = list.collect { id, state -> - (state.fastqc_zip_1 instanceof java.nio.file.Path && state.fastqc_zip_1.exists()) ? - state.fastqc_zip_1 : - null } - def fastqc_zip_2 = list.collect { id, state -> - (state.fastqc_zip_2 instanceof java.nio.file.Path && state.fastqc_zip_2.exists()) ? - state.fastqc_zip_2 : - null } - def trim_zip_1 = list.collect { id, state -> - (state.trim_zip_1 instanceof java.nio.file.Path && state.trim_zip_1.exists()) ? - state.trim_zip_1 : - null } - def trim_zip_2 = list.collect { id, state -> - (state.trim_zip_2 instanceof java.nio.file.Path && state.trim_zip_2.exists()) ? - state.trim_zip_2 : - null } - def trim_log_1 = list.collect { id, state -> - (state.trim_log_1 instanceof java.nio.file.Path && state.trim_log_1.exists()) ? - state.trim_log_1 : - null } - def trim_log_2 = list.collect { id, state -> - (state.trim_log_2 instanceof java.nio.file.Path && state.trim_log_2.exists()) ? - state.trim_log_2 : - null } - def sortmerna_multiqc = list.collect { id, state -> - (state.sortmerna_multiqc instanceof java.nio.file.Path && state.sortmerna_multiqc.exists()) ? - state.sortmerna_multiqc : - null } - def star_multiqc = list.collect { id, state -> - (state.star_multiqc instanceof java.nio.file.Path && state.star_multiqc.exists()) ? - state.star_multiqc : - null } - def genome_bam_stats = list.collect { id, state -> - (state.genome_bam_stats instanceof java.nio.file.Path && state.genome_bam_stats.exists()) ? - state.genome_bam_stats : - null } - def genome_bam_flagstat = list.collect { id, state -> - (state.genome_bam_flagstat instanceof java.nio.file.Path && state.genome_bam_flagstat.exists()) ? - state.genome_bam_flagstat : - null } - def genome_bam_idxstats = list.collect { id, state -> - (state.genome_bam_idxstats instanceof java.nio.file.Path && state.genome_bam_idxstats.exists()) ? - state.genome_bam_idxstats : - null } - def markduplicates_multiqc = list.collect { id, state -> - (state.markduplicates_multiqc instanceof java.nio.file.Path && state.markduplicates_multiqc.exists()) ? - state.markduplicates_multiqc : - null } - def salmon_multiqc = list.collect { id, state -> - (state.salmon_multiqc instanceof java.nio.file.Path && state.salmon_multiqc.exists()) ? - state.salmon_multiqc : - null } - def rsem_multiqc = list.collect { id, state -> - (state.rsem_multiqc instanceof java.nio.file.Path && state.rsem_multiqc.exists()) ? - state.rsem_multiqc : - null } - def pseudo_multiqc = list.collect { id, state -> - (state.pseudo_multiqc instanceof java.nio.file.Path && state.pseudo_multiqc.exists()) ? - state.pseudo_multiqc : - null } - def featurecounts_multiqc = list.collect { id, state -> - (state.featurecounts_multiqc instanceof java.nio.file.Path && state.featurecounts_multiqc.exists()) ? - state.featurecounts_multiqc : - null } - def featurecounts_rrna_multiqc = list.collect { id, state -> - (state.featurecounts_rrna_multiqc instanceof java.nio.file.Path && state.featurecounts_rrna_multiqc.exists()) ? - state.featurecounts_rrna_multiqc : - null } - def preseq_output = list.collect { id, state -> - (state.preseq_output instanceof java.nio.file.Path && state.preseq_output.exists()) ? - state.preseq_output : - null } - // def qualimap_output_dir = list.collect { id, state -> - // (state.qualimap_output_dir instanceof java.nio.file.Path && state.qualimap_output_dir.exists()) ? - // state.qualimap_output_dir : - // null } - def dupradar_output_dup_intercept_mqc = list.collect { id, state -> - (state.dupradar_output_dup_intercept_mqc instanceof java.nio.file.Path && state.dupradar_output_dup_intercept_mqc.exists()) ? - state.dupradar_output_dup_intercept_mqc : - null } - def dupradar_output_duprate_exp_denscurve_mqc = list.collect { id, state -> - (state.dupradar_output_duprate_exp_denscurve_mqc instanceof java.nio.file.Path && state.dupradar_output_duprate_exp_denscurve_mqc.exists()) ? - state.dupradar_output_duprate_exp_denscurve_mqc : - null } - def bamstat_output = list.collect { id, state -> - (state.bamstat_output instanceof java.nio.file.Path && state.bamstat_output.exists()) ? - state.bamstat_output : - null } - def inferexperiment_multiqc = list.collect { id, state -> - (state.strandedness_output instanceof java.nio.file.Path && state.strandedness_output.exists()) ? - state.strandedness_output : - null } - def inner_dist_output_freq = list.collect { id, state -> - (state.inner_dist_output_freq instanceof java.nio.file.Path && state.inner_dist_output_freq.exists()) ? - state.inner_dist_output_freq : - null } - def junction_annotation_output_log = list.collect { id, state -> - (state.junction_annotation_output_log instanceof java.nio.file.Path && state.junction_annotation_output_log.exists()) ? - state.junction_annotation_output_log : - null } - def junction_saturation_output_plot_r = list.collect { id, state -> - (state.junction_saturation_output_plot_r instanceof java.nio.file.Path && state.junction_saturation_output_plot_r.exists()) ? - state.junction_saturation_output_plot_r : - null } - def read_distribution_output = list.collect { id, state -> - (state.read_distribution_output instanceof java.nio.file.Path && state.read_distribution_output.exists()) ? - state.read_distribution_output : - null } - def read_duplication_output_duplication_rate_mapping = list.collect { id, state -> - (state.read_duplication_output_duplication_rate_mapping instanceof java.nio.file.Path && state.read_duplication_output_duplication_rate_mapping.exists()) ? - state.read_duplication_output_duplication_rate_mapping : - null } - def tin_output_summary = list.collect { id, state -> - (state.tin_output_summary instanceof java.nio.file.Path && state.tin_output_summary.exists()) ? - state.tin_output_summary : - null } - def multiqc_custom_config = list.collect { id, state -> state.multiqc_custom_config }.unique()[0] - ["merged", [ - ids: ids, - strandedness: strandedness, - num_trimmed_reads: num_trimmed_reads, - passed_trimmed_reads: passed_trimmed_reads, - passed_mapping: passed_mapping, - percent_mapped: percent_mapped, - inferred_strand: inferred_strand, - passed_strand_check: passed_strand_check, - skip_align: skip_align, - skip_pseudo_align: skip_pseudo_align, - quant_results: quant_results.findAll { it != null }, - rsem_counts_gene: rsem_counts_gene.findAll { it != null }, - rsem_counts_transcripts: rsem_counts_transcripts.findAll { it != null }, - pseudo_quant_out_dir: pseudo_quant_out_dir.findAll { it != null }, - pseudo_salmon_quant_results: pseudo_salmon_quant_results.findAll { it != null }, - pseudo_kallisto_quant_results: pseudo_kallisto_quant_results.findAll { it != null }, - gtf: gtf, - gtf_extra_attributes: gtf_extra_attributes, - gtf_group_features: gtf_group_features, - pca_header_multiqc: pca_header_multiqc, - clustering_header_multiqc: clustering_header_multiqc, - aligner: aligner, - pseudo_aligner: pseudo_aligner, - deseq2_vst: deseq2_vst, - extra_deseq2_args: extra_deseq2_args, - extra_deseq2_args2: extra_deseq2_args2, - skip_deseq2_qc: skip_deseq2_qc, - fastqc_zip: fastqc_zip_1 + fastqc_zip_2, - trim_zip: trim_zip_1 + trim_zip_2, - trim_log: trim_log_1 + trim_log_2, - sortmerna_multiqc: sortmerna_multiqc, - star_multiqc: star_multiqc, - genome_bam_stats: genome_bam_stats, - genome_bam_flagstat: genome_bam_flagstat, - genome_bam_idxstats: genome_bam_idxstats, - markduplicates_multiqc: markduplicates_multiqc, - salmon_multiqc: salmon_multiqc, - rsem_multiqc: rsem_multiqc, - pseudo_multiqc: pseudo_multiqc, - featurecounts_multiqc: featurecounts_multiqc, - featurecounts_rrna_multiqc: featurecounts_rrna_multiqc, - preseq_output: preseq_output, - // qualimap_output_dir: qualimap_output_dir, - dupradar_output_dup_intercept_mqc: dupradar_output_dup_intercept_mqc, - dupradar_output_duprate_exp_denscurve_mqc: dupradar_output_duprate_exp_denscurve_mqc, - bamstat_output: bamstat_output, - inner_dist_output_freq: inner_dist_output_freq, - inferexperiment_multiqc: inferexperiment_multiqc, - junction_annotation_output_log: junction_annotation_output_log, - junction_saturation_output_plot_r: junction_saturation_output_plot_r, - read_distribution_output: read_distribution_output, - read_duplication_output_duplication_rate_mapping: read_duplication_output_duplication_rate_mapping, - tin_output_summary: tin_output_summary, - multiqc_custom_config: multiqc_custom_config - ] ] - } + | prepare_multiqc_input.run( + runIf: { id, state -> !state.skip_qc && !state.skip_multiqc }, + fromState: [ + "fail_trimming_multiqc": "fail_trimming_multiqc", + "fail_mapping_multiqc": "fail_mapping_multiqc", + "fail_strand_multiqc": "fail_strand_multiqc", + "fastqc_raw_multiqc": "fastqc_zip", + "fastqc_trim_multiqc": "trim_zip", + "trim_log_multiqc": "trim_log", + "sortmerna_multiqc": "sortmerna_multiqc", + "star_multiqc": "star_multiqc", + "salmon_multiqc": "salmon_multiqc", + "rsem_multiqc": "rsem_multiqc", + "pseudo_multiqc": "pseudo_multiqc", + "samtools_stats": "genome_bam_stats", + "samtools_flagstat": "genome_bam_flagstat", + "samtools_idxstats": "genome_bam_idxstats", + "markduplicates_multiqc": "markduplicates_multiqc", + "featurecounts_multiqc": "featurecounts_multiqc", + "featurecounts_rrna_multiqc": "featurecounts_rrna_multiqc", + "aligner_pca_multiqc": "deseq2_pca_multiqc", + "aligner_clustering_multiqc": "deseq2_dists_multiqc", + "pseudo_aligner_pca_multiqc": "deseq2_pca_multiqc_pseudo", + "pseudo_aligner_clustering_multiqc": "deseq2_dists_multiqc_pseudo", + "preseq_multiqc": "preseq_output", + // "qualimap_multiqc": "qualimap_output_dir", + "dupradar_output_dup_intercept_mqc": "dupradar_output_dup_intercept_mqc", + "dupradar_output_duprate_exp_denscurve_mqc": "dupradar_output_duprate_exp_denscurve_mqc", + "bamstat_multiqc": "bamstat_output", + "inferexperiment_multiqc": "inferexperiment_multiqc", + "innerdistance_multiqc": "inner_dist_output_freq", + "junctionannotation_multiqc": "junction_annotation_output_log", + "junctionsaturation_multiqc": "junction_saturation_output_plot_r", + "readdistribution_multiqc": "read_distribution_output", + "readduplication_multiqc": "read_duplication_output_duplication_rate_mapping", + "tin_multiqc": "tin_output_summary", + "multiqc_config": "multiqc_custom_config" + ], + toState: [ "multiqc_input": "output" ], + directives: [ label: [ "midmem", "midcpu" ] ] + ) - // Merge quantification results of alignment - | merge_quant_results.run ( - runIf: { id, state -> !state.skip_align && state.aligner == 'star_salmon' }, - fromState: [ - "salmon_quant_results": "quant_results", - "gtf": "gtf", - "gtf_extra_attributes": "gtf_extra_attributes", - "gtf_group_features": "gtf_group_features" - ], - args: [ quant_type: "salmon"], - toState: [ - "tpm_gene": "tpm_gene", - "counts_gene": "counts_gene", - "counts_gene_length_scaled": "counts_gene_length_scaled", - "counts_gene_scaled": "counts_gene_scaled", - "tpm_transcript": "tpm_transcript", - "counts_transcript": "counts_transcript", - "lengths_gene": "lengths_gene", - "lengths_transcript": "lengths_transcript", - "quant_merged_summarizedexperiment": "quant_merged_summarizedexperiment" - ], - key: "merge_quant_results" - ) + | multiqc.run ( + runIf: { id, state -> !state.skip_qc && !state.skip_multiqc }, + fromState: [ + "title": "multiqc_title", + "input": "multiqc_input", + ], + args: [exclude_modules: "general_stats"], + toState: [ + "multiqc_report": "output_report", + "multiqc_data": "output_data", + "multiqc_plots": "output_plots" + ], + directives: [ label: [ "highmem", "highcpu" ] ] + ) - | rsem_merge_counts.run ( - runIf: { id, state -> state.aligner == 'star_rsem' }, - fromState: [ - "counts_gene": "rsem_counts_gene", - "counts_transcripts": "rsem_counts_transcripts" - ], - toState: [ - "tpm_gene": "merged_gene_tpm", - "counts_gene": "merged_gene_counts", - "tpm_transcript": "merged_transcript_tpm", - "counts_transcript": "merged_transcript_counts" - ] - ) + | map { id, state -> + [ + id, [ + tpm_gene: state.tpm_gene, + counts_gene: state.counts_gene, + counts_gene_length_scaled: state.counts_gene_length_scaled, + counts_gene_scaled: state.counts_gene_scaled, + tpm_transcript: state.tpm_transcript, + counts_transcript: state.counts_transcript, + quant_merged_summarizedexperiment: state.quant_merged_summarizedexperiment, + deseq2_output: state.deseq2_output, + pseudo_tpm_gene: state.pseudo_tpm_gene, + pseudo_counts_gene: state.pseudo_counts_gene, + pseudo_counts_gene_length_scaled: state.pseudo_counts_gene_length_scaled, + pseudo_counts_gene_scaled: state.pseudo_counts_gene_scaled, + pseudo_tpm_transcript: state.pseudo_tpm_transcript, + pseudo_counts_transcript: state.pseudo_counts_transcript, + pseudo_quant_merged_summarizedexperiment: state.pseudo_quant_merged_summarizedexperiment, + deseq2_output_pseudo: state.deseq2_output_pseudo, + multiqc_report: state.multiqc_report, + multiqc_data: state.multiqc_data, + multiqc_plots: state.multiqc_plots + ] + ] + } - | deseq2_qc.run ( - runIf: { id, state -> !state.skip_qc && !state.skip_deseq2_qc && !state.skip_align }, - fromState: { id, state -> - def counts = (state.aligner == "star_rsem") ? state.counts_gene : state.counts_gene_length_scaled - [ - counts: counts, - vst: state.deseq2_vst, - label: state.aligner - ] - }, - args: [count_col: 3, id_col: 1, outprefix: "deseq2"], - toState: [ - "deseq2_output": "outdir", - "deseq2_pca_multiqc": "pca_multiqc", - "deseq2_dists_multiqc": "dists_multiqc" - ], - key: "deseq2_qc_align_quant" - ) + | map { list -> list[1]} - // Merge quantification results of pseudo alignment - | merge_quant_results.run ( - runIf: { id, state -> !state.skip_pseudo_align }, - fromState: [ - "salmon_quant_results": "pseudo_salmon_quant_results", - "kallisto_quant_results": "pseudo_kallisto_quant_results", - "gtf": "gtf", - "gtf_extra_attributes": "gtf_extra_attributes", - "gtf_group_features": "gtf_group_features", - "quant_type": "pseudo_aligner" - ], - toState: [ - "pseudo_tpm_gene": "tpm_gene", - "pseudo_counts_gene": "counts_gene", - "pseudo_counts_gene_length_scaled": "counts_gene_length_scaled", - "pseudo_counts_gene_scaled": "counts_gene_scaled", - "pseudo_tpm_transcript": "tpm_transcript", - "pseudo_counts_transcript": "counts_transcript", - "pseudo_lengths_gene": "lengths_gene", - "pseudo_lengths_transcript": "lengths_transcript", - "pseudo_quant_merged_summarizedexperiment": "quant_merged_summarizedexperiment" - ], - key: "merge_pseudo_quant_results" - ) + output_ch = qc_ch - | deseq2_qc.run ( - runIf: { id, state -> !state.skip_qc && !state.skip_deseq2_qc && !state.skip_pseudo_align }, - fromState: [ - "counts": "pseudo_counts_gene_length_scaled", - "vst": "deseq2_vst", - "label": "pseudo_aligner" - ], - args: [count_col: 3, id_col: 1, outprefix: "deseq2"], - toState: [ - "deseq2_output_pseudo": "outdir", - "deseq2_pca_multiqc_pseudo": "pca_multiqc", - "deseq2_dists_multiqc_pseudo": "dists_multiqc" - ], - key: "deseq2_qc_pseuso_align_quant" - ) - - // Get list of samples that failed trimming, mapping, and strand check for MultiQC report - | map { id, state -> - def fail_trimming_header = ["Sample", "Reads after trimming"] - def fail_trimming_multiqc = "" - def star_mapping_header = ["Sample", "STAR uniquely mapped reads (%)"] - def fail_mapping_multiqc = "" - def strand_check_header = ["Sample", "Provided strandedness", "Inferred strandedness", "Sense (%)", "Antisense (%)", "Undetermined (%)"] - def fail_strand_multiqc = "" - if (state.ids.size() > 0) { - fail_trimming_multiqc += "${fail_trimming_header.join('\t')}\n" - fail_mapping_multiqc += "${star_mapping_header.join('\t')}\n" - fail_strand_multiqc += "${strand_check_header.join('\t')}\n" - for (i=0; i - state.each { key, value -> - if (value instanceof ArrayList) { - value.removeAll { it == null } - } - } - mod_state = state.findAll { key, value -> value != null } - [ id, mod_state ] - } + | map { list -> [list[0], list[1] + list[2]] } - | prepare_multiqc_input.run( - runIf: { id, state -> !state.skip_qc && !state.skip_multiqc }, - fromState: [ - "fail_trimming_multiqc": "fail_trimming_multiqc", - "fail_mapping_multiqc": "fail_mapping_multiqc", - "fail_strand_multiqc": "fail_strand_multiqc", - "fastqc_raw_multiqc": "fastqc_zip", - "fastqc_trim_multiqc": "trim_zip", - "trim_log_multiqc": "trim_log", - "sortmerna_multiqc": "sortmerna_multiqc", - "star_multiqc": "star_multiqc", - "salmon_multiqc": "salmon_multiqc", - "rsem_multiqc": "rsem_multiqc", - "pseudo_multiqc": "pseudo_multiqc", - "samtools_stats": "genome_bam_stats", - "samtools_flagstat": "genome_bam_flagstat", - "samtools_idxstats": "genome_bam_idxstats", - "markduplicates_multiqc": "markduplicates_multiqc", - "featurecounts_multiqc": "featurecounts_multiqc", - "featurecounts_rrna_multiqc": "featurecounts_rrna_multiqc", - "aligner_pca_multiqc": "deseq2_pca_multiqc", - "aligner_clustering_multiqc": "deseq2_dists_multiqc", - "pseudo_aligner_pca_multiqc": "deseq2_pca_multiqc_pseudo", - "pseudo_aligner_clustering_multiqc": "deseq2_dists_multiqc_pseudo", - "preseq_multiqc": "preseq_output", - // "qualimap_multiqc": "qualimap_output_dir", - "dupradar_output_dup_intercept_mqc": "dupradar_output_dup_intercept_mqc", - "dupradar_output_duprate_exp_denscurve_mqc": "dupradar_output_duprate_exp_denscurve_mqc", - "bamstat_multiqc": "bamstat_output", - "inferexperiment_multiqc": "inferexperiment_multiqc", - "innerdistance_multiqc": "inner_dist_output_freq", - "junctionannotation_multiqc": "junction_annotation_output_log", - "junctionsaturation_multiqc": "junction_saturation_output_plot_r", - "readdistribution_multiqc": "read_distribution_output", - "readduplication_multiqc": "read_duplication_output_duplication_rate_mapping", - "tin_multiqc": "tin_output_summary", - "multiqc_config": "multiqc_custom_config" - ], - toState: [ "multiqc_input": "output" ] - ) + | map { id, state -> + def mod_state = state.findAll { key, value -> value instanceof java.nio.file.Path && value.exists() } + [ id, mod_state ] + } - | multiqc.run ( - runIf: { id, state -> !state.skip_qc && !state.skip_multiqc }, - fromState: [ - "title": "multiqc_title", - "input": "multiqc_input", - ], - args: [exclude_modules: "general_stats"], - toState: [ - "multiqc_report": "output_report", - "multiqc_data": "output_data", - "multiqc_plots": "output_plots" - ] - ) + | setState ( + [ + "preseq_output": "preseq_output", + "bamstat_output": "bamstat_output", + "strandedness_output": "strandedness_output", + "inner_dist_output_stats": "inner_dist_output_stats", + "inner_dist_output_dist": "inner_dist_output_dist", + "inner_dist_output_freq": "inner_dist_output_freq", + "inner_dist_output_plot": "inner_dist_output_plot", + "inner_dist_output_plot_r": "inner_dist_output_plot_r", + "junction_annotation_output_log": "junction_annotation_output_log", + "junction_annotation_output_plot_r": "junction_annotation_output_plot_r", + "junction_annotation_output_junction_bed": "junction_annotation_output_junction_bed", + "junction_annotation_output_junction_interact": "junction_annotation_output_junction_interact", + "junction_annotation_output_junction_sheet": "junction_annotation_output_junction_sheet", + "junction_annotation_output_splice_events_plot": "junction_annotation_output_splice_events_plot", + "junction_annotation_output_splice_junctions_plot": "junction_annotation_output_splice_junctions_plot", + "junction_saturation_output_plot_r": "junction_saturation_output_plot_r", + "junction_saturation_output_plot": "junction_saturation_output_plot", + "read_distribution_output": "read_distribution_output", + "read_duplication_output_duplication_rate_plot_r": "read_duplication_output_duplication_rate_plot_r", + "read_duplication_output_duplication_rate_plot": "read_duplication_output_duplication_rate_plot", + "read_duplication_output_duplication_rate_mapping": "read_duplication_output_duplication_rate_mapping", + "read_duplication_output_duplication_rate_sequence": "read_duplication_output_duplication_rate_sequence", + "tin_output_summary": "tin_output_summary", + "tin_output_metrics": "tin_output_metrics", + "dupradar_output_dupmatrix": "dupradar_output_dupmatrix", + "dupradar_output_dup_intercept_mqc": "dupradar_output_dup_intercept_mqc", + "dupradar_output_duprate_exp_boxplot": "dupradar_output_duprate_exp_boxplot", + "dupradar_output_duprate_exp_densplot": "dupradar_output_duprate_exp_densplot", + "dupradar_output_duprate_exp_denscurve_mqc": "dupradar_output_duprate_exp_denscurve_mqc", + "dupradar_output_expression_histogram": "dupradar_output_expression_histogram", + "dupradar_output_intercept_slope": "dupradar_output_intercept_slope", + "qualimap_report": "qualimap_report", + "qualimap_qc_report": "qualimap_qc_report", + "qualimap_counts": "qualimap_counts", + "featurecounts": "featurecounts", + "featurecounts_summary": "featurecounts_summary", + "featurecounts_multiqc": "featurecounts_multiqc", + "featurecounts_rrna_multiqc": "featurecounts_rrna_multiqc", + "tpm_gene": "tpm_gene", + "counts_gene": "counts_gene", + "counts_gene_length_scaled": "counts_gene_length_scaled", + "counts_gene_scaled": "counts_gene_scaled", + "tpm_transcript": "tpm_transcript", + "counts_transcript": "counts_transcript", + "lengths_gene": "lengths_gene", + "lengths_transcript": "lengths_transcript", + "quant_merged_summarizedexperiment": "quant_merged_summarizedexperiment", + "deseq2_output": "deseq2_output", + "pseudo_tpm_gene": "pseudo_tpm_gene", + "pseudo_counts_gene": "pseudo_counts_gene", + "pseudo_counts_gene_length_scaled": "pseudo_counts_gene_length_scaled", + "pseudo_counts_gene_scaled": "pseudo_counts_gene_scaled", + "pseudo_tpm_transcript": "pseudo_tpm_transcript", + "pseudo_counts_transcript": "pseudo_counts_transcript", + "pseudo_lengths_gene": "pseudo_lengths_gene", + "pseudo_lengths_transcript": "pseudo_lengths_transcript", + "pseudo_quant_merged_summarizedexperiment": "pseudo_quant_merged_summarizedexperiment", + "deseq2_output_pseudo": "deseq2_output_pseudo", + "multiqc_report": "multiqc_report", + "multiqc_data": "multiqc_data", + "multiqc_plots": "multiqc_plots" + ] + ) - | map { id, state -> - [ id, [ - tpm_gene: state.tpm_gene, - counts_gene: state.counts_gene, - counts_gene_length_scaled: state.counts_gene_length_scaled, - counts_gene_scaled: state.counts_gene_scaled, - tpm_transcript: state.tpm_transcript, - counts_transcript: state.counts_transcript, - quant_merged_summarizedexperiment: state.quant_merged_summarizedexperiment, - deseq2_output: state.deseq2_output, - pseudo_tpm_gene: state.pseudo_tpm_gene, - pseudo_counts_gene: state.pseudo_counts_gene, - pseudo_counts_gene_length_scaled: state.pseudo_counts_gene_length_scaled, - pseudo_counts_gene_scaled: state.pseudo_counts_gene_scaled, - pseudo_tpm_transcript: state.pseudo_tpm_transcript, - pseudo_counts_transcript: state.pseudo_counts_transcript, - pseudo_quant_merged_summarizedexperiment: state.pseudo_quant_merged_summarizedexperiment, - deseq2_output_pseudo: state.deseq2_output_pseudo, - multiqc_report: state.multiqc_report, - multiqc_data: state.multiqc_data, - multiqc_plots: state.multiqc_plots - ] ] - } - - | map { list -> list[1]} - - output_ch = qc_ch - - | combine(merged_ch) - - | map { list -> [list[0], list[1] + list[2]] } - - | map { id, state -> - def mod_state = state.findAll { key, value -> value instanceof java.nio.file.Path && value.exists() } - [ id, mod_state ] - } - - | setState ( - [ - "preseq_output": "preseq_output", - "bamstat_output": "bamstat_output", - "strandedness_output": "strandedness_output", - "inner_dist_output_stats": "inner_dist_output_stats", - "inner_dist_output_dist": "inner_dist_output_dist", - "inner_dist_output_freq": "inner_dist_output_freq", - "inner_dist_output_plot": "inner_dist_output_plot", - "inner_dist_output_plot_r": "inner_dist_output_plot_r", - "junction_annotation_output_log": "junction_annotation_output_log", - "junction_annotation_output_plot_r": "junction_annotation_output_plot_r", - "junction_annotation_output_junction_bed": "junction_annotation_output_junction_bed", - "junction_annotation_output_junction_interact": "junction_annotation_output_junction_interact", - "junction_annotation_output_junction_sheet": "junction_annotation_output_junction_sheet", - "junction_annotation_output_splice_events_plot": "junction_annotation_output_splice_events_plot", - "junction_annotation_output_splice_junctions_plot": "junction_annotation_output_splice_junctions_plot", - "junction_saturation_output_plot_r": "junction_saturation_output_plot_r", - "junction_saturation_output_plot": "junction_saturation_output_plot", - "read_distribution_output": "read_distribution_output", - "read_duplication_output_duplication_rate_plot_r": "read_duplication_output_duplication_rate_plot_r", - "read_duplication_output_duplication_rate_plot": "read_duplication_output_duplication_rate_plot", - "read_duplication_output_duplication_rate_mapping": "read_duplication_output_duplication_rate_mapping", - "read_duplication_output_duplication_rate_sequence": "read_duplication_output_duplication_rate_sequence", - "tin_output_summary": "tin_output_summary", - "tin_output_metrics": "tin_output_metrics", - "dupradar_output_dupmatrix": "dupradar_output_dupmatrix", - "dupradar_output_dup_intercept_mqc": "dupradar_output_dup_intercept_mqc", - "dupradar_output_duprate_exp_boxplot": "dupradar_output_duprate_exp_boxplot", - "dupradar_output_duprate_exp_densplot": "dupradar_output_duprate_exp_densplot", - "dupradar_output_duprate_exp_denscurve_mqc": "dupradar_output_duprate_exp_denscurve_mqc", - "dupradar_output_expression_histogram": "dupradar_output_expression_histogram", - "dupradar_output_intercept_slope": "dupradar_output_intercept_slope", - "qualimap_report": "qualimap_report", - "qualimap_qc_report": "qualimap_qc_report", - "qualimap_counts": "qualimap_counts", - "featurecounts": "featurecounts", - "featurecounts_summary": "featurecounts_summary", - "featurecounts_multiqc": "featurecounts_multiqc", - "featurecounts_rrna_multiqc": "featurecounts_rrna_multiqc", - "tpm_gene": "tpm_gene", - "counts_gene": "counts_gene", - "counts_gene_length_scaled": "counts_gene_length_scaled", - "counts_gene_scaled": "counts_gene_scaled", - "tpm_transcript": "tpm_transcript", - "counts_transcript": "counts_transcript", - "lengths_gene": "lengths_gene", - "lengths_transcript": "lengths_transcript", - "quant_merged_summarizedexperiment": "quant_merged_summarizedexperiment", - "deseq2_output": "deseq2_output", - "pseudo_tpm_gene": "pseudo_tpm_gene", - "pseudo_counts_gene": "pseudo_counts_gene", - "pseudo_counts_gene_length_scaled": "pseudo_counts_gene_length_scaled", - "pseudo_counts_gene_scaled": "pseudo_counts_gene_scaled", - "pseudo_tpm_transcript": "pseudo_tpm_transcript", - "pseudo_counts_transcript": "pseudo_counts_transcript", - "pseudo_lengths_gene": "pseudo_lengths_gene", - "pseudo_lengths_transcript": "pseudo_lengths_transcript", - "pseudo_quant_merged_summarizedexperiment": "pseudo_quant_merged_summarizedexperiment", - "deseq2_output_pseudo": "deseq2_output_pseudo", - "multiqc_report": "multiqc_report", - "multiqc_data": "multiqc_data", - "multiqc_plots": "multiqc_plots" - ] - ) - - emit: - output_ch + emit: + output_ch } // // Function to check whether biotype field exists in GTF file // def biotypeInGtf(gtf_file, biotype) { - def hits = 0 - gtf_file.eachLine { line -> - def attributes = line.split('\t')[-1].split() - if (attributes.contains(biotype)) { - hits += 1 - } - } - if (hits) { - return true - } else { - log.warn "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" + - " Biotype attribute '${biotype}' not found in the last column of the GTF file!\n\n" + - " Biotype QC will be skipped to circumvent the issue below:\n" + - " https://github.com/nf-core/rnaseq/issues/460\n\n" + - " Amend '--featurecounts_group_type' to change this behaviour.\n" + - "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" - return false + def hits = 0 + gtf_file.eachLine { line -> + def attributes = line.split('\t')[-1].split() + if (attributes.contains(biotype)) { + hits += 1 } + } + if (hits) { + return true + } else { + log.warn "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" + + " Biotype attribute '${biotype}' not found in the last column of the GTF file!\n\n" + + " Biotype QC will be skipped to circumvent the issue below:\n" + + " https://github.com/nf-core/rnaseq/issues/460\n\n" + + " Amend '--featurecounts_group_type' to change this behaviour.\n" + + "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" + return false + } } // // Function that parses and returns the predicted strandedness from the RSeQC infer_experiment.py output // def getInferexperimentStrandedness(inferexperiment_file, cutoff=30) { - def sense = 0 - def antisense = 0 - def undetermined = 0 - inferexperiment_file.eachLine { line -> - def undetermined_matcher = line =~ /Fraction of reads failed to determine:\s([\d\.]+)/ - def se_sense_matcher = line =~ /Fraction of reads explained by "\++,--":\s([\d\.]+)/ - def se_antisense_matcher = line =~ /Fraction of reads explained by "\+-,-\+":\s([\d\.]+)/ - def pe_sense_matcher = line =~ /Fraction of reads explained by "1\++,1--,2\+-,2-\+":\s([\d\.]+)/ - def pe_antisense_matcher = line =~ /Fraction of reads explained by "1\+-,1-\+,2\+\+,2--":\s([\d\.]+)/ - if (undetermined_matcher) undetermined = undetermined_matcher[0][1].toFloat() * 100 - if (se_sense_matcher) sense = se_sense_matcher[0][1].toFloat() * 100 - if (se_antisense_matcher) antisense = se_antisense_matcher[0][1].toFloat() * 100 - if (pe_sense_matcher) sense = pe_sense_matcher[0][1].toFloat() * 100 - if (pe_antisense_matcher) antisense = pe_antisense_matcher[0][1].toFloat() * 100 - } - def strandedness = 'unstranded' - if (sense >= 100-cutoff) { - strandedness = 'forward' - } else if (antisense >= 100-cutoff) { - strandedness = 'reverse' - } - return [ strandedness, sense, antisense, undetermined ] + def sense = 0 + def antisense = 0 + def undetermined = 0 + inferexperiment_file.eachLine { line -> + def undetermined_matcher = line =~ /Fraction of reads failed to determine:\s([\d\.]+)/ + def se_sense_matcher = line =~ /Fraction of reads explained by "\++,--":\s([\d\.]+)/ + def se_antisense_matcher = line =~ /Fraction of reads explained by "\+-,-\+":\s([\d\.]+)/ + def pe_sense_matcher = line =~ /Fraction of reads explained by "1\++,1--,2\+-,2-\+":\s([\d\.]+)/ + def pe_antisense_matcher = line =~ /Fraction of reads explained by "1\+-,1-\+,2\+\+,2--":\s([\d\.]+)/ + if (undetermined_matcher) undetermined = undetermined_matcher[0][1].toFloat() * 100 + if (se_sense_matcher) sense = se_sense_matcher[0][1].toFloat() * 100 + if (se_antisense_matcher) antisense = se_antisense_matcher[0][1].toFloat() * 100 + if (pe_sense_matcher) sense = pe_sense_matcher[0][1].toFloat() * 100 + if (pe_antisense_matcher) antisense = pe_antisense_matcher[0][1].toFloat() * 100 + } + def strandedness = 'unstranded' + if (sense >= 100-cutoff) { + strandedness = 'forward' + } else if (antisense >= 100-cutoff) { + strandedness = 'reverse' + } + return [ strandedness, sense, antisense, undetermined ] } - - diff --git a/src/workflows/rnaseq/config.vsh.yaml b/src/workflows/rnaseq/config.vsh.yaml index 4d4f4df..c83a576 100644 --- a/src/workflows/rnaseq/config.vsh.yaml +++ b/src/workflows/rnaseq/config.vsh.yaml @@ -218,9 +218,10 @@ argument_groups: type: boolean description: Skip the adapter trimming step. default: false - - name: "--skip_bbsplit" - type: boolean_true - description: Skip BBSplit for removal of non-reference genome reads. + # See: + # - name: "--skip_bbsplit" + # type: boolean_true + # description: Skip BBSplit for removal of non-reference genome reads. - name: "--skip_umi_extract" type: boolean description: Skip umi_tools extract step. @@ -243,9 +244,9 @@ argument_groups: - name: "--skip_preseq" type: boolean_true description: Skip Preseq. - - name: "--skip_deseq2_qc" - type: boolean_true - description: Skip DESeq2 PCA and heatmap plotting. + # - name: "--skip_deseq2_qc" + # type: boolean_true + # description: Skip DESeq2 PCA and heatmap plotting. - name: --skip_dupradar type: boolean_true description: Skip dupRadar. @@ -285,13 +286,15 @@ argument_groups: arguments: - name: "--multiqc_custom_config" type: file - default: src/assets/multiqc_config.yml + description: | + Custom multiqc configuration file - name: "--multiqc_title" type: string + description: | + Custom multiqc title - name: "--multiqc_methods_description" type: file - default: src/assets/methods_description_template.yml - + - name: Output arguments: # Reference files @@ -886,12 +889,17 @@ argument_groups: type: file direction: output default: pseudo_alignment_quantification/quant_merged_summarizedexperiment - + resources: - type: nextflow_script path: main.nf entrypoint: run_wf +test_resources: + - type: nextflow_script + path: test.nf + entrypoint: test_wf + dependencies: - name: workflows/prepare_genome - name: cat_fastq diff --git a/src/workflows/rnaseq/main.nf b/src/workflows/rnaseq/main.nf index 0c52e18..f974d00 100644 --- a/src/workflows/rnaseq/main.nf +++ b/src/workflows/rnaseq/main.nf @@ -3,6 +3,7 @@ workflow run_wf { input_ch main: + reference_ch = input_ch | map { id, state -> @@ -21,8 +22,8 @@ workflow run_wf { | toSortedList | map { list -> - [ "ref", - [ fasta: list.collect { id, state -> state.fasta }.unique()[0], + [ "ref", [ + fasta: list.collect { id, state -> state.fasta }.unique()[0], gtf: list.collect { id, state -> state.gtf }.unique()[0], gff: list.collect { id, state -> state.gff }.unique()[0], additional_fasta: list.collect { id, state -> state.additional_fasta }.unique()[0], @@ -38,7 +39,8 @@ workflow run_wf { // splicesites: list.collect { id, state -> state.splicesites }.unique()[0], // hisat2_index: list.collect { id, state -> state.hisat2_index }.unique()[0], bbsplit_index: list.collect { id, state -> state.bbsplit_index }.unique()[0], - skip_bbsplit: list.collect { id, state -> state.skip_bbsplit }.unique()[0], + // See: + skip_bbsplit: true, // list.collect { id, state -> state.skip_bbsplit }.unique()[0], skip_alignment: list.collect { id, state -> state.skip_alignment }.unique()[0], gencode: list.collect { id, state -> state.gencode }.unique()[0], biotype: list.collect { id, state -> state.biotype }.unique()[0], @@ -50,43 +52,43 @@ workflow run_wf { // prepare all the necessary files for reference genome | prepare_genome.run ( - fromState: [ - "fasta": "fasta", - "gtf": "gtf", - "gff": "gff", - "additional_fasta": "additional_fasta", - "transcript_fasta": "transcript_fasta", - "gene_bed": "gene_bed", - "bbsplit_fasta_list": "bbsplit_fasta_list", - "star_index": "star_index", - "rsem_index": "rsem_index", - "salmon_index": "salmon_index", - "kallisto_index": "kallisto_index", - "pseudo_aligner_kmer_size": "pseudo_aligner_kmer_size", - // "splicesites": "splicesites", - // "hisat2_index": "hisat2_index", - "bbsplit_index": "bbsplit_index", - "skip_bbsplit": "skip_bbsplit", - "gencode": "gencode", - "biotype": "biotype", - "filter_gtf": "filter_gtf", - "aligner": "aligner", - "pseudo_aligner": "pseudo_aligner", - "skip_alignment": "skip_alignment", - "star_sjdb_gtf_feature_exon": "star_sjdb_gtf_feature_exon" - ], - toState: [ - "fasta": "uncompressed_fasta", - "gtf": "gtf_uncompressed", - "transcript_fasta": "transcript_fasta_uncompressed", - "fai": "fai", - "chrom_sizes": "chrom_sizes", - "bbsplit_index": "bbsplit_index_uncompressed", - "star_index": "star_index_uncompressed", - "salmon_index": "salmon_index_uncompressed", - "kallisto_index": "kallisto_index_uncompressed", - "gene_bed": "gene_bed_uncompressed" - ] + fromState: [ + "fasta": "fasta", + "gtf": "gtf", + "gff": "gff", + "additional_fasta": "additional_fasta", + "transcript_fasta": "transcript_fasta", + "gene_bed": "gene_bed", + "bbsplit_fasta_list": "bbsplit_fasta_list", + "star_index": "star_index", + "rsem_index": "rsem_index", + "salmon_index": "salmon_index", + "kallisto_index": "kallisto_index", + "pseudo_aligner_kmer_size": "pseudo_aligner_kmer_size", + // "splicesites": "splicesites", + // "hisat2_index": "hisat2_index", + "bbsplit_index": "bbsplit_index", + "skip_bbsplit": "skip_bbsplit", + "gencode": "gencode", + "biotype": "biotype", + "filter_gtf": "filter_gtf", + "aligner": "aligner", + "pseudo_aligner": "pseudo_aligner", + "skip_alignment": "skip_alignment", + "star_sjdb_gtf_feature_exon": "star_sjdb_gtf_feature_exon" + ], + toState: [ + "fasta": "uncompressed_fasta", + "gtf": "gtf_uncompressed", + "transcript_fasta": "transcript_fasta_uncompressed", + "fai": "fai", + "chrom_sizes": "chrom_sizes", + "bbsplit_index": "bbsplit_index_uncompressed", + "star_index": "star_index_uncompressed", + "salmon_index": "salmon_index_uncompressed", + "kallisto_index": "kallisto_index_uncompressed", + "gene_bed": "gene_bed_uncompressed" + ] ) // Check if contigs in genome fasta file > 512 Mbp @@ -94,6 +96,7 @@ workflow run_wf { (isBelowMaxContigSize(state.fai)) ? [id, state] : [id, state + [bam_csi_index: true]] } + // Pick out the state | map { list -> list[1]} analysis_ch = input_ch @@ -104,73 +107,74 @@ workflow run_wf { // Concatenate FastQ files from same sample if required | cat_fastq.run ( - fromState: [ - "read_1": "fastq_1", - "read_2": "fastq_2" - ], - toState: [ - "fastq_1": "fastq_1", - "fastq_2": "fastq_2" - ] + fromState: [ + "read_1": "fastq_1", + "read_2": "fastq_2" + ], + toState: [ + "fastq_1": "fastq_1", + "fastq_2": "fastq_2" + ], + directives: [ label: [ "lowmem", "midcpu" ] ] ) // Pre-process fastq files | pre_processing.run ( - fromState: [ - "id": "id", - "fastq_1": "fastq_1", - "fastq_2": "fastq_2", - "umitools_bc_pattern": "umitools_bc_pattern", - "umitools_bc_pattern2": "umitools_bc_pattern2", - "strandedness": "strandedness", - "transcript_fasta": "transcript_fasta", - "gtf": "gtf", - "with_umi": "with_umi", - "bbsplit_index": "bbsplit_index", - "bbsplit_fasta_list": "bbsplit_fasta_list", - "bc_pattern": "bc_pattern", - "ribo_database_manifest": "ribo_database_manifest", - "salmon_index": "salmon_index", - "skip_qc": "skip_qc", - "skip_fastqc": "skip_fastqc", - "skip_skip_umi_extract": "skip_umi_extract", - "umi_discard_read": "umi_discard_read", - "skip_trimming": "skip_trimming", - "trimmer": "trimmer", - "skip_bbsplit": "skip_bbsplit", - "remove_ribo_rna": "remove_ribo_rna" - ], - toState: [ - "fastqc_html_1": "fastqc_html_1", - "fastqc_html_2": "fastqc_html_2", - "fastqc_zip_1": "fastqc_zip_1", - "fastqc_zip_2": "fastqc_zip_2", - "fastq_1": "qc_output1", - "fastq_2": "qc_output2", - "trim_log_1": "trim_log_1", - "trim_log_2": "trim_log_2", - "trim_zip_1": "trim_zip_1", - "trim_zip_2": "trim_zip_2", - "trim_html_1": "trim_html_1", - "trim_html_2": "trim_html_2", - "passed_trimmed_reads": "passed_trimmed_reads", - "num_trimmed_reads": "num_trimmed_reads", - "sortmerna_log": "sortmerna_log", - "salmon_quant_output": "salmon_quant_output", - "fastp_failed_trim": "failed_trim", - "fastp_failed_trim_unpaired1": "failed_trim_unpaired1", - "fastp_failed_trim_unpaired2": "failed_trim_unpaired2", - "fastp_trim_json": "trim_json", - "fastp_trim_html": "trim_html", - "fastp_trim_merged_out": "trim_merged_out" - ] + fromState: [ + "id": "id", + "fastq_1": "fastq_1", + "fastq_2": "fastq_2", + "umitools_bc_pattern": "umitools_bc_pattern", + "umitools_bc_pattern2": "umitools_bc_pattern2", + "strandedness": "strandedness", + "transcript_fasta": "transcript_fasta", + "gtf": "gtf", + "with_umi": "with_umi", + "bbsplit_index": "bbsplit_index", + "bbsplit_fasta_list": "bbsplit_fasta_list", + "bc_pattern": "bc_pattern", + "ribo_database_manifest": "ribo_database_manifest", + "salmon_index": "salmon_index", + "skip_qc": "skip_qc", + "skip_fastqc": "skip_fastqc", + "skip_skip_umi_extract": "skip_umi_extract", + "umi_discard_read": "umi_discard_read", + "skip_trimming": "skip_trimming", + "trimmer": "trimmer", + "skip_bbsplit": "skip_bbsplit", + "remove_ribo_rna": "remove_ribo_rna" + ], + toState: [ + "fastqc_html_1": "fastqc_html_1", + "fastqc_html_2": "fastqc_html_2", + "fastqc_zip_1": "fastqc_zip_1", + "fastqc_zip_2": "fastqc_zip_2", + "fastq_1": "qc_output1", + "fastq_2": "qc_output2", + "trim_log_1": "trim_log_1", + "trim_log_2": "trim_log_2", + "trim_zip_1": "trim_zip_1", + "trim_zip_2": "trim_zip_2", + "trim_html_1": "trim_html_1", + "trim_html_2": "trim_html_2", + "passed_trimmed_reads": "passed_trimmed_reads", + "num_trimmed_reads": "num_trimmed_reads", + "sortmerna_log": "sortmerna_log", + "salmon_quant_output": "salmon_quant_output", + "fastp_failed_trim": "failed_trim", + "fastp_failed_trim_unpaired1": "failed_trim_unpaired1", + "fastp_failed_trim_unpaired2": "failed_trim_unpaired2", + "fastp_trim_json": "trim_json", + "fastp_trim_html": "trim_html", + "fastp_trim_merged_out": "trim_merged_out" + ] ) // Infer strandedness from Salmon pseudo-alignment results | map { id, state -> - (state.strandedness == 'auto') ? - [ id, state + [strandedness: getSalmonInferredStrandedness(state.salmon_quant_output)] ] : - [id, state] + (state.strandedness == 'auto') ? + [ id, state + [strandedness: getSalmonInferredStrandedness(state.salmon_quant_output)] ] : + [id, state] } // Filter FastQ files based on minimum trimmed read count after adapter trimming @@ -196,49 +200,49 @@ workflow run_wf { // Genome alignment and quantification | genome_alignment_and_quant.run ( - runIf: { id, state -> !state.skip_alignment && state.passed_trimmed_reads }, - fromState: [ - "id": "id", - "fastq_1": "fastq_1", - "fastq_2": "fastq_2", - "strandedness": "strandedness", - "gtf": "gtf", - "transcript_fasta": "transcript_fasta", - "bam_csi_index": "bam_csi_index", - "aligner": "aligner", - "rsem_index": "rsem_index", - "star_index": "star_index", - "star_sjdb_gtf_feature_exon": "star_sjdb_gtf_feature_exon", - "star_ignore_sjdbgtf": "star_ignore_sjdbgtf", - "with_umi": "with_umi", - "umi_dedup_stats": "umi_dedup_stats", - "gtf_group_features": "gtf_group_features", - "gtf_extra_attributes": "gtf_extra_attributes", - "salmon_quant_libtype": "salmon_quant_libtype", - "salmon_index": "salmon_index", - "extra_rsem_calculate_expression_args": "extra_rsem_calculate_expression_args" - ], - toState: [ - "star_multiqc": "star_multiqc", - "rsem_multiqc": "rsem_multiqc", - "salmon_multiqc": "salmon_multiqc", - "genome_bam_sorted": "genome_bam_sorted", - "genome_bam_index": "genome_bam_index", - "genome_bam_stats": "genome_bam_stats", - "genome_bam_flagstat": "genome_bam_flagstat", - "genome_bam_idxstats": "genome_bam_idxstats", - "transcriptome_bam": "transcriptome_bam", - "transcriptome_bam_index": "transcriptome_bam_index", - "transcriptome_bam_stats": "transcriptome_bam_stats", - "transcriptome_bam_flagstat": "transcriptome_bam_flagstat", - "transcriptome_bam_idxstats": "transcriptome_bam_idxstats", - "quant_out_dir": "quant_out_dir", - "quant_results_file": "quant_results_file", - "rsem_counts_gene": "rsem_counts_gene", - "rsem_counts_transcripts": "rsem_counts_transcripts", - "bam_genome_rsem": "bam_genome_rsem", - "bam_transcript_rsem": "bam_transcript_rsem" - ] + runIf: { id, state -> !state.skip_alignment && state.passed_trimmed_reads }, + fromState: [ + "id": "id", + "fastq_1": "fastq_1", + "fastq_2": "fastq_2", + "strandedness": "strandedness", + "gtf": "gtf", + "transcript_fasta": "transcript_fasta", + "bam_csi_index": "bam_csi_index", + "aligner": "aligner", + "rsem_index": "rsem_index", + "star_index": "star_index", + "star_sjdb_gtf_feature_exon": "star_sjdb_gtf_feature_exon", + "star_ignore_sjdbgtf": "star_ignore_sjdbgtf", + "with_umi": "with_umi", + "umi_dedup_stats": "umi_dedup_stats", + "gtf_group_features": "gtf_group_features", + "gtf_extra_attributes": "gtf_extra_attributes", + "salmon_quant_libtype": "salmon_quant_libtype", + "salmon_index": "salmon_index", + "extra_rsem_calculate_expression_args": "extra_rsem_calculate_expression_args" + ], + toState: [ + "star_multiqc": "star_multiqc", + "rsem_multiqc": "rsem_multiqc", + "salmon_multiqc": "salmon_multiqc", + "genome_bam_sorted": "genome_bam_sorted", + "genome_bam_index": "genome_bam_index", + "genome_bam_stats": "genome_bam_stats", + "genome_bam_flagstat": "genome_bam_flagstat", + "genome_bam_idxstats": "genome_bam_idxstats", + "transcriptome_bam": "transcriptome_bam", + "transcriptome_bam_index": "transcriptome_bam_index", + "transcriptome_bam_stats": "transcriptome_bam_stats", + "transcriptome_bam_flagstat": "transcriptome_bam_flagstat", + "transcriptome_bam_idxstats": "transcriptome_bam_idxstats", + "quant_out_dir": "quant_out_dir", + "quant_results_file": "quant_results_file", + "rsem_counts_gene": "rsem_counts_gene", + "rsem_counts_transcripts": "rsem_counts_transcripts", + "bam_genome_rsem": "bam_genome_rsem", + "bam_transcript_rsem": "bam_transcript_rsem" + ] ) // Filter channels to get samples that passed STAR minimum mapping percentage @@ -250,35 +254,35 @@ workflow run_wf { // Pseudo-alignment and quantification | pseudo_alignment_and_quant.run ( - runIf: { id, state -> !state.skip_pseudo_alignment && state.passed_trimmed_reads }, - fromState: [ - "id": "id", - "fastq_1": "fastq_1", - "fastq_2": "fastq_2", - "strandedness": "strandedness", - "gtf": "gtf", - "transcript_fasta": "transcript_fasta", - "pseudo_aligner": "pseudo_aligner", - "salmon_index": "salmon_index", - "kallisto_index": "kallisto_index", - "extra_star_align_args": "extra_star_align_args", - "star_ignore_sjdbgtf": "star_ignore_sjdbgtf", - "seq_platform": "seq_platform", - "seq_center": "seq_center", - "with_umi": "with_umi", - "umi_dedup_stats": "umi_dedup_stats", - "gtf_group_features": "gtf_group_features", - "gtf_extra_attributes": "gtf_extra_attributes", - "lib_type": "salmon_quant_libtype", - "kallisto_quant_fragment_length": "kallisto_quant_fragment_length", - "kallisto_quant_fragment_length_sd": "kallisto_quant_fragment_length_sd" - ], - toState: [ - "pseudo_quant_out_dir": "quant_out_dir", - "pseudo_salmon_quant_results_file": "salmon_quant_results_file", - "pseudo_kallisto_quant_results_file": "kallisto_quant_results_file", - "pseudo_multiqc": "pseudo_multiqc" - ] + runIf: { id, state -> !state.skip_pseudo_alignment && state.passed_trimmed_reads }, + fromState: [ + "id": "id", + "fastq_1": "fastq_1", + "fastq_2": "fastq_2", + "strandedness": "strandedness", + "gtf": "gtf", + "transcript_fasta": "transcript_fasta", + "pseudo_aligner": "pseudo_aligner", + "salmon_index": "salmon_index", + "kallisto_index": "kallisto_index", + "extra_star_align_args": "extra_star_align_args", + "star_ignore_sjdbgtf": "star_ignore_sjdbgtf", + "seq_platform": "seq_platform", + "seq_center": "seq_center", + "with_umi": "with_umi", + "umi_dedup_stats": "umi_dedup_stats", + "gtf_group_features": "gtf_group_features", + "gtf_extra_attributes": "gtf_extra_attributes", + "lib_type": "salmon_quant_libtype", + "kallisto_quant_fragment_length": "kallisto_quant_fragment_length", + "kallisto_quant_fragment_length_sd": "kallisto_quant_fragment_length_sd" + ], + toState: [ + "pseudo_quant_out_dir": "quant_out_dir", + "pseudo_salmon_quant_results_file": "salmon_quant_results_file", + "pseudo_kallisto_quant_results_file": "kallisto_quant_results_file", + "pseudo_multiqc": "pseudo_multiqc" + ] ) | map { id, state -> @@ -289,165 +293,170 @@ workflow run_wf { // Post-processing | post_processing.run ( - runIf: { id, state -> !state.skip_alignment && state.passed_trimmed_reads && state.passed_mapping }, - fromState: [ - "id": "id", - "paired": "paired", - "strandedness": "strandedness", - "fasta": "fasta", - "fai": "fai", - "gtf": "gtf", - "genome_bam": "genome_bam_sorted", - "chrom_sizes": "chrom_sizes", - "star_multiqc": "star_multiqc", - "extra_picard_args": "extra_picard_args", - "extra_stringtie_args": "extra_stringtie_args", - "stringtie_ignore_gtf": "stringtie_ignore_gtf", - "extra_bedtools_args": "extra_bedtools_args", - "bam_csi_index": "bam_csi_index", - "min_mapped_reads": "min_mapped_reads", - "with_umi": "with_umi", - "skip_qc": "skip_qc", - "skip_markduplicates": "skip_markduplicates", - "skip_stringtie": "skip_stringtie", - "skip_bigwig":"gencode" - ], - toState: [ - "genome_bam_sorted": "processed_genome_bam", - "genome_bam_index": "genome_bam_index", - "genome_bam_stats": "genome_bam_stats", - "genome_bam_flagstat": "genome_bam_flagstat", - "genome_bam_idxstats": "genome_bam_idxstats", - "markduplicates_metrics": "markduplicates_metrics", - "stringtie_transcript_gtf": "stringtie_transcript_gtf", - "stringtie_coverage_gtf": "stringtie_coverage_gtf", - "stringtie_abundance": "stringtie_abundance", - "stringtie_ballgown": "stringtie_ballgown", - "bedgraph_forward": "bedgraph_forward", - "bedgraph_reverse": "bedgraph_reverse", - "bigwig_forward": "bigwig_forward", - "bigwig_reverse": "bigwig_reverse" - ] + runIf: { id, state -> !state.skip_alignment && state.passed_trimmed_reads && state.passed_mapping }, + fromState: [ + "id": "id", + "paired": "paired", + "strandedness": "strandedness", + "fasta": "fasta", + "fai": "fai", + "gtf": "gtf", + "genome_bam": "genome_bam_sorted", + "chrom_sizes": "chrom_sizes", + "star_multiqc": "star_multiqc", + "extra_picard_args": "extra_picard_args", + "extra_stringtie_args": "extra_stringtie_args", + "stringtie_ignore_gtf": "stringtie_ignore_gtf", + "extra_bedtools_args": "extra_bedtools_args", + "bam_csi_index": "bam_csi_index", + "min_mapped_reads": "min_mapped_reads", + "with_umi": "with_umi", + "skip_qc": "skip_qc", + "skip_markduplicates": "skip_markduplicates", + "skip_stringtie": "skip_stringtie", + "skip_bigwig":"gencode" + ], + toState: [ + "genome_bam_sorted": "processed_genome_bam", + "genome_bam_index": "genome_bam_index", + "genome_bam_stats": "genome_bam_stats", + "genome_bam_flagstat": "genome_bam_flagstat", + "genome_bam_idxstats": "genome_bam_idxstats", + "markduplicates_metrics": "markduplicates_metrics", + "stringtie_transcript_gtf": "stringtie_transcript_gtf", + "stringtie_coverage_gtf": "stringtie_coverage_gtf", + "stringtie_abundance": "stringtie_abundance", + "stringtie_ballgown": "stringtie_ballgown", + "bedgraph_forward": "bedgraph_forward", + "bedgraph_reverse": "bedgraph_reverse", + "bigwig_forward": "bigwig_forward", + "bigwig_reverse": "bigwig_reverse" + ] ) // Final QC + + // Temporarily skip DESeq2 QC for now + // https://github.com/viash-hub/rnaseq/issues/31 + | map{ id, state -> [ id, state + [ skip_deseq2_qc: true ] ] } + | quality_control.run ( - fromState: [ - "id": "id", - "paired": "paired", - "strandedness": "strandedness", - "skip_align": "skip_alignment", - "skip_pseudo_align": "skip_pseudo_alignment", - "skip_dupradar": "skip_dupradar", - "skip_qualimap": "skip_qualimap", - "skip_rseqc": "skip_rseqc", - "skip_multiqc": "skip_multiqc", - "skip_preseq": "skip_preseq", - "gtf": "gtf", - "num_trimmed_reads": "num_trimmed_reads", - "passed_trimmed_reads": "passed_trimmed_reads", - "passed_mapping": "passed_mapping", - "percent_mapped": "percent_mapped", - "genome_bam": "genome_bam_sorted", - "genome_bam_index": "genome_bam_index", - "salmon_multiqc": "salmon_multiqc", - "quant_results_file": "quant_results_file", - "rsem_multiqc": "rsem_multiqc", - "rsem_counts_gene": "rsem_counts_gene", - "rsem_counts_transcripts": "rsem_counts_transcripts", - "pseudo_multiqc": "pseudo_multiqc", - "pseudo_quant_out_dir": "pseudo_quant_out_dir", - "pseudo_salmon_quant_results_file": "pseudo_salmon_quant_results_file", - "pseudo_kallisto_quant_results_file": "pseudo_kallisto_quant_results_file", - "aligner": "aligner", - "pseudo_aligner": "pseudo_aligner", - "gene_bed": "gene_bed", - "extra_preseq_args": "extra_preseq_args", - "biotype": "biotype", - "skip_biotype_qc": "skip_biotype_qc", - "featurecounts_group_type": "featurecounts_group_type", - "featurecounts_feature_type": "featurecounts_feature_type", - "gencode": "gencode", - "skip_deseq2_qc": "skip_deseq2_qc", - "deseq2_vst": "deseq2_vst", - "multiqc_custom_config": "multiqc_custom_config", - "multiqc_title": "multiqc_title", - "multiqc_methods_description": "multiqc_methods_description", - "fastqc_zip_1": "fastqc_zip_1", - "fastqc_zip_2": "fastqc_zip_2", - "trim_log_1": "trim_log_1", - "trim_log_2": "trim_log_2", - "trim_zip_1": "trim_zip_1", - "trim_zip_2": "trim_zip_2", - "sortmerna_multiqc": "sortmerna_log", - "star_multiqc": "star_multiqc", - "genome_bam_stats": "genome_bam_stats", - "genome_bam_flagstat": "genome_bam_flagstat", - "genome_bam_idxstats": "genome_bam_idxstats", - "markduplicates_multiqc": "markduplicates_metrics", - "rseqc_modules": "rseqc_modules" - ], - toState: [ - "preseq_output": "preseq_output", - "bamstat_output": "bamstat_output", - "strandedness_output": "strandedness_output", - "inner_dist_output_stats": "inner_dist_output_stats", - "inner_dist_output_dist": "inner_dist_output_dist", - "inner_dist_output_freq": "inner_dist_output_freq", - "inner_dist_output_plot": "inner_dist_output_plot", - "inner_dist_output_plot_r": "inner_dist_output_plot_r", - "junction_annotation_output_log": "junction_annotation_output_log", - "junction_annotation_output_plot_r": "junction_annotation_output_plot_r", - "junction_annotation_output_junction_bed": "junction_annotation_output_junction_bed", - "junction_annotation_output_junction_interact": "junction_annotation_output_junction_interact", - "junction_annotation_output_junction_sheet": "junction_annotation_output_junction_sheet", - "junction_annotation_output_splice_events_plot": "junction_annotation_output_splice_events_plot", - "junction_annotation_output_splice_junctions_plot": "junction_annotation_output_splice_junctions_plot", - "junction_saturation_output_plot_r": "junction_saturation_output_plot_r", - "junction_saturation_output_plot": "junction_saturation_output_plot", - "read_distribution_output": "read_distribution_output", - "read_duplication_output_duplication_rate_plot_r": "read_duplication_output_duplication_rate_plot_r", - "read_duplication_output_duplication_rate_plot": "read_duplication_output_duplication_rate_plot", - "read_duplication_output_duplication_rate_mapping": "read_duplication_output_duplication_rate_mapping", - "read_duplication_output_duplication_rate_sequence": "read_duplication_output_duplication_rate_sequence", - "tin_output_summary": "tin_output_summary", - "tin_output_metrics": "tin_output_metrics", - "dupradar_output_dupmatrix": "dupradar_output_dupmatrix", - "dupradar_output_dup_intercept_mqc": "dupradar_output_dup_intercept_mqc", - "dupradar_output_duprate_exp_boxplot": "dupradar_output_duprate_exp_boxplot", - "dupradar_output_duprate_exp_densplot": "dupradar_output_duprate_exp_densplot", - "dupradar_output_duprate_exp_denscurve_mqc": "dupradar_output_duprate_exp_denscurve_mqc", - "dupradar_output_expression_histogram": "dupradar_output_expression_histogram", - "dupradar_output_intercept_slope": "dupradar_output_intercept_slope", - "qualimap_report": "qualimap_report", - "qualimap_qc_report": "qualimap_qc_report", - "qualimap_counts": "qualimap_counts", - "featurecounts": "featurecounts", - "featurecounts_summary": "featurecounts_summary", - "featurecounts_multiqc": "featurecounts_multiqc", - "featurecounts_rrna_multiqc": "featurecounts_rrna_multiqc", - "tpm_gene": "tpm_gene", - "counts_gene": "counts_gene", - "counts_gene_length_scaled": "counts_gene_length_scaled", - "counts_gene_scaled": "counts_gene_scaled", - "tpm_transcript": "tpm_transcript", - "counts_transcript": "counts_transcript", - "qunat_merged_summarizedexperiment": "quant_merged_summarizedexperiment", - "deseq2_output": "deseq2_output", - "pseudo_tpm_gene": "pseudo_tpm_gene", - "pseudo_counts_gene": "pseudo_counts_gene", - "pseudo_counts_gene_length_scaled": "pseudo_counts_gene_length_scaled", - "pseudo_counts_gene_scaled": "pseudo_counts_gene_scaled", - "pseudo_tpm_transcript": "pseudo_tpm_transcript", - "pseudo_counts_transcript": "pseudo_counts_transcript", - "pseudo_lengths_gene": "pseudo_lengths_gene", - "pseudo_lengths_transcript": "pseudo_lengths_transcript", - "pseudo_quant_merged_summarizedexperiment": "pseudo_quant_merged_summarizedexperiment", - "deseq2_output_pseudo": "deseq2_output_pseudo", - "multiqc_report": "multiqc_report", - "multiqc_data": "multiqc_data", - "multiqc_plots": "multiqc_plots" - ] + fromState: [ + "id": "id", + "paired": "paired", + "strandedness": "strandedness", + "skip_align": "skip_alignment", + "skip_pseudo_align": "skip_pseudo_alignment", + "skip_dupradar": "skip_dupradar", + "skip_qualimap": "skip_qualimap", + "skip_rseqc": "skip_rseqc", + "skip_multiqc": "skip_multiqc", + "skip_preseq": "skip_preseq", + "gtf": "gtf", + "num_trimmed_reads": "num_trimmed_reads", + "passed_trimmed_reads": "passed_trimmed_reads", + "passed_mapping": "passed_mapping", + "percent_mapped": "percent_mapped", + "genome_bam": "genome_bam_sorted", + "genome_bam_index": "genome_bam_index", + "salmon_multiqc": "salmon_multiqc", + "quant_results_file": "quant_results_file", + "rsem_multiqc": "rsem_multiqc", + "rsem_counts_gene": "rsem_counts_gene", + "rsem_counts_transcripts": "rsem_counts_transcripts", + "pseudo_multiqc": "pseudo_multiqc", + "pseudo_quant_out_dir": "pseudo_quant_out_dir", + "pseudo_salmon_quant_results_file": "pseudo_salmon_quant_results_file", + "pseudo_kallisto_quant_results_file": "pseudo_kallisto_quant_results_file", + "aligner": "aligner", + "pseudo_aligner": "pseudo_aligner", + "gene_bed": "gene_bed", + "extra_preseq_args": "extra_preseq_args", + "biotype": "biotype", + "skip_biotype_qc": "skip_biotype_qc", + "featurecounts_group_type": "featurecounts_group_type", + "featurecounts_feature_type": "featurecounts_feature_type", + "gencode": "gencode", + "skip_deseq2_qc": "skip_deseq2_qc", + "deseq2_vst": "deseq2_vst", + "multiqc_custom_config": "multiqc_custom_config", + "multiqc_title": "multiqc_title", + "multiqc_methods_description": "multiqc_methods_description", + "fastqc_zip_1": "fastqc_zip_1", + "fastqc_zip_2": "fastqc_zip_2", + "trim_log_1": "trim_log_1", + "trim_log_2": "trim_log_2", + "trim_zip_1": "trim_zip_1", + "trim_zip_2": "trim_zip_2", + "sortmerna_multiqc": "sortmerna_log", + "star_multiqc": "star_multiqc", + "genome_bam_stats": "genome_bam_stats", + "genome_bam_flagstat": "genome_bam_flagstat", + "genome_bam_idxstats": "genome_bam_idxstats", + "markduplicates_multiqc": "markduplicates_metrics", + "rseqc_modules": "rseqc_modules" + ], + toState: [ + "preseq_output": "preseq_output", + "bamstat_output": "bamstat_output", + "strandedness_output": "strandedness_output", + "inner_dist_output_stats": "inner_dist_output_stats", + "inner_dist_output_dist": "inner_dist_output_dist", + "inner_dist_output_freq": "inner_dist_output_freq", + "inner_dist_output_plot": "inner_dist_output_plot", + "inner_dist_output_plot_r": "inner_dist_output_plot_r", + "junction_annotation_output_log": "junction_annotation_output_log", + "junction_annotation_output_plot_r": "junction_annotation_output_plot_r", + "junction_annotation_output_junction_bed": "junction_annotation_output_junction_bed", + "junction_annotation_output_junction_interact": "junction_annotation_output_junction_interact", + "junction_annotation_output_junction_sheet": "junction_annotation_output_junction_sheet", + "junction_annotation_output_splice_events_plot": "junction_annotation_output_splice_events_plot", + "junction_annotation_output_splice_junctions_plot": "junction_annotation_output_splice_junctions_plot", + "junction_saturation_output_plot_r": "junction_saturation_output_plot_r", + "junction_saturation_output_plot": "junction_saturation_output_plot", + "read_distribution_output": "read_distribution_output", + "read_duplication_output_duplication_rate_plot_r": "read_duplication_output_duplication_rate_plot_r", + "read_duplication_output_duplication_rate_plot": "read_duplication_output_duplication_rate_plot", + "read_duplication_output_duplication_rate_mapping": "read_duplication_output_duplication_rate_mapping", + "read_duplication_output_duplication_rate_sequence": "read_duplication_output_duplication_rate_sequence", + "tin_output_summary": "tin_output_summary", + "tin_output_metrics": "tin_output_metrics", + "dupradar_output_dupmatrix": "dupradar_output_dupmatrix", + "dupradar_output_dup_intercept_mqc": "dupradar_output_dup_intercept_mqc", + "dupradar_output_duprate_exp_boxplot": "dupradar_output_duprate_exp_boxplot", + "dupradar_output_duprate_exp_densplot": "dupradar_output_duprate_exp_densplot", + "dupradar_output_duprate_exp_denscurve_mqc": "dupradar_output_duprate_exp_denscurve_mqc", + "dupradar_output_expression_histogram": "dupradar_output_expression_histogram", + "dupradar_output_intercept_slope": "dupradar_output_intercept_slope", + "qualimap_report": "qualimap_report", + "qualimap_qc_report": "qualimap_qc_report", + "qualimap_counts": "qualimap_counts", + "featurecounts": "featurecounts", + "featurecounts_summary": "featurecounts_summary", + "featurecounts_multiqc": "featurecounts_multiqc", + "featurecounts_rrna_multiqc": "featurecounts_rrna_multiqc", + "tpm_gene": "tpm_gene", + "counts_gene": "counts_gene", + "counts_gene_length_scaled": "counts_gene_length_scaled", + "counts_gene_scaled": "counts_gene_scaled", + "tpm_transcript": "tpm_transcript", + "counts_transcript": "counts_transcript", + "quant_merged_summarizedexperiment": "quant_merged_summarizedexperiment", + "deseq2_output": "deseq2_output", + "pseudo_tpm_gene": "pseudo_tpm_gene", + "pseudo_counts_gene": "pseudo_counts_gene", + "pseudo_counts_gene_length_scaled": "pseudo_counts_gene_length_scaled", + "pseudo_counts_gene_scaled": "pseudo_counts_gene_scaled", + "pseudo_tpm_transcript": "pseudo_tpm_transcript", + "pseudo_counts_transcript": "pseudo_counts_transcript", + "pseudo_lengths_gene": "pseudo_lengths_gene", + "pseudo_lengths_transcript": "pseudo_lengths_transcript", + "pseudo_quant_merged_summarizedexperiment": "pseudo_quant_merged_summarizedexperiment", + "deseq2_output_pseudo": "deseq2_output_pseudo", + "multiqc_report": "multiqc_report", + "multiqc_data": "multiqc_data", + "multiqc_plots": "multiqc_plots" + ] ) | map { id, state -> @@ -639,8 +648,8 @@ def getTrimGaloreReadsAfterFiltering(log_file) { // Function that parses fastp json output file to get total number of reads after trimming // def getFastpReadsAfterFiltering(json_file) { - def Map json = (Map) new JsonSlurper().parseText(json_file.text).get('summary') - return json['after_filtering']['total_reads'].toLong() + def Map json = (Map) new JsonSlurper().parseText(json_file.text).get('summary') + return json['after_filtering']['total_reads'].toLong() } // diff --git a/src/workflows/rnaseq/nextflow.config b/src/workflows/rnaseq/nextflow.config new file mode 100644 index 0000000..39ba610 --- /dev/null +++ b/src/workflows/rnaseq/nextflow.config @@ -0,0 +1,14 @@ +manifest { + nextflowVersion = '!>=20.12.1-edge' +} + +params { + rootDir = java.nio.file.Paths.get("$projectDir/../../../").toAbsolutePath().normalize().toString() +} + +// Some important settings +docker.fixOwnership = true +process.container = "nextflow/nextflow:24.04.2" + +// include common settings +includeConfig("${params.rootDir}/src/workflows/utils/labels.config") diff --git a/src/workflows/rnaseq/test.nf b/src/workflows/rnaseq/test.nf new file mode 100644 index 0000000..b57f2ea --- /dev/null +++ b/src/workflows/rnaseq/test.nf @@ -0,0 +1,53 @@ +include { rnaseq } from params.rootDir + "/target/nextflow/workflows/rnaseq/main.nf" + +params.resources_test = params.rootDir + "/resources_test" + +workflow test_wf { + + resources_test = file(params.resources_test) + + output_ch = + + Channel.fromList([ + [ + id: "_test", + fastq_1: "https://github.com/nf-core/test-datasets/raw/refs/heads/rnaseq/testdata/GSE110004/SRR6357070_1.fastq.gz;" + + "https://github.com/nf-core/test-datasets/raw/refs/heads/rnaseq/testdata/GSE110004/SRR6357071_1.fastq.gz" , + fastq_2: "https://github.com/nf-core/test-datasets/raw/refs/heads/rnaseq/testdata/GSE110004/SRR6357070_2.fastq.gz;" + + "https://github.com/nf-core/test-datasets/raw/refs/heads/rnaseq/testdata/GSE110004/SRR6357071_2.fastq.gz", + strandedness: "reverse", + fasta: "https://github.com/nf-core/test-datasets/raw/refs/heads/rnaseq/reference/genome.fasta", + gtf: "https://github.com/nf-core/test-datasets/raw/refs/heads/rnaseq/reference/genes.gtf.gz", + additional_fasta: "https://github.com/nf-core/test-datasets/raw/refs/heads/rnaseq/reference/gfp.fa.gz", + transcript_fasta: "https://github.com/nf-core/test-datasets/raw/refs/heads/rnaseq/reference/transcriptome.fasta", + salmon_index: "https://github.com/nf-core/test-datasets/raw/refs/heads/rnaseq/reference/salmon.tar.gz", + publish_dir: "output/", + skip_deseq2_qc: true + ] + ]) + + | map { state -> [state.id, state] } + + | rnaseq.run( + fromState: { id, state -> state }, + toState: { id, output, state -> output } + ) + + | view { output -> + assert output.size() == 2 : "Outputs should contain two elements; [id, state]" + + // check id + def id = output[0] + assert id.endsWith("_test") + + // check output + def state = output[1] + assert state instanceof Map : "State should be a map. Found: ${state}" + assert state.containsKey("output_fasta") : "Output should contain key 'output_fasta'." + assert state.output_fasta.isFile() : "'output_fasta' should be a file." + assert state.containsKey("output_gtf") : "Output should contain key 'output_gtf'." + assert state.output_gtf.isFile() : "'output_gtf' should be a file." + + "Output: $output" + } +} diff --git a/src/workflows/utils/labels.config b/src/workflows/utils/labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/src/workflows/utils/labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/bbmap/bbmap_bbsplit/.config.vsh.yaml b/target/dependencies/vsh/vsh/biobox/main/nextflow/bbmap/bbmap_bbsplit/.config.vsh.yaml index 0a4f0f3..d115281 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/bbmap/bbmap_bbsplit/.config.vsh.yaml +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/bbmap/bbmap_bbsplit/.config.vsh.yaml @@ -368,9 +368,9 @@ build_info: output: "target/nextflow/bbmap/bbmap_bbsplit" executable: "target/nextflow/bbmap/bbmap_bbsplit/main.nf" viash_version: "0.9.0" - git_commit: "a13b57d04a3f3741eedd1af10fd96a9bee126f55" - git_remote: "https://x-access-token:ghs_xpDMoQpz4lF1RaGsMH4IlMbO48cLeW1cIYSF@github.com/viash-hub/biobox" - git_tag: "v0.2.0-26-ga13b57d" + git_commit: "952ff0843093b538cbfd6fefdecf2e7a0bc9e70b" + git_remote: "https://x-access-token:ghs_EwAUAMYJ0K4VBHlAEMs4ZP2OyQYqJM0PSfEO@github.com/viash-hub/biobox" + git_tag: "v0.2.0-27-g952ff08" package_config: name: "biobox" version: "main" diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/bbmap/bbmap_bbsplit/main.nf b/target/dependencies/vsh/vsh/biobox/main/nextflow/bbmap/bbmap_bbsplit/main.nf index dbf9c6e..be42fc5 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/bbmap/bbmap_bbsplit/main.nf +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/bbmap/bbmap_bbsplit/main.nf @@ -3220,9 +3220,9 @@ meta = [ "engine" : "docker|native", "output" : "target/nextflow/bbmap/bbmap_bbsplit", "viash_version" : "0.9.0", - "git_commit" : "a13b57d04a3f3741eedd1af10fd96a9bee126f55", - "git_remote" : "https://x-access-token:ghs_xpDMoQpz4lF1RaGsMH4IlMbO48cLeW1cIYSF@github.com/viash-hub/biobox", - "git_tag" : "v0.2.0-26-ga13b57d" + "git_commit" : "952ff0843093b538cbfd6fefdecf2e7a0bc9e70b", + "git_remote" : "https://x-access-token:ghs_EwAUAMYJ0K4VBHlAEMs4ZP2OyQYqJM0PSfEO@github.com/viash-hub/biobox", + "git_tag" : "v0.2.0-27-g952ff08" }, "package_config" : { "name" : "biobox", diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/bbmap/bbmap_bbsplit/nextflow_schema.json b/target/dependencies/vsh/vsh/biobox/main/nextflow/bbmap/bbmap_bbsplit/nextflow_schema.json index 1321e05..e33875e 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/bbmap/bbmap_bbsplit/nextflow_schema.json +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/bbmap/bbmap_bbsplit/nextflow_schema.json @@ -30,7 +30,7 @@ "description": "Type: `boolean_true`, default: `false`. Paired fastq files or not?", "help_text": "Type: `boolean_true`, default: `false`. Paired fastq files or not?" , - "default": "False" + "default":false } @@ -61,7 +61,7 @@ "description": "Type: `boolean_true`, default: `false`. If set, only builds the index", "help_text": "Type: `boolean_true`, default: `false`. If set, only builds the index. Otherwise, mapping is performed." , - "default": "False" + "default":false } @@ -92,7 +92,7 @@ "description": "Type: `boolean_true`, default: `false`. True forces paired/interleaved input; false forces single-ended mapping", "help_text": "Type: `boolean_true`, default: `false`. True forces paired/interleaved input; false forces single-ended mapping.\nIf not specified, interleaved status will be autodetected from read names.\n" , - "default": "False" + "default":false } @@ -169,7 +169,7 @@ "description": "Type: `boolean_true`, default: `false`. Undo trimming after mapping", "help_text": "Type: `boolean_true`, default: `false`. Undo trimming after mapping. Untrimmed bases will be soft-clipped in cigar strings." , - "default": "False" + "default":false } @@ -190,7 +190,7 @@ "description": "Type: `file`, default: `$id.$key.index.index`, example: `BBSplit_index`. Location to write the index", "help_text": "Type: `file`, default: `$id.$key.index.index`, example: `BBSplit_index`. Location to write the index.\n" , - "default": "$id.$key.index.index" + "default":"$id.$key.index.index" } @@ -201,7 +201,7 @@ "description": "Type: `file`, default: `$id.$key.fastq_1.fastq`, example: `read_out1.fastq`. Output file for read 1", "help_text": "Type: `file`, default: `$id.$key.fastq_1.fastq`, example: `read_out1.fastq`. Output file for read 1.\n" , - "default": "$id.$key.fastq_1.fastq" + "default":"$id.$key.fastq_1.fastq" } @@ -212,7 +212,7 @@ "description": "Type: `file`, default: `$id.$key.fastq_2.fastq`, example: `read_out2.fastq`. Output file for read 2", "help_text": "Type: `file`, default: `$id.$key.fastq_2.fastq`, example: `read_out2.fastq`. Output file for read 2.\n" , - "default": "$id.$key.fastq_2.fastq" + "default":"$id.$key.fastq_2.fastq" } @@ -223,7 +223,7 @@ "description": "Type: `file`, default: `$id.$key.sam2bam.sh`, example: `script.sh`. Write a shell script to \u0027file\u0027 that will turn the sam output into a sorted, indexed bam file", "help_text": "Type: `file`, default: `$id.$key.sam2bam.sh`, example: `script.sh`. Write a shell script to \u0027file\u0027 that will turn the sam output into a sorted, indexed bam file.\n" , - "default": "$id.$key.sam2bam.sh" + "default":"$id.$key.sam2bam.sh" } @@ -234,7 +234,7 @@ "description": "Type: `file`, default: `$id.$key.scafstats.txt`, example: `scaffold_stats.txt`. Write statistics on how many reads mapped to which scaffold to this file", "help_text": "Type: `file`, default: `$id.$key.scafstats.txt`, example: `scaffold_stats.txt`. Write statistics on how many reads mapped to which scaffold to this file.\n" , - "default": "$id.$key.scafstats.txt" + "default":"$id.$key.scafstats.txt" } @@ -245,7 +245,7 @@ "description": "Type: `file`, default: `$id.$key.refstats.txt`, example: `reference_stats.txt`. Write statistics on how many reads were assigned to which reference to this file", "help_text": "Type: `file`, default: `$id.$key.refstats.txt`, example: `reference_stats.txt`. Write statistics on how many reads were assigned to which reference to this file.\nUnmapped reads whose mate mapped to a reference are considered assigned and will be counted.\n" , - "default": "$id.$key.refstats.txt" + "default":"$id.$key.refstats.txt" } @@ -256,7 +256,7 @@ "description": "Type: `boolean_true`, default: `false`. Only print lines with nonzero coverage", "help_text": "Type: `boolean_true`, default: `false`. Only print lines with nonzero coverage." , - "default": "False" + "default":false } diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/bedtools/bedtools_genomecov/.config.vsh.yaml b/target/dependencies/vsh/vsh/biobox/main/nextflow/bedtools/bedtools_genomecov/.config.vsh.yaml index 8b9438c..49a48c4 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/bedtools/bedtools_genomecov/.config.vsh.yaml +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/bedtools/bedtools_genomecov/.config.vsh.yaml @@ -337,9 +337,9 @@ build_info: output: "target/nextflow/bedtools/bedtools_genomecov" executable: "target/nextflow/bedtools/bedtools_genomecov/main.nf" viash_version: "0.9.0" - git_commit: "a13b57d04a3f3741eedd1af10fd96a9bee126f55" - git_remote: "https://x-access-token:ghs_xpDMoQpz4lF1RaGsMH4IlMbO48cLeW1cIYSF@github.com/viash-hub/biobox" - git_tag: "v0.2.0-26-ga13b57d" + git_commit: "952ff0843093b538cbfd6fefdecf2e7a0bc9e70b" + git_remote: "https://x-access-token:ghs_EwAUAMYJ0K4VBHlAEMs4ZP2OyQYqJM0PSfEO@github.com/viash-hub/biobox" + git_tag: "v0.2.0-27-g952ff08" package_config: name: "biobox" version: "main" diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/bedtools/bedtools_genomecov/main.nf b/target/dependencies/vsh/vsh/biobox/main/nextflow/bedtools/bedtools_genomecov/main.nf index 29f1f47..ff93428 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/bedtools/bedtools_genomecov/main.nf +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/bedtools/bedtools_genomecov/main.nf @@ -3207,9 +3207,9 @@ meta = [ "engine" : "docker|native", "output" : "target/nextflow/bedtools/bedtools_genomecov", "viash_version" : "0.9.0", - "git_commit" : "a13b57d04a3f3741eedd1af10fd96a9bee126f55", - "git_remote" : "https://x-access-token:ghs_xpDMoQpz4lF1RaGsMH4IlMbO48cLeW1cIYSF@github.com/viash-hub/biobox", - "git_tag" : "v0.2.0-26-ga13b57d" + "git_commit" : "952ff0843093b538cbfd6fefdecf2e7a0bc9e70b", + "git_remote" : "https://x-access-token:ghs_EwAUAMYJ0K4VBHlAEMs4ZP2OyQYqJM0PSfEO@github.com/viash-hub/biobox", + "git_tag" : "v0.2.0-27-g952ff08" }, "package_config" : { "name" : "biobox", diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/bedtools/bedtools_genomecov/nextflow_schema.json b/target/dependencies/vsh/vsh/biobox/main/nextflow/bedtools/bedtools_genomecov/nextflow_schema.json index 3e0bb4b..292d251 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/bedtools/bedtools_genomecov/nextflow_schema.json +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/bedtools/bedtools_genomecov/nextflow_schema.json @@ -60,7 +60,7 @@ "description": "Type: `file`, required, default: `$id.$key.output.bed`, example: `output.bed`. The output BED file", "help_text": "Type: `file`, required, default: `$id.$key.output.bed`, example: `output.bed`. The output BED file. \n" , - "default": "$id.$key.output.bed" + "default":"$id.$key.output.bed" } @@ -81,7 +81,7 @@ "description": "Type: `boolean_true`, default: `false`. Report the depth at each genome position (with one-based coordinates)", "help_text": "Type: `boolean_true`, default: `false`. Report the depth at each genome position (with one-based coordinates).\nDefault behavior is to report a histogram.\n" , - "default": "False" + "default":false } @@ -92,7 +92,7 @@ "description": "Type: `boolean_true`, default: `false`. Report the depth at each genome position (with zero-based coordinates)", "help_text": "Type: `boolean_true`, default: `false`. Report the depth at each genome position (with zero-based coordinates).\nReports only non-zero positions.\nDefault behavior is to report a histogram.\n" , - "default": "False" + "default":false } @@ -103,7 +103,7 @@ "description": "Type: `boolean_true`, default: `false`. Report depth in BedGraph format", "help_text": "Type: `boolean_true`, default: `false`. Report depth in BedGraph format. For details, see:\ngenome.ucsc.edu/goldenPath/help/bedgraph.html\n" , - "default": "False" + "default":false } @@ -114,7 +114,7 @@ "description": "Type: `boolean_true`, default: `false`. Report depth in BedGraph format, as above (-bg)", "help_text": "Type: `boolean_true`, default: `false`. Report depth in BedGraph format, as above (-bg).\nHowever with this option, regions with zero \ncoverage are also reported. This allows one to\nquickly extract all regions of a genome with 0 \ncoverage by applying: \"grep -w 0$\" to the output.\n" , - "default": "False" + "default":false } @@ -125,7 +125,7 @@ "description": "Type: `boolean_true`, default: `false`. Treat \"split\" BAM or BED12 entries as distinct BED intervals", "help_text": "Type: `boolean_true`, default: `false`. Treat \"split\" BAM or BED12 entries as distinct BED intervals.\nwhen computing coverage.\nFor BAM files, this uses the CIGAR \"N\" and \"D\" operations \nto infer the blocks for computing coverage.\nFor BED12 files, this uses the BlockCount, BlockStarts, and BlockEnds\nfields (i.e., columns 10,11,12).\n" , - "default": "False" + "default":false } @@ -136,7 +136,7 @@ "description": "Type: `boolean_true`, default: `false`. Ignore local deletions (CIGAR \"D\" operations) in BAM entries\nwhen computing coverage", "help_text": "Type: `boolean_true`, default: `false`. Ignore local deletions (CIGAR \"D\" operations) in BAM entries\nwhen computing coverage.\n" , - "default": "False" + "default":false } @@ -159,7 +159,7 @@ "description": "Type: `boolean_true`, default: `false`. Calculate coverage of pair-end fragments", "help_text": "Type: `boolean_true`, default: `false`. Calculate coverage of pair-end fragments.\nWorks for BAM files only\n" , - "default": "False" + "default":false } @@ -170,7 +170,7 @@ "description": "Type: `boolean_true`, default: `false`. Force to use provided fragment size instead of read length\nWorks for BAM files only\n", "help_text": "Type: `boolean_true`, default: `false`. Force to use provided fragment size instead of read length\nWorks for BAM files only\n" , - "default": "False" + "default":false } @@ -181,7 +181,7 @@ "description": "Type: `boolean_true`, default: `false`. Change strand af the mate read (so both reads from the same strand) useful for strand specific\nWorks for BAM files only\n", "help_text": "Type: `boolean_true`, default: `false`. Change strand af the mate read (so both reads from the same strand) useful for strand specific\nWorks for BAM files only\n" , - "default": "False" + "default":false } @@ -192,7 +192,7 @@ "description": "Type: `boolean_true`, default: `false`. Calculate coverage of 5\" positions (instead of entire interval)", "help_text": "Type: `boolean_true`, default: `false`. Calculate coverage of 5\" positions (instead of entire interval).\n" , - "default": "False" + "default":false } @@ -203,7 +203,7 @@ "description": "Type: `boolean_true`, default: `false`. Calculate coverage of 3\" positions (instead of entire interval)", "help_text": "Type: `boolean_true`, default: `false`. Calculate coverage of 3\" positions (instead of entire interval).\n" , - "default": "False" + "default":false } @@ -234,7 +234,7 @@ "description": "Type: `boolean_true`, default: `false`. Adds a UCSC/Genome-Browser track line definition in the first line of the output", "help_text": "Type: `boolean_true`, default: `false`. Adds a UCSC/Genome-Browser track line definition in the first line of the output.\n- See here for more details about track line definition:\n http://genome.ucsc.edu/goldenPath/help/bedgraph.html\n- NOTE: When adding a trackline definition, the output BedGraph can be easily\n uploaded to the Genome Browser as a custom track,\n BUT CAN NOT be converted into a BigWig file (w/o removing the first line).\n" , - "default": "False" + "default":false } diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/fastp/.config.vsh.yaml b/target/dependencies/vsh/vsh/biobox/main/nextflow/fastp/.config.vsh.yaml index b114c3b..14c8381 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/fastp/.config.vsh.yaml +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/fastp/.config.vsh.yaml @@ -1083,9 +1083,9 @@ build_info: output: "target/nextflow/fastp" executable: "target/nextflow/fastp/main.nf" viash_version: "0.9.0" - git_commit: "a13b57d04a3f3741eedd1af10fd96a9bee126f55" - git_remote: "https://x-access-token:ghs_xpDMoQpz4lF1RaGsMH4IlMbO48cLeW1cIYSF@github.com/viash-hub/biobox" - git_tag: "v0.2.0-26-ga13b57d" + git_commit: "952ff0843093b538cbfd6fefdecf2e7a0bc9e70b" + git_remote: "https://x-access-token:ghs_EwAUAMYJ0K4VBHlAEMs4ZP2OyQYqJM0PSfEO@github.com/viash-hub/biobox" + git_tag: "v0.2.0-27-g952ff08" package_config: name: "biobox" version: "main" diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/fastp/main.nf b/target/dependencies/vsh/vsh/biobox/main/nextflow/fastp/main.nf index 9075708..b3df043 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/fastp/main.nf +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/fastp/main.nf @@ -4023,9 +4023,9 @@ meta = [ "engine" : "docker|native", "output" : "target/nextflow/fastp", "viash_version" : "0.9.0", - "git_commit" : "a13b57d04a3f3741eedd1af10fd96a9bee126f55", - "git_remote" : "https://x-access-token:ghs_xpDMoQpz4lF1RaGsMH4IlMbO48cLeW1cIYSF@github.com/viash-hub/biobox", - "git_tag" : "v0.2.0-26-ga13b57d" + "git_commit" : "952ff0843093b538cbfd6fefdecf2e7a0bc9e70b", + "git_remote" : "https://x-access-token:ghs_EwAUAMYJ0K4VBHlAEMs4ZP2OyQYqJM0PSfEO@github.com/viash-hub/biobox", + "git_tag" : "v0.2.0-27-g952ff08" }, "package_config" : { "name" : "biobox", diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/fastp/nextflow_schema.json b/target/dependencies/vsh/vsh/biobox/main/nextflow/fastp/nextflow_schema.json index bbeb733..bbc0c53 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/fastp/nextflow_schema.json +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/fastp/nextflow_schema.json @@ -50,7 +50,7 @@ "description": "Type: `file`, required, default: `$id.$key.out1.gz`, example: `out.R1.fq.gz`. The single-end or paired-end R1 reads that pass QC", "help_text": "Type: `file`, required, default: `$id.$key.out1.gz`, example: `out.R1.fq.gz`. The single-end or paired-end R1 reads that pass QC. Will be gzipped if its file name ends with `.gz`." , - "default": "$id.$key.out1.gz" + "default":"$id.$key.out1.gz" } @@ -61,7 +61,7 @@ "description": "Type: `file`, default: `$id.$key.out2.gz`, example: `out.R2.fq.gz`. The paired-end R2 reads that pass QC", "help_text": "Type: `file`, default: `$id.$key.out2.gz`, example: `out.R2.fq.gz`. The paired-end R2 reads that pass QC. Will be gzipped if its file name ends with `.gz`." , - "default": "$id.$key.out2.gz" + "default":"$id.$key.out2.gz" } @@ -72,7 +72,7 @@ "description": "Type: `file`, default: `$id.$key.unpaired1.gz`, example: `unpaired.R1.fq.gz`. Store the reads that `read1` passes filters but its paired `read2` doesn\u0027t", "help_text": "Type: `file`, default: `$id.$key.unpaired1.gz`, example: `unpaired.R1.fq.gz`. Store the reads that `read1` passes filters but its paired `read2` doesn\u0027t." , - "default": "$id.$key.unpaired1.gz" + "default":"$id.$key.unpaired1.gz" } @@ -83,7 +83,7 @@ "description": "Type: `file`, default: `$id.$key.unpaired2.gz`, example: `unpaired.R2.fq.gz`. Store the reads that `read2` passes filters but its paired `read1` doesn\u0027t", "help_text": "Type: `file`, default: `$id.$key.unpaired2.gz`, example: `unpaired.R2.fq.gz`. Store the reads that `read2` passes filters but its paired `read1` doesn\u0027t." , - "default": "$id.$key.unpaired2.gz" + "default":"$id.$key.unpaired2.gz" } @@ -94,7 +94,7 @@ "description": "Type: `file`, default: `$id.$key.failed_out.gz`, example: `failed.fq.gz`. Store the reads that fail filters", "help_text": "Type: `file`, default: `$id.$key.failed_out.gz`, example: `failed.fq.gz`. Store the reads that fail filters.\n\nIf one read failed and is written to --failed_out, its failure reason will be appended to its read name. For example, failed_quality_filter, failed_too_short etc.\nFor PE data, if unpaired reads are not stored (by giving --unpaired1 or --unpaired2), the failed pair of reads will be put together. If one read passes the filters but its pair doesn\u0027t, the failure reason will be paired_read_is_failing.\n" , - "default": "$id.$key.failed_out.gz" + "default":"$id.$key.failed_out.gz" } @@ -105,7 +105,7 @@ "description": "Type: `file`, default: `$id.$key.overlapped_out.overlapped_out`. For each read pair, output the overlapped region if it has no any mismatched base", "help_text": "Type: `file`, default: `$id.$key.overlapped_out.overlapped_out`. For each read pair, output the overlapped region if it has no any mismatched base.\n" , - "default": "$id.$key.overlapped_out.overlapped_out" + "default":"$id.$key.overlapped_out.overlapped_out" } @@ -126,7 +126,7 @@ "description": "Type: `file`, default: `$id.$key.json.json`, example: `out.json`. The json format report file name\n", "help_text": "Type: `file`, default: `$id.$key.json.json`, example: `out.json`. The json format report file name\n" , - "default": "$id.$key.json.json" + "default":"$id.$key.json.json" } @@ -137,7 +137,7 @@ "description": "Type: `file`, default: `$id.$key.html.html`, example: `out.html`. The html format report file name\n", "help_text": "Type: `file`, default: `$id.$key.html.html`, example: `out.html`. The html format report file name\n" , - "default": "$id.$key.html.html" + "default":"$id.$key.html.html" } @@ -168,7 +168,7 @@ "description": "Type: `boolean_true`, default: `false`. Disable adapter trimming", "help_text": "Type: `boolean_true`, default: `false`. Disable adapter trimming.\n" , - "default": "False" + "default":false } @@ -179,7 +179,7 @@ "description": "Type: `boolean_true`, default: `false`. By default, the auto-detection for adapter is for SE data input only, turn on this option to enable it for PE data", "help_text": "Type: `boolean_true`, default: `false`. By default, the auto-detection for adapter is for SE data input only, turn on this option to enable it for PE data.\n" , - "default": "False" + "default":false } @@ -300,7 +300,7 @@ "description": "Type: `boolean_true`, default: `false`. For paired-end input, merge each pair of reads into a single read if they are overlapped", "help_text": "Type: `boolean_true`, default: `false`. For paired-end input, merge each pair of reads into a single read if they are overlapped. The merged reads will be written to the file given by --merged_out, the unmerged reads will be written to the files specified by --out1 and --out2. The merging mode is disabled by default.\n" , - "default": "False" + "default":false } @@ -311,7 +311,7 @@ "description": "Type: `file`, default: `$id.$key.merged_out.gz`, example: `merged.fq.gz`. In the merging mode, specify the file name to store merged output, or specify --stdout to stream the merged output", "help_text": "Type: `file`, default: `$id.$key.merged_out.gz`, example: `merged.fq.gz`. In the merging mode, specify the file name to store merged output, or specify --stdout to stream the merged output.\n" , - "default": "$id.$key.merged_out.gz" + "default":"$id.$key.merged_out.gz" } @@ -322,7 +322,7 @@ "description": "Type: `boolean_true`, default: `false`. In the merging mode, write the unmerged or unpaired reads to the file specified by --merge", "help_text": "Type: `boolean_true`, default: `false`. In the merging mode, write the unmerged or unpaired reads to the file specified by --merge. Disabled by default.\n" , - "default": "False" + "default":false } @@ -343,7 +343,7 @@ "description": "Type: `boolean_true`, default: `false`. Indicate that \u003cin1\u003e is an interleaved FASTQ which contains both read1 and read2", "help_text": "Type: `boolean_true`, default: `false`. Indicate that \u003cin1\u003e is an interleaved FASTQ which contains both read1 and read2. Disabled by default.\n" , - "default": "False" + "default":false } @@ -354,7 +354,7 @@ "description": "Type: `boolean_true`, default: `false`. The MGI FASTQ ID format is not compatible with many BAM operation tools, enable this option to fix it", "help_text": "Type: `boolean_true`, default: `false`. The MGI FASTQ ID format is not compatible with many BAM operation tools, enable this option to fix it.\n" , - "default": "False" + "default":false } @@ -365,7 +365,7 @@ "description": "Type: `boolean_true`, default: `false`. Indicate the input is using phred64 scoring (it\u0027ll be converted to phred33, so the output will still be phred33)\n", "help_text": "Type: `boolean_true`, default: `false`. Indicate the input is using phred64 scoring (it\u0027ll be converted to phred33, so the output will still be phred33)\n" , - "default": "False" + "default":false } @@ -396,7 +396,7 @@ "description": "Type: `boolean_true`, default: `false`. Don\u0027t overwrite existing files", "help_text": "Type: `boolean_true`, default: `false`. Don\u0027t overwrite existing files. Overwritting is allowed by default.\n" , - "default": "False" + "default":false } @@ -417,7 +417,7 @@ "description": "Type: `boolean_true`, default: `false`. Output verbose log information (i", "help_text": "Type: `boolean_true`, default: `false`. Output verbose log information (i.e. when every 1M reads are processed)." , - "default": "False" + "default":false } @@ -458,7 +458,7 @@ "description": "Type: `boolean_true`, default: `false`. Enable deduplication to drop the duplicated reads/pairs\n", "help_text": "Type: `boolean_true`, default: `false`. Enable deduplication to drop the duplicated reads/pairs\n" , - "default": "False" + "default":false } @@ -479,7 +479,7 @@ "description": "Type: `boolean_true`, default: `false`. Don\u0027t evaluate duplication rate to save time and use less memory", "help_text": "Type: `boolean_true`, default: `false`. Don\u0027t evaluate duplication rate to save time and use less memory.\n" , - "default": "False" + "default":false } @@ -500,7 +500,7 @@ "description": "Type: `boolean_true`, default: `false`. Force polyG tail trimming, by default trimming is automatically enabled for Illumina NextSeq/NovaSeq data\n", "help_text": "Type: `boolean_true`, default: `false`. Force polyG tail trimming, by default trimming is automatically enabled for Illumina NextSeq/NovaSeq data\n" , - "default": "False" + "default":false } @@ -521,7 +521,7 @@ "description": "Type: `boolean_true`, default: `false`. Disable polyG tail trimming, by default trimming is automatically enabled for Illumina NextSeq/NovaSeq data\n", "help_text": "Type: `boolean_true`, default: `false`. Disable polyG tail trimming, by default trimming is automatically enabled for Illumina NextSeq/NovaSeq data\n" , - "default": "False" + "default":false } @@ -542,7 +542,7 @@ "description": "Type: `boolean_true`, default: `false`. Enable polyX trimming in 3\u0027 ends", "help_text": "Type: `boolean_true`, default: `false`. Enable polyX trimming in 3\u0027 ends.\n" , - "default": "False" + "default":false } @@ -693,7 +693,7 @@ "description": "Type: `boolean_true`, default: `false`. Quality filtering is enabled by default", "help_text": "Type: `boolean_true`, default: `false`. Quality filtering is enabled by default. If this option is specified, quality filtering is disabled.\n" , - "default": "False" + "default":false } @@ -754,7 +754,7 @@ "description": "Type: `boolean_true`, default: `false`. Length filtering is enabled by default", "help_text": "Type: `boolean_true`, default: `false`. Length filtering is enabled by default. If this option is specified, length filtering is disabled.\n" , - "default": "False" + "default":false } @@ -795,7 +795,7 @@ "description": "Type: `boolean_true`, default: `false`. Enable low complexity filter", "help_text": "Type: `boolean_true`, default: `false`. Enable low complexity filter. The complexity is defined as the percentage of base that is different from its next base (base[i] != base[i+1]).\n" , - "default": "False" + "default":false } @@ -866,7 +866,7 @@ "description": "Type: `boolean_true`, default: `false`. Enable base correction in overlapped regions (only for PE data), default is disabled", "help_text": "Type: `boolean_true`, default: `false`. Enable base correction in overlapped regions (only for PE data), default is disabled.\n" , - "default": "False" + "default":false } @@ -917,7 +917,7 @@ "description": "Type: `boolean_true`, default: `false`. Enable unique molecular identifier (UMI) preprocessing", "help_text": "Type: `boolean_true`, default: `false`. Enable unique molecular identifier (UMI) preprocessing.\n" , - "default": "False" + "default":false } @@ -990,7 +990,7 @@ "description": "Type: `boolean_true`, default: `false`. Enable overrepresentation analysis", "help_text": "Type: `boolean_true`, default: `false`. Enable overrepresentation analysis.\n" , - "default": "False" + "default":false } diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/fastqc/.config.vsh.yaml b/target/dependencies/vsh/vsh/biobox/main/nextflow/fastqc/.config.vsh.yaml index 04db226..fdd4416 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/fastqc/.config.vsh.yaml +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/fastqc/.config.vsh.yaml @@ -340,9 +340,9 @@ build_info: output: "target/nextflow/fastqc" executable: "target/nextflow/fastqc/main.nf" viash_version: "0.9.0" - git_commit: "a13b57d04a3f3741eedd1af10fd96a9bee126f55" - git_remote: "https://x-access-token:ghs_xpDMoQpz4lF1RaGsMH4IlMbO48cLeW1cIYSF@github.com/viash-hub/biobox" - git_tag: "v0.2.0-26-ga13b57d" + git_commit: "952ff0843093b538cbfd6fefdecf2e7a0bc9e70b" + git_remote: "https://x-access-token:ghs_EwAUAMYJ0K4VBHlAEMs4ZP2OyQYqJM0PSfEO@github.com/viash-hub/biobox" + git_tag: "v0.2.0-27-g952ff08" package_config: name: "biobox" version: "main" diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/fastqc/main.nf b/target/dependencies/vsh/vsh/biobox/main/nextflow/fastqc/main.nf index 39ed05c..221b751 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/fastqc/main.nf +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/fastqc/main.nf @@ -3182,9 +3182,9 @@ meta = [ "engine" : "docker|native", "output" : "target/nextflow/fastqc", "viash_version" : "0.9.0", - "git_commit" : "a13b57d04a3f3741eedd1af10fd96a9bee126f55", - "git_remote" : "https://x-access-token:ghs_xpDMoQpz4lF1RaGsMH4IlMbO48cLeW1cIYSF@github.com/viash-hub/biobox", - "git_tag" : "v0.2.0-26-ga13b57d" + "git_commit" : "952ff0843093b538cbfd6fefdecf2e7a0bc9e70b", + "git_remote" : "https://x-access-token:ghs_EwAUAMYJ0K4VBHlAEMs4ZP2OyQYqJM0PSfEO@github.com/viash-hub/biobox", + "git_tag" : "v0.2.0-27-g952ff08" }, "package_config" : { "name" : "biobox", diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/fastqc/nextflow_schema.json b/target/dependencies/vsh/vsh/biobox/main/nextflow/fastqc/nextflow_schema.json index 75ac399..b85804c 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/fastqc/nextflow_schema.json +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/fastqc/nextflow_schema.json @@ -40,7 +40,7 @@ "description": "Type: List of `file`, default: `$id.$key.html_*.html`, example: `*.html`, multiple_sep: `\";\"`. Create the HTML report of the results", "help_text": "Type: List of `file`, default: `$id.$key.html_*.html`, example: `*.html`, multiple_sep: `\";\"`. Create the HTML report of the results. \n\u0027*\u0027 wild card must be provided in the output file name. \nWild card will be replaced by the input file basename.\ne.g. \n --input \"sample_1.fq\"\n --html \"*.html\"\n would create an output html file named sample_1.html\n" , - "default": "$id.$key.html_*.html" + "default":"$id.$key.html_*.html" } @@ -51,7 +51,7 @@ "description": "Type: List of `file`, default: `$id.$key.zip_*.zip`, example: `*.zip`, multiple_sep: `\";\"`. Create the zip file(s) containing: html report, data, images, icons, summary, etc", "help_text": "Type: List of `file`, default: `$id.$key.zip_*.zip`, example: `*.zip`, multiple_sep: `\";\"`. Create the zip file(s) containing: html report, data, images, icons, summary, etc.\n\u0027*\u0027 wild card must be provided in the output file name.\nWild card will be replaced by the input basename.\ne.g. \n --input \"sample_1.fq\"\n --html \"*.zip\"\n would create an output zip file named sample_1.zip\n" , - "default": "$id.$key.zip_*.zip" + "default":"$id.$key.zip_*.zip" } @@ -62,7 +62,7 @@ "description": "Type: List of `file`, default: `$id.$key.summary_*.txt`, example: `*_summary.txt`, multiple_sep: `\";\"`. Create the summary file(s)", "help_text": "Type: List of `file`, default: `$id.$key.summary_*.txt`, example: `*_summary.txt`, multiple_sep: `\";\"`. Create the summary file(s).\n\u0027*\u0027 wild card must be provided in the output file name.\nWild card will be replaced by the input basename.\ne.g. \n --input \"sample_1.fq\"\n --summary \"*_summary.txt\"\n would create an output summary.txt file named sample_1_summary.txt\n" , - "default": "$id.$key.summary_*.txt" + "default":"$id.$key.summary_*.txt" } @@ -73,7 +73,7 @@ "description": "Type: List of `file`, default: `$id.$key.data_*.txt`, example: `*_data.txt`, multiple_sep: `\";\"`. Create the data file(s)", "help_text": "Type: List of `file`, default: `$id.$key.data_*.txt`, example: `*_data.txt`, multiple_sep: `\";\"`. Create the data file(s).\n\u0027*\u0027 wild card must be provided in the output file name.\nWild card will be replaced by the input basename.\ne.g. \n --input \"sample_1.fq\"\n --summary \"*_data.txt\"\n would create an output data.txt file named sample_1_data.txt\n" , - "default": "$id.$key.data_*.txt" + "default":"$id.$key.data_*.txt" } @@ -94,7 +94,7 @@ "description": "Type: `boolean_true`, default: `false`. Files come from raw casava output", "help_text": "Type: `boolean_true`, default: `false`. Files come from raw casava output. Files in the same sample\ngroup (differing only by the group number) will be analysed\nas a set rather than individually. Sequences with the filter\nflag set in the header will be excluded from the analysis.\nFiles must have the same names given to them by casava\n(including being gzipped and ending with .gz) otherwise they\nwon\u0027t be grouped together correctly.\n" , - "default": "False" + "default":false } @@ -105,7 +105,7 @@ "description": "Type: `boolean_true`, default: `false`. Files come from nanopore sequences and are in fast5 format", "help_text": "Type: `boolean_true`, default: `false`. Files come from nanopore sequences and are in fast5 format. In\nthis mode you can pass in directories to process and the program\nwill take in all fast5 files within those directories and produce\na single output file from the sequences found in all files.\n" , - "default": "False" + "default":false } @@ -116,7 +116,7 @@ "description": "Type: `boolean_true`, default: `false`. If running with --casava then don\u0027t remove read flagged by\ncasava as poor quality when performing the QC analysis", "help_text": "Type: `boolean_true`, default: `false`. If running with --casava then don\u0027t remove read flagged by\ncasava as poor quality when performing the QC analysis.\n" , - "default": "False" + "default":false } @@ -127,7 +127,7 @@ "description": "Type: `boolean_true`, default: `false`. Disable grouping of bases for reads \u003e50bp", "help_text": "Type: `boolean_true`, default: `false`. Disable grouping of bases for reads \u003e50bp. \nAll reports will show data for every base in the read. \nWARNING: Using this option will cause fastqc to crash \nand burn if you use it on really long reads, and your \nplots may end up a ridiculous size. You have been warned!\n" , - "default": "False" + "default":false } @@ -198,7 +198,7 @@ "description": "Type: `boolean_true`, default: `false`. Suppress all progress messages on stdout and only report errors", "help_text": "Type: `boolean_true`, default: `false`. Suppress all progress messages on stdout and only report errors.\n" , - "default": "False" + "default":false } diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/featurecounts/.config.vsh.yaml b/target/dependencies/vsh/vsh/biobox/main/nextflow/featurecounts/.config.vsh.yaml index 37865fe..f59e1f1 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/featurecounts/.config.vsh.yaml +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/featurecounts/.config.vsh.yaml @@ -645,9 +645,9 @@ build_info: output: "target/nextflow/featurecounts" executable: "target/nextflow/featurecounts/main.nf" viash_version: "0.9.0" - git_commit: "a13b57d04a3f3741eedd1af10fd96a9bee126f55" - git_remote: "https://x-access-token:ghs_xpDMoQpz4lF1RaGsMH4IlMbO48cLeW1cIYSF@github.com/viash-hub/biobox" - git_tag: "v0.2.0-26-ga13b57d" + git_commit: "952ff0843093b538cbfd6fefdecf2e7a0bc9e70b" + git_remote: "https://x-access-token:ghs_EwAUAMYJ0K4VBHlAEMs4ZP2OyQYqJM0PSfEO@github.com/viash-hub/biobox" + git_tag: "v0.2.0-27-g952ff08" package_config: name: "biobox" version: "main" diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/featurecounts/main.nf b/target/dependencies/vsh/vsh/biobox/main/nextflow/featurecounts/main.nf index 6db06cc..d9852f3 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/featurecounts/main.nf +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/featurecounts/main.nf @@ -3549,9 +3549,9 @@ meta = [ "engine" : "docker|native", "output" : "target/nextflow/featurecounts", "viash_version" : "0.9.0", - "git_commit" : "a13b57d04a3f3741eedd1af10fd96a9bee126f55", - "git_remote" : "https://x-access-token:ghs_xpDMoQpz4lF1RaGsMH4IlMbO48cLeW1cIYSF@github.com/viash-hub/biobox", - "git_tag" : "v0.2.0-26-ga13b57d" + "git_commit" : "952ff0843093b538cbfd6fefdecf2e7a0bc9e70b", + "git_remote" : "https://x-access-token:ghs_EwAUAMYJ0K4VBHlAEMs4ZP2OyQYqJM0PSfEO@github.com/viash-hub/biobox", + "git_tag" : "v0.2.0-27-g952ff08" }, "package_config" : { "name" : "biobox", diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/featurecounts/nextflow_schema.json b/target/dependencies/vsh/vsh/biobox/main/nextflow/featurecounts/nextflow_schema.json index d55c22d..8b277f2 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/featurecounts/nextflow_schema.json +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/featurecounts/nextflow_schema.json @@ -50,7 +50,7 @@ "description": "Type: `file`, required, default: `$id.$key.counts.tsv`, example: `features.tsv`. Name of output file including read counts in tab delimited format", "help_text": "Type: `file`, required, default: `$id.$key.counts.tsv`, example: `features.tsv`. Name of output file including read counts in tab delimited format.\n" , - "default": "$id.$key.counts.tsv" + "default":"$id.$key.counts.tsv" } @@ -61,7 +61,7 @@ "description": "Type: `file`, default: `$id.$key.summary.tsv`, example: `summary.tsv`. Summary statistics of counting results in tab delimited format", "help_text": "Type: `file`, default: `$id.$key.summary.tsv`, example: `summary.tsv`. Summary statistics of counting results in tab delimited format.\n" , - "default": "$id.$key.summary.tsv" + "default":"$id.$key.summary.tsv" } @@ -72,7 +72,7 @@ "description": "Type: `file`, default: `$id.$key.junctions.txt`, example: `junctions.txt`. Count number of reads supporting each exon-exon junction", "help_text": "Type: `file`, default: `$id.$key.junctions.txt`, example: `junctions.txt`. Count number of reads supporting each exon-exon junction. Junctions were identified from those exon-spanning reads in the input (containing \u0027N\u0027 in CIGAR string).\n" , - "default": "$id.$key.junctions.txt" + "default":"$id.$key.junctions.txt" } @@ -155,7 +155,7 @@ "description": "Type: `boolean_true`, default: `false`. Perform read counting at feature level (eg", "help_text": "Type: `boolean_true`, default: `false`. Perform read counting at feature level (eg. counting reads for exons rather than genes).\n" , - "default": "False" + "default":false } @@ -176,7 +176,7 @@ "description": "Type: `boolean_true`, default: `false`. Assign reads to all their overlapping meta-features (or features if \u0027--feature_level\u0027 is specified)", "help_text": "Type: `boolean_true`, default: `false`. Assign reads to all their overlapping meta-features (or features if \u0027--feature_level\u0027 is specified).\n" , - "default": "False" + "default":false } @@ -217,7 +217,7 @@ "description": "Type: `boolean_true`, default: `false`. Assign reads to a meta-feature/feature that has the largest number of overlapping bases", "help_text": "Type: `boolean_true`, default: `false`. Assign reads to a meta-feature/feature that has the largest number of overlapping bases.\n" , - "default": "False" + "default":false } @@ -290,7 +290,7 @@ "description": "Type: `boolean_true`, default: `false`. Multi-mapping reads will also be counted", "help_text": "Type: `boolean_true`, default: `false`. Multi-mapping reads will also be counted. For a multi-mapping read, all its reported alignments will be counted. The \u0027NH\u0027 tag in BAM/SAM input is used to detect multi-mapping reads.\n" , - "default": "False" + "default":false } @@ -311,7 +311,7 @@ "description": "Type: `boolean_true`, default: `false`. Assign fractional counts to features", "help_text": "Type: `boolean_true`, default: `false`. Assign fractional counts to features. This option must be used together with \u0027--multi_mapping\u0027 or \u0027--overlapping\u0027 or both. When \u0027--multi_mapping\u0027 is specified, each reported alignment from a multi-mapping read (identified via \u0027NH\u0027 tag) will carry a fractional count of 1/x, instead of 1 (one), where x is the total number of alignments reported for the same read. When \u0027--overlapping\u0027 is specified, each overlapping feature will receive a fractional count of 1/y, where y is the total number of features overlapping with the read. When both \u0027--multi_mapping\u0027 and \u0027--overlapping\u0027 are specified, each alignment will carry a fractional count of 1/(x*y).\n" , - "default": "False" + "default":false } @@ -342,7 +342,7 @@ "description": "Type: `boolean_true`, default: `false`. Count split alignments only (ie", "help_text": "Type: `boolean_true`, default: `false`. Count split alignments only (ie. alignments with CIGAR string containing \u0027N\u0027). An example of split alignments is exon-spanning reads in RNA-seq data.\n" , - "default": "False" + "default":false } @@ -353,7 +353,7 @@ "description": "Type: `boolean_true`, default: `false`. If specified, only non-split alignments (CIGAR strings do not contain letter \u0027N\u0027) will be counted", "help_text": "Type: `boolean_true`, default: `false`. If specified, only non-split alignments (CIGAR strings do not contain letter \u0027N\u0027) will be counted. All the other alignments will be ignored.\n" , - "default": "False" + "default":false } @@ -364,7 +364,7 @@ "description": "Type: `boolean_true`, default: `false`. Count primary alignments only", "help_text": "Type: `boolean_true`, default: `false`. Count primary alignments only. Primary alignments are identified using bit 0x100 in SAM/BAM FLAG field.\n" , - "default": "False" + "default":false } @@ -375,7 +375,7 @@ "description": "Type: `boolean_true`, default: `false`. Ignore duplicate reads in read counting", "help_text": "Type: `boolean_true`, default: `false`. Ignore duplicate reads in read counting. Duplicate reads are identified using bit Ox400 in BAM/SAM FLAG field. The whole read pair is ignored if one of the reads is a duplicate read for paired end data.\n" , - "default": "False" + "default":false } @@ -438,7 +438,7 @@ "description": "Type: `boolean_true`, default: `false`. Specify that input data contain paired-end reads", "help_text": "Type: `boolean_true`, default: `false`. Specify that input data contain paired-end reads. To perform fragment counting (ie. counting read pairs), the \u0027--countReadPairs\u0027 parameter should also be specified in addition to this parameter.\n" , - "default": "False" + "default":false } @@ -449,7 +449,7 @@ "description": "Type: `boolean_true`, default: `false`. Count read pairs (fragments) instead of reads", "help_text": "Type: `boolean_true`, default: `false`. Count read pairs (fragments) instead of reads. This option is only applicable for paired-end reads.\n" , - "default": "False" + "default":false } @@ -460,7 +460,7 @@ "description": "Type: `boolean_true`, default: `false`. Count read pairs (fragments) instead of reads", "help_text": "Type: `boolean_true`, default: `false`. Count read pairs (fragments) instead of reads. This option is only applicable for paired-end reads.\n" , - "default": "False" + "default":false } @@ -471,7 +471,7 @@ "description": "Type: `boolean_true`, default: `false`. Check validity of paired-end distance when counting read pairs", "help_text": "Type: `boolean_true`, default: `false`. Check validity of paired-end distance when counting read pairs. Use \u0027--min_length\u0027 and \u0027--max_length\u0027 to set thresholds.\n" , - "default": "False" + "default":false } @@ -502,7 +502,7 @@ "description": "Type: `boolean_true`, default: `false`. Do not count read pairs that have their two ends mapping to different chromosomes or mapping to same chromosome but on different strands", "help_text": "Type: `boolean_true`, default: `false`. Do not count read pairs that have their two ends mapping to different chromosomes or mapping to same chromosome but on different strands.\n" , - "default": "False" + "default":false } @@ -513,7 +513,7 @@ "description": "Type: `boolean_true`, default: `false`. Do not sort reads in BAM/SAM input", "help_text": "Type: `boolean_true`, default: `false`. Do not sort reads in BAM/SAM input. Note that reads from the same pair are required to be located next to each other in the input.\n" , - "default": "False" + "default":false } @@ -534,7 +534,7 @@ "description": "Type: `boolean_true`, default: `false`. Assign reads by read group", "help_text": "Type: `boolean_true`, default: `false`. Assign reads by read group. \"RG\" tag is required to be present in the input BAM/SAM files.\n" , - "default": "False" + "default":false } @@ -555,7 +555,7 @@ "description": "Type: `boolean_true`, default: `false`. Count long reads such as Nanopore and PacBio reads", "help_text": "Type: `boolean_true`, default: `false`. Count long reads such as Nanopore and PacBio reads. Long read counting can only run in one thread and only reads (not read-pairs) can be counted. There is no limitation on the number of \u0027M\u0027 operations allowed in a CIGAR string in long read counting.\n" , - "default": "False" + "default":false } @@ -576,7 +576,7 @@ "description": "Type: `file`, default: `$id.$key.detailed_results.detailed_results`, example: `detailed_results`. Directory to save the detailed assignment results", "help_text": "Type: `file`, default: `$id.$key.detailed_results.detailed_results`, example: `detailed_results`. Directory to save the detailed assignment results. Use `--detailed_results_format` to determine the format of the detailed results.\n" , - "default": "$id.$key.detailed_results.detailed_results" + "default":"$id.$key.detailed_results.detailed_results" } @@ -619,7 +619,7 @@ "description": "Type: `boolean_true`, default: `false`. Output verbose information for debugging, such as un-matched chromosome/contig names", "help_text": "Type: `boolean_true`, default: `false`. Output verbose information for debugging, such as un-matched chromosome/contig names.\n" , - "default": "False" + "default":false } diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/fq_subsample/.config.vsh.yaml b/target/dependencies/vsh/vsh/biobox/main/nextflow/fq_subsample/.config.vsh.yaml index a55dc37..d56f5cb 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/fq_subsample/.config.vsh.yaml +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/fq_subsample/.config.vsh.yaml @@ -190,9 +190,9 @@ build_info: output: "target/nextflow/fq_subsample" executable: "target/nextflow/fq_subsample/main.nf" viash_version: "0.9.0" - git_commit: "a13b57d04a3f3741eedd1af10fd96a9bee126f55" - git_remote: "https://x-access-token:ghs_xpDMoQpz4lF1RaGsMH4IlMbO48cLeW1cIYSF@github.com/viash-hub/biobox" - git_tag: "v0.2.0-26-ga13b57d" + git_commit: "952ff0843093b538cbfd6fefdecf2e7a0bc9e70b" + git_remote: "https://x-access-token:ghs_EwAUAMYJ0K4VBHlAEMs4ZP2OyQYqJM0PSfEO@github.com/viash-hub/biobox" + git_tag: "v0.2.0-27-g952ff08" package_config: name: "biobox" version: "main" diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/fq_subsample/main.nf b/target/dependencies/vsh/vsh/biobox/main/nextflow/fq_subsample/main.nf index b0a41ef..ae3f2e3 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/fq_subsample/main.nf +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/fq_subsample/main.nf @@ -3032,9 +3032,9 @@ meta = [ "engine" : "docker|native", "output" : "target/nextflow/fq_subsample", "viash_version" : "0.9.0", - "git_commit" : "a13b57d04a3f3741eedd1af10fd96a9bee126f55", - "git_remote" : "https://x-access-token:ghs_xpDMoQpz4lF1RaGsMH4IlMbO48cLeW1cIYSF@github.com/viash-hub/biobox", - "git_tag" : "v0.2.0-26-ga13b57d" + "git_commit" : "952ff0843093b538cbfd6fefdecf2e7a0bc9e70b", + "git_remote" : "https://x-access-token:ghs_EwAUAMYJ0K4VBHlAEMs4ZP2OyQYqJM0PSfEO@github.com/viash-hub/biobox", + "git_tag" : "v0.2.0-27-g952ff08" }, "package_config" : { "name" : "biobox", diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/fq_subsample/nextflow_schema.json b/target/dependencies/vsh/vsh/biobox/main/nextflow/fq_subsample/nextflow_schema.json index ace623d..511bd91 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/fq_subsample/nextflow_schema.json +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/fq_subsample/nextflow_schema.json @@ -50,7 +50,7 @@ "description": "Type: `file`, default: `$id.$key.output_1.output_1`. Sampled read 1 fastq files", "help_text": "Type: `file`, default: `$id.$key.output_1.output_1`. Sampled read 1 fastq files. Output will be gzipped if ends in `.gz`." , - "default": "$id.$key.output_1.output_1" + "default":"$id.$key.output_1.output_1" } @@ -61,7 +61,7 @@ "description": "Type: `file`, default: `$id.$key.output_2.output_2`. Sampled read 2 fastq files", "help_text": "Type: `file`, default: `$id.$key.output_2.output_2`. Sampled read 2 fastq files. Output will be gzipped if ends in `.gz`." , - "default": "$id.$key.output_2.output_2" + "default":"$id.$key.output_2.output_2" } diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/gffread/.config.vsh.yaml b/target/dependencies/vsh/vsh/biobox/main/nextflow/gffread/.config.vsh.yaml index 90eb2f2..54dad4b 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/gffread/.config.vsh.yaml +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/gffread/.config.vsh.yaml @@ -685,9 +685,9 @@ build_info: output: "target/nextflow/gffread" executable: "target/nextflow/gffread/main.nf" viash_version: "0.9.0" - git_commit: "a13b57d04a3f3741eedd1af10fd96a9bee126f55" - git_remote: "https://x-access-token:ghs_xpDMoQpz4lF1RaGsMH4IlMbO48cLeW1cIYSF@github.com/viash-hub/biobox" - git_tag: "v0.2.0-26-ga13b57d" + git_commit: "952ff0843093b538cbfd6fefdecf2e7a0bc9e70b" + git_remote: "https://x-access-token:ghs_EwAUAMYJ0K4VBHlAEMs4ZP2OyQYqJM0PSfEO@github.com/viash-hub/biobox" + git_tag: "v0.2.0-27-g952ff08" package_config: name: "biobox" version: "main" diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/gffread/main.nf b/target/dependencies/vsh/vsh/biobox/main/nextflow/gffread/main.nf index 9c3fc68..0b9416b 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/gffread/main.nf +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/gffread/main.nf @@ -3606,9 +3606,9 @@ meta = [ "engine" : "docker|native", "output" : "target/nextflow/gffread", "viash_version" : "0.9.0", - "git_commit" : "a13b57d04a3f3741eedd1af10fd96a9bee126f55", - "git_remote" : "https://x-access-token:ghs_xpDMoQpz4lF1RaGsMH4IlMbO48cLeW1cIYSF@github.com/viash-hub/biobox", - "git_tag" : "v0.2.0-26-ga13b57d" + "git_commit" : "952ff0843093b538cbfd6fefdecf2e7a0bc9e70b", + "git_remote" : "https://x-access-token:ghs_EwAUAMYJ0K4VBHlAEMs4ZP2OyQYqJM0PSfEO@github.com/viash-hub/biobox", + "git_tag" : "v0.2.0-27-g952ff08" }, "package_config" : { "name" : "biobox", diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/gffread/nextflow_schema.json b/target/dependencies/vsh/vsh/biobox/main/nextflow/gffread/nextflow_schema.json index 5d49463..5ed6b22 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/gffread/nextflow_schema.json +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/gffread/nextflow_schema.json @@ -70,7 +70,7 @@ "description": "Type: `file`, required, default: `$id.$key.outfile.gff`, example: `output.gff`. Write the output records into \u003coutfile\u003e", "help_text": "Type: `file`, required, default: `$id.$key.outfile.gff`, example: `output.gff`. Write the output records into \u003coutfile\u003e.\n" , - "default": "$id.$key.outfile.gff" + "default":"$id.$key.outfile.gff" } @@ -81,7 +81,7 @@ "description": "Type: `boolean_true`, default: `false`. Make sure that the lowest level GFF features are considered \"exon\" features", "help_text": "Type: `boolean_true`, default: `false`. Make sure that the lowest level GFF features are considered \"exon\" features.\n" , - "default": "False" + "default":false } @@ -92,7 +92,7 @@ "description": "Type: `boolean_true`, default: `false`. For single-line genes not parenting any transcripts, add an exon feature spanning \nthe entire gene (treat it as a transcript)", "help_text": "Type: `boolean_true`, default: `false`. For single-line genes not parenting any transcripts, add an exon feature spanning \nthe entire gene (treat it as a transcript).\n" , - "default": "False" + "default":false } @@ -103,7 +103,7 @@ "description": "Type: `boolean_true`, default: `false`. Try to find a parent gene overlapping/containing a transcript that does not have \nany explicit gene Parent", "help_text": "Type: `boolean_true`, default: `false`. Try to find a parent gene overlapping/containing a transcript that does not have \nany explicit gene Parent.\n" , - "default": "False" + "default":false } @@ -114,7 +114,7 @@ "description": "Type: `boolean_true`, default: `false`. Decode url encoded characters within attributes", "help_text": "Type: `boolean_true`, default: `false`. Decode url encoded characters within attributes.\n" , - "default": "False" + "default":false } @@ -125,7 +125,7 @@ "description": "Type: `boolean_true`, default: `false`. Merge very close exons into a single exon (when intron size\u003c4)", "help_text": "Type: `boolean_true`, default: `false`. Merge very close exons into a single exon (when intron size\u003c4).\n" , - "default": "False" + "default":false } @@ -136,7 +136,7 @@ "description": "Type: `boolean_true`, default: `false`. Output the junctions and the corresponding transcripts", "help_text": "Type: `boolean_true`, default: `false`. Output the junctions and the corresponding transcripts.\n" , - "default": "False" + "default":false } @@ -147,7 +147,7 @@ "description": "Type: `file`, default: `$id.$key.spliced_exons.fa`, example: `exons.fa`. Write a fasta file with spliced exons for each transcript", "help_text": "Type: `file`, default: `$id.$key.spliced_exons.fa`, example: `exons.fa`. Write a fasta file with spliced exons for each transcript.\n" , - "default": "$id.$key.spliced_exons.fa" + "default":"$id.$key.spliced_exons.fa" } @@ -168,7 +168,7 @@ "description": "Type: `boolean_true`, default: `false`. For --spliced_exons, disable the output of CDS info in the FASTA file", "help_text": "Type: `boolean_true`, default: `false`. For --spliced_exons, disable the output of CDS info in the FASTA file.\n" , - "default": "False" + "default":false } @@ -199,7 +199,7 @@ "description": "Type: `boolean_true`, default: `false`. For --spliced_exons, --spliced_cds and -tr_cds options, write in the FASTA defline \nall the exon coordinates projected onto the spliced sequence", "help_text": "Type: `boolean_true`, default: `false`. For --spliced_exons, --spliced_cds and -tr_cds options, write in the FASTA defline \nall the exon coordinates projected onto the spliced sequence.\n" , - "default": "False" + "default":false } @@ -210,7 +210,7 @@ "description": "Type: `boolean_true`, default: `false`. For --tr_cds option, use \u0027*\u0027 instead of \u0027", "help_text": "Type: `boolean_true`, default: `false`. For --tr_cds option, use \u0027*\u0027 instead of \u0027.\u0027 as stop codon translation.\n" , - "default": "False" + "default":false } @@ -221,7 +221,7 @@ "description": "Type: `boolean_true`, default: `false`. Ensembl GTF to GFF3 conversion, adds version to IDs", "help_text": "Type: `boolean_true`, default: `false`. Ensembl GTF to GFF3 conversion, adds version to IDs.\n" , - "default": "False" + "default":false } @@ -242,7 +242,7 @@ "description": "Type: `boolean_true`, default: `false`. Main output will be GTF instead of GFF3", "help_text": "Type: `boolean_true`, default: `false`. Main output will be GTF instead of GFF3.\n" , - "default": "False" + "default":false } @@ -253,7 +253,7 @@ "description": "Type: `boolean_true`, default: `false`. Output records in BED format instead of default GFF3", "help_text": "Type: `boolean_true`, default: `false`. Output records in BED format instead of default GFF3.\n" , - "default": "False" + "default":false } @@ -264,7 +264,7 @@ "description": "Type: `boolean_true`, default: `false`. Output \"transcript line format\" which is like GFF but with exons and CDS related \nfeatures stored as GFF attributes in the transcript feature line, like this:\n exoncount=N;exons=\u003cexons\u003e;CDSphase=\u003cN\u003e;CDS=\u003cCDScoords\u003e\n\u003cexons\u003e is a comma-delimited list of exon_start-exon_end coordinates;\n\u003cCDScoords\u003e is CDS_start:CDS_end coordinates or a list like \u003cexons\u003e", "help_text": "Type: `boolean_true`, default: `false`. Output \"transcript line format\" which is like GFF but with exons and CDS related \nfeatures stored as GFF attributes in the transcript feature line, like this:\n exoncount=N;exons=\u003cexons\u003e;CDSphase=\u003cN\u003e;CDS=\u003cCDScoords\u003e\n\u003cexons\u003e is a comma-delimited list of exon_start-exon_end coordinates;\n\u003cCDScoords\u003e is CDS_start:CDS_end coordinates or a list like \u003cexons\u003e.\n" , - "default": "False" + "default":false } @@ -285,7 +285,7 @@ "description": "Type: `boolean_true`, default: `false`. Expose (warn about) duplicate transcript IDs and other potential problems with the \ngiven GFF/GTF records", "help_text": "Type: `boolean_true`, default: `false`. Expose (warn about) duplicate transcript IDs and other potential problems with the \ngiven GFF/GTF records.\n" , - "default": "False" + "default":false } @@ -356,7 +356,7 @@ "description": "Type: `boolean_true`, default: `false`. For --range option, discard all transcripts that are not fully contained within the given \nrange", "help_text": "Type: `boolean_true`, default: `false`. For --range option, discard all transcripts that are not fully contained within the given \nrange.\n" , - "default": "False" + "default":false } @@ -377,7 +377,7 @@ "description": "Type: `boolean_true`, default: `false`. Discard single-exon transcripts", "help_text": "Type: `boolean_true`, default: `false`. Discard single-exon transcripts.\n" , - "default": "False" + "default":false } @@ -388,7 +388,7 @@ "description": "Type: `boolean_true`, default: `false`. Coding only: discard mRNAs that have no CDS features", "help_text": "Type: `boolean_true`, default: `false`. Coding only: discard mRNAs that have no CDS features.\n" , - "default": "False" + "default":false } @@ -399,7 +399,7 @@ "description": "Type: `boolean_true`, default: `false`. Non-coding only: discard mRNAs that have CDS features", "help_text": "Type: `boolean_true`, default: `false`. Non-coding only: discard mRNAs that have CDS features.\n" , - "default": "False" + "default":false } @@ -410,7 +410,7 @@ "description": "Type: `boolean_true`, default: `false`. Discard locus features and attributes found in the input", "help_text": "Type: `boolean_true`, default: `false`. Discard locus features and attributes found in the input.\n" , - "default": "False" + "default":false } @@ -421,7 +421,7 @@ "description": "Type: `boolean_true`, default: `false`. Use the description field from \u003cseq_info", "help_text": "Type: `boolean_true`, default: `false`. Use the description field from \u003cseq_info.fsize\u003e and add it as the value for a \u0027descr\u0027 \nattribute to the GFF record.\n" , - "default": "False" + "default":false } @@ -442,7 +442,7 @@ "description": "Type: `boolean_true`, default: `false`. Chromosomes (reference sequences) are sorted alphabetically", "help_text": "Type: `boolean_true`, default: `false`. Chromosomes (reference sequences) are sorted alphabetically.\n" , - "default": "False" + "default":false } @@ -473,7 +473,7 @@ "description": "Type: `boolean_true`, default: `false`. Keep all GFF attributes (for non-exon features)", "help_text": "Type: `boolean_true`, default: `false`. Keep all GFF attributes (for non-exon features).\n" , - "default": "False" + "default":false } @@ -484,7 +484,7 @@ "description": "Type: `boolean_true`, default: `false`. For -F option, do not attempt to reduce redundant exon/CDS attributes", "help_text": "Type: `boolean_true`, default: `false`. For -F option, do not attempt to reduce redundant exon/CDS attributes.\n" , - "default": "False" + "default":false } @@ -495,7 +495,7 @@ "description": "Type: `boolean_true`, default: `false`. Do not keep exon attributes, move them to the transcript feature (for GFF3 output)", "help_text": "Type: `boolean_true`, default: `false`. Do not keep exon attributes, move them to the transcript feature (for GFF3 output).\n" , - "default": "False" + "default":false } @@ -516,7 +516,7 @@ "description": "Type: `boolean_true`, default: `false`. In transcript-only mode (default), also preserve gene records", "help_text": "Type: `boolean_true`, default: `false`. In transcript-only mode (default), also preserve gene records.\n" , - "default": "False" + "default":false } @@ -527,7 +527,7 @@ "description": "Type: `boolean_true`, default: `false`. For GFF3 input/output, try to preserve comments", "help_text": "Type: `boolean_true`, default: `false`. For GFF3 input/output, try to preserve comments.\n" , - "default": "False" + "default":false } @@ -538,7 +538,7 @@ "description": "Type: `boolean_true`, default: `false`. process other non-transcript GFF records (by default non-transcript records are ignored)", "help_text": "Type: `boolean_true`, default: `false`. process other non-transcript GFF records (by default non-transcript records are ignored).\n" , - "default": "False" + "default":false } @@ -549,7 +549,7 @@ "description": "Type: `boolean_true`, default: `false`. Discard any mRNAs with CDS having in-frame stop codons (requires --genome)", "help_text": "Type: `boolean_true`, default: `false`. Discard any mRNAs with CDS having in-frame stop codons (requires --genome).\n" , - "default": "False" + "default":false } @@ -560,7 +560,7 @@ "description": "Type: `boolean_true`, default: `false`. For --rm_stop_codons option, check and adjust the starting CDS phase if the original phase\nleads to a translation with an in-frame stop codon", "help_text": "Type: `boolean_true`, default: `false`. For --rm_stop_codons option, check and adjust the starting CDS phase if the original phase\nleads to a translation with an in-frame stop codon.\n" , - "default": "False" + "default":false } @@ -571,7 +571,7 @@ "description": "Type: `boolean_true`, default: `false`. For -V option, single-exon transcripts are also checked on the opposite strand (requires \n--genome)", "help_text": "Type: `boolean_true`, default: `false`. For -V option, single-exon transcripts are also checked on the opposite strand (requires \n--genome). \n" , - "default": "False" + "default":false } @@ -582,7 +582,7 @@ "description": "Type: `boolean_true`, default: `false`. Add transcript level GFF attributes about the coding status of each transcript, including \npartialness or in-frame stop codons (requires --genome)", "help_text": "Type: `boolean_true`, default: `false`. Add transcript level GFF attributes about the coding status of each transcript, including \npartialness or in-frame stop codons (requires --genome).\n" , - "default": "False" + "default":false } @@ -593,7 +593,7 @@ "description": "Type: `boolean_true`, default: `false`. Add a \"hasCDS\" attribute with value \"true\" for transcripts that have CDS features", "help_text": "Type: `boolean_true`, default: `false`. Add a \"hasCDS\" attribute with value \"true\" for transcripts that have CDS features. \n" , - "default": "False" + "default":false } @@ -604,7 +604,7 @@ "description": "Type: `boolean_true`, default: `false`. Stop codon adjustment: enables --coding_status and performs automatic adjustment of the CDS stop \ncoordinate if premature or downstream", "help_text": "Type: `boolean_true`, default: `false`. Stop codon adjustment: enables --coding_status and performs automatic adjustment of the CDS stop \ncoordinate if premature or downstream.\n" , - "default": "False" + "default":false } @@ -615,7 +615,7 @@ "description": "Type: `boolean_true`, default: `false`. Discard multi-exon mRNAs that have any intron with a non-canonical splice site consensus \n(i", "help_text": "Type: `boolean_true`, default: `false`. Discard multi-exon mRNAs that have any intron with a non-canonical splice site consensus \n(i.e. not GT-AG, GC-AG or AT-AC).\n" , - "default": "False" + "default":false } @@ -626,7 +626,7 @@ "description": "Type: `boolean_true`, default: `false`. Discard any mRNAs that either lack initial START codon or the terminal STOP codon, or \nhave an in-frame stop codon (i", "help_text": "Type: `boolean_true`, default: `false`. Discard any mRNAs that either lack initial START codon or the terminal STOP codon, or \nhave an in-frame stop codon (i.e. only print mRNAs with a complete CDS).\n" , - "default": "False" + "default":false } @@ -637,7 +637,7 @@ "description": "Type: `boolean_true`, default: `false`. Filter out records matching the \u0027pseudo\u0027 keyword", "help_text": "Type: `boolean_true`, default: `false`. Filter out records matching the \u0027pseudo\u0027 keyword.\n" , - "default": "False" + "default":false } @@ -648,7 +648,7 @@ "description": "Type: `boolean_true`, default: `false`. Input should be parsed as BED format (automatic if the input filename ends with ", "help_text": "Type: `boolean_true`, default: `false`. Input should be parsed as BED format (automatic if the input filename ends with .bed*).\n" , - "default": "False" + "default":false } @@ -659,7 +659,7 @@ "description": "Type: `boolean_true`, default: `false`. Input GFF-like one-line-per-transcript format without exon/CDS features (see --tlf option \nbelow); automatic if the input filename ends with ", "help_text": "Type: `boolean_true`, default: `false`. Input GFF-like one-line-per-transcript format without exon/CDS features (see --tlf option \nbelow); automatic if the input filename ends with .tlf).\n" , - "default": "False" + "default":false } @@ -670,7 +670,7 @@ "description": "Type: `boolean_true`, default: `false`. Fast processing of input GFF/BED transcripts as they are received (no sorting, exons must \nbe grouped by transcript in the input data)", "help_text": "Type: `boolean_true`, default: `false`. Fast processing of input GFF/BED transcripts as they are received (no sorting, exons must \nbe grouped by transcript in the input data).\n" , - "default": "False" + "default":false } @@ -691,7 +691,7 @@ "description": "Type: `boolean_true`, default: `false`. Cluster the input transcripts into loci, discarding \"redundant\" transcripts (those with \nthe same exact introns and fully contained or equal boundaries)", "help_text": "Type: `boolean_true`, default: `false`. Cluster the input transcripts into loci, discarding \"redundant\" transcripts (those with \nthe same exact introns and fully contained or equal boundaries).\n" , - "default": "False" + "default":false } @@ -712,7 +712,7 @@ "description": "Type: `boolean_true`, default: `false`. Same as --merge but without discarding any of the \"duplicate\" transcripts, only create \n\"locus\" features", "help_text": "Type: `boolean_true`, default: `false`. Same as --merge but without discarding any of the \"duplicate\" transcripts, only create \n\"locus\" features.\n" , - "default": "False" + "default":false } @@ -723,7 +723,7 @@ "description": "Type: `boolean_true`, default: `false`. For --merge option: also discard as redundant the shorter, fully contained transcripts (intron \nchains matching a part of the container)", "help_text": "Type: `boolean_true`, default: `false`. For --merge option: also discard as redundant the shorter, fully contained transcripts (intron \nchains matching a part of the container).\n" , - "default": "False" + "default":false } @@ -734,7 +734,7 @@ "description": "Type: `boolean_true`, default: `false`. For --merge option, no longer require boundary containment when assessing redundancy (can be \ncombined with --rm_redundant); only introns have to match for multi-exon transcripts, and \u003e=80%\noverlap for single-exon transcripts", "help_text": "Type: `boolean_true`, default: `false`. For --merge option, no longer require boundary containment when assessing redundancy (can be \ncombined with --rm_redundant); only introns have to match for multi-exon transcripts, and \u003e=80%\noverlap for single-exon transcripts.\n" , - "default": "False" + "default":false } @@ -745,7 +745,7 @@ "description": "Type: `boolean_true`, default: `false`. For --merge option, enforce --no_boundary but also discard overlapping single-exon transcripts,\neven on the opposite strand (can be combined with --rm_redudant)", "help_text": "Type: `boolean_true`, default: `false`. For --merge option, enforce --no_boundary but also discard overlapping single-exon transcripts,\neven on the opposite strand (can be combined with --rm_redudant).\n" , - "default": "False" + "default":false } diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/kallisto/kallisto_index/.config.vsh.yaml b/target/dependencies/vsh/vsh/biobox/main/nextflow/kallisto/kallisto_index/.config.vsh.yaml index 659174a..adb39ff 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/kallisto/kallisto_index/.config.vsh.yaml +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/kallisto/kallisto_index/.config.vsh.yaml @@ -218,9 +218,9 @@ build_info: output: "target/nextflow/kallisto/kallisto_index" executable: "target/nextflow/kallisto/kallisto_index/main.nf" viash_version: "0.9.0" - git_commit: "a13b57d04a3f3741eedd1af10fd96a9bee126f55" - git_remote: "https://x-access-token:ghs_xpDMoQpz4lF1RaGsMH4IlMbO48cLeW1cIYSF@github.com/viash-hub/biobox" - git_tag: "v0.2.0-26-ga13b57d" + git_commit: "952ff0843093b538cbfd6fefdecf2e7a0bc9e70b" + git_remote: "https://x-access-token:ghs_EwAUAMYJ0K4VBHlAEMs4ZP2OyQYqJM0PSfEO@github.com/viash-hub/biobox" + git_tag: "v0.2.0-27-g952ff08" package_config: name: "biobox" version: "main" diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/kallisto/kallisto_index/main.nf b/target/dependencies/vsh/vsh/biobox/main/nextflow/kallisto/kallisto_index/main.nf index fa3ac85..c324d4a 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/kallisto/kallisto_index/main.nf +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/kallisto/kallisto_index/main.nf @@ -3071,9 +3071,9 @@ meta = [ "engine" : "docker|native", "output" : "target/nextflow/kallisto/kallisto_index", "viash_version" : "0.9.0", - "git_commit" : "a13b57d04a3f3741eedd1af10fd96a9bee126f55", - "git_remote" : "https://x-access-token:ghs_xpDMoQpz4lF1RaGsMH4IlMbO48cLeW1cIYSF@github.com/viash-hub/biobox", - "git_tag" : "v0.2.0-26-ga13b57d" + "git_commit" : "952ff0843093b538cbfd6fefdecf2e7a0bc9e70b", + "git_remote" : "https://x-access-token:ghs_EwAUAMYJ0K4VBHlAEMs4ZP2OyQYqJM0PSfEO@github.com/viash-hub/biobox", + "git_tag" : "v0.2.0-27-g952ff08" }, "package_config" : { "name" : "biobox", diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/kallisto/kallisto_index/nextflow_schema.json b/target/dependencies/vsh/vsh/biobox/main/nextflow/kallisto/kallisto_index/nextflow_schema.json index bf4b2c8..6d0b616 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/kallisto/kallisto_index/nextflow_schema.json +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/kallisto/kallisto_index/nextflow_schema.json @@ -50,7 +50,7 @@ "description": "Type: `file`, default: `$id.$key.index.index`, example: `Kallisto_index`. ", "help_text": "Type: `file`, default: `$id.$key.index.index`, example: `Kallisto_index`. " , - "default": "$id.$key.index.index" + "default":"$id.$key.index.index" } @@ -81,7 +81,7 @@ "description": "Type: `boolean_true`, default: `false`. Replace repeated target names with unique names", "help_text": "Type: `boolean_true`, default: `false`. Replace repeated target names with unique names.\n" , - "default": "False" + "default":false } @@ -92,7 +92,7 @@ "description": "Type: `boolean_true`, default: `false`. Generate index from a FASTA-file containing amino acid sequences", "help_text": "Type: `boolean_true`, default: `false`. Generate index from a FASTA-file containing amino acid sequences.\n" , - "default": "False" + "default":false } @@ -103,7 +103,7 @@ "description": "Type: `boolean_true`, default: `false`. Generate index where sequences are distinguished by the sequence names", "help_text": "Type: `boolean_true`, default: `false`. Generate index where sequences are distinguished by the sequence names.\n" , - "default": "False" + "default":false } diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/kallisto/kallisto_quant/.config.vsh.yaml b/target/dependencies/vsh/vsh/biobox/main/nextflow/kallisto/kallisto_quant/.config.vsh.yaml index db6bb9a..75ae5e7 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/kallisto/kallisto_quant/.config.vsh.yaml +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/kallisto/kallisto_quant/.config.vsh.yaml @@ -246,9 +246,9 @@ build_info: output: "target/nextflow/kallisto/kallisto_quant" executable: "target/nextflow/kallisto/kallisto_quant/main.nf" viash_version: "0.9.0" - git_commit: "a13b57d04a3f3741eedd1af10fd96a9bee126f55" - git_remote: "https://x-access-token:ghs_xpDMoQpz4lF1RaGsMH4IlMbO48cLeW1cIYSF@github.com/viash-hub/biobox" - git_tag: "v0.2.0-26-ga13b57d" + git_commit: "952ff0843093b538cbfd6fefdecf2e7a0bc9e70b" + git_remote: "https://x-access-token:ghs_EwAUAMYJ0K4VBHlAEMs4ZP2OyQYqJM0PSfEO@github.com/viash-hub/biobox" + git_tag: "v0.2.0-27-g952ff08" package_config: name: "biobox" version: "main" diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/kallisto/kallisto_quant/main.nf b/target/dependencies/vsh/vsh/biobox/main/nextflow/kallisto/kallisto_quant/main.nf index bec853b..d8f9d46 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/kallisto/kallisto_quant/main.nf +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/kallisto/kallisto_quant/main.nf @@ -3105,9 +3105,9 @@ meta = [ "engine" : "docker|native", "output" : "target/nextflow/kallisto/kallisto_quant", "viash_version" : "0.9.0", - "git_commit" : "a13b57d04a3f3741eedd1af10fd96a9bee126f55", - "git_remote" : "https://x-access-token:ghs_xpDMoQpz4lF1RaGsMH4IlMbO48cLeW1cIYSF@github.com/viash-hub/biobox", - "git_tag" : "v0.2.0-26-ga13b57d" + "git_commit" : "952ff0843093b538cbfd6fefdecf2e7a0bc9e70b", + "git_remote" : "https://x-access-token:ghs_EwAUAMYJ0K4VBHlAEMs4ZP2OyQYqJM0PSfEO@github.com/viash-hub/biobox", + "git_tag" : "v0.2.0-27-g952ff08" }, "package_config" : { "name" : "biobox", diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/kallisto/kallisto_quant/nextflow_schema.json b/target/dependencies/vsh/vsh/biobox/main/nextflow/kallisto/kallisto_quant/nextflow_schema.json index 260d9ca..40a2444 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/kallisto/kallisto_quant/nextflow_schema.json +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/kallisto/kallisto_quant/nextflow_schema.json @@ -50,7 +50,7 @@ "description": "Type: `file`, required, default: `$id.$key.output_dir.output_dir`. Directory to write output to", "help_text": "Type: `file`, required, default: `$id.$key.output_dir.output_dir`. Directory to write output to." , - "default": "$id.$key.output_dir.output_dir" + "default":"$id.$key.output_dir.output_dir" } @@ -61,7 +61,7 @@ "description": "Type: `file`, default: `$id.$key.log.log`. File containing log information from running kallisto quant", "help_text": "Type: `file`, default: `$id.$key.log.log`. File containing log information from running kallisto quant" , - "default": "$id.$key.log.log" + "default":"$id.$key.log.log" } @@ -82,7 +82,7 @@ "description": "Type: `boolean_true`, default: `false`. Single end mode", "help_text": "Type: `boolean_true`, default: `false`. Single end mode." , - "default": "False" + "default":false } @@ -93,7 +93,7 @@ "description": "Type: `boolean_true`, default: `false`. Include reads where unobserved rest of fragment is predicted to lie outside a transcript", "help_text": "Type: `boolean_true`, default: `false`. Include reads where unobserved rest of fragment is predicted to lie outside a transcript." , - "default": "False" + "default":false } @@ -104,7 +104,7 @@ "description": "Type: `boolean_true`, default: `false`. Strand specific reads, first read forward", "help_text": "Type: `boolean_true`, default: `false`. Strand specific reads, first read forward." , - "default": "False" + "default":false } @@ -115,7 +115,7 @@ "description": "Type: `boolean_true`, default: `false`. Strand specific reads, first read reverse", "help_text": "Type: `boolean_true`, default: `false`. Strand specific reads, first read reverse." , - "default": "False" + "default":false } @@ -146,7 +146,7 @@ "description": "Type: `boolean_true`, default: `false`. Output plaintext instead of HDF5", "help_text": "Type: `boolean_true`, default: `false`. Output plaintext instead of HDF5." , - "default": "False" + "default":false } diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/multiqc/.config.vsh.yaml b/target/dependencies/vsh/vsh/biobox/main/nextflow/multiqc/.config.vsh.yaml index eddcbae..3475e44 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/multiqc/.config.vsh.yaml +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/multiqc/.config.vsh.yaml @@ -456,9 +456,9 @@ build_info: output: "target/nextflow/multiqc" executable: "target/nextflow/multiqc/main.nf" viash_version: "0.9.0" - git_commit: "a13b57d04a3f3741eedd1af10fd96a9bee126f55" - git_remote: "https://x-access-token:ghs_xpDMoQpz4lF1RaGsMH4IlMbO48cLeW1cIYSF@github.com/viash-hub/biobox" - git_tag: "v0.2.0-26-ga13b57d" + git_commit: "952ff0843093b538cbfd6fefdecf2e7a0bc9e70b" + git_remote: "https://x-access-token:ghs_EwAUAMYJ0K4VBHlAEMs4ZP2OyQYqJM0PSfEO@github.com/viash-hub/biobox" + git_tag: "v0.2.0-27-g952ff08" package_config: name: "biobox" version: "main" diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/multiqc/main.nf b/target/dependencies/vsh/vsh/biobox/main/nextflow/multiqc/main.nf index 9abc618..71ef4c3 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/multiqc/main.nf +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/multiqc/main.nf @@ -3366,9 +3366,9 @@ meta = [ "engine" : "docker|native", "output" : "target/nextflow/multiqc", "viash_version" : "0.9.0", - "git_commit" : "a13b57d04a3f3741eedd1af10fd96a9bee126f55", - "git_remote" : "https://x-access-token:ghs_xpDMoQpz4lF1RaGsMH4IlMbO48cLeW1cIYSF@github.com/viash-hub/biobox", - "git_tag" : "v0.2.0-26-ga13b57d" + "git_commit" : "952ff0843093b538cbfd6fefdecf2e7a0bc9e70b", + "git_remote" : "https://x-access-token:ghs_EwAUAMYJ0K4VBHlAEMs4ZP2OyQYqJM0PSfEO@github.com/viash-hub/biobox", + "git_tag" : "v0.2.0-27-g952ff08" }, "package_config" : { "name" : "biobox", diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/multiqc/nextflow_schema.json b/target/dependencies/vsh/vsh/biobox/main/nextflow/multiqc/nextflow_schema.json index 5f3f25e..6a3bd5c 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/multiqc/nextflow_schema.json +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/multiqc/nextflow_schema.json @@ -40,7 +40,7 @@ "description": "Type: `file`, default: `$id.$key.output_report.html`, example: `multiqc_report.html`. Filepath of the generated report", "help_text": "Type: `file`, default: `$id.$key.output_report.html`, example: `multiqc_report.html`. Filepath of the generated report.\n" , - "default": "$id.$key.output_report.html" + "default":"$id.$key.output_report.html" } @@ -51,7 +51,7 @@ "description": "Type: `file`, default: `$id.$key.output_data.output_data`, example: `multiqc_data`. Output directory for parsed data files", "help_text": "Type: `file`, default: `$id.$key.output_data.output_data`, example: `multiqc_data`. Output directory for parsed data files. If not provided, parsed data will not be published.\n" , - "default": "$id.$key.output_data.output_data" + "default":"$id.$key.output_data.output_data" } @@ -62,7 +62,7 @@ "description": "Type: `file`, default: `$id.$key.output_plots.output_plots`, example: `multiqc_plots`. Output directory for generated plots", "help_text": "Type: `file`, default: `$id.$key.output_plots.output_plots`, example: `multiqc_plots`. Output directory for generated plots. If not provided, plots will not be published.\n" , - "default": "$id.$key.output_plots.output_plots" + "default":"$id.$key.output_plots.output_plots" } @@ -123,7 +123,7 @@ "description": "Type: `boolean_true`, default: `false`. Ignore symlinked directories and files", "help_text": "Type: `boolean_true`, default: `false`. Ignore symlinked directories and files" , - "default": "False" + "default":false } @@ -144,7 +144,7 @@ "description": "Type: `boolean_true`, default: `false`. Prepend directory to sample names to avoid clashing filenames", "help_text": "Type: `boolean_true`, default: `false`. Prepend directory to sample names to avoid clashing filenames" , - "default": "False" + "default":false } @@ -165,7 +165,7 @@ "description": "Type: `boolean_true`, default: `false`. Do not clean the sample names (leave as full file name)", "help_text": "Type: `boolean_true`, default: `false`. Do not clean the sample names (leave as full file name)" , - "default": "False" + "default":false } @@ -176,7 +176,7 @@ "description": "Type: `boolean_true`, default: `false`. Use the log filename as the sample name", "help_text": "Type: `boolean_true`, default: `false`. Use the log filename as the sample name" , - "default": "False" + "default":false } @@ -269,7 +269,7 @@ "description": "Type: `boolean_true`, default: `false`. Add analysis of how long MultiQC takes to run to the report\n", "help_text": "Type: `boolean_true`, default: `false`. Add analysis of how long MultiQC takes to run to the report\n" , - "default": "False" + "default":false } @@ -290,7 +290,7 @@ "description": "Type: `boolean_true`, default: `false`. Increase output verbosity", "help_text": "Type: `boolean_true`, default: `false`. Increase output verbosity.\n" , - "default": "False" + "default":false } @@ -301,7 +301,7 @@ "description": "Type: `boolean_true`, default: `false`. Only show log warnings\n", "help_text": "Type: `boolean_true`, default: `false`. Only show log warnings\n" , - "default": "False" + "default":false } @@ -312,7 +312,7 @@ "description": "Type: `boolean_true`, default: `false`. Don\u0027t catch exceptions, run additional code checks to help development", "help_text": "Type: `boolean_true`, default: `false`. Don\u0027t catch exceptions, run additional code checks to help development.\n" , - "default": "False" + "default":false } @@ -323,7 +323,7 @@ "description": "Type: `boolean_true`, default: `false`. Development mode", "help_text": "Type: `boolean_true`, default: `false`. Development mode. Do not compress and minimise JS, export uncompressed plot data.\n" , - "default": "False" + "default":false } @@ -334,7 +334,7 @@ "description": "Type: `boolean_true`, default: `false`. Require all explicitly requested modules to have log files", "help_text": "Type: `boolean_true`, default: `false`. Require all explicitly requested modules to have log files. If not, MultiQC will exit with an error.\n" , - "default": "False" + "default":false } @@ -345,7 +345,7 @@ "description": "Type: `boolean_true`, default: `false`. Don\u0027t upload generated report to MegaQC, even if MegaQC options are found", "help_text": "Type: `boolean_true`, default: `false`. Don\u0027t upload generated report to MegaQC, even if MegaQC options are found.\n" , - "default": "False" + "default":false } @@ -356,7 +356,7 @@ "description": "Type: `boolean_true`, default: `false`. Disable coloured log output", "help_text": "Type: `boolean_true`, default: `false`. Disable coloured log output.\n" , - "default": "False" + "default":false } @@ -387,7 +387,7 @@ "description": "Type: `boolean_true`, default: `false`. Use only flat plots (static images)", "help_text": "Type: `boolean_true`, default: `false`. Use only flat plots (static images).\n" , - "default": "False" + "default":false } @@ -398,7 +398,7 @@ "description": "Type: `boolean_true`, default: `false`. Use only interactive plots (in-browser Javascript)", "help_text": "Type: `boolean_true`, default: `false`. Use only interactive plots (in-browser Javascript).\n" , - "default": "False" + "default":false } @@ -409,7 +409,7 @@ "description": "Type: `boolean_true`, default: `false`. Force the parsed data directory to be created", "help_text": "Type: `boolean_true`, default: `false`. Force the parsed data directory to be created.\n" , - "default": "False" + "default":false } @@ -420,7 +420,7 @@ "description": "Type: `boolean_true`, default: `false`. Prevent the parsed data directory from being created", "help_text": "Type: `boolean_true`, default: `false`. Prevent the parsed data directory from being created.\n" , - "default": "False" + "default":false } @@ -431,7 +431,7 @@ "description": "Type: `boolean_true`, default: `false`. Compress the data directory", "help_text": "Type: `boolean_true`, default: `false`. Compress the data directory.\n" , - "default": "False" + "default":false } @@ -454,7 +454,7 @@ "description": "Type: `boolean_true`, default: `false`. Creates PDF report with the \u0027simple\u0027 template", "help_text": "Type: `boolean_true`, default: `false`. Creates PDF report with the \u0027simple\u0027 template. Requires Pandoc to be installed.\n" , - "default": "False" + "default":false } diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/qualimap/qualimap_rnaseq/.config.vsh.yaml b/target/dependencies/vsh/vsh/biobox/main/nextflow/qualimap/qualimap_rnaseq/.config.vsh.yaml index 4a1b9ad..b4b0553 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/qualimap/qualimap_rnaseq/.config.vsh.yaml +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/qualimap/qualimap_rnaseq/.config.vsh.yaml @@ -264,9 +264,9 @@ build_info: output: "target/nextflow/qualimap/qualimap_rnaseq" executable: "target/nextflow/qualimap/qualimap_rnaseq/main.nf" viash_version: "0.9.0" - git_commit: "a13b57d04a3f3741eedd1af10fd96a9bee126f55" - git_remote: "https://x-access-token:ghs_xpDMoQpz4lF1RaGsMH4IlMbO48cLeW1cIYSF@github.com/viash-hub/biobox" - git_tag: "v0.2.0-26-ga13b57d" + git_commit: "952ff0843093b538cbfd6fefdecf2e7a0bc9e70b" + git_remote: "https://x-access-token:ghs_EwAUAMYJ0K4VBHlAEMs4ZP2OyQYqJM0PSfEO@github.com/viash-hub/biobox" + git_tag: "v0.2.0-27-g952ff08" package_config: name: "biobox" version: "main" diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/qualimap/qualimap_rnaseq/main.nf b/target/dependencies/vsh/vsh/biobox/main/nextflow/qualimap/qualimap_rnaseq/main.nf index 0d70bed..5acb4ba 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/qualimap/qualimap_rnaseq/main.nf +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/qualimap/qualimap_rnaseq/main.nf @@ -3129,9 +3129,9 @@ meta = [ "engine" : "docker|native", "output" : "target/nextflow/qualimap/qualimap_rnaseq", "viash_version" : "0.9.0", - "git_commit" : "a13b57d04a3f3741eedd1af10fd96a9bee126f55", - "git_remote" : "https://x-access-token:ghs_xpDMoQpz4lF1RaGsMH4IlMbO48cLeW1cIYSF@github.com/viash-hub/biobox", - "git_tag" : "v0.2.0-26-ga13b57d" + "git_commit" : "952ff0843093b538cbfd6fefdecf2e7a0bc9e70b", + "git_remote" : "https://x-access-token:ghs_EwAUAMYJ0K4VBHlAEMs4ZP2OyQYqJM0PSfEO@github.com/viash-hub/biobox", + "git_tag" : "v0.2.0-27-g952ff08" }, "package_config" : { "name" : "biobox", diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/qualimap/qualimap_rnaseq/nextflow_schema.json b/target/dependencies/vsh/vsh/biobox/main/nextflow/qualimap/qualimap_rnaseq/nextflow_schema.json index aaf2e05..37135d5 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/qualimap/qualimap_rnaseq/nextflow_schema.json +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/qualimap/qualimap_rnaseq/nextflow_schema.json @@ -50,7 +50,7 @@ "description": "Type: `file`, required, default: `$id.$key.qc_results.txt`, example: `rnaseq_qc_results.txt`. Text file containing the RNAseq QC results", "help_text": "Type: `file`, required, default: `$id.$key.qc_results.txt`, example: `rnaseq_qc_results.txt`. Text file containing the RNAseq QC results." , - "default": "$id.$key.qc_results.txt" + "default":"$id.$key.qc_results.txt" } @@ -61,7 +61,7 @@ "description": "Type: `file`, default: `$id.$key.counts.counts`. Output file for computed counts", "help_text": "Type: `file`, default: `$id.$key.counts.counts`. Output file for computed counts." , - "default": "$id.$key.counts.counts" + "default":"$id.$key.counts.counts" } @@ -72,7 +72,7 @@ "description": "Type: `file`, default: `$id.$key.report.html`, example: `report.html`. Report output file", "help_text": "Type: `file`, default: `$id.$key.report.html`, example: `report.html`. Report output file. Supported formats are PDF or HTML." , - "default": "$id.$key.report.html" + "default":"$id.$key.report.html" } @@ -137,7 +137,7 @@ "description": "Type: `boolean_true`, default: `false`. Setting this flag for paired-end experiments will result in counting fragments instead of reads", "help_text": "Type: `boolean_true`, default: `false`. Setting this flag for paired-end experiments will result in counting fragments instead of reads." , - "default": "False" + "default":false } @@ -148,7 +148,7 @@ "description": "Type: `boolean_true`, default: `false`. Setting this flag indicates that the input file is already sorted by name", "help_text": "Type: `boolean_true`, default: `false`. Setting this flag indicates that the input file is already sorted by name. If flag is not set, additional sorting by name will be performed. Only requiredfor paired-end analysis." , - "default": "False" + "default":false } diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/rsem/rsem_calculate_expression/.config.vsh.yaml b/target/dependencies/vsh/vsh/biobox/main/nextflow/rsem/rsem_calculate_expression/.config.vsh.yaml index 780fa6d..4e942c8 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/rsem/rsem_calculate_expression/.config.vsh.yaml +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/rsem/rsem_calculate_expression/.config.vsh.yaml @@ -852,9 +852,9 @@ build_info: output: "target/nextflow/rsem/rsem_calculate_expression" executable: "target/nextflow/rsem/rsem_calculate_expression/main.nf" viash_version: "0.9.0" - git_commit: "a13b57d04a3f3741eedd1af10fd96a9bee126f55" - git_remote: "https://x-access-token:ghs_xpDMoQpz4lF1RaGsMH4IlMbO48cLeW1cIYSF@github.com/viash-hub/biobox" - git_tag: "v0.2.0-26-ga13b57d" + git_commit: "952ff0843093b538cbfd6fefdecf2e7a0bc9e70b" + git_remote: "https://x-access-token:ghs_EwAUAMYJ0K4VBHlAEMs4ZP2OyQYqJM0PSfEO@github.com/viash-hub/biobox" + git_tag: "v0.2.0-27-g952ff08" package_config: name: "biobox" version: "main" diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/rsem/rsem_calculate_expression/main.nf b/target/dependencies/vsh/vsh/biobox/main/nextflow/rsem/rsem_calculate_expression/main.nf index 7961406..56e7d17 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/rsem/rsem_calculate_expression/main.nf +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/rsem/rsem_calculate_expression/main.nf @@ -3661,9 +3661,9 @@ meta = [ "engine" : "docker|native", "output" : "target/nextflow/rsem/rsem_calculate_expression", "viash_version" : "0.9.0", - "git_commit" : "a13b57d04a3f3741eedd1af10fd96a9bee126f55", - "git_remote" : "https://x-access-token:ghs_xpDMoQpz4lF1RaGsMH4IlMbO48cLeW1cIYSF@github.com/viash-hub/biobox", - "git_tag" : "v0.2.0-26-ga13b57d" + "git_commit" : "952ff0843093b538cbfd6fefdecf2e7a0bc9e70b", + "git_remote" : "https://x-access-token:ghs_EwAUAMYJ0K4VBHlAEMs4ZP2OyQYqJM0PSfEO@github.com/viash-hub/biobox", + "git_tag" : "v0.2.0-27-g952ff08" }, "package_config" : { "name" : "biobox", diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/rsem/rsem_calculate_expression/nextflow_schema.json b/target/dependencies/vsh/vsh/biobox/main/nextflow/rsem/rsem_calculate_expression/nextflow_schema.json index c0aedae..63db46d 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/rsem/rsem_calculate_expression/nextflow_schema.json +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/rsem/rsem_calculate_expression/nextflow_schema.json @@ -42,7 +42,7 @@ "description": "Type: `boolean_true`, default: `false`. Paired-end reads or not?", "help_text": "Type: `boolean_true`, default: `false`. Paired-end reads or not?" , - "default": "False" + "default":false } @@ -93,7 +93,7 @@ "description": "Type: `file`, default: `$id.$key.counts_gene.results`, example: `$id.genes.results`. Expression counts on gene level", "help_text": "Type: `file`, default: `$id.$key.counts_gene.results`, example: `$id.genes.results`. Expression counts on gene level" , - "default": "$id.$key.counts_gene.results" + "default":"$id.$key.counts_gene.results" } @@ -104,7 +104,7 @@ "description": "Type: `file`, default: `$id.$key.counts_transcripts.results`, example: `$id.isoforms.results`. Expression counts on transcript level", "help_text": "Type: `file`, default: `$id.$key.counts_transcripts.results`, example: `$id.isoforms.results`. Expression counts on transcript level" , - "default": "$id.$key.counts_transcripts.results" + "default":"$id.$key.counts_transcripts.results" } @@ -115,7 +115,7 @@ "description": "Type: `file`, default: `$id.$key.stat.stat`, example: `$id.stat`. RSEM statistics", "help_text": "Type: `file`, default: `$id.$key.stat.stat`, example: `$id.stat`. RSEM statistics" , - "default": "$id.$key.stat.stat" + "default":"$id.$key.stat.stat" } @@ -126,7 +126,7 @@ "description": "Type: `file`, default: `$id.$key.logs.log`, example: `$id.log`. RSEM logs", "help_text": "Type: `file`, default: `$id.$key.logs.log`, example: `$id.log`. RSEM logs" , - "default": "$id.$key.logs.log" + "default":"$id.$key.logs.log" } @@ -137,7 +137,7 @@ "description": "Type: `file`, default: `$id.$key.bam_star.bam`, example: `$id.STAR.genome.bam`. BAM file generated by STAR (optional)", "help_text": "Type: `file`, default: `$id.$key.bam_star.bam`, example: `$id.STAR.genome.bam`. BAM file generated by STAR (optional)" , - "default": "$id.$key.bam_star.bam" + "default":"$id.$key.bam_star.bam" } @@ -148,7 +148,7 @@ "description": "Type: `file`, default: `$id.$key.bam_genome.bam`, example: `$id.genome.bam`. Genome BAM file (optional)", "help_text": "Type: `file`, default: `$id.$key.bam_genome.bam`, example: `$id.genome.bam`. Genome BAM file (optional)" , - "default": "$id.$key.bam_genome.bam" + "default":"$id.$key.bam_genome.bam" } @@ -159,7 +159,7 @@ "description": "Type: `file`, default: `$id.$key.bam_transcript.bam`, example: `$id.transcript.bam`. Transcript BAM file (optional)", "help_text": "Type: `file`, default: `$id.$key.bam_transcript.bam`, example: `$id.transcript.bam`. Transcript BAM file (optional)" , - "default": "$id.$key.bam_transcript.bam" + "default":"$id.$key.bam_transcript.bam" } @@ -170,7 +170,7 @@ "description": "Type: `boolean_true`, default: `false`. Sort BAM file aligned under transcript coordidate by read name", "help_text": "Type: `boolean_true`, default: `false`. Sort BAM file aligned under transcript coordidate by read name. Setting this option on will produce \ndeterministic maximum likelihood estimations from independent runs. Note that sorting will take long \ntime and lots of memory.\n" , - "default": "False" + "default":false } @@ -181,7 +181,7 @@ "description": "Type: `boolean_true`, default: `false`. Do not output any BAM file", "help_text": "Type: `boolean_true`, default: `false`. Do not output any BAM file." , - "default": "False" + "default":false } @@ -192,7 +192,7 @@ "description": "Type: `boolean_true`, default: `false`. When RSEM generates a BAM file, instead of outputting all alignments a read has with their posterior \nprobabilities, one alignment is sampled according to the posterior probabilities", "help_text": "Type: `boolean_true`, default: `false`. When RSEM generates a BAM file, instead of outputting all alignments a read has with their posterior \nprobabilities, one alignment is sampled according to the posterior probabilities. The sampling procedure \nincludes the alignment to the \"noise\" transcript, which does not appear in the BAM file. Only the \nsampled alignment has a weight of 1. All other alignments have weight 0. If the \"noise\" transcript is \nsampled, all alignments appeared in the BAM file should have weight 0.\n" , - "default": "False" + "default":false } @@ -203,7 +203,7 @@ "description": "Type: `boolean_true`, default: `false`. Generate a BAM file, \u0027sample_name", "help_text": "Type: `boolean_true`, default: `false`. Generate a BAM file, \u0027sample_name.genome.bam\u0027, with alignments mapped to genomic coordinates and \nannotated with their posterior probabilities. In addition, RSEM will call samtools (included in RSEM \npackage) to sort and index the bam file. \u0027sample_name.genome.sorted.bam\u0027 and \u0027sample_name.genome.sorted.bam.bai\u0027 \nwill be generated.\n" , - "default": "False" + "default":false } @@ -214,7 +214,7 @@ "description": "Type: `boolean_true`, default: `false`. Sort RSEM generated transcript and genome BAM files by coordinates and build associated indices", "help_text": "Type: `boolean_true`, default: `false`. Sort RSEM generated transcript and genome BAM files by coordinates and build associated indices.\n" , - "default": "False" + "default":false } @@ -235,7 +235,7 @@ "description": "Type: `boolean_true`, default: `false`. Input reads do not contain quality scores", "help_text": "Type: `boolean_true`, default: `false`. Input reads do not contain quality scores." , - "default": "False" + "default":false } @@ -246,7 +246,7 @@ "description": "Type: `boolean_true`, default: `false`. Input file contains alignments in SAM/BAM/CRAM format", "help_text": "Type: `boolean_true`, default: `false`. Input file contains alignments in SAM/BAM/CRAM format. The exact file format will be determined \nautomatically.\n" , - "default": "False" + "default":false } @@ -267,7 +267,7 @@ "description": "Type: `boolean_true`, default: `false`. Use Bowtie 2 instead of Bowtie to align reads", "help_text": "Type: `boolean_true`, default: `false`. Use Bowtie 2 instead of Bowtie to align reads. Since currently RSEM does not handle indel, local \nand discordant alignments, the Bowtie2 parameters are set in a way to avoid those alignments. In \nparticular, we use options \u0027--sensitive --dpad 0 --gbar 99999999 --mp 1,1 --np 1 --score_min L,0,-0.1\u0027 \nby default. The last parameter of \u0027--score_min\u0027, \u0027-0.1\u0027, is the negative of maximum mismatch rate. \nThis rate can be set by option \u0027--bowtie2_mismatch_rate\u0027. If reads are paired-end, we additionally \nuse options \u0027--no_mixed\u0027 and \u0027--no_discordant\u0027.\n" , - "default": "False" + "default":false } @@ -278,7 +278,7 @@ "description": "Type: `boolean_true`, default: `false`. Use STAR to align reads", "help_text": "Type: `boolean_true`, default: `false`. Use STAR to align reads. Alignment parameters are from ENCODE3\u0027s STAR-RSEM pipeline. To save \ncomputational time and memory resources, STAR\u0027s Output BAM file is unsorted. It is stored in RSEM\u0027s \ntemporary directory with name as \u0027sample_name.bam\u0027. Each STAR job will have its own private copy of \nthe genome in memory.\n" , - "default": "False" + "default":false } @@ -289,7 +289,7 @@ "description": "Type: `boolean_true`, default: `false`. Use HISAT2 to align reads to the transcriptome according to Human Cell Atlast", "help_text": "Type: `boolean_true`, default: `false`. Use HISAT2 to align reads to the transcriptome according to Human Cell Atlast.\n" , - "default": "False" + "default":false } @@ -300,7 +300,7 @@ "description": "Type: `boolean_true`, default: `false`. If gene_name/transcript_name is available, append it to the end of gene_id/transcript_id (separated \nby \u0027_\u0027) in files \u0027sample_name", "help_text": "Type: `boolean_true`, default: `false`. If gene_name/transcript_name is available, append it to the end of gene_id/transcript_id (separated \nby \u0027_\u0027) in files \u0027sample_name.isoforms.results\u0027 and \u0027sample_name.genes.results\u0027.\n" , - "default": "False" + "default":false } @@ -321,7 +321,7 @@ "description": "Type: `boolean_true`, default: `false`. By default, RSEM uses Dirichlet(1) as the prior to calculate posterior mean estimates and credibility \nintervals", "help_text": "Type: `boolean_true`, default: `false`. By default, RSEM uses Dirichlet(1) as the prior to calculate posterior mean estimates and credibility \nintervals. However, much less genes are expressed in single cell RNA-Seq data. Thus, if you want to \ncompute posterior mean estimates and/or credibility intervals and you have single-cell RNA-Seq data, \nyou are recommended to turn on this option. Then RSEM will use Dirichlet(0.1) as the prior which \nencourage the sparsity of the expression levels.\n" , - "default": "False" + "default":false } @@ -332,7 +332,7 @@ "description": "Type: `boolean_true`, default: `false`. Run RSEM\u0027s collapsed Gibbs sampler to calculate posterior mean estimates", "help_text": "Type: `boolean_true`, default: `false`. Run RSEM\u0027s collapsed Gibbs sampler to calculate posterior mean estimates." , - "default": "False" + "default":false } @@ -343,7 +343,7 @@ "description": "Type: `boolean_true`, default: `false`. Calculate 95% credibility intervals and posterior mean estimates", "help_text": "Type: `boolean_true`, default: `false`. Calculate 95% credibility intervals and posterior mean estimates. The credibility level can be \nchanged by setting \u0027--ci_credibility_level\u0027.\n" , - "default": "False" + "default":false } @@ -354,7 +354,7 @@ "description": "Type: `boolean_true`, default: `false`. Suppress the output of logging information", "help_text": "Type: `boolean_true`, default: `false`. Suppress the output of logging information." , - "default": "False" + "default":false } @@ -385,7 +385,7 @@ "description": "Type: `boolean_true`, default: `false`. Input quality scores are encoded as Phred+64 (default for GA Pipeline ver", "help_text": "Type: `boolean_true`, default: `false`. Input quality scores are encoded as Phred+64 (default for GA Pipeline ver. \u003e= 1.3). This option is \nused by Bowtie, Bowtie 2 and HISAT2. Otherwise, quality score will be encoded as Phred+33. (Default: false)\n" , - "default": "False" + "default":false } @@ -396,7 +396,7 @@ "description": "Type: `boolean_true`, default: `false`. Input quality scores are solexa encoded (from GA Pipeline ver", "help_text": "Type: `boolean_true`, default: `false`. Input quality scores are solexa encoded (from GA Pipeline ver. \u003c 1.3). This option is used by \nBowtie, Bowtie 2 and HISAT2. Otherwise, quality score will be encoded as Phred+33. (Default: false)\n" , - "default": "False" + "default":false } @@ -481,7 +481,7 @@ "description": "Type: `boolean_true`, default: `false`. Input read file(s) is compressed by gzip", "help_text": "Type: `boolean_true`, default: `false`. Input read file(s) is compressed by gzip. (Default: false)\n" , - "default": "False" + "default":false } @@ -492,7 +492,7 @@ "description": "Type: `boolean_true`, default: `false`. Input read file(s) is compressed by bzip2", "help_text": "Type: `boolean_true`, default: `false`. Input read file(s) is compressed by bzip2. (Default: false)\n" , - "default": "False" + "default":false } @@ -503,7 +503,7 @@ "description": "Type: `boolean_true`, default: `false`. Save the BAM file from STAR alignment under genomic coordinate to \u0027sample_name", "help_text": "Type: `boolean_true`, default: `false`. Save the BAM file from STAR alignment under genomic coordinate to \u0027sample_name.STAR.genome.bam\u0027. \nThis file is NOT sorted by genomic coordinate. In this file, according to STAR\u0027s manual, \u0027paired \nends of an alignment are always adjacent, and multiple alignments of a read are adjacent as well\u0027. \n(Default: false)\n" , - "default": "False" + "default":false } @@ -574,7 +574,7 @@ "description": "Type: `boolean_true`, default: `false`. Set this option if you want to estimate the read start position distribution (RSPD) from data", "help_text": "Type: `boolean_true`, default: `false`. Set this option if you want to estimate the read start position distribution (RSPD) from data.\nOtherwise, RSEM will use a uniform RSPD.\n" , - "default": "False" + "default":false } @@ -645,7 +645,7 @@ "description": "Type: `boolean_true`, default: `false`. Keep temporary files generated by RSEM", "help_text": "Type: `boolean_true`, default: `false`. Keep temporary files generated by RSEM. RSEM creates a temporary directory, \u0027sample_name.temp\u0027, \ninto which it puts all intermediate output files. If this directory already exists, RSEM overwrites \nall files generated by previous RSEM runs inside of it. By default, after RSEM finishes, the \ntemporary directory is deleted. Set this option to prevent the deletion of this directory and the \nintermediate files inside of it.\n" , - "default": "False" + "default":false } @@ -666,7 +666,7 @@ "description": "Type: `boolean_true`, default: `false`. Output time consumed by each step of RSEM to \u0027sample_name", "help_text": "Type: `boolean_true`, default: `false`. Output time consumed by each step of RSEM to \u0027sample_name.time\u0027.\n" , - "default": "False" + "default":false } @@ -687,7 +687,7 @@ "description": "Type: `boolean_true`, default: `false`. Running prior-enhanced RSEM (pRSEM)", "help_text": "Type: `boolean_true`, default: `false`. Running prior-enhanced RSEM (pRSEM). Prior parameters, i.e. isoform\u0027s initial pseudo-count for \nRSEM\u0027s Gibbs sampling, will be learned from input RNA-seq data and an external data set. When pRSEM \nneeds and only needs ChIP-seq peak information to partition isoforms (e.g. in pRSEM\u0027s default \npartition model), either ChIP-seq peak file (with the \u0027--chipseq_peak_file\u0027 option) or ChIP-seq \nFASTQ files for target and input and the path for Bowtie executables are required (with the \n\u0027--chipseq_target_read_files \u003cstring\u003e\u0027, \u0027--chipseq_control_read_files \u003cstring\u003e\u0027, and \u0027--bowtie_path \n\u003cpath\u003e options), otherwise, ChIP-seq FASTQ files for target and control and the path to Bowtie \nexecutables are required.\n" , - "default": "False" + "default":false } @@ -748,7 +748,7 @@ "description": "Type: `boolean_true`, default: `false`. Keep a maximum number of ChIP-seq reads that aligned to the same genomic interval", "help_text": "Type: `boolean_true`, default: `false`. Keep a maximum number of ChIP-seq reads that aligned to the same genomic interval. This option is used \nwhen running prior-enhanced RSEM, where prior is learned from multiple complementary data sets. This \noption is only in use when either \u0027--chipseq_read_files_multi_targets \u003cstring\u003e\u0027 or \n\u0027--chipseq_bed_files_multi_targets \u003cstring\u003e\u0027 is specified.\n" , - "default": "False" + "default":false } diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/rsem/rsem_prepare_reference/.config.vsh.yaml b/target/dependencies/vsh/vsh/biobox/main/nextflow/rsem/rsem_prepare_reference/.config.vsh.yaml index b77ed36..94266b8 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/rsem/rsem_prepare_reference/.config.vsh.yaml +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/rsem/rsem_prepare_reference/.config.vsh.yaml @@ -416,9 +416,9 @@ build_info: output: "target/nextflow/rsem/rsem_prepare_reference" executable: "target/nextflow/rsem/rsem_prepare_reference/main.nf" viash_version: "0.9.0" - git_commit: "a13b57d04a3f3741eedd1af10fd96a9bee126f55" - git_remote: "https://x-access-token:ghs_xpDMoQpz4lF1RaGsMH4IlMbO48cLeW1cIYSF@github.com/viash-hub/biobox" - git_tag: "v0.2.0-26-ga13b57d" + git_commit: "952ff0843093b538cbfd6fefdecf2e7a0bc9e70b" + git_remote: "https://x-access-token:ghs_EwAUAMYJ0K4VBHlAEMs4ZP2OyQYqJM0PSfEO@github.com/viash-hub/biobox" + git_tag: "v0.2.0-27-g952ff08" package_config: name: "biobox" version: "main" diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/rsem/rsem_prepare_reference/main.nf b/target/dependencies/vsh/vsh/biobox/main/nextflow/rsem/rsem_prepare_reference/main.nf index 01da680..e4f08ad 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/rsem/rsem_prepare_reference/main.nf +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/rsem/rsem_prepare_reference/main.nf @@ -3245,9 +3245,9 @@ meta = [ "engine" : "docker|native", "output" : "target/nextflow/rsem/rsem_prepare_reference", "viash_version" : "0.9.0", - "git_commit" : "a13b57d04a3f3741eedd1af10fd96a9bee126f55", - "git_remote" : "https://x-access-token:ghs_xpDMoQpz4lF1RaGsMH4IlMbO48cLeW1cIYSF@github.com/viash-hub/biobox", - "git_tag" : "v0.2.0-26-ga13b57d" + "git_commit" : "952ff0843093b538cbfd6fefdecf2e7a0bc9e70b", + "git_remote" : "https://x-access-token:ghs_EwAUAMYJ0K4VBHlAEMs4ZP2OyQYqJM0PSfEO@github.com/viash-hub/biobox", + "git_tag" : "v0.2.0-27-g952ff08" }, "package_config" : { "name" : "biobox", diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/rsem/rsem_prepare_reference/nextflow_schema.json b/target/dependencies/vsh/vsh/biobox/main/nextflow/rsem/rsem_prepare_reference/nextflow_schema.json index 1474274..1a04a5e 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/rsem/rsem_prepare_reference/nextflow_schema.json +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/rsem/rsem_prepare_reference/nextflow_schema.json @@ -50,7 +50,7 @@ "description": "Type: `file`, required, default: `$id.$key.output.output`. Directory containing reference files generated by RSEM", "help_text": "Type: `file`, required, default: `$id.$key.output.output`. Directory containing reference files generated by RSEM." , - "default": "$id.$key.output.output" + "default":"$id.$key.output.output" } @@ -101,7 +101,7 @@ "description": "Type: `boolean_true`, default: `false`. This option is designed for untypical organisms, such as viruses, whose GFF3 files only contain genes", "help_text": "Type: `boolean_true`, default: `false`. This option is designed for untypical organisms, such as viruses, whose GFF3 files only contain genes. RSEM will assume each gene as a unique transcript when it converts the GFF3 file into GTF format." , - "default": "False" + "default":false } @@ -142,7 +142,7 @@ "description": "Type: `boolean_true`, default: `false`. Add poly(A) tails to the end of all reference isoforms", "help_text": "Type: `boolean_true`, default: `false`. Add poly(A) tails to the end of all reference isoforms. The length of poly(A) tail added is specified by \u0027--polyA-length\u0027 option. STAR aligner users may not want to use this option." , - "default": "False" + "default":false } @@ -173,7 +173,7 @@ "description": "Type: `boolean_true`, default: `false`. Build Bowtie indices", "help_text": "Type: `boolean_true`, default: `false`. Build Bowtie indices." , - "default": "False" + "default":false } @@ -184,7 +184,7 @@ "description": "Type: `boolean_true`, default: `false`. Build Bowtie 2 indices", "help_text": "Type: `boolean_true`, default: `false`. Build Bowtie 2 indices." , - "default": "False" + "default":false } @@ -195,7 +195,7 @@ "description": "Type: `boolean_true`, default: `false`. Build STAR indices", "help_text": "Type: `boolean_true`, default: `false`. Build STAR indices." , - "default": "False" + "default":false } @@ -216,7 +216,7 @@ "description": "Type: `boolean_true`, default: `false`. Build HISAT2 indices on the transcriptome according to Human Cell Atlas (HCA) SMART-Seq2 pipeline", "help_text": "Type: `boolean_true`, default: `false`. Build HISAT2 indices on the transcriptome according to Human Cell Atlas (HCA) SMART-Seq2 pipeline." , - "default": "False" + "default":false } @@ -227,7 +227,7 @@ "description": "Type: `boolean_true`, default: `false`. Suppress the output of logging information", "help_text": "Type: `boolean_true`, default: `false`. Suppress the output of logging information." , - "default": "False" + "default":false } @@ -248,7 +248,7 @@ "description": "Type: `boolean_true`, default: `false`. A Boolean indicating whether to prepare reference files for pRSEM, including building Bowtie indices for a genome and selecting training set isoforms", "help_text": "Type: `boolean_true`, default: `false`. A Boolean indicating whether to prepare reference files for pRSEM, including building Bowtie indices for a genome and selecting training set isoforms. The index files will be used for aligning ChIP-seq reads in prior-enhanced RSEM and the training set isoforms will be used for learning prior. A path to Bowtie executables and a mappability file in bigWig format are required when this option is on. Currently, Bowtie2 is not supported for prior-enhanced RSEM." , - "default": "False" + "default":false } diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/rseqc/rseqc_bamstat/.config.vsh.yaml b/target/dependencies/vsh/vsh/biobox/main/nextflow/rseqc/rseqc_bamstat/.config.vsh.yaml index 1bd8d27..a1eb2e2 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/rseqc/rseqc_bamstat/.config.vsh.yaml +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/rseqc/rseqc_bamstat/.config.vsh.yaml @@ -175,9 +175,9 @@ build_info: output: "target/nextflow/rseqc/rseqc_bamstat" executable: "target/nextflow/rseqc/rseqc_bamstat/main.nf" viash_version: "0.9.0" - git_commit: "a13b57d04a3f3741eedd1af10fd96a9bee126f55" - git_remote: "https://x-access-token:ghs_xpDMoQpz4lF1RaGsMH4IlMbO48cLeW1cIYSF@github.com/viash-hub/biobox" - git_tag: "v0.2.0-26-ga13b57d" + git_commit: "952ff0843093b538cbfd6fefdecf2e7a0bc9e70b" + git_remote: "https://x-access-token:ghs_EwAUAMYJ0K4VBHlAEMs4ZP2OyQYqJM0PSfEO@github.com/viash-hub/biobox" + git_tag: "v0.2.0-27-g952ff08" package_config: name: "biobox" version: "main" diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/rseqc/rseqc_bamstat/main.nf b/target/dependencies/vsh/vsh/biobox/main/nextflow/rseqc/rseqc_bamstat/main.nf index e64063b..043175f 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/rseqc/rseqc_bamstat/main.nf +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/rseqc/rseqc_bamstat/main.nf @@ -3036,9 +3036,9 @@ meta = [ "engine" : "docker|native", "output" : "target/nextflow/rseqc/rseqc_bamstat", "viash_version" : "0.9.0", - "git_commit" : "a13b57d04a3f3741eedd1af10fd96a9bee126f55", - "git_remote" : "https://x-access-token:ghs_xpDMoQpz4lF1RaGsMH4IlMbO48cLeW1cIYSF@github.com/viash-hub/biobox", - "git_tag" : "v0.2.0-26-ga13b57d" + "git_commit" : "952ff0843093b538cbfd6fefdecf2e7a0bc9e70b", + "git_remote" : "https://x-access-token:ghs_EwAUAMYJ0K4VBHlAEMs4ZP2OyQYqJM0PSfEO@github.com/viash-hub/biobox", + "git_tag" : "v0.2.0-27-g952ff08" }, "package_config" : { "name" : "biobox", diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/rseqc/rseqc_bamstat/nextflow_schema.json b/target/dependencies/vsh/vsh/biobox/main/nextflow/rseqc/rseqc_bamstat/nextflow_schema.json index 21b1df1..e84def6 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/rseqc/rseqc_bamstat/nextflow_schema.json +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/rseqc/rseqc_bamstat/nextflow_schema.json @@ -50,7 +50,7 @@ "description": "Type: `file`, default: `$id.$key.output.output`. Output file (txt) with mapping quality statistics", "help_text": "Type: `file`, default: `$id.$key.output.output`. Output file (txt) with mapping quality statistics." , - "default": "$id.$key.output.output" + "default":"$id.$key.output.output" } diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/rseqc/rseqc_inferexperiment/.config.vsh.yaml b/target/dependencies/vsh/vsh/biobox/main/nextflow/rseqc/rseqc_inferexperiment/.config.vsh.yaml index 73ab053..dd24905 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/rseqc/rseqc_inferexperiment/.config.vsh.yaml +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/rseqc/rseqc_inferexperiment/.config.vsh.yaml @@ -201,9 +201,9 @@ build_info: output: "target/nextflow/rseqc/rseqc_inferexperiment" executable: "target/nextflow/rseqc/rseqc_inferexperiment/main.nf" viash_version: "0.9.0" - git_commit: "a13b57d04a3f3741eedd1af10fd96a9bee126f55" - git_remote: "https://x-access-token:ghs_xpDMoQpz4lF1RaGsMH4IlMbO48cLeW1cIYSF@github.com/viash-hub/biobox" - git_tag: "v0.2.0-26-ga13b57d" + git_commit: "952ff0843093b538cbfd6fefdecf2e7a0bc9e70b" + git_remote: "https://x-access-token:ghs_EwAUAMYJ0K4VBHlAEMs4ZP2OyQYqJM0PSfEO@github.com/viash-hub/biobox" + git_tag: "v0.2.0-27-g952ff08" package_config: name: "biobox" version: "main" diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/rseqc/rseqc_inferexperiment/main.nf b/target/dependencies/vsh/vsh/biobox/main/nextflow/rseqc/rseqc_inferexperiment/main.nf index 1a007ad..8c96bf6 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/rseqc/rseqc_inferexperiment/main.nf +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/rseqc/rseqc_inferexperiment/main.nf @@ -3069,9 +3069,9 @@ meta = [ "engine" : "docker|native", "output" : "target/nextflow/rseqc/rseqc_inferexperiment", "viash_version" : "0.9.0", - "git_commit" : "a13b57d04a3f3741eedd1af10fd96a9bee126f55", - "git_remote" : "https://x-access-token:ghs_xpDMoQpz4lF1RaGsMH4IlMbO48cLeW1cIYSF@github.com/viash-hub/biobox", - "git_tag" : "v0.2.0-26-ga13b57d" + "git_commit" : "952ff0843093b538cbfd6fefdecf2e7a0bc9e70b", + "git_remote" : "https://x-access-token:ghs_EwAUAMYJ0K4VBHlAEMs4ZP2OyQYqJM0PSfEO@github.com/viash-hub/biobox", + "git_tag" : "v0.2.0-27-g952ff08" }, "package_config" : { "name" : "biobox", diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/rseqc/rseqc_inferexperiment/nextflow_schema.json b/target/dependencies/vsh/vsh/biobox/main/nextflow/rseqc/rseqc_inferexperiment/nextflow_schema.json index 5ac5937..1ab703c 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/rseqc/rseqc_inferexperiment/nextflow_schema.json +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/rseqc/rseqc_inferexperiment/nextflow_schema.json @@ -50,7 +50,7 @@ "description": "Type: `file`, required, default: `$id.$key.output.txt`, example: `$id.strandedness.txt`. Output file (txt) of strandness report", "help_text": "Type: `file`, required, default: `$id.$key.output.txt`, example: `$id.strandedness.txt`. Output file (txt) of strandness report." , - "default": "$id.$key.output.txt" + "default":"$id.$key.output.txt" } diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/rseqc/rseqc_inner_distance/.config.vsh.yaml b/target/dependencies/vsh/vsh/biobox/main/nextflow/rseqc/rseqc_inner_distance/.config.vsh.yaml index ccf4c4a..43639d0 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/rseqc/rseqc_inner_distance/.config.vsh.yaml +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/rseqc/rseqc_inner_distance/.config.vsh.yaml @@ -294,9 +294,9 @@ build_info: output: "target/nextflow/rseqc/rseqc_inner_distance" executable: "target/nextflow/rseqc/rseqc_inner_distance/main.nf" viash_version: "0.9.0" - git_commit: "a13b57d04a3f3741eedd1af10fd96a9bee126f55" - git_remote: "https://x-access-token:ghs_xpDMoQpz4lF1RaGsMH4IlMbO48cLeW1cIYSF@github.com/viash-hub/biobox" - git_tag: "v0.2.0-26-ga13b57d" + git_commit: "952ff0843093b538cbfd6fefdecf2e7a0bc9e70b" + git_remote: "https://x-access-token:ghs_EwAUAMYJ0K4VBHlAEMs4ZP2OyQYqJM0PSfEO@github.com/viash-hub/biobox" + git_tag: "v0.2.0-27-g952ff08" package_config: name: "biobox" version: "main" diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/rseqc/rseqc_inner_distance/main.nf b/target/dependencies/vsh/vsh/biobox/main/nextflow/rseqc/rseqc_inner_distance/main.nf index de086a1..0a0e0ec 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/rseqc/rseqc_inner_distance/main.nf +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/rseqc/rseqc_inner_distance/main.nf @@ -3169,9 +3169,9 @@ meta = [ "engine" : "docker|native", "output" : "target/nextflow/rseqc/rseqc_inner_distance", "viash_version" : "0.9.0", - "git_commit" : "a13b57d04a3f3741eedd1af10fd96a9bee126f55", - "git_remote" : "https://x-access-token:ghs_xpDMoQpz4lF1RaGsMH4IlMbO48cLeW1cIYSF@github.com/viash-hub/biobox", - "git_tag" : "v0.2.0-26-ga13b57d" + "git_commit" : "952ff0843093b538cbfd6fefdecf2e7a0bc9e70b", + "git_remote" : "https://x-access-token:ghs_EwAUAMYJ0K4VBHlAEMs4ZP2OyQYqJM0PSfEO@github.com/viash-hub/biobox", + "git_tag" : "v0.2.0-27-g952ff08" }, "package_config" : { "name" : "biobox", diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/rseqc/rseqc_inner_distance/nextflow_schema.json b/target/dependencies/vsh/vsh/biobox/main/nextflow/rseqc/rseqc_inner_distance/nextflow_schema.json index 34e9318..9f62271 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/rseqc/rseqc_inner_distance/nextflow_schema.json +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/rseqc/rseqc_inner_distance/nextflow_schema.json @@ -110,7 +110,7 @@ "description": "Type: `file`, default: `$id.$key.output_stats.output_stats`. output file (txt) with summary statistics of inner distances of paired reads", "help_text": "Type: `file`, default: `$id.$key.output_stats.output_stats`. output file (txt) with summary statistics of inner distances of paired reads" , - "default": "$id.$key.output_stats.output_stats" + "default":"$id.$key.output_stats.output_stats" } @@ -121,7 +121,7 @@ "description": "Type: `file`, default: `$id.$key.output_dist.output_dist`. output file (txt) with inner distances of all paired reads", "help_text": "Type: `file`, default: `$id.$key.output_dist.output_dist`. output file (txt) with inner distances of all paired reads" , - "default": "$id.$key.output_dist.output_dist" + "default":"$id.$key.output_dist.output_dist" } @@ -132,7 +132,7 @@ "description": "Type: `file`, default: `$id.$key.output_freq.output_freq`. output file (txt) with frequencies of inner distances of all paired reads", "help_text": "Type: `file`, default: `$id.$key.output_freq.output_freq`. output file (txt) with frequencies of inner distances of all paired reads" , - "default": "$id.$key.output_freq.output_freq" + "default":"$id.$key.output_freq.output_freq" } @@ -143,7 +143,7 @@ "description": "Type: `file`, default: `$id.$key.output_plot.output_plot`. output file (pdf) with histogram plot of of inner distances of all paired reads", "help_text": "Type: `file`, default: `$id.$key.output_plot.output_plot`. output file (pdf) with histogram plot of of inner distances of all paired reads" , - "default": "$id.$key.output_plot.output_plot" + "default":"$id.$key.output_plot.output_plot" } @@ -154,7 +154,7 @@ "description": "Type: `file`, default: `$id.$key.output_plot_r.output_plot_r`. output file (R) with script of histogram plot of of inner distances of all paired reads", "help_text": "Type: `file`, default: `$id.$key.output_plot_r.output_plot_r`. output file (R) with script of histogram plot of of inner distances of all paired reads" , - "default": "$id.$key.output_plot_r.output_plot_r" + "default":"$id.$key.output_plot_r.output_plot_r" } diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/salmon/salmon_index/.config.vsh.yaml b/target/dependencies/vsh/vsh/biobox/main/nextflow/salmon/salmon_index/.config.vsh.yaml index 9426bd8..29e1d6a 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/salmon/salmon_index/.config.vsh.yaml +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/salmon/salmon_index/.config.vsh.yaml @@ -277,9 +277,9 @@ build_info: output: "target/nextflow/salmon/salmon_index" executable: "target/nextflow/salmon/salmon_index/main.nf" viash_version: "0.9.0" - git_commit: "a13b57d04a3f3741eedd1af10fd96a9bee126f55" - git_remote: "https://x-access-token:ghs_xpDMoQpz4lF1RaGsMH4IlMbO48cLeW1cIYSF@github.com/viash-hub/biobox" - git_tag: "v0.2.0-26-ga13b57d" + git_commit: "952ff0843093b538cbfd6fefdecf2e7a0bc9e70b" + git_remote: "https://x-access-token:ghs_EwAUAMYJ0K4VBHlAEMs4ZP2OyQYqJM0PSfEO@github.com/viash-hub/biobox" + git_tag: "v0.2.0-27-g952ff08" package_config: name: "biobox" version: "main" diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/salmon/salmon_index/main.nf b/target/dependencies/vsh/vsh/biobox/main/nextflow/salmon/salmon_index/main.nf index 66caf72..33a48b3 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/salmon/salmon_index/main.nf +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/salmon/salmon_index/main.nf @@ -3129,9 +3129,9 @@ meta = [ "engine" : "docker|native", "output" : "target/nextflow/salmon/salmon_index", "viash_version" : "0.9.0", - "git_commit" : "a13b57d04a3f3741eedd1af10fd96a9bee126f55", - "git_remote" : "https://x-access-token:ghs_xpDMoQpz4lF1RaGsMH4IlMbO48cLeW1cIYSF@github.com/viash-hub/biobox", - "git_tag" : "v0.2.0-26-ga13b57d" + "git_commit" : "952ff0843093b538cbfd6fefdecf2e7a0bc9e70b", + "git_remote" : "https://x-access-token:ghs_EwAUAMYJ0K4VBHlAEMs4ZP2OyQYqJM0PSfEO@github.com/viash-hub/biobox", + "git_tag" : "v0.2.0-27-g952ff08" }, "package_config" : { "name" : "biobox", diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/salmon/salmon_index/nextflow_schema.json b/target/dependencies/vsh/vsh/biobox/main/nextflow/salmon/salmon_index/nextflow_schema.json index 9c28220..d21c0ee 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/salmon/salmon_index/nextflow_schema.json +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/salmon/salmon_index/nextflow_schema.json @@ -50,7 +50,7 @@ "description": "Type: `boolean_true`, default: `false`. This flag will expect the input transcript fasta to be in GENCODE format, and will split the transcript name at the first \u0027|\u0027 character", "help_text": "Type: `boolean_true`, default: `false`. This flag will expect the input transcript fasta to be in GENCODE format, and will split the transcript name at the first \u0027|\u0027 character. These reduced names will be used in the output and when looking for these transcripts in a gene to transcript GTF.\n" , - "default": "False" + "default":false } @@ -61,7 +61,7 @@ "description": "Type: `boolean_true`, default: `false`. This flag will expect the input reference to be in the tsv file format, and will split the feature name at the first \u0027tab\u0027 character", "help_text": "Type: `boolean_true`, default: `false`. This flag will expect the input reference to be in the tsv file format, and will split the feature name at the first \u0027tab\u0027 character. These reduced names will be used in the output and when looking for the sequence of the features.GTF.\n" , - "default": "False" + "default":false } @@ -72,7 +72,7 @@ "description": "Type: `boolean_true`, default: `false`. This flag will disable the default indexing behavior of discarding sequence-identical duplicate transcripts", "help_text": "Type: `boolean_true`, default: `false`. This flag will disable the default indexing behavior of discarding sequence-identical duplicate transcripts. If this flag is passed, then duplicate transcripts that appear in the input will be retained and quantified separately.\n" , - "default": "False" + "default":false } @@ -83,7 +83,7 @@ "description": "Type: `boolean_true`, default: `false`. Retain the fixed fasta file (without short transcripts and duplicates, clipped, etc", "help_text": "Type: `boolean_true`, default: `false`. Retain the fixed fasta file (without short transcripts and duplicates, clipped, etc.) generated during indexing.\n" , - "default": "False" + "default":false } @@ -104,7 +104,7 @@ "description": "Type: `boolean_true`, default: `false`. Build the index using a sparse sampling of k-mer positions This will require less memory (especially during quantification), but will take longer to construct and can slow down mapping / alignment", "help_text": "Type: `boolean_true`, default: `false`. Build the index using a sparse sampling of k-mer positions This will require less memory (especially during quantification), but will take longer to construct and can slow down mapping / alignment.\n" , - "default": "False" + "default":false } @@ -125,7 +125,7 @@ "description": "Type: `boolean_true`, default: `false`. Don\u0027t clip poly-A tails from the ends of target sequences", "help_text": "Type: `boolean_true`, default: `false`. Don\u0027t clip poly-A tails from the ends of target sequences.\n" , - "default": "False" + "default":false } @@ -156,7 +156,7 @@ "description": "Type: `file`, required, default: `$id.$key.index.index`, example: `Salmon_index`. Salmon index\n", "help_text": "Type: `file`, required, default: `$id.$key.index.index`, example: `Salmon_index`. Salmon index\n" , - "default": "$id.$key.index.index" + "default":"$id.$key.index.index" } diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/salmon/salmon_quant/.config.vsh.yaml b/target/dependencies/vsh/vsh/biobox/main/nextflow/salmon/salmon_quant/.config.vsh.yaml index 1f7058a..cdcde82 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/salmon/salmon_quant/.config.vsh.yaml +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/salmon/salmon_quant/.config.vsh.yaml @@ -1173,9 +1173,9 @@ build_info: output: "target/nextflow/salmon/salmon_quant" executable: "target/nextflow/salmon/salmon_quant/main.nf" viash_version: "0.9.0" - git_commit: "a13b57d04a3f3741eedd1af10fd96a9bee126f55" - git_remote: "https://x-access-token:ghs_xpDMoQpz4lF1RaGsMH4IlMbO48cLeW1cIYSF@github.com/viash-hub/biobox" - git_tag: "v0.2.0-26-ga13b57d" + git_commit: "952ff0843093b538cbfd6fefdecf2e7a0bc9e70b" + git_remote: "https://x-access-token:ghs_EwAUAMYJ0K4VBHlAEMs4ZP2OyQYqJM0PSfEO@github.com/viash-hub/biobox" + git_tag: "v0.2.0-27-g952ff08" package_config: name: "biobox" version: "main" diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/salmon/salmon_quant/main.nf b/target/dependencies/vsh/vsh/biobox/main/nextflow/salmon/salmon_quant/main.nf index 21999e3a..c86bbd5 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/salmon/salmon_quant/main.nf +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/salmon/salmon_quant/main.nf @@ -3964,9 +3964,9 @@ meta = [ "engine" : "docker|native", "output" : "target/nextflow/salmon/salmon_quant", "viash_version" : "0.9.0", - "git_commit" : "a13b57d04a3f3741eedd1af10fd96a9bee126f55", - "git_remote" : "https://x-access-token:ghs_xpDMoQpz4lF1RaGsMH4IlMbO48cLeW1cIYSF@github.com/viash-hub/biobox", - "git_tag" : "v0.2.0-26-ga13b57d" + "git_commit" : "952ff0843093b538cbfd6fefdecf2e7a0bc9e70b", + "git_remote" : "https://x-access-token:ghs_EwAUAMYJ0K4VBHlAEMs4ZP2OyQYqJM0PSfEO@github.com/viash-hub/biobox", + "git_tag" : "v0.2.0-27-g952ff08" }, "package_config" : { "name" : "biobox", diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/salmon/salmon_quant/nextflow_schema.json b/target/dependencies/vsh/vsh/biobox/main/nextflow/salmon/salmon_quant/nextflow_schema.json index 0b9e23d..16d210f 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/salmon/salmon_quant/nextflow_schema.json +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/salmon/salmon_quant/nextflow_schema.json @@ -22,7 +22,7 @@ "enum": ["A", "U", "SF", "SR", "IU", "IS", "ISF", "ISR", "OU", "OS", "OSF", "OSR", "MU", "MS", "MSF", "MSR"] , - "default": "A" + "default":"A" } @@ -93,7 +93,7 @@ "description": "Type: `boolean_true`, default: `false`. Discard orphan alignments in the input [for alignment-based mode only]", "help_text": "Type: `boolean_true`, default: `false`. Discard orphan alignments in the input [for alignment-based mode only]. If this flag is passed, then only paired alignments will be considered toward quantification estimates. The default behavior is to consider orphan alignments if no valid paired mappings exist.\n" , - "default": "False" + "default":false } @@ -134,7 +134,7 @@ "description": "Type: `boolean_true`, default: `false`. Use alignment model for Oxford Nanopore long reads\n", "help_text": "Type: `boolean_true`, default: `false`. Use alignment model for Oxford Nanopore long reads\n" , - "default": "False" + "default":false } @@ -155,7 +155,7 @@ "description": "Type: `file`, required, default: `$id.$key.output.output`, example: `quant_output`. Output quantification directory", "help_text": "Type: `file`, required, default: `$id.$key.output.output`, example: `quant_output`. Output quantification directory.\n" , - "default": "$id.$key.output.output" + "default":"$id.$key.output.output" } @@ -166,7 +166,7 @@ "description": "Type: `file`, default: `$id.$key.quant_results.sf`, example: `quant.sf`. Salmon quantification file", "help_text": "Type: `file`, default: `$id.$key.quant_results.sf`, example: `quant.sf`. Salmon quantification file.\n" , - "default": "$id.$key.quant_results.sf" + "default":"$id.$key.quant_results.sf" } @@ -187,7 +187,7 @@ "description": "Type: `boolean_true`, default: `false`. Perform sequence-specific bias correction", "help_text": "Type: `boolean_true`, default: `false`. Perform sequence-specific bias correction.\n" , - "default": "False" + "default":false } @@ -198,7 +198,7 @@ "description": "Type: `boolean_true`, default: `false`. Perform fragment GC bias correction [beta for single-end reads]", "help_text": "Type: `boolean_true`, default: `false`. Perform fragment GC bias correction [beta for single-end reads].\n" , - "default": "False" + "default":false } @@ -209,7 +209,7 @@ "description": "Type: `boolean_true`, default: `false`. Perform positional bias correction", "help_text": "Type: `boolean_true`, default: `false`. Perform positional bias correction.\n" , - "default": "False" + "default":false } @@ -250,7 +250,7 @@ "description": "Type: `boolean_true`, default: `false`. If you\u0027re using Salmon on a metagenomic dataset, consider setting this flag to disable parts of the abundance estimation model that make less sense for metagenomic data", "help_text": "Type: `boolean_true`, default: `false`. If you\u0027re using Salmon on a metagenomic dataset, consider setting this flag to disable parts of the abundance estimation model that make less sense for metagenomic data.\n" , - "default": "False" + "default":false } @@ -281,7 +281,7 @@ "description": "Type: `boolean_true`, default: `false`. [selective-alignment mode only] \nDiscard orphan mappings in selective-alignment mode", "help_text": "Type: `boolean_true`, default: `false`. [selective-alignment mode only] \nDiscard orphan mappings in selective-alignment mode. If this flag is passed then only paired mappings will be considered toward quantification estimates. The default behavior is to consider orphan mappings if no valid paired mappings exist. This flag is independent of the option to write the orphaned mappings to file (--writeOrphanLinks).\n" , - "default": "False" + "default":false } @@ -352,7 +352,7 @@ "description": "Type: `boolean_true`, default: `false`. [selective-alignment mode only] \nBy default, the heuristic of (Li 2018) is implemented, which terminates the chaining DP once a given number of valid backpointers are found", "help_text": "Type: `boolean_true`, default: `false`. [selective-alignment mode only] \nBy default, the heuristic of (Li 2018) is implemented, which terminates the chaining DP once a given number of valid backpointers are found. This speeds up the seed (MEM) chaining step, but may result in sub-optimal chains in complex situations (e.g. sequences with many repeats and overlapping repeats). Passing this flag will disable the chaining heuristic, and perform the full chaining dynamic program, guaranteeing the optimal chain is found in this step.\n" , - "default": "False" + "default":false } @@ -423,7 +423,7 @@ "description": "Type: `boolean_true`, default: `false`. [selective-alignment mode only] \nAllow dovetailing mappings", "help_text": "Type: `boolean_true`, default: `false`. [selective-alignment mode only] \nAllow dovetailing mappings.\n" , - "default": "False" + "default":false } @@ -434,7 +434,7 @@ "description": "Type: `boolean_true`, default: `false`. [selective-alignment mode only] \nAttempt to recover the mates of orphaned reads", "help_text": "Type: `boolean_true`, default: `false`. [selective-alignment mode only] \nAttempt to recover the mates of orphaned reads. This uses edlib for orphan recovery, and so introduces some computational overhead, but it can improve sensitivity.\n" , - "default": "False" + "default":false } @@ -445,7 +445,7 @@ "description": "Type: `boolean_true`, default: `false`. [selective-alignment mode only] \nSet flags to mimic parameters similar to Bowtie2 with --no-discordant and --no-mixed flags", "help_text": "Type: `boolean_true`, default: `false`. [selective-alignment mode only] \nSet flags to mimic parameters similar to Bowtie2 with --no-discordant and --no-mixed flags. This increases disallows dovetailing reads, and discards orphans. Note, this does not impose the very strict parameters assumed by RSEM+Bowtie2, like gapless alignments. For that behavior, use the --mimic_strictBT2 flag below.\n" , - "default": "False" + "default":false } @@ -456,7 +456,7 @@ "description": "Type: `boolean_true`, default: `false`. [selective-alignment mode only] \nSet flags to mimic the very strict parameters used by RSEM+Bowtie2", "help_text": "Type: `boolean_true`, default: `false`. [selective-alignment mode only] \nSet flags to mimic the very strict parameters used by RSEM+Bowtie2. This increases --min_score_fraction to 0.8, disallows dovetailing reads, discards orphans, and disallows gaps in alignments.\n" , - "default": "False" + "default":false } @@ -467,7 +467,7 @@ "description": "Type: `boolean_true`, default: `false`. [selective-alignment mode only] \nAllos soft-clipping of reads during selective-alignment", "help_text": "Type: `boolean_true`, default: `false`. [selective-alignment mode only] \nAllos soft-clipping of reads during selective-alignment. If this option is provided, then regions at the beginning or end of the read can be withheld from alignment without any effect on the resulting score (i.e. neither adding nor removing from the score). This will drastically reduce the penalty if there are mismatches at the beginning or end of the read due to e.g. low-quality bases or adapters. NOTE: Even with soft-clipping enabled, the read must still achieve a score of at least min_score_fraction * maximum achievable score, where the maximum achievable score is computed based on the full (un-clipped) read length.\n" , - "default": "False" + "default":false } @@ -478,7 +478,7 @@ "description": "Type: `boolean_true`, default: `false`. [selective-alignment mode only] \nAllow soft-clipping of reads that overhang the beginning or ends of the transcript", "help_text": "Type: `boolean_true`, default: `false`. [selective-alignment mode only] \nAllow soft-clipping of reads that overhang the beginning or ends of the transcript. In this case, the overhaning section of the read will simply be unaligned, and will not contribute or detract from the alignment score. The default policy is to force an end-to-end alignment of the entire read, so that overhanings will result in some deletion of nucleotides from the read.\n" , - "default": "False" + "default":false } @@ -489,7 +489,7 @@ "description": "Type: `boolean_true`, default: `false`. [selective-alignment mode only] \nPerform selective alignment over the full length of the read, beginning from the (approximate) initial mapping location and using extension alignment", "help_text": "Type: `boolean_true`, default: `false`. [selective-alignment mode only] \nPerform selective alignment over the full length of the read, beginning from the (approximate) initial mapping location and using extension alignment. This is in contrast with the default behavior which is to only perform alignment between the MEMs in the optimal chain (and before the first and after the last MEM if applicable). The default strategy forces the MEMs to belong to the alignment, but has the benefit that it can discover indels prior to the first hit shared between the read and reference. Except in very rare circumstances, the default mode should be more accurate.\n" , - "default": "False" + "default":false } @@ -500,7 +500,7 @@ "description": "Type: `boolean_true`, default: `false`. [selective-alignment mode only] \nInstead of weighting mappings by their alignment score, this flag will discard any mappings with sub-optimal alignment score", "help_text": "Type: `boolean_true`, default: `false`. [selective-alignment mode only] \nInstead of weighting mappings by their alignment score, this flag will discard any mappings with sub-optimal alignment score. The default option of soft-filtering (i.e. weighting mappings by their alignment score) usually yields slightly more accurate abundance estimates but this flag may be desirable if you want more accurate \u0027naive\u0027 equivalence classes, rather than range factorized equivalence classes.\n" , - "default": "False" + "default":false } @@ -521,7 +521,7 @@ "description": "Type: `boolean_true`, default: `false`. If this option is provided, then the selective-alignment results will be written out in SAM-compatible format", "help_text": "Type: `boolean_true`, default: `false`. If this option is provided, then the selective-alignment results will be written out in SAM-compatible format. By default, output will be directed to stdout, but an alternative file name can be provided instead.\n" , - "default": "False" + "default":false } @@ -532,7 +532,7 @@ "description": "Type: `file`, default: `$id.$key.mapping_sam.sam`, example: `mappings.sam`. Path to file that should output the selective-alignment results in SAM-compatible format", "help_text": "Type: `file`, default: `$id.$key.mapping_sam.sam`, example: `mappings.sam`. Path to file that should output the selective-alignment results in SAM-compatible format. This option must be provided while using --write_mappings" , - "default": "$id.$key.mapping_sam.sam" + "default":"$id.$key.mapping_sam.sam" } @@ -543,7 +543,7 @@ "description": "Type: `boolean_true`, default: `false`. This flag only has meaning if mappings are being written (with --write_mappings/-z)", "help_text": "Type: `boolean_true`, default: `false`. This flag only has meaning if mappings are being written (with --write_mappings/-z). If this flag is provided, then the output SAM file will contain quality strings as well as read sequences. Note that this can greatly increase the size of the output file.\n" , - "default": "False" + "default":false } @@ -576,7 +576,7 @@ "description": "Type: `boolean_true`, default: `false`. Use an alternative strategy (rather than simple interpolation between) the online and uniform abundance estimates to initialize the EM / VBEM algorithm", "help_text": "Type: `boolean_true`, default: `false`. Use an alternative strategy (rather than simple interpolation between) the online and uniform abundance estimates to initialize the EM / VBEM algorithm.\n" , - "default": "False" + "default":false } @@ -587,7 +587,7 @@ "description": "Type: `file`, default: `$id.$key.aux_dir.aux_dir`, example: `aux_info`. The sub-directory of the quantification directory where auxiliary information e", "help_text": "Type: `file`, default: `$id.$key.aux_dir.aux_dir`, example: `aux_info`. The sub-directory of the quantification directory where auxiliary information e.g. bootstraps, bias parameters, etc. will be written.\n" , - "default": "$id.$key.aux_dir.aux_dir" + "default":"$id.$key.aux_dir.aux_dir" } @@ -598,7 +598,7 @@ "description": "Type: `boolean_true`, default: `false`. Skip performing the actual transcript quantification (including any Gibbs sampling or bootstrapping)", "help_text": "Type: `boolean_true`, default: `false`. Skip performing the actual transcript quantification (including any Gibbs sampling or bootstrapping).\n" , - "default": "False" + "default":false } @@ -609,7 +609,7 @@ "description": "Type: `boolean_true`, default: `false`. Dump the simple equivalence class counts that were computed during mapping or alignment", "help_text": "Type: `boolean_true`, default: `false`. Dump the simple equivalence class counts that were computed during mapping or alignment.\n" , - "default": "False" + "default":false } @@ -620,7 +620,7 @@ "description": "Type: `boolean_true`, default: `false`. Dump conditional probabilities associated with transcripts when equivalence class information is being dumped to file", "help_text": "Type: `boolean_true`, default: `false`. Dump conditional probabilities associated with transcripts when equivalence class information is being dumped to file. Note, this will dump the factorization that is actually used by salmon\u0027s offline phase for inference. If you are using range-factorized equivalence classes (the default) then the same transcript set may appear multiple times with different associated conditional probabilities.\n" , - "default": "False" + "default":false } @@ -641,7 +641,7 @@ "description": "Type: `boolean_true`, default: `false`. If this option is selected, a more memory efficient (but slightly slower) representation is used to compute fragment GC content", "help_text": "Type: `boolean_true`, default: `false`. If this option is selected, a more memory efficient (but slightly slower) representation is used to compute fragment GC content. Enabling this will reduce memory usage, but can also reduce speed. However, the results themselves will remain the same.\n" , - "default": "False" + "default":false } @@ -702,7 +702,7 @@ "description": "Type: `boolean_true`, default: `false`. Initialize the offline inference with uniform parameters, rather than seeding with online parameters", "help_text": "Type: `boolean_true`, default: `false`. Initialize the offline inference with uniform parameters, rather than seeding with online parameters.\n" , - "default": "False" + "default":false } @@ -733,7 +733,7 @@ "description": "Type: `boolean_true`, default: `false`. Entirely disables length correction when estimating the abundance of transcripts", "help_text": "Type: `boolean_true`, default: `false`. Entirely disables length correction when estimating the abundance of transcripts. This option can be used with protocols where one expects that fragments derive from their underlying targets without regard to that target\u0027s length (e.g. QuantSeq)\n" , - "default": "False" + "default":false } @@ -744,7 +744,7 @@ "description": "Type: `boolean_true`, default: `false`. Disables effective length correction when computing the probability that a fragment was generated from a transcript", "help_text": "Type: `boolean_true`, default: `false`. Disables effective length correction when computing the probability that a fragment was generated from a transcript. If this flag is passed in,the fragment length distribution is not taken into account when computing this probability.\n" , - "default": "False" + "default":false } @@ -755,7 +755,7 @@ "description": "Type: `boolean_true`, default: `false`. Disables the estimation of an associated fragment length probability for single-end reads or for orphaned mappings in paired-end libraries", "help_text": "Type: `boolean_true`, default: `false`. Disables the estimation of an associated fragment length probability for single-end reads or for orphaned mappings in paired-end libraries. The default behavior is to consider the probability of all possible fragment lengths associated with the retained mapping. Enabling this flag (i.e. turning this default behavior off) will simply not attempt to estimate a fragment length probability in such cases.\n" , - "default": "False" + "default":false } @@ -766,7 +766,7 @@ "description": "Type: `boolean_true`, default: `false`. Don\u0027t consider concordance with the learned fragment length distribution when trying to determine the probability that a fragment has originated from a specified location", "help_text": "Type: `boolean_true`, default: `false`. Don\u0027t consider concordance with the learned fragment length distribution when trying to determine the probability that a fragment has originated from a specified location. Normally, Fragments with unlikely lengths will be assigned a smaller relative probability than those with more likely lengths. When this flag is passed in, the observed fragment length has no effect on that fragment\u0027s a priori probability.\n" , - "default": "False" + "default":false } @@ -777,7 +777,7 @@ "description": "Type: `boolean_true`, default: `false`. If this option is enabled, then no (lower) threshold will be set on how short bias correction can make effective lengths", "help_text": "Type: `boolean_true`, default: `false`. If this option is enabled, then no (lower) threshold will be set on how short bias correction can make effective lengths. This can increase the precision of bias correction, but harm robustness. The default correction applies a threshold.\n" , - "default": "False" + "default":false } @@ -818,7 +818,7 @@ "description": "Type: `boolean_true`, default: `false`. Use the traditional EM algorithm for optimization in the batch passes", "help_text": "Type: `boolean_true`, default: `false`. Use the traditional EM algorithm for optimization in the batch passes.\n" , - "default": "False" + "default":false } @@ -829,7 +829,7 @@ "description": "Type: `boolean_true`, default: `false`. Use the Variational Bayesian EM [default]\n", "help_text": "Type: `boolean_true`, default: `false`. Use the Variational Bayesian EM [default]\n" , - "default": "False" + "default":false } @@ -860,7 +860,7 @@ "description": "Type: `boolean_true`, default: `false`. This switch will disable drawing transcript fractions from a Gamma distribution during Gibbs sampling", "help_text": "Type: `boolean_true`, default: `false`. This switch will disable drawing transcript fractions from a Gamma distribution during Gibbs sampling. In this case the sampler does not account for shot-noise, but only assignment ambiguity\n" , - "default": "False" + "default":false } @@ -881,7 +881,7 @@ "description": "Type: `boolean_true`, default: `false`. This switch will learn the parameter distribution from the bootstrapped counts for each sample, but will reproject those parameters onto the original equivalence class counts", "help_text": "Type: `boolean_true`, default: `false`. This switch will learn the parameter distribution from the bootstrapped counts for each sample, but will reproject those parameters onto the original equivalence class counts.\n" , - "default": "False" + "default":false } @@ -902,7 +902,7 @@ "description": "Type: `boolean_true`, default: `false`. Be quiet while doing quantification (don\u0027t write informative output to the console unless something goes wrong)", "help_text": "Type: `boolean_true`, default: `false`. Be quiet while doing quantification (don\u0027t write informative output to the console unless something goes wrong).\n" , - "default": "False" + "default":false } @@ -913,7 +913,7 @@ "description": "Type: `boolean_true`, default: `false`. The prior (either the default or the argument provided via --vb_prior) will be interpreted as a transcript-level prior (i", "help_text": "Type: `boolean_true`, default: `false`. The prior (either the default or the argument provided via --vb_prior) will be interpreted as a transcript-level prior (i.e. each transcript will be given a prior read count of this value)\n" , - "default": "False" + "default":false } @@ -924,7 +924,7 @@ "description": "Type: `boolean_true`, default: `false`. The prior (either the default or the argument provided via --vb_prior) will be interpreted as a nucleotide-level prior (i", "help_text": "Type: `boolean_true`, default: `false`. The prior (either the default or the argument provided via --vb_prior) will be interpreted as a nucleotide-level prior (i.e. each nucleotide will be given a prior read count of this value)\n" , - "default": "False" + "default":false } @@ -955,7 +955,7 @@ "description": "Type: `boolean_true`, default: `false`. Write the transcripts that are linked by orphaned reads", "help_text": "Type: `boolean_true`, default: `false`. Write the transcripts that are linked by orphaned reads.\n" , - "default": "False" + "default":false } @@ -966,7 +966,7 @@ "description": "Type: `boolean_true`, default: `false`. Write the names of un-mapped reads to the file unmapped_names", "help_text": "Type: `boolean_true`, default: `false`. Write the names of un-mapped reads to the file unmapped_names.txt in the auxiliary directory.\n" , - "default": "False" + "default":false } @@ -987,7 +987,7 @@ "description": "Type: `boolean_true`, default: `false`. Turn off the alignment error model, which takes into account the the observed frequency of different types of mismatches / indels when computing the likelihood of a given alignment", "help_text": "Type: `boolean_true`, default: `false`. Turn off the alignment error model, which takes into account the the observed frequency of different types of mismatches / indels when computing the likelihood of a given alignment. Turning this off can speed up alignment-based salmon, but can harm quantification accuracy.\n" , - "default": "False" + "default":false } @@ -1008,7 +1008,7 @@ "description": "Type: `boolean_true`, default: `false`. Write a \"postSample", "help_text": "Type: `boolean_true`, default: `false`. Write a \"postSample.bam\" file in the output directory that will sample the input alignments according to the estimated transcript abundances. If you\u0027re going to perform downstream analysis of the alignments with tools which don\u0027t, themselves, take fragment assignment ambiguity into account, you should use this output.\n" , - "default": "False" + "default":false } @@ -1019,7 +1019,7 @@ "description": "Type: `boolean_true`, default: `false`. In addition to sampling the aligned reads, also write the un-aligned reads to \"postSample", "help_text": "Type: `boolean_true`, default: `false`. In addition to sampling the aligned reads, also write the un-aligned reads to \"postSample.bam\".\n" , - "default": "False" + "default":false } @@ -1030,7 +1030,7 @@ "description": "Type: `boolean_true`, default: `false`. This flag will expect the input transcript fasta to be in GENCODE format, and will split the transcript name at the first \u0027|\u0027 character", "help_text": "Type: `boolean_true`, default: `false`. This flag will expect the input transcript fasta to be in GENCODE format, and will split the transcript name at the first \u0027|\u0027 character. These reduced names will be used in the output and when looking for these transcripts in a gene to transcript GTF.\n" , - "default": "False" + "default":false } diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/samtools/samtools_flagstat/.config.vsh.yaml b/target/dependencies/vsh/vsh/biobox/main/nextflow/samtools/samtools_flagstat/.config.vsh.yaml index 4efc0e0..16adec4 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/samtools/samtools_flagstat/.config.vsh.yaml +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/samtools/samtools_flagstat/.config.vsh.yaml @@ -173,9 +173,9 @@ build_info: output: "target/nextflow/samtools/samtools_flagstat" executable: "target/nextflow/samtools/samtools_flagstat/main.nf" viash_version: "0.9.0" - git_commit: "a13b57d04a3f3741eedd1af10fd96a9bee126f55" - git_remote: "https://x-access-token:ghs_xpDMoQpz4lF1RaGsMH4IlMbO48cLeW1cIYSF@github.com/viash-hub/biobox" - git_tag: "v0.2.0-26-ga13b57d" + git_commit: "952ff0843093b538cbfd6fefdecf2e7a0bc9e70b" + git_remote: "https://x-access-token:ghs_EwAUAMYJ0K4VBHlAEMs4ZP2OyQYqJM0PSfEO@github.com/viash-hub/biobox" + git_tag: "v0.2.0-27-g952ff08" package_config: name: "biobox" version: "main" diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/samtools/samtools_flagstat/main.nf b/target/dependencies/vsh/vsh/biobox/main/nextflow/samtools/samtools_flagstat/main.nf index b637167..31df84f 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/samtools/samtools_flagstat/main.nf +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/samtools/samtools_flagstat/main.nf @@ -3028,9 +3028,9 @@ meta = [ "engine" : "docker|native", "output" : "target/nextflow/samtools/samtools_flagstat", "viash_version" : "0.9.0", - "git_commit" : "a13b57d04a3f3741eedd1af10fd96a9bee126f55", - "git_remote" : "https://x-access-token:ghs_xpDMoQpz4lF1RaGsMH4IlMbO48cLeW1cIYSF@github.com/viash-hub/biobox", - "git_tag" : "v0.2.0-26-ga13b57d" + "git_commit" : "952ff0843093b538cbfd6fefdecf2e7a0bc9e70b", + "git_remote" : "https://x-access-token:ghs_EwAUAMYJ0K4VBHlAEMs4ZP2OyQYqJM0PSfEO@github.com/viash-hub/biobox", + "git_tag" : "v0.2.0-27-g952ff08" }, "package_config" : { "name" : "biobox", diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/samtools/samtools_flagstat/nextflow_schema.json b/target/dependencies/vsh/vsh/biobox/main/nextflow/samtools/samtools_flagstat/nextflow_schema.json index 6c3cfd0..77d8de7 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/samtools/samtools_flagstat/nextflow_schema.json +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/samtools/samtools_flagstat/nextflow_schema.json @@ -50,7 +50,7 @@ "description": "Type: `file`, required, default: `$id.$key.output.flagstat`, example: `output.flagstat`. File containing samtools stats output", "help_text": "Type: `file`, required, default: `$id.$key.output.flagstat`, example: `output.flagstat`. File containing samtools stats output.\n" , - "default": "$id.$key.output.flagstat" + "default":"$id.$key.output.flagstat" } diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/samtools/samtools_idxstats/.config.vsh.yaml b/target/dependencies/vsh/vsh/biobox/main/nextflow/samtools/samtools_idxstats/.config.vsh.yaml index 5bc8c43..ef273e9 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/samtools/samtools_idxstats/.config.vsh.yaml +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/samtools/samtools_idxstats/.config.vsh.yaml @@ -183,9 +183,9 @@ build_info: output: "target/nextflow/samtools/samtools_idxstats" executable: "target/nextflow/samtools/samtools_idxstats/main.nf" viash_version: "0.9.0" - git_commit: "a13b57d04a3f3741eedd1af10fd96a9bee126f55" - git_remote: "https://x-access-token:ghs_xpDMoQpz4lF1RaGsMH4IlMbO48cLeW1cIYSF@github.com/viash-hub/biobox" - git_tag: "v0.2.0-26-ga13b57d" + git_commit: "952ff0843093b538cbfd6fefdecf2e7a0bc9e70b" + git_remote: "https://x-access-token:ghs_EwAUAMYJ0K4VBHlAEMs4ZP2OyQYqJM0PSfEO@github.com/viash-hub/biobox" + git_tag: "v0.2.0-27-g952ff08" package_config: name: "biobox" version: "main" diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/samtools/samtools_idxstats/main.nf b/target/dependencies/vsh/vsh/biobox/main/nextflow/samtools/samtools_idxstats/main.nf index 86aa0a2..2729e99 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/samtools/samtools_idxstats/main.nf +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/samtools/samtools_idxstats/main.nf @@ -3040,9 +3040,9 @@ meta = [ "engine" : "docker|native", "output" : "target/nextflow/samtools/samtools_idxstats", "viash_version" : "0.9.0", - "git_commit" : "a13b57d04a3f3741eedd1af10fd96a9bee126f55", - "git_remote" : "https://x-access-token:ghs_xpDMoQpz4lF1RaGsMH4IlMbO48cLeW1cIYSF@github.com/viash-hub/biobox", - "git_tag" : "v0.2.0-26-ga13b57d" + "git_commit" : "952ff0843093b538cbfd6fefdecf2e7a0bc9e70b", + "git_remote" : "https://x-access-token:ghs_EwAUAMYJ0K4VBHlAEMs4ZP2OyQYqJM0PSfEO@github.com/viash-hub/biobox", + "git_tag" : "v0.2.0-27-g952ff08" }, "package_config" : { "name" : "biobox", diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/samtools/samtools_idxstats/nextflow_schema.json b/target/dependencies/vsh/vsh/biobox/main/nextflow/samtools/samtools_idxstats/nextflow_schema.json index 8426544..3b43ccc 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/samtools/samtools_idxstats/nextflow_schema.json +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/samtools/samtools_idxstats/nextflow_schema.json @@ -60,7 +60,7 @@ "description": "Type: `file`, required, default: `$id.$key.output.idxstats`, example: `output.idxstats`. File containing samtools stats output in tab-delimited format", "help_text": "Type: `file`, required, default: `$id.$key.output.idxstats`, example: `output.idxstats`. File containing samtools stats output in tab-delimited format.\n" , - "default": "$id.$key.output.idxstats" + "default":"$id.$key.output.idxstats" } diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/samtools/samtools_index/.config.vsh.yaml b/target/dependencies/vsh/vsh/biobox/main/nextflow/samtools/samtools_index/.config.vsh.yaml index 7c6beaa..a4ffaa2 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/samtools/samtools_index/.config.vsh.yaml +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/samtools/samtools_index/.config.vsh.yaml @@ -189,9 +189,9 @@ build_info: output: "target/nextflow/samtools/samtools_index" executable: "target/nextflow/samtools/samtools_index/main.nf" viash_version: "0.9.0" - git_commit: "a13b57d04a3f3741eedd1af10fd96a9bee126f55" - git_remote: "https://x-access-token:ghs_xpDMoQpz4lF1RaGsMH4IlMbO48cLeW1cIYSF@github.com/viash-hub/biobox" - git_tag: "v0.2.0-26-ga13b57d" + git_commit: "952ff0843093b538cbfd6fefdecf2e7a0bc9e70b" + git_remote: "https://x-access-token:ghs_EwAUAMYJ0K4VBHlAEMs4ZP2OyQYqJM0PSfEO@github.com/viash-hub/biobox" + git_tag: "v0.2.0-27-g952ff08" package_config: name: "biobox" version: "main" diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/samtools/samtools_index/main.nf b/target/dependencies/vsh/vsh/biobox/main/nextflow/samtools/samtools_index/main.nf index 210ff4b..85b710d 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/samtools/samtools_index/main.nf +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/samtools/samtools_index/main.nf @@ -3053,9 +3053,9 @@ meta = [ "engine" : "docker|native", "output" : "target/nextflow/samtools/samtools_index", "viash_version" : "0.9.0", - "git_commit" : "a13b57d04a3f3741eedd1af10fd96a9bee126f55", - "git_remote" : "https://x-access-token:ghs_xpDMoQpz4lF1RaGsMH4IlMbO48cLeW1cIYSF@github.com/viash-hub/biobox", - "git_tag" : "v0.2.0-26-ga13b57d" + "git_commit" : "952ff0843093b538cbfd6fefdecf2e7a0bc9e70b", + "git_remote" : "https://x-access-token:ghs_EwAUAMYJ0K4VBHlAEMs4ZP2OyQYqJM0PSfEO@github.com/viash-hub/biobox", + "git_tag" : "v0.2.0-27-g952ff08" }, "package_config" : { "name" : "biobox", diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/samtools/samtools_index/nextflow_schema.json b/target/dependencies/vsh/vsh/biobox/main/nextflow/samtools/samtools_index/nextflow_schema.json index 38b2492..1617235 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/samtools/samtools_index/nextflow_schema.json +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/samtools/samtools_index/nextflow_schema.json @@ -40,7 +40,7 @@ "description": "Type: `file`, required, default: `$id.$key.output.bai`, example: `out.bam.bai`. Output file name", "help_text": "Type: `file`, required, default: `$id.$key.output.bai`, example: `out.bam.bai`. Output file name" , - "default": "$id.$key.output.bai" + "default":"$id.$key.output.bai" } @@ -61,7 +61,7 @@ "description": "Type: `boolean_true`, default: `false`. Generate BAM index", "help_text": "Type: `boolean_true`, default: `false`. Generate BAM index" , - "default": "False" + "default":false } @@ -72,7 +72,7 @@ "description": "Type: `boolean_true`, default: `false`. Create a CSI index for BAM files instead of the traditional BAI \nindex", "help_text": "Type: `boolean_true`, default: `false`. Create a CSI index for BAM files instead of the traditional BAI \nindex. This will be required for genomes with larger chromosome \nsizes.\n" , - "default": "False" + "default":false } diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/samtools/samtools_sort/.config.vsh.yaml b/target/dependencies/vsh/vsh/biobox/main/nextflow/samtools/samtools_sort/.config.vsh.yaml index 4933b68..d341c2f 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/samtools/samtools_sort/.config.vsh.yaml +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/samtools/samtools_sort/.config.vsh.yaml @@ -332,9 +332,9 @@ build_info: output: "target/nextflow/samtools/samtools_sort" executable: "target/nextflow/samtools/samtools_sort/main.nf" viash_version: "0.9.0" - git_commit: "a13b57d04a3f3741eedd1af10fd96a9bee126f55" - git_remote: "https://x-access-token:ghs_xpDMoQpz4lF1RaGsMH4IlMbO48cLeW1cIYSF@github.com/viash-hub/biobox" - git_tag: "v0.2.0-26-ga13b57d" + git_commit: "952ff0843093b538cbfd6fefdecf2e7a0bc9e70b" + git_remote: "https://x-access-token:ghs_EwAUAMYJ0K4VBHlAEMs4ZP2OyQYqJM0PSfEO@github.com/viash-hub/biobox" + git_tag: "v0.2.0-27-g952ff08" package_config: name: "biobox" version: "main" diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/samtools/samtools_sort/main.nf b/target/dependencies/vsh/vsh/biobox/main/nextflow/samtools/samtools_sort/main.nf index b48f412..81aa788 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/samtools/samtools_sort/main.nf +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/samtools/samtools_sort/main.nf @@ -3225,9 +3225,9 @@ meta = [ "engine" : "docker|native", "output" : "target/nextflow/samtools/samtools_sort", "viash_version" : "0.9.0", - "git_commit" : "a13b57d04a3f3741eedd1af10fd96a9bee126f55", - "git_remote" : "https://x-access-token:ghs_xpDMoQpz4lF1RaGsMH4IlMbO48cLeW1cIYSF@github.com/viash-hub/biobox", - "git_tag" : "v0.2.0-26-ga13b57d" + "git_commit" : "952ff0843093b538cbfd6fefdecf2e7a0bc9e70b", + "git_remote" : "https://x-access-token:ghs_EwAUAMYJ0K4VBHlAEMs4ZP2OyQYqJM0PSfEO@github.com/viash-hub/biobox", + "git_tag" : "v0.2.0-27-g952ff08" }, "package_config" : { "name" : "biobox", diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/samtools/samtools_sort/nextflow_schema.json b/target/dependencies/vsh/vsh/biobox/main/nextflow/samtools/samtools_sort/nextflow_schema.json index 74147b3..b46fa99 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/samtools/samtools_sort/nextflow_schema.json +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/samtools/samtools_sort/nextflow_schema.json @@ -40,7 +40,7 @@ "description": "Type: `file`, required, default: `$id.$key.output.bam`, example: `out.bam`. Write final output to file", "help_text": "Type: `file`, required, default: `$id.$key.output.bam`, example: `out.bam`. Write final output to file.\n" , - "default": "$id.$key.output.bam" + "default":"$id.$key.output.bam" } @@ -81,7 +81,7 @@ "description": "Type: `boolean_true`, default: `false`. Automatically index the output files", "help_text": "Type: `boolean_true`, default: `false`. Automatically index the output files.\n" , - "default": "False" + "default":false } @@ -102,7 +102,7 @@ "description": "Type: `boolean_true`, default: `false`. Do not add a PG line", "help_text": "Type: `boolean_true`, default: `false`. Do not add a PG line.\n" , - "default": "False" + "default":false } @@ -113,7 +113,7 @@ "description": "Type: `boolean_true`, default: `false`. Sort by template-coordinate", "help_text": "Type: `boolean_true`, default: `false`. Sort by template-coordinate.\n" , - "default": "False" + "default":false } @@ -144,7 +144,7 @@ "description": "Type: `integer`, default: `0`. Set compression level, from 0 (uncompressed) to 9 (best)", "help_text": "Type: `integer`, default: `0`. Set compression level, from 0 (uncompressed) to 9 (best).\n" , - "default": "0" + "default":0 } @@ -155,7 +155,7 @@ "description": "Type: `boolean_true`, default: `false`. Output uncompressed data (equivalent to --compression 0)", "help_text": "Type: `boolean_true`, default: `false`. Output uncompressed data (equivalent to --compression 0).\n" , - "default": "False" + "default":false } @@ -166,7 +166,7 @@ "description": "Type: `boolean_true`, default: `false`. Use minimiser for clustering unaligned/unplaced reads", "help_text": "Type: `boolean_true`, default: `false`. Use minimiser for clustering unaligned/unplaced reads.\n" , - "default": "False" + "default":false } @@ -177,7 +177,7 @@ "description": "Type: `boolean_true`, default: `false`. Do not use reverse strand (only compatible with --minimiser)\n", "help_text": "Type: `boolean_true`, default: `false`. Do not use reverse strand (only compatible with --minimiser)\n" , - "default": "False" + "default":false } @@ -218,7 +218,7 @@ "description": "Type: `boolean_true`, default: `false`. Squash homopolymers when computing minimiser", "help_text": "Type: `boolean_true`, default: `false`. Squash homopolymers when computing minimiser.\n" , - "default": "False" + "default":false } @@ -229,7 +229,7 @@ "description": "Type: `boolean_true`, default: `false`. Sort by read name (natural): cannot be used with samtools index", "help_text": "Type: `boolean_true`, default: `false`. Sort by read name (natural): cannot be used with samtools index.\n" , - "default": "False" + "default":false } @@ -240,7 +240,7 @@ "description": "Type: `boolean_true`, default: `false`. Sort by read name (ASCII): cannot be used with samtools index", "help_text": "Type: `boolean_true`, default: `false`. Sort by read name (ASCII): cannot be used with samtools index.\n" , - "default": "False" + "default":false } diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/samtools/samtools_stats/.config.vsh.yaml b/target/dependencies/vsh/vsh/biobox/main/nextflow/samtools/samtools_stats/.config.vsh.yaml index 90ed44a..208326c 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/samtools/samtools_stats/.config.vsh.yaml +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/samtools/samtools_stats/.config.vsh.yaml @@ -401,9 +401,9 @@ build_info: output: "target/nextflow/samtools/samtools_stats" executable: "target/nextflow/samtools/samtools_stats/main.nf" viash_version: "0.9.0" - git_commit: "a13b57d04a3f3741eedd1af10fd96a9bee126f55" - git_remote: "https://x-access-token:ghs_xpDMoQpz4lF1RaGsMH4IlMbO48cLeW1cIYSF@github.com/viash-hub/biobox" - git_tag: "v0.2.0-26-ga13b57d" + git_commit: "952ff0843093b538cbfd6fefdecf2e7a0bc9e70b" + git_remote: "https://x-access-token:ghs_EwAUAMYJ0K4VBHlAEMs4ZP2OyQYqJM0PSfEO@github.com/viash-hub/biobox" + git_tag: "v0.2.0-27-g952ff08" package_config: name: "biobox" version: "main" diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/samtools/samtools_stats/main.nf b/target/dependencies/vsh/vsh/biobox/main/nextflow/samtools/samtools_stats/main.nf index 4faeaa1..958eac0 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/samtools/samtools_stats/main.nf +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/samtools/samtools_stats/main.nf @@ -3295,9 +3295,9 @@ meta = [ "engine" : "docker|native", "output" : "target/nextflow/samtools/samtools_stats", "viash_version" : "0.9.0", - "git_commit" : "a13b57d04a3f3741eedd1af10fd96a9bee126f55", - "git_remote" : "https://x-access-token:ghs_xpDMoQpz4lF1RaGsMH4IlMbO48cLeW1cIYSF@github.com/viash-hub/biobox", - "git_tag" : "v0.2.0-26-ga13b57d" + "git_commit" : "952ff0843093b538cbfd6fefdecf2e7a0bc9e70b", + "git_remote" : "https://x-access-token:ghs_EwAUAMYJ0K4VBHlAEMs4ZP2OyQYqJM0PSfEO@github.com/viash-hub/biobox", + "git_tag" : "v0.2.0-27-g952ff08" }, "package_config" : { "name" : "biobox", diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/samtools/samtools_stats/nextflow_schema.json b/target/dependencies/vsh/vsh/biobox/main/nextflow/samtools/samtools_stats/nextflow_schema.json index 147c8c2..4e161ad 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/samtools/samtools_stats/nextflow_schema.json +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/samtools/samtools_stats/nextflow_schema.json @@ -60,7 +60,7 @@ "description": "Type: `boolean_true`, default: `false`. Exclude from statistics reads marked as duplicates", "help_text": "Type: `boolean_true`, default: `false`. Exclude from statistics reads marked as duplicates.\n" , - "default": "False" + "default":false } @@ -71,7 +71,7 @@ "description": "Type: `boolean_true`, default: `false`. Use a customized index file", "help_text": "Type: `boolean_true`, default: `false`. Use a customized index file.\n" , - "default": "False" + "default":false } @@ -202,7 +202,7 @@ "description": "Type: `boolean_true`, default: `false`. Suppress outputting IS rows where there are no insertions", "help_text": "Type: `boolean_true`, default: `false`. Suppress outputting IS rows where there are no insertions.\n" , - "default": "False" + "default":false } @@ -213,7 +213,7 @@ "description": "Type: `boolean_true`, default: `false`. Remove overlaps of paired-end reads from coverage and base count computations", "help_text": "Type: `boolean_true`, default: `false`. Remove overlaps of paired-end reads from coverage and base count computations.\n" , - "default": "False" + "default":false } @@ -264,7 +264,7 @@ "description": "Type: `file`, required, default: `$id.$key.output.txt`, example: `out.txt`. Output file", "help_text": "Type: `file`, required, default: `$id.$key.output.txt`, example: `out.txt`. Output file.\n" , - "default": "$id.$key.output.txt" + "default":"$id.$key.output.txt" } diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/sortmerna/.config.vsh.yaml b/target/dependencies/vsh/vsh/biobox/main/nextflow/sortmerna/.config.vsh.yaml index 4b8fc1f..fff395c 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/sortmerna/.config.vsh.yaml +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/sortmerna/.config.vsh.yaml @@ -594,9 +594,9 @@ build_info: output: "target/nextflow/sortmerna" executable: "target/nextflow/sortmerna/main.nf" viash_version: "0.9.0" - git_commit: "a13b57d04a3f3741eedd1af10fd96a9bee126f55" - git_remote: "https://x-access-token:ghs_xpDMoQpz4lF1RaGsMH4IlMbO48cLeW1cIYSF@github.com/viash-hub/biobox" - git_tag: "v0.2.0-26-ga13b57d" + git_commit: "952ff0843093b538cbfd6fefdecf2e7a0bc9e70b" + git_remote: "https://x-access-token:ghs_EwAUAMYJ0K4VBHlAEMs4ZP2OyQYqJM0PSfEO@github.com/viash-hub/biobox" + git_tag: "v0.2.0-27-g952ff08" package_config: name: "biobox" version: "main" diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/sortmerna/main.nf b/target/dependencies/vsh/vsh/biobox/main/nextflow/sortmerna/main.nf index 9bafb9d..ba848a9 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/sortmerna/main.nf +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/sortmerna/main.nf @@ -3460,9 +3460,9 @@ meta = [ "engine" : "docker|native", "output" : "target/nextflow/sortmerna", "viash_version" : "0.9.0", - "git_commit" : "a13b57d04a3f3741eedd1af10fd96a9bee126f55", - "git_remote" : "https://x-access-token:ghs_xpDMoQpz4lF1RaGsMH4IlMbO48cLeW1cIYSF@github.com/viash-hub/biobox", - "git_tag" : "v0.2.0-26-ga13b57d" + "git_commit" : "952ff0843093b538cbfd6fefdecf2e7a0bc9e70b", + "git_remote" : "https://x-access-token:ghs_EwAUAMYJ0K4VBHlAEMs4ZP2OyQYqJM0PSfEO@github.com/viash-hub/biobox", + "git_tag" : "v0.2.0-27-g952ff08" }, "package_config" : { "name" : "biobox", diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/sortmerna/nextflow_schema.json b/target/dependencies/vsh/vsh/biobox/main/nextflow/sortmerna/nextflow_schema.json index d9bfdad..c0e0df6 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/sortmerna/nextflow_schema.json +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/sortmerna/nextflow_schema.json @@ -20,7 +20,7 @@ "description": "Type: `boolean_true`, default: `false`. Reads are paired-end", "help_text": "Type: `boolean_true`, default: `false`. Reads are paired-end. If a single reads file is provided, use this option \nto indicate the file contains interleaved paired reads when neither\n\u0027paired_in\u0027 | \u0027paired_out\u0027 | \u0027out2\u0027 | \u0027sout\u0027 are specified.\n" , - "default": "False" + "default":false } @@ -71,7 +71,7 @@ "description": "Type: `file`, default: `$id.$key.log.log`, example: `$id.sortmerna.log`. Sortmerna log file", "help_text": "Type: `file`, default: `$id.$key.log.log`, example: `$id.sortmerna.log`. Sortmerna log file." , - "default": "$id.$key.log.log" + "default":"$id.$key.log.log" } @@ -82,7 +82,7 @@ "description": "Type: `file`, default: `$id.$key.output.output`. Directory and file prefix for aligned output", "help_text": "Type: `file`, default: `$id.$key.output.output`. Directory and file prefix for aligned output. The appropriate extension: \n(fasta|fastq|blast|sam|etc) is automatically added.\nIf \u0027dir\u0027 is not specified, the output is created in the WORKDIR/out/.\nIf \u0027pfx\u0027 is not specified, the prefix \u0027aligned\u0027 is used.\n" , - "default": "$id.$key.output.output" + "default":"$id.$key.output.output" } @@ -93,7 +93,7 @@ "description": "Type: `file`, default: `$id.$key.other.other`. Create Non-aligned reads output file with this path/prefix", "help_text": "Type: `file`, default: `$id.$key.other.other`. Create Non-aligned reads output file with this path/prefix. Must be used with fastx." , - "default": "$id.$key.other.other" + "default":"$id.$key.other.other" } @@ -144,7 +144,7 @@ "description": "Type: `boolean_true`, default: `false`. Output aligned reads into FASTA/FASTQ file", "help_text": "Type: `boolean_true`, default: `false`. Output aligned reads into FASTA/FASTQ file" , - "default": "False" + "default":false } @@ -155,7 +155,7 @@ "description": "Type: `boolean_true`, default: `false`. Output SAM alignment for aligned reads", "help_text": "Type: `boolean_true`, default: `false`. Output SAM alignment for aligned reads." , - "default": "False" + "default":false } @@ -166,7 +166,7 @@ "description": "Type: `boolean_true`, default: `false`. Add SQ tags to the SAM file", "help_text": "Type: `boolean_true`, default: `false`. Add SQ tags to the SAM file" , - "default": "False" + "default":false } @@ -209,7 +209,7 @@ "description": "Type: `boolean_true`, default: `false`. output null alignment strings for non-aligned reads to SAM and/or BLAST tabular files", "help_text": "Type: `boolean_true`, default: `false`. output null alignment strings for non-aligned reads to SAM and/or BLAST tabular files." , - "default": "False" + "default":false } @@ -220,7 +220,7 @@ "description": "Type: `boolean_true`, default: `false`. In the case where a pair of reads is aligned with a score above the threshold, the output of the reads is controlled\nby the following options:\n* --paired_in and --paired_out are both false: Only one read per pair is output to the aligned fasta file", "help_text": "Type: `boolean_true`, default: `false`. In the case where a pair of reads is aligned with a score above the threshold, the output of the reads is controlled\nby the following options:\n* --paired_in and --paired_out are both false: Only one read per pair is output to the aligned fasta file.\n* --paired_in is true and --paired_out is false: Both reads of the pair are output to the aligned fasta file.\n* --paired_in is false and --paired_out is true: Both reads are output the the other fasta file (if it is specified).\n" , - "default": "False" + "default":false } @@ -231,7 +231,7 @@ "description": "Type: `boolean_true`, default: `false`. See description of --paired_in", "help_text": "Type: `boolean_true`, default: `false`. See description of --paired_in." , - "default": "False" + "default":false } @@ -242,7 +242,7 @@ "description": "Type: `boolean_true`, default: `false`. Output paired reads into separate files", "help_text": "Type: `boolean_true`, default: `false`. Output paired reads into separate files. Must be used with \u0027--fastx\u0027. If a single reads file is provided, this options\nimplies interleaved paired reads. When used with \u0027sout\u0027, four (4) output files for aligned reads will be generated:\n\u0027aligned-paired-fwd, aligned-paired-rev, aligned-singleton-fwd, aligned-singleton-rev\u0027. If \u0027other\u0027 option is also used,\neight (8) output files will be generated.\n" , - "default": "False" + "default":false } @@ -253,7 +253,7 @@ "description": "Type: `boolean_true`, default: `false`. Separate paired and singleton aligned reads", "help_text": "Type: `boolean_true`, default: `false`. Separate paired and singleton aligned reads. Must be used with \u0027--fastx\u0027. If a single reads file is provided,\nthis options implies interleaved paired reads. Cannot be used with \u0027--paired_in\u0027 or \u0027--paired_out\u0027.\n" , - "default": "False" + "default":false } @@ -346,7 +346,7 @@ "description": "Type: `boolean_true`, default: `false`. Search only the forward strand", "help_text": "Type: `boolean_true`, default: `false`. Search only the forward strand." , - "default": "False" + "default":false } @@ -357,7 +357,7 @@ "description": "Type: `boolean_true`, default: `false`. Search only the reverse-complementary strand", "help_text": "Type: `boolean_true`, default: `false`. Search only the reverse-complementary strand." , - "default": "False" + "default":false } @@ -388,7 +388,7 @@ "description": "Type: `boolean_true`, default: `false`. Verbose output", "help_text": "Type: `boolean_true`, default: `false`. Verbose output." , - "default": "False" + "default":false } @@ -429,7 +429,7 @@ "description": "Type: `boolean_true`, default: `false`. FASTA/FASTQ file for reads matching database \u003c %id off (set using --id) and \u003c %cov (set using --coverage)\n(alignment must still pass the E-value threshold)", "help_text": "Type: `boolean_true`, default: `false`. FASTA/FASTQ file for reads matching database \u003c %id off (set using --id) and \u003c %cov (set using --coverage)\n(alignment must still pass the E-value threshold).\n" , - "default": "False" + "default":false } @@ -440,7 +440,7 @@ "description": "Type: `boolean_true`, default: `false`. Output OTU map (input to QIIME\u0027s make_otu_table", "help_text": "Type: `boolean_true`, default: `false`. Output OTU map (input to QIIME\u0027s make_otu_table.py).\n" , - "default": "False" + "default":false } @@ -491,7 +491,7 @@ "description": "Type: `boolean_true`, default: `false`. Search for all 0-error and 1-error seed off matches in the index rather than stopping after finding a 0-error match\n(\u003c1% gain in sensitivity with up four-fold decrease in speed)", "help_text": "Type: `boolean_true`, default: `false`. Search for all 0-error and 1-error seed off matches in the index rather than stopping after finding a 0-error match\n(\u003c1% gain in sensitivity with up four-fold decrease in speed).\n" , - "default": "False" + "default":false } diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/star/star_align_reads/.config.vsh.yaml b/target/dependencies/vsh/vsh/biobox/main/nextflow/star/star_align_reads/.config.vsh.yaml index 2723c12..86213b4 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/star/star_align_reads/.config.vsh.yaml +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/star/star_align_reads/.config.vsh.yaml @@ -2663,9 +2663,9 @@ build_info: output: "target/nextflow/star/star_align_reads" executable: "target/nextflow/star/star_align_reads/main.nf" viash_version: "0.9.0" - git_commit: "a13b57d04a3f3741eedd1af10fd96a9bee126f55" - git_remote: "https://x-access-token:ghs_xpDMoQpz4lF1RaGsMH4IlMbO48cLeW1cIYSF@github.com/viash-hub/biobox" - git_tag: "v0.2.0-26-ga13b57d" + git_commit: "952ff0843093b538cbfd6fefdecf2e7a0bc9e70b" + git_remote: "https://x-access-token:ghs_EwAUAMYJ0K4VBHlAEMs4ZP2OyQYqJM0PSfEO@github.com/viash-hub/biobox" + git_tag: "v0.2.0-27-g952ff08" package_config: name: "biobox" version: "main" diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/star/star_align_reads/main.nf b/target/dependencies/vsh/vsh/biobox/main/nextflow/star/star_align_reads/main.nf index 8057868..97daee4 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/star/star_align_reads/main.nf +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/star/star_align_reads/main.nf @@ -5943,9 +5943,9 @@ meta = [ "engine" : "docker|native", "output" : "target/nextflow/star/star_align_reads", "viash_version" : "0.9.0", - "git_commit" : "a13b57d04a3f3741eedd1af10fd96a9bee126f55", - "git_remote" : "https://x-access-token:ghs_xpDMoQpz4lF1RaGsMH4IlMbO48cLeW1cIYSF@github.com/viash-hub/biobox", - "git_tag" : "v0.2.0-26-ga13b57d" + "git_commit" : "952ff0843093b538cbfd6fefdecf2e7a0bc9e70b", + "git_remote" : "https://x-access-token:ghs_EwAUAMYJ0K4VBHlAEMs4ZP2OyQYqJM0PSfEO@github.com/viash-hub/biobox", + "git_tag" : "v0.2.0-27-g952ff08" }, "package_config" : { "name" : "biobox", diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/star/star_align_reads/nextflow_schema.json b/target/dependencies/vsh/vsh/biobox/main/nextflow/star/star_align_reads/nextflow_schema.json index 7afc49c..b839aa8 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/star/star_align_reads/nextflow_schema.json +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/star/star_align_reads/nextflow_schema.json @@ -50,7 +50,7 @@ "description": "Type: `file`, required, default: `$id.$key.aligned_reads.bam`, example: `aligned_reads.bam`. The output file containing the aligned reads", "help_text": "Type: `file`, required, default: `$id.$key.aligned_reads.bam`, example: `aligned_reads.bam`. The output file containing the aligned reads." , - "default": "$id.$key.aligned_reads.bam" + "default":"$id.$key.aligned_reads.bam" } @@ -61,7 +61,7 @@ "description": "Type: `file`, default: `$id.$key.reads_per_gene.tsv`, example: `reads_per_gene.tsv`. The output file containing the number of reads per gene", "help_text": "Type: `file`, default: `$id.$key.reads_per_gene.tsv`, example: `reads_per_gene.tsv`. The output file containing the number of reads per gene." , - "default": "$id.$key.reads_per_gene.tsv" + "default":"$id.$key.reads_per_gene.tsv" } @@ -72,7 +72,7 @@ "description": "Type: `file`, default: `$id.$key.unmapped.fastq`, example: `unmapped.fastq`. The output file containing the unmapped reads", "help_text": "Type: `file`, default: `$id.$key.unmapped.fastq`, example: `unmapped.fastq`. The output file containing the unmapped reads." , - "default": "$id.$key.unmapped.fastq" + "default":"$id.$key.unmapped.fastq" } @@ -83,7 +83,7 @@ "description": "Type: `file`, default: `$id.$key.unmapped_r2.fastq`, example: `unmapped_r2.fastq`. The output file containing the unmapped R2 reads", "help_text": "Type: `file`, default: `$id.$key.unmapped_r2.fastq`, example: `unmapped_r2.fastq`. The output file containing the unmapped R2 reads." , - "default": "$id.$key.unmapped_r2.fastq" + "default":"$id.$key.unmapped_r2.fastq" } @@ -94,7 +94,7 @@ "description": "Type: `file`, default: `$id.$key.chimeric_junctions.tsv`, example: `chimeric_junctions.tsv`. The output file containing the chimeric junctions", "help_text": "Type: `file`, default: `$id.$key.chimeric_junctions.tsv`, example: `chimeric_junctions.tsv`. The output file containing the chimeric junctions." , - "default": "$id.$key.chimeric_junctions.tsv" + "default":"$id.$key.chimeric_junctions.tsv" } @@ -105,7 +105,7 @@ "description": "Type: `file`, default: `$id.$key.log.txt`, example: `log.txt`. The output file containing the log of the alignment process", "help_text": "Type: `file`, default: `$id.$key.log.txt`, example: `log.txt`. The output file containing the log of the alignment process." , - "default": "$id.$key.log.txt" + "default":"$id.$key.log.txt" } @@ -116,7 +116,7 @@ "description": "Type: `file`, default: `$id.$key.splice_junctions.tsv`, example: `splice_junctions.tsv`. The output file containing the splice junctions", "help_text": "Type: `file`, default: `$id.$key.splice_junctions.tsv`, example: `splice_junctions.tsv`. The output file containing the splice junctions." , - "default": "$id.$key.splice_junctions.tsv" + "default":"$id.$key.splice_junctions.tsv" } @@ -127,7 +127,7 @@ "description": "Type: `file`, default: `$id.$key.reads_aligned_to_transcriptome.bam`, example: `transcriptome_aligned.bam`. The output file containing the alignments to transcriptome in BAM formats", "help_text": "Type: `file`, default: `$id.$key.reads_aligned_to_transcriptome.bam`, example: `transcriptome_aligned.bam`. The output file containing the alignments to transcriptome in BAM formats. This file is generated when --quantMode is set to TranscriptomeSAM." , - "default": "$id.$key.reads_aligned_to_transcriptome.bam" + "default":"$id.$key.reads_aligned_to_transcriptome.bam" } diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/star/star_genome_generate/.config.vsh.yaml b/target/dependencies/vsh/vsh/biobox/main/nextflow/star/star_genome_generate/.config.vsh.yaml index 288d0cf..2a12740 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/star/star_genome_generate/.config.vsh.yaml +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/star/star_genome_generate/.config.vsh.yaml @@ -333,9 +333,9 @@ build_info: output: "target/nextflow/star/star_genome_generate" executable: "target/nextflow/star/star_genome_generate/main.nf" viash_version: "0.9.0" - git_commit: "a13b57d04a3f3741eedd1af10fd96a9bee126f55" - git_remote: "https://x-access-token:ghs_xpDMoQpz4lF1RaGsMH4IlMbO48cLeW1cIYSF@github.com/viash-hub/biobox" - git_tag: "v0.2.0-26-ga13b57d" + git_commit: "952ff0843093b538cbfd6fefdecf2e7a0bc9e70b" + git_remote: "https://x-access-token:ghs_EwAUAMYJ0K4VBHlAEMs4ZP2OyQYqJM0PSfEO@github.com/viash-hub/biobox" + git_tag: "v0.2.0-27-g952ff08" package_config: name: "biobox" version: "main" diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/star/star_genome_generate/main.nf b/target/dependencies/vsh/vsh/biobox/main/nextflow/star/star_genome_generate/main.nf index 72211a4..17e745a 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/star/star_genome_generate/main.nf +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/star/star_genome_generate/main.nf @@ -3195,9 +3195,9 @@ meta = [ "engine" : "docker|native", "output" : "target/nextflow/star/star_genome_generate", "viash_version" : "0.9.0", - "git_commit" : "a13b57d04a3f3741eedd1af10fd96a9bee126f55", - "git_remote" : "https://x-access-token:ghs_xpDMoQpz4lF1RaGsMH4IlMbO48cLeW1cIYSF@github.com/viash-hub/biobox", - "git_tag" : "v0.2.0-26-ga13b57d" + "git_commit" : "952ff0843093b538cbfd6fefdecf2e7a0bc9e70b", + "git_remote" : "https://x-access-token:ghs_EwAUAMYJ0K4VBHlAEMs4ZP2OyQYqJM0PSfEO@github.com/viash-hub/biobox", + "git_tag" : "v0.2.0-27-g952ff08" }, "package_config" : { "name" : "biobox", diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/star/star_genome_generate/nextflow_schema.json b/target/dependencies/vsh/vsh/biobox/main/nextflow/star/star_genome_generate/nextflow_schema.json index 60ab837..e8aadf1 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/star/star_genome_generate/nextflow_schema.json +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/star/star_genome_generate/nextflow_schema.json @@ -190,7 +190,7 @@ "description": "Type: `file`, required, default: `$id.$key.index.index`. STAR index directory", "help_text": "Type: `file`, required, default: `$id.$key.index.index`. STAR index directory." , - "default": "$id.$key.index.index" + "default":"$id.$key.index.index" } diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/trimgalore/.config.vsh.yaml b/target/dependencies/vsh/vsh/biobox/main/nextflow/trimgalore/.config.vsh.yaml index f2b1494..a46f492 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/trimgalore/.config.vsh.yaml +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/trimgalore/.config.vsh.yaml @@ -770,9 +770,9 @@ build_info: output: "target/nextflow/trimgalore" executable: "target/nextflow/trimgalore/main.nf" viash_version: "0.9.0" - git_commit: "a13b57d04a3f3741eedd1af10fd96a9bee126f55" - git_remote: "https://x-access-token:ghs_xpDMoQpz4lF1RaGsMH4IlMbO48cLeW1cIYSF@github.com/viash-hub/biobox" - git_tag: "v0.2.0-26-ga13b57d" + git_commit: "952ff0843093b538cbfd6fefdecf2e7a0bc9e70b" + git_remote: "https://x-access-token:ghs_EwAUAMYJ0K4VBHlAEMs4ZP2OyQYqJM0PSfEO@github.com/viash-hub/biobox" + git_tag: "v0.2.0-27-g952ff08" package_config: name: "biobox" version: "main" diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/trimgalore/main.nf b/target/dependencies/vsh/vsh/biobox/main/nextflow/trimgalore/main.nf index f9b9b84..c46ce51 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/trimgalore/main.nf +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/trimgalore/main.nf @@ -3560,9 +3560,9 @@ meta = [ "engine" : "docker|native", "output" : "target/nextflow/trimgalore", "viash_version" : "0.9.0", - "git_commit" : "a13b57d04a3f3741eedd1af10fd96a9bee126f55", - "git_remote" : "https://x-access-token:ghs_xpDMoQpz4lF1RaGsMH4IlMbO48cLeW1cIYSF@github.com/viash-hub/biobox", - "git_tag" : "v0.2.0-26-ga13b57d" + "git_commit" : "952ff0843093b538cbfd6fefdecf2e7a0bc9e70b", + "git_remote" : "https://x-access-token:ghs_EwAUAMYJ0K4VBHlAEMs4ZP2OyQYqJM0PSfEO@github.com/viash-hub/biobox", + "git_tag" : "v0.2.0-27-g952ff08" }, "package_config" : { "name" : "biobox", diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/trimgalore/nextflow_schema.json b/target/dependencies/vsh/vsh/biobox/main/nextflow/trimgalore/nextflow_schema.json index 9933493..9ee3b48 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/trimgalore/nextflow_schema.json +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/trimgalore/nextflow_schema.json @@ -50,7 +50,7 @@ "description": "Type: `boolean_true`, default: `false`. Instructs Cutadapt to use ASCII+33 quality scores as Phred scores (Sanger/Illumina 1", "help_text": "Type: `boolean_true`, default: `false`. Instructs Cutadapt to use ASCII+33 quality scores as Phred scores (Sanger/Illumina 1.9+ encoding) for quality trimming." , - "default": "False" + "default":false } @@ -61,7 +61,7 @@ "description": "Type: `boolean_true`, default: `false`. Instructs Cutadapt to use ASCII+64 quality scores as Phred scores (Illumina 1", "help_text": "Type: `boolean_true`, default: `false`. Instructs Cutadapt to use ASCII+64 quality scores as Phred scores (Illumina 1.5 encoding) for quality trimming." , - "default": "False" + "default":false } @@ -72,7 +72,7 @@ "description": "Type: `boolean_true`, default: `false`. Run FastQC in the default mode on the FastQ file once trimming is complete", "help_text": "Type: `boolean_true`, default: `false`. Run FastQC in the default mode on the FastQ file once trimming is complete." , - "default": "False" + "default":false } @@ -143,7 +143,7 @@ "description": "Type: `boolean_true`, default: `false`. Adapter sequence to be trimmed is the first 13bp of the Illumina universal adapter \u0027AGATCGGAAGAGC\u0027 instead of the default auto-detection of adapter sequence", "help_text": "Type: `boolean_true`, default: `false`. Adapter sequence to be trimmed is the first 13bp of the Illumina universal adapter \u0027AGATCGGAAGAGC\u0027 instead of the default auto-detection of adapter sequence." , - "default": "False" + "default":false } @@ -154,7 +154,7 @@ "description": "Type: `boolean_true`, default: `false`. Adapter sequence to be trimmed is the first 13bp of the Illumina stranded mRNA or Total RNA adapter \u0027ACTGTCTCTTATA\u0027 instead of the default auto-detection of adapter sequence", "help_text": "Type: `boolean_true`, default: `false`. Adapter sequence to be trimmed is the first 13bp of the Illumina stranded mRNA or Total RNA adapter \u0027ACTGTCTCTTATA\u0027 instead of the default auto-detection of adapter sequence." , - "default": "False" + "default":false } @@ -165,7 +165,7 @@ "description": "Type: `boolean_true`, default: `false`. Adapter sequence to be trimmed is the first 12bp of the Nextera adapter \u0027CTGTCTCTTATA\u0027 instead of the default auto-detection of adapter sequence", "help_text": "Type: `boolean_true`, default: `false`. Adapter sequence to be trimmed is the first 12bp of the Nextera adapter \u0027CTGTCTCTTATA\u0027 instead of the default auto-detection of adapter sequence." , - "default": "False" + "default":false } @@ -176,7 +176,7 @@ "description": "Type: `boolean_true`, default: `false`. Adapter sequence to be trimmed is the first 12bp of the Illumina Small RNA 3\u0027 Adapter \u0027TGGAATTCTCGG\u0027 instead of the default auto-detection of adapter sequence", "help_text": "Type: `boolean_true`, default: `false`. Adapter sequence to be trimmed is the first 12bp of the Illumina Small RNA 3\u0027 Adapter \u0027TGGAATTCTCGG\u0027 instead of the default auto-detection of adapter sequence. Selecting to trim smallRNA adapters will also lower the --length value to 18bp. If the smallRNA libraries are paired-end then a automatically (GATCGTCGGACT) unless -a 2 had been defined explicitly." , - "default": "False" + "default":false } @@ -227,7 +227,7 @@ "description": "Type: `boolean_true`, default: `false`. Compress the output file with GZIP", "help_text": "Type: `boolean_true`, default: `false`. Compress the output file with GZIP. If the input files are GZIP-compressed the output files will automatically be GZIP compressed as well. As of v0.2.8 the compression will take place on the fly." , - "default": "False" + "default":false } @@ -238,7 +238,7 @@ "description": "Type: `boolean_true`, default: `false`. Output files won\u0027t be compressed with GZIP", "help_text": "Type: `boolean_true`, default: `false`. Output files won\u0027t be compressed with GZIP. This option overrides --gzip." , - "default": "False" + "default":false } @@ -269,7 +269,7 @@ "description": "Type: `boolean_true`, default: `false`. Removes Ns from either side of the read", "help_text": "Type: `boolean_true`, default: `false`. Removes Ns from either side of the read. This option does currently not work in RRBS mode." , - "default": "False" + "default":false } @@ -280,7 +280,7 @@ "description": "Type: `boolean_true`, default: `false`. If specified no report file will be generated", "help_text": "Type: `boolean_true`, default: `false`. If specified no report file will be generated." , - "default": "False" + "default":false } @@ -291,7 +291,7 @@ "description": "Type: `boolean_true`, default: `false`. If specified any output to STDOUT or STDERR will be suppressed", "help_text": "Type: `boolean_true`, default: `false`. If specified any output to STDOUT or STDERR will be suppressed." , - "default": "False" + "default":false } @@ -392,7 +392,7 @@ "description": "Type: `boolean_true`, default: `false`. In this mode, reads are trimmed in a specific way that is currently used for the Mouse Epigenetic Clock", "help_text": "Type: `boolean_true`, default: `false`. In this mode, reads are trimmed in a specific way that is currently used for the Mouse Epigenetic Clock." , - "default": "False" + "default":false } @@ -403,7 +403,7 @@ "description": "Type: `boolean_true`, default: `false`. This is a new, still experimental, trimming mode to identify and remove poly-A tails from sequences", "help_text": "Type: `boolean_true`, default: `false`. This is a new, still experimental, trimming mode to identify and remove poly-A tails from sequences. When --polyA is selected, Trim Galore attempts to identify from the first supplied sample whether sequences contain more often a stretch of either \u0027AAAAAAAAAA\u0027 or \u0027TTTTTTTTTT\u0027. This determines if Read 1 of a paired-end end file, or single-end files, are trimmed for PolyA or PolyT. In case of paired-end sequencing, Read2 is trimmed for the complementary base from the start of the reads. The auto-detection uses a default of A{20} for Read1 (3\u0027-end trimming) and T{150} for Read2 (5\u0027-end trimming). These values may be changed manually using the options -a and -a2. In addition to trimming the sequences, white spaces are replaced with _ and it records in the read ID how many bases were trimmed so it can later be used to identify PolyA trimmed sequences. This is currently done by writing tags to both the start (\"32:A:\") and end (\"_PolyA:32\") of the reads. The poly-A trimming mode expects that sequences were both adapter and quality before looking for Poly-A tails, and it is the user\u0027s responsibility to carry out an initial round of trimming." , - "default": "False" + "default":false } @@ -414,7 +414,7 @@ "description": "Type: `boolean_true`, default: `false`. This is a special mode of operation for paired-end data, such as required for the IMPLICON method, where a UMI sequence is getting transferred from the start of Read 2 to the readID of both reads", "help_text": "Type: `boolean_true`, default: `false`. This is a special mode of operation for paired-end data, such as required for the IMPLICON method, where a UMI sequence is getting transferred from the start of Read 2 to the readID of both reads. Following this, Trim Galore will exit. In it\u0027s current implementation, the UMI carrying reads come in the following format\n Read 1 5\u0027 FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF 3\u0027\n Read 2 3\u0027 UUUUUUUUFFFFFFFFFFFFFFFFFFFFFFFFFFFF 5\u0027\nWhere UUUUUUUU is a random 8-mer unique molecular identifier (UMI) and FFFFFFF... is the actual fragment to be sequenced. The UMI of Read 2 (R2) is written into the read ID of both reads and removed from the actual sequence.\n" , - "default": "False" + "default":false } @@ -435,7 +435,7 @@ "description": "Type: `boolean_true`, default: `false`. Specifies that the input file was an MspI digested RRBS sample (recognition site is CCGG)", "help_text": "Type: `boolean_true`, default: `false`. Specifies that the input file was an MspI digested RRBS sample (recognition site is CCGG). Single-end or Read 1 sequences (paired-end) which were adapter-trimmed will have a further 2 bp removed from their 3\u0027 end. Sequences which were merely trimmed because of poor quality will not be shortened further. Read 2 of paired-end libraries will in addition have the first 2 bp removed from the 5\u0027 end (by setting \u0027--clip_r2 2\u0027). This is to avoid using artificial methylation calls from the filled-in cytosine positions close to the 3\u0027 MspI site in sequenced fragments. This option is not recommended for users of the Tecan Ovation RRBS Methyl-Seq with TrueMethyl oxBS 1-16 kit (see below)." , - "default": "False" + "default":false } @@ -446,7 +446,7 @@ "description": "Type: `boolean_true`, default: `false`. Selecting this option for non-directional RRBS libraries will screen quality-trimmed sequences for \u0027CAA\u0027 or \u0027CGA\u0027 at the start of the read and, if found, removes the first two basepairs", "help_text": "Type: `boolean_true`, default: `false`. Selecting this option for non-directional RRBS libraries will screen quality-trimmed sequences for \u0027CAA\u0027 or \u0027CGA\u0027 at the start of the read and, if found, removes the first two basepairs. Like with the option \u0027--rrbs\u0027 this avoids using cytosine positions that were filled-in during the end-repair step. \u0027--non_directional\u0027 requires \u0027--rrbs\u0027 to be specified as well. Note that this option does not set \u0027--clip_r2 2\u0027 in paired-end mode." , - "default": "False" + "default":false } @@ -457,7 +457,7 @@ "description": "Type: `boolean_true`, default: `false`. Keep the quality trimmed intermediate file", "help_text": "Type: `boolean_true`, default: `false`. Keep the quality trimmed intermediate file." , - "default": "False" + "default":false } @@ -478,7 +478,7 @@ "description": "Type: `boolean_true`, default: `false`. This option performs length trimming of quality/adapter/RRBS trimmed reads for paired-end files", "help_text": "Type: `boolean_true`, default: `false`. This option performs length trimming of quality/adapter/RRBS trimmed reads for paired-end files. To pass the validation test, both sequences of a sequence pair are required to have a certain minimum length which is governed by the option --length (see above). If only one read passes this length threshold the other read can be rescued (see option --retain_unpaired). Using this option lets you discard too short read pairs without disturbing the sequence-by-sequence order of FastQ files which is required by many aligners. Trim Galore expects paired-end files to be supplied in a pairwise fashion, e.g. file1_1.fq file1_2.fq SRR2_1.fq.gz SRR2_2.fq.gz ... ." , - "default": "False" + "default":false } @@ -489,7 +489,7 @@ "description": "Type: `boolean_true`, default: `false`. If only one of the two paired-end reads became too short, the longer read will be written to either \u0027", "help_text": "Type: `boolean_true`, default: `false`. If only one of the two paired-end reads became too short, the longer read will be written to either \u0027.unpaired_1.fq\u0027 or \u0027.unpaired_2.fq\u0027 output files. The length cutoff for unpaired single-end reads is governed by the parameters -r1/--length_1 and -r2/--length_2." , - "default": "False" + "default":false } @@ -530,7 +530,7 @@ "description": "Type: `file`, required, default: `$id.$key.output_dir.output_dir`. If specified all output will be written to this directory instead of the current directory", "help_text": "Type: `file`, required, default: `$id.$key.output_dir.output_dir`. If specified all output will be written to this directory instead of the current directory." , - "default": "$id.$key.output_dir.output_dir" + "default":"$id.$key.output_dir.output_dir" } @@ -541,7 +541,7 @@ "description": "Type: `file`, default: `$id.$key.trimmed_r1.fastq`, example: `read_1.fastq`. Output file for read 1", "help_text": "Type: `file`, default: `$id.$key.trimmed_r1.fastq`, example: `read_1.fastq`. Output file for read 1. Only works when 1 file (single-end) or 2 files (paired-end) are specified, but not for longer lists." , - "default": "$id.$key.trimmed_r1.fastq" + "default":"$id.$key.trimmed_r1.fastq" } @@ -552,7 +552,7 @@ "description": "Type: `file`, default: `$id.$key.trimmed_r2.fastq`, example: `read_2.fastq`. Output file for read 2", "help_text": "Type: `file`, default: `$id.$key.trimmed_r2.fastq`, example: `read_2.fastq`. Output file for read 2. Only works when 1 file (single-end) or 2 files (paired-end) are specified, but not for longer lists." , - "default": "$id.$key.trimmed_r2.fastq" + "default":"$id.$key.trimmed_r2.fastq" } @@ -563,7 +563,7 @@ "description": "Type: `file`, default: `$id.$key.trimming_report_r1.txt`, example: `read_1.trimming_report.txt`. Trimming report for read 1", "help_text": "Type: `file`, default: `$id.$key.trimming_report_r1.txt`, example: `read_1.trimming_report.txt`. Trimming report for read 1. Only works when 1 file (single-end) or 2 files (paired-end) are specified, but not for longer lists." , - "default": "$id.$key.trimming_report_r1.txt" + "default":"$id.$key.trimming_report_r1.txt" } @@ -574,7 +574,7 @@ "description": "Type: `file`, default: `$id.$key.trimming_report_r2.txt`, example: `read_2.trimming_report.txt`. Trimming report for read 1", "help_text": "Type: `file`, default: `$id.$key.trimming_report_r2.txt`, example: `read_2.trimming_report.txt`. Trimming report for read 1. Only works when 1 file (single-end) or 2 files (paired-end) are specified, but not for longer lists." , - "default": "$id.$key.trimming_report_r2.txt" + "default":"$id.$key.trimming_report_r2.txt" } @@ -585,7 +585,7 @@ "description": "Type: `file`, default: `$id.$key.trimmed_fastqc_html_1.html`, example: `read_1.fastqc.html`. FastQC report for trimmed (single-end) reads (or read 1 for paired-end)", "help_text": "Type: `file`, default: `$id.$key.trimmed_fastqc_html_1.html`, example: `read_1.fastqc.html`. FastQC report for trimmed (single-end) reads (or read 1 for paired-end). Only works when 1 file (single-end) or 2 files (paired-end) are specified, but not for longer lists." , - "default": "$id.$key.trimmed_fastqc_html_1.html" + "default":"$id.$key.trimmed_fastqc_html_1.html" } @@ -596,7 +596,7 @@ "description": "Type: `file`, default: `$id.$key.trimmed_fastqc_html_2.html`, example: `read_2.fastqc.html`. FastQC report for trimmed reads (read2 for paired-end)", "help_text": "Type: `file`, default: `$id.$key.trimmed_fastqc_html_2.html`, example: `read_2.fastqc.html`. FastQC report for trimmed reads (read2 for paired-end). Only works when 1 file (single-end) or 2 files (paired-end) are specified, but not for longer lists." , - "default": "$id.$key.trimmed_fastqc_html_2.html" + "default":"$id.$key.trimmed_fastqc_html_2.html" } @@ -607,7 +607,7 @@ "description": "Type: `file`, default: `$id.$key.trimmed_fastqc_zip_1.zip`, example: `read_1.fastqc.zip`. FastQC results for trimmed (single-end) reads (or read 1 for paired-end)", "help_text": "Type: `file`, default: `$id.$key.trimmed_fastqc_zip_1.zip`, example: `read_1.fastqc.zip`. FastQC results for trimmed (single-end) reads (or read 1 for paired-end). Only works when 1 file (single-end) or 2 files (paired-end) are specified, but not for longer lists." , - "default": "$id.$key.trimmed_fastqc_zip_1.zip" + "default":"$id.$key.trimmed_fastqc_zip_1.zip" } @@ -618,7 +618,7 @@ "description": "Type: `file`, default: `$id.$key.trimmed_fastqc_zip_2.zip`, example: `read_2.fastqc.zip`. FastQC results for trimmed reads (read2 for paired-end)", "help_text": "Type: `file`, default: `$id.$key.trimmed_fastqc_zip_2.zip`, example: `read_2.fastqc.zip`. FastQC results for trimmed reads (read2 for paired-end). Only works when 1 file (single-end) or 2 files (paired-end) are specified, but not for longer lists." , - "default": "$id.$key.trimmed_fastqc_zip_2.zip" + "default":"$id.$key.trimmed_fastqc_zip_2.zip" } @@ -629,7 +629,7 @@ "description": "Type: `file`, default: `$id.$key.unpaired_r1.fastq`, example: `unpaired_read_1.fastq`. Output file for unpired read 1", "help_text": "Type: `file`, default: `$id.$key.unpaired_r1.fastq`, example: `unpaired_read_1.fastq`. Output file for unpired read 1. Only works when 1 file (single-end) or 2 files (paired-end) are specified, but not for longer lists." , - "default": "$id.$key.unpaired_r1.fastq" + "default":"$id.$key.unpaired_r1.fastq" } @@ -640,7 +640,7 @@ "description": "Type: `file`, default: `$id.$key.unpaired_r2.fastq`, example: `unpaired_read_2.fastq`. Output file for unpaired read 2", "help_text": "Type: `file`, default: `$id.$key.unpaired_r2.fastq`, example: `unpaired_read_2.fastq`. Output file for unpaired read 2. Only works when 1 file (single-end) or 2 files (paired-end) are specified, but not for longer lists." , - "default": "$id.$key.unpaired_r2.fastq" + "default":"$id.$key.unpaired_r2.fastq" } diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/umi_tools/umi_tools_dedup/.config.vsh.yaml b/target/dependencies/vsh/vsh/biobox/main/nextflow/umi_tools/umi_tools_dedup/.config.vsh.yaml index 0cd39bb..6296dff 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/umi_tools/umi_tools_dedup/.config.vsh.yaml +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/umi_tools/umi_tools_dedup/.config.vsh.yaml @@ -611,9 +611,9 @@ build_info: output: "target/nextflow/umi_tools/umi_tools_dedup" executable: "target/nextflow/umi_tools/umi_tools_dedup/main.nf" viash_version: "0.9.0" - git_commit: "a13b57d04a3f3741eedd1af10fd96a9bee126f55" - git_remote: "https://x-access-token:ghs_xpDMoQpz4lF1RaGsMH4IlMbO48cLeW1cIYSF@github.com/viash-hub/biobox" - git_tag: "v0.2.0-26-ga13b57d" + git_commit: "952ff0843093b538cbfd6fefdecf2e7a0bc9e70b" + git_remote: "https://x-access-token:ghs_EwAUAMYJ0K4VBHlAEMs4ZP2OyQYqJM0PSfEO@github.com/viash-hub/biobox" + git_tag: "v0.2.0-27-g952ff08" package_config: name: "biobox" version: "main" diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/umi_tools/umi_tools_dedup/main.nf b/target/dependencies/vsh/vsh/biobox/main/nextflow/umi_tools/umi_tools_dedup/main.nf index 4540ecf..910e67d 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/umi_tools/umi_tools_dedup/main.nf +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/umi_tools/umi_tools_dedup/main.nf @@ -3487,9 +3487,9 @@ meta = [ "engine" : "docker|native", "output" : "target/nextflow/umi_tools/umi_tools_dedup", "viash_version" : "0.9.0", - "git_commit" : "a13b57d04a3f3741eedd1af10fd96a9bee126f55", - "git_remote" : "https://x-access-token:ghs_xpDMoQpz4lF1RaGsMH4IlMbO48cLeW1cIYSF@github.com/viash-hub/biobox", - "git_tag" : "v0.2.0-26-ga13b57d" + "git_commit" : "952ff0843093b538cbfd6fefdecf2e7a0bc9e70b", + "git_remote" : "https://x-access-token:ghs_EwAUAMYJ0K4VBHlAEMs4ZP2OyQYqJM0PSfEO@github.com/viash-hub/biobox", + "git_tag" : "v0.2.0-27-g952ff08" }, "package_config" : { "name" : "biobox", diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/umi_tools/umi_tools_dedup/nextflow_schema.json b/target/dependencies/vsh/vsh/biobox/main/nextflow/umi_tools/umi_tools_dedup/nextflow_schema.json index 834b53a..58ecde0 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/umi_tools/umi_tools_dedup/nextflow_schema.json +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/umi_tools/umi_tools_dedup/nextflow_schema.json @@ -30,7 +30,7 @@ "description": "Type: `boolean_true`, default: `false`. By default, inputs are assumed to be in BAM format", "help_text": "Type: `boolean_true`, default: `false`. By default, inputs are assumed to be in BAM format. Use this options to specify the use of SAM\nformat for input.\n" , - "default": "False" + "default":false } @@ -71,7 +71,7 @@ "description": "Type: `file`, required, default: `$id.$key.output.output`. Deduplicated BAM file", "help_text": "Type: `file`, required, default: `$id.$key.output.output`. Deduplicated BAM file." , - "default": "$id.$key.output.output" + "default":"$id.$key.output.output" } @@ -82,7 +82,7 @@ "description": "Type: `boolean_true`, default: `false`. By default, outputa are written in BAM format", "help_text": "Type: `boolean_true`, default: `false`. By default, outputa are written in BAM format. Use this options to specify the use of SAM format\nfor output.\n" , - "default": "False" + "default":false } @@ -93,7 +93,7 @@ "description": "Type: `boolean_true`, default: `false`. BAM is paired end - output both read pairs", "help_text": "Type: `boolean_true`, default: `false`. BAM is paired end - output both read pairs. This will also force the use of the template length\nto determine reads with the same mapping coordinates.\n" , - "default": "False" + "default":false } @@ -228,7 +228,7 @@ "description": "Type: `boolean_true`, default: `false`. Causes two reads that start in the same position on the same strand and having the same UMI\nto be considered unique if one is spliced and the other is not", "help_text": "Type: `boolean_true`, default: `false`. Causes two reads that start in the same position on the same strand and having the same UMI\nto be considered unique if one is spliced and the other is not. (Uses the \u0027N\u0027 cigar operation\nto test for splicing).\n" , - "default": "False" + "default":false } @@ -259,7 +259,7 @@ "description": "Type: `boolean_true`, default: `false`. Use the read length as a criteria when deduping, for e", "help_text": "Type: `boolean_true`, default: `false`. Use the read length as a criteria when deduping, for e.g. sRNA-Seq." , - "default": "False" + "default":false } @@ -280,7 +280,7 @@ "description": "Type: `boolean_true`, default: `false`. Reads will be grouped together if they have the same gene", "help_text": "Type: `boolean_true`, default: `false`. Reads will be grouped together if they have the same gene. This is useful if your library prep\ngenerates PCR duplicates with non identical alignment positions such as CEL-Seq. Note this option\nis hardcoded to be on with the count command. I.e. counting is always performed per-gene. Must be\ncombined with either --gene_tag or --per_contig option.\n" , - "default": "False" + "default":false } @@ -321,7 +321,7 @@ "description": "Type: `boolean_true`, default: `false`. Deduplicate per contig (field 3 in BAM; RNAME)", "help_text": "Type: `boolean_true`, default: `false`. Deduplicate per contig (field 3 in BAM; RNAME). All reads with the sam contig will be considered to\nhave the same alignment position. This is useful if you have aligned to a reference transcriptome\nwith one transcript per gene. If you have aligned to a transcriptome with more than one transcript\nper gene, you can supply a map between transcripts and gene using the --gene_transcript_map option.\n" , - "default": "False" + "default":false } @@ -342,7 +342,7 @@ "description": "Type: `boolean_true`, default: `false`. Reads will only be grouped together if they have the same cell barcode", "help_text": "Type: `boolean_true`, default: `false`. Reads will only be grouped together if they have the same cell barcode. Can be combined with\n--per_gene.\n" , - "default": "False" + "default":false } @@ -407,7 +407,7 @@ "description": "Type: `boolean_true`, default: `false`. Ignore the UMI and group reads using mapping coordinates only", "help_text": "Type: `boolean_true`, default: `false`. Ignore the UMI and group reads using mapping coordinates only." , - "default": "False" + "default":false } @@ -448,7 +448,7 @@ "description": "Type: `boolean_true`, default: `false`. By default, output is sorted", "help_text": "Type: `boolean_true`, default: `false`. By default, output is sorted. This involves the use of a temporary unsorted file (saved in\n--temp_dir). Use this option to turn off sorting.\n" , - "default": "False" + "default":false } @@ -459,7 +459,7 @@ "description": "Type: `boolean_true`, default: `false`. Forces dedup to parse an entire contig before yielding any reads for deduplication", "help_text": "Type: `boolean_true`, default: `false`. Forces dedup to parse an entire contig before yielding any reads for deduplication. This is the\nonly way to absolutely guarantee that all reads with the same start position are grouped together\nfor deduplication since dedup uses the start position of the read, not the alignment coordinate on\nwhich the reads are sorted. However, by default, dedup reads for another 1000bp before outputting\nread groups which will avoid any reads being missed with short read sequencing (\u003c1000bp).\n" , - "default": "False" + "default":false } @@ -490,7 +490,7 @@ "description": "Type: `boolean_true`, default: `false`. Send logging information to stderr", "help_text": "Type: `boolean_true`, default: `false`. Send logging information to stderr." , - "default": "False" + "default":false } diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/umi_tools/umi_tools_extract/.config.vsh.yaml b/target/dependencies/vsh/vsh/biobox/main/nextflow/umi_tools/umi_tools_extract/.config.vsh.yaml index 2a04ee4..dea32d2 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/umi_tools/umi_tools_extract/.config.vsh.yaml +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/umi_tools/umi_tools_extract/.config.vsh.yaml @@ -434,9 +434,9 @@ build_info: output: "target/nextflow/umi_tools/umi_tools_extract" executable: "target/nextflow/umi_tools/umi_tools_extract/main.nf" viash_version: "0.9.0" - git_commit: "a13b57d04a3f3741eedd1af10fd96a9bee126f55" - git_remote: "https://x-access-token:ghs_xpDMoQpz4lF1RaGsMH4IlMbO48cLeW1cIYSF@github.com/viash-hub/biobox" - git_tag: "v0.2.0-26-ga13b57d" + git_commit: "952ff0843093b538cbfd6fefdecf2e7a0bc9e70b" + git_remote: "https://x-access-token:ghs_EwAUAMYJ0K4VBHlAEMs4ZP2OyQYqJM0PSfEO@github.com/viash-hub/biobox" + git_tag: "v0.2.0-27-g952ff08" package_config: name: "biobox" version: "main" diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/umi_tools/umi_tools_extract/main.nf b/target/dependencies/vsh/vsh/biobox/main/nextflow/umi_tools/umi_tools_extract/main.nf index c392b78..af503a7 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/umi_tools/umi_tools_extract/main.nf +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/umi_tools/umi_tools_extract/main.nf @@ -3299,9 +3299,9 @@ meta = [ "engine" : "docker|native", "output" : "target/nextflow/umi_tools/umi_tools_extract", "viash_version" : "0.9.0", - "git_commit" : "a13b57d04a3f3741eedd1af10fd96a9bee126f55", - "git_remote" : "https://x-access-token:ghs_xpDMoQpz4lF1RaGsMH4IlMbO48cLeW1cIYSF@github.com/viash-hub/biobox", - "git_tag" : "v0.2.0-26-ga13b57d" + "git_commit" : "952ff0843093b538cbfd6fefdecf2e7a0bc9e70b", + "git_remote" : "https://x-access-token:ghs_EwAUAMYJ0K4VBHlAEMs4ZP2OyQYqJM0PSfEO@github.com/viash-hub/biobox", + "git_tag" : "v0.2.0-27-g952ff08" }, "package_config" : { "name" : "biobox", diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/umi_tools/umi_tools_extract/nextflow_schema.json b/target/dependencies/vsh/vsh/biobox/main/nextflow/umi_tools/umi_tools_extract/nextflow_schema.json index aacd7d1..927e039 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/umi_tools/umi_tools_extract/nextflow_schema.json +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/umi_tools/umi_tools_extract/nextflow_schema.json @@ -70,7 +70,7 @@ "description": "Type: `file`, required, default: `$id.$key.output.output`. Output file for read 1", "help_text": "Type: `file`, required, default: `$id.$key.output.output`. Output file for read 1." , - "default": "$id.$key.output.output" + "default":"$id.$key.output.output" } @@ -81,7 +81,7 @@ "description": "Type: `file`, default: `$id.$key.read2_out.read2_out`. Output file for read 2", "help_text": "Type: `file`, default: `$id.$key.read2_out.read2_out`. Output file for read 2." , - "default": "$id.$key.read2_out.read2_out" + "default":"$id.$key.read2_out.read2_out" } @@ -134,7 +134,7 @@ "description": "Type: `boolean_true`, default: `false`. Error correct cell barcodes to the whitelist", "help_text": "Type: `boolean_true`, default: `false`. Error correct cell barcodes to the whitelist." , - "default": "False" + "default":false } @@ -207,7 +207,7 @@ "description": "Type: `boolean_true`, default: `false`. Allow read 2 infile to contain reads not in read 1 infile", "help_text": "Type: `boolean_true`, default: `false`. Allow read 2 infile to contain reads not in read 1 infile. This enables support for upstream protocols\nwhere read one contains cell barcodes, and the read pairs have been filtered and corrected without regard\nto the read2.\n" , - "default": "False" + "default":false } @@ -218,7 +218,7 @@ "description": "Type: `boolean_true`, default: `false`. By default the barcode is assumed to be on the 5\u0027 end of the read, but use this option to sepecify that it is\non the 3\u0027 end instead", "help_text": "Type: `boolean_true`, default: `false`. By default the barcode is assumed to be on the 5\u0027 end of the read, but use this option to sepecify that it is\non the 3\u0027 end instead. This option only works with --extract_method=string since 3\u0027 encoding can be specified\nexplicitly with a regex, e.g `.*(?P\u003cumi_1\u003e.{5})$`.\n" , - "default": "False" + "default":false } @@ -229,7 +229,7 @@ "description": "Type: `boolean_true`, default: `false`. Ignore \"/1\" and \"/2\" read name suffixes", "help_text": "Type: `boolean_true`, default: `false`. Ignore \"/1\" and \"/2\" read name suffixes. Note that this options is required if the suffixes are not whitespace\nseparated from the rest of the read name.\narguments:\n" , - "default": "False" + "default":false } @@ -272,7 +272,7 @@ "description": "Type: `file`, default: `$id.$key.log.log`. File with logging information", "help_text": "Type: `file`, default: `$id.$key.log.log`. File with logging information." , - "default": "$id.$key.log.log" + "default":"$id.$key.log.log" } @@ -283,7 +283,7 @@ "description": "Type: `boolean_true`, default: `false`. Send logging information to stderr", "help_text": "Type: `boolean_true`, default: `false`. Send logging information to stderr." , - "default": "False" + "default":false } @@ -304,7 +304,7 @@ "description": "Type: `file`, default: `$id.$key.error.error`. File with error information", "help_text": "Type: `file`, default: `$id.$key.error.error`. File with error information." , - "default": "$id.$key.error.error" + "default":"$id.$key.error.error" } @@ -335,7 +335,7 @@ "description": "Type: `file`, default: `$id.$key.timeit.timeit`. Store timing information in file", "help_text": "Type: `file`, default: `$id.$key.timeit.timeit`. Store timing information in file." , - "default": "$id.$key.timeit.timeit" + "default":"$id.$key.timeit.timeit" } @@ -346,7 +346,7 @@ "description": "Type: `string`, default: `all`. Name in timing file for this class of jobs", "help_text": "Type: `string`, default: `all`. Name in timing file for this class of jobs." , - "default": "all" + "default":"all" } @@ -357,7 +357,7 @@ "description": "Type: `boolean_true`, default: `false`. Add header for timing information", "help_text": "Type: `boolean_true`, default: `false`. Add header for timing information." , - "default": "False" + "default":false } diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/umi_tools/umi_tools_prepareforrsem/.config.vsh.yaml b/target/dependencies/vsh/vsh/biobox/main/nextflow/umi_tools/umi_tools_prepareforrsem/.config.vsh.yaml index aacf4b2..30bbe4a 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/umi_tools/umi_tools_prepareforrsem/.config.vsh.yaml +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/umi_tools/umi_tools_prepareforrsem/.config.vsh.yaml @@ -256,9 +256,9 @@ build_info: output: "target/nextflow/umi_tools/umi_tools_prepareforrsem" executable: "target/nextflow/umi_tools/umi_tools_prepareforrsem/main.nf" viash_version: "0.9.0" - git_commit: "a13b57d04a3f3741eedd1af10fd96a9bee126f55" - git_remote: "https://x-access-token:ghs_xpDMoQpz4lF1RaGsMH4IlMbO48cLeW1cIYSF@github.com/viash-hub/biobox" - git_tag: "v0.2.0-26-ga13b57d" + git_commit: "952ff0843093b538cbfd6fefdecf2e7a0bc9e70b" + git_remote: "https://x-access-token:ghs_EwAUAMYJ0K4VBHlAEMs4ZP2OyQYqJM0PSfEO@github.com/viash-hub/biobox" + git_tag: "v0.2.0-27-g952ff08" package_config: name: "biobox" version: "main" diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/umi_tools/umi_tools_prepareforrsem/main.nf b/target/dependencies/vsh/vsh/biobox/main/nextflow/umi_tools/umi_tools_prepareforrsem/main.nf index 2412e04..df5b652 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/umi_tools/umi_tools_prepareforrsem/main.nf +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/umi_tools/umi_tools_prepareforrsem/main.nf @@ -3121,9 +3121,9 @@ meta = [ "engine" : "docker|native", "output" : "target/nextflow/umi_tools/umi_tools_prepareforrsem", "viash_version" : "0.9.0", - "git_commit" : "a13b57d04a3f3741eedd1af10fd96a9bee126f55", - "git_remote" : "https://x-access-token:ghs_xpDMoQpz4lF1RaGsMH4IlMbO48cLeW1cIYSF@github.com/viash-hub/biobox", - "git_tag" : "v0.2.0-26-ga13b57d" + "git_commit" : "952ff0843093b538cbfd6fefdecf2e7a0bc9e70b", + "git_remote" : "https://x-access-token:ghs_EwAUAMYJ0K4VBHlAEMs4ZP2OyQYqJM0PSfEO@github.com/viash-hub/biobox", + "git_tag" : "v0.2.0-27-g952ff08" }, "package_config" : { "name" : "biobox", diff --git a/target/dependencies/vsh/vsh/biobox/main/nextflow/umi_tools/umi_tools_prepareforrsem/nextflow_schema.json b/target/dependencies/vsh/vsh/biobox/main/nextflow/umi_tools/umi_tools_prepareforrsem/nextflow_schema.json index 75b3c8d..d7e1cd7 100644 --- a/target/dependencies/vsh/vsh/biobox/main/nextflow/umi_tools/umi_tools_prepareforrsem/nextflow_schema.json +++ b/target/dependencies/vsh/vsh/biobox/main/nextflow/umi_tools/umi_tools_prepareforrsem/nextflow_schema.json @@ -40,7 +40,7 @@ "description": "Type: `file`, default: `$id.$key.output.bam`, example: `$id.transcriptome_sorted.bam`. ", "help_text": "Type: `file`, default: `$id.$key.output.bam`, example: `$id.transcriptome_sorted.bam`. " , - "default": "$id.$key.output.bam" + "default":"$id.$key.output.bam" } @@ -51,7 +51,7 @@ "description": "Type: `file`, default: `$id.$key.log.log`. File with logging information [default = stdout]", "help_text": "Type: `file`, default: `$id.$key.log.log`. File with logging information [default = stdout]." , - "default": "$id.$key.log.log" + "default":"$id.$key.log.log" } @@ -62,7 +62,7 @@ "description": "Type: `file`, default: `$id.$key.error.error`. File with error information [default = stderr]", "help_text": "Type: `file`, default: `$id.$key.error.error`. File with error information [default = stderr]." , - "default": "$id.$key.error.error" + "default":"$id.$key.error.error" } @@ -73,7 +73,7 @@ "description": "Type: `boolean_true`, default: `false`. Send logging information to stderr [default = False]", "help_text": "Type: `boolean_true`, default: `false`. Send logging information to stderr [default = False]." , - "default": "False" + "default":false } @@ -124,7 +124,7 @@ "description": "Type: `boolean_true`, default: `false`. Input and output SAM rather than BAM", "help_text": "Type: `boolean_true`, default: `false`. Input and output SAM rather than BAM." , - "default": "False" + "default":false } @@ -155,7 +155,7 @@ "description": "Type: `boolean_true`, default: `false`. Add header for timing information [none]", "help_text": "Type: `boolean_true`, default: `false`. Add header for timing information [none]." , - "default": "False" + "default":false } diff --git a/target/executable/bedtools_genomecov/.config.vsh.yaml b/target/executable/bedtools_genomecov/.config.vsh.yaml index a19cad4..7bee430 100644 --- a/target/executable/bedtools_genomecov/.config.vsh.yaml +++ b/target/executable/bedtools_genomecov/.config.vsh.yaml @@ -63,6 +63,9 @@ resources: - type: "bash_script" path: "script.sh" is_executable: true +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "Compute BEDGRAPH (-bg) summaries of feature coverage" test_resources: - type: "bash_script" @@ -152,6 +155,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -178,8 +183,8 @@ build_info: output: "target/executable/bedtools_genomecov" executable: "target/executable/bedtools_genomecov/bedtools_genomecov" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" package_config: name: "rnaseq" version: "main" @@ -200,8 +205,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/executable/bedtools_genomecov/bedtools_genomecov b/target/executable/bedtools_genomecov/bedtools_genomecov index 37de61f..e088418 100755 --- a/target/executable/bedtools_genomecov/bedtools_genomecov +++ b/target/executable/bedtools_genomecov/bedtools_genomecov @@ -481,9 +481,9 @@ mv bedtools.static /usr/local/bin/bedtools && \ chmod a+x /usr/local/bin/bedtools LABEL org.opencontainers.image.description="Companion container for running component bedtools_genomecov" -LABEL org.opencontainers.image.created="2024-11-27T17:11:16Z" -LABEL org.opencontainers.image.source="https://x-access-token/ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" -LABEL org.opencontainers.image.revision="d63250ae704b6bd9a11792c4f979be2309999a2e" +LABEL org.opencontainers.image.created="2024-12-05T08:04:23Z" +LABEL org.opencontainers.image.source="https://x-access-token/ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" +LABEL org.opencontainers.image.revision="4adb388c7d928eea02bccf890214f3b932b08714" LABEL org.opencontainers.image.version="main" VIASHDOCKER diff --git a/target/executable/bedtools_genomecov/nextflow_labels.config b/target/executable/bedtools_genomecov/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/executable/bedtools_genomecov/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/executable/cat_additional_fasta/.config.vsh.yaml b/target/executable/cat_additional_fasta/.config.vsh.yaml index bf77ebc..d50f236 100644 --- a/target/executable/cat_additional_fasta/.config.vsh.yaml +++ b/target/executable/cat_additional_fasta/.config.vsh.yaml @@ -69,6 +69,9 @@ resources: - type: "python_script" path: "script.py" is_executable: true +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "Concatenate addional fasta file to reference FASTA and GTF files.\n" test_resources: - type: "bash_script" @@ -162,6 +165,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -182,8 +187,8 @@ build_info: output: "target/executable/cat_additional_fasta" executable: "target/executable/cat_additional_fasta/cat_additional_fasta" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" package_config: name: "rnaseq" version: "main" @@ -204,8 +209,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/executable/cat_additional_fasta/cat_additional_fasta b/target/executable/cat_additional_fasta/cat_additional_fasta index 95efbcf..7bec505 100755 --- a/target/executable/cat_additional_fasta/cat_additional_fasta +++ b/target/executable/cat_additional_fasta/cat_additional_fasta @@ -480,9 +480,9 @@ function ViashDockerfile { FROM python:latest ENTRYPOINT [] LABEL org.opencontainers.image.description="Companion container for running component cat_additional_fasta" -LABEL org.opencontainers.image.created="2024-11-27T17:11:15Z" -LABEL org.opencontainers.image.source="https://x-access-token/ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" -LABEL org.opencontainers.image.revision="d63250ae704b6bd9a11792c4f979be2309999a2e" +LABEL org.opencontainers.image.created="2024-12-05T08:04:22Z" +LABEL org.opencontainers.image.source="https://x-access-token/ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" +LABEL org.opencontainers.image.revision="4adb388c7d928eea02bccf890214f3b932b08714" LABEL org.opencontainers.image.version="main" VIASHDOCKER diff --git a/target/executable/cat_additional_fasta/nextflow_labels.config b/target/executable/cat_additional_fasta/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/executable/cat_additional_fasta/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/executable/cat_fastq/.config.vsh.yaml b/target/executable/cat_fastq/.config.vsh.yaml index dd675aa..8e75fb7 100644 --- a/target/executable/cat_fastq/.config.vsh.yaml +++ b/target/executable/cat_fastq/.config.vsh.yaml @@ -53,6 +53,9 @@ resources: - type: "bash_script" path: "script.sh" is_executable: true +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "Concatenate multiple fastq files" test_resources: - type: "bash_script" @@ -149,6 +152,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -169,8 +174,8 @@ build_info: output: "target/executable/cat_fastq" executable: "target/executable/cat_fastq/cat_fastq" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" package_config: name: "rnaseq" version: "main" @@ -191,8 +196,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/executable/cat_fastq/cat_fastq b/target/executable/cat_fastq/cat_fastq index a16e790..95dc38a 100755 --- a/target/executable/cat_fastq/cat_fastq +++ b/target/executable/cat_fastq/cat_fastq @@ -472,9 +472,9 @@ function ViashDockerfile { FROM ubuntu:22.04 ENTRYPOINT [] LABEL org.opencontainers.image.description="Companion container for running component cat_fastq" -LABEL org.opencontainers.image.created="2024-11-27T17:11:14Z" -LABEL org.opencontainers.image.source="https://x-access-token/ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" -LABEL org.opencontainers.image.revision="d63250ae704b6bd9a11792c4f979be2309999a2e" +LABEL org.opencontainers.image.created="2024-12-05T08:04:22Z" +LABEL org.opencontainers.image.source="https://x-access-token/ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" +LABEL org.opencontainers.image.revision="4adb388c7d928eea02bccf890214f3b932b08714" LABEL org.opencontainers.image.version="main" VIASHDOCKER diff --git a/target/executable/cat_fastq/nextflow_labels.config b/target/executable/cat_fastq/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/executable/cat_fastq/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/executable/deseq2_qc/.config.vsh.yaml b/target/executable/deseq2_qc/.config.vsh.yaml index 40636dd..6d425d8 100644 --- a/target/executable/deseq2_qc/.config.vsh.yaml +++ b/target/executable/deseq2_qc/.config.vsh.yaml @@ -115,6 +115,9 @@ resources: path: "deseq2_pca_header.txt" - type: "file" path: "deseq2_clustering_header.txt" +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "run deseq2, perform pca, generate heatmaps and scatterplots for samples\ \ in the counts files\n" test_resources: @@ -205,6 +208,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -237,8 +242,8 @@ build_info: output: "target/executable/deseq2_qc" executable: "target/executable/deseq2_qc/deseq2_qc" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" package_config: name: "rnaseq" version: "main" @@ -259,8 +264,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/executable/deseq2_qc/deseq2_qc b/target/executable/deseq2_qc/deseq2_qc index f08a26f..67cb000 100755 --- a/target/executable/deseq2_qc/deseq2_qc +++ b/target/executable/deseq2_qc/deseq2_qc @@ -506,9 +506,9 @@ RUN Rscript -e 'if (!requireNamespace("remotes", quietly = TRUE)) install.packag Rscript -e 'remotes::install_cran(c("optparse", "ggplot2", "RColorBrewer", "pheatmap", "stringr", "matrixStats"), repos = "https://cran.rstudio.com")' LABEL org.opencontainers.image.description="Companion container for running component deseq2_qc" -LABEL org.opencontainers.image.created="2024-11-27T17:11:15Z" -LABEL org.opencontainers.image.source="https://x-access-token/ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" -LABEL org.opencontainers.image.revision="d63250ae704b6bd9a11792c4f979be2309999a2e" +LABEL org.opencontainers.image.created="2024-12-05T08:04:22Z" +LABEL org.opencontainers.image.source="https://x-access-token/ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" +LABEL org.opencontainers.image.revision="4adb388c7d928eea02bccf890214f3b932b08714" LABEL org.opencontainers.image.version="main" VIASHDOCKER diff --git a/target/executable/deseq2_qc/nextflow_labels.config b/target/executable/deseq2_qc/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/executable/deseq2_qc/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/executable/dupradar/.config.vsh.yaml b/target/executable/dupradar/.config.vsh.yaml index 33f7209..facf709 100644 --- a/target/executable/dupradar/.config.vsh.yaml +++ b/target/executable/dupradar/.config.vsh.yaml @@ -146,6 +146,9 @@ resources: is_executable: true - type: "file" path: "dupradar.r" +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "Assessment of duplication rates in RNA-Seq datasets\n" test_resources: - type: "bash_script" @@ -237,6 +240,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -266,8 +271,8 @@ build_info: output: "target/executable/dupradar" executable: "target/executable/dupradar/dupradar" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" package_config: name: "rnaseq" version: "main" @@ -288,8 +293,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/executable/dupradar/dupradar b/target/executable/dupradar/dupradar index 7775c6d..78de1f6 100755 --- a/target/executable/dupradar/dupradar +++ b/target/executable/dupradar/dupradar @@ -520,9 +520,9 @@ RUN Rscript -e 'if (!requireNamespace("BiocManager", quietly = TRUE)) install.pa Rscript -e 'if (!requireNamespace("dupRadar", quietly = TRUE)) BiocManager::install("dupRadar")' LABEL org.opencontainers.image.description="Companion container for running component dupradar" -LABEL org.opencontainers.image.created="2024-11-27T17:11:16Z" -LABEL org.opencontainers.image.source="https://x-access-token/ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" -LABEL org.opencontainers.image.revision="d63250ae704b6bd9a11792c4f979be2309999a2e" +LABEL org.opencontainers.image.created="2024-12-05T08:04:24Z" +LABEL org.opencontainers.image.source="https://x-access-token/ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" +LABEL org.opencontainers.image.revision="4adb388c7d928eea02bccf890214f3b932b08714" LABEL org.opencontainers.image.version="main" VIASHDOCKER diff --git a/target/executable/dupradar/nextflow_labels.config b/target/executable/dupradar/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/executable/dupradar/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/executable/getchromsizes/.config.vsh.yaml b/target/executable/getchromsizes/.config.vsh.yaml index 9b61a13..364dadd 100644 --- a/target/executable/getchromsizes/.config.vsh.yaml +++ b/target/executable/getchromsizes/.config.vsh.yaml @@ -49,6 +49,9 @@ resources: - type: "bash_script" path: "script.sh" is_executable: true +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "Generates a FASTA file of chromosome sizes and a fasta index file.\n" test_resources: - type: "bash_script" @@ -139,6 +142,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -167,8 +172,8 @@ build_info: output: "target/executable/getchromsizes" executable: "target/executable/getchromsizes/getchromsizes" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" package_config: name: "rnaseq" version: "main" @@ -189,8 +194,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/executable/getchromsizes/getchromsizes b/target/executable/getchromsizes/getchromsizes index 6651d62..362516e 100755 --- a/target/executable/getchromsizes/getchromsizes +++ b/target/executable/getchromsizes/getchromsizes @@ -480,9 +480,9 @@ make && \ make install LABEL org.opencontainers.image.description="Companion container for running component getchromsizes" -LABEL org.opencontainers.image.created="2024-11-27T17:11:15Z" -LABEL org.opencontainers.image.source="https://x-access-token/ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" -LABEL org.opencontainers.image.revision="d63250ae704b6bd9a11792c4f979be2309999a2e" +LABEL org.opencontainers.image.created="2024-12-05T08:04:23Z" +LABEL org.opencontainers.image.source="https://x-access-token/ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" +LABEL org.opencontainers.image.revision="4adb388c7d928eea02bccf890214f3b932b08714" LABEL org.opencontainers.image.version="main" VIASHDOCKER diff --git a/target/executable/getchromsizes/nextflow_labels.config b/target/executable/getchromsizes/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/executable/getchromsizes/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/executable/gtf2bed/.config.vsh.yaml b/target/executable/gtf2bed/.config.vsh.yaml index e69798e..58a0a03 100644 --- a/target/executable/gtf2bed/.config.vsh.yaml +++ b/target/executable/gtf2bed/.config.vsh.yaml @@ -31,6 +31,9 @@ resources: is_executable: true - type: "file" path: "gtf2bed.pl" +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "Create BED annotation file from GTF.\n" test_resources: - type: "bash_script" @@ -120,6 +123,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -145,8 +150,8 @@ build_info: output: "target/executable/gtf2bed" executable: "target/executable/gtf2bed/gtf2bed" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" package_config: name: "rnaseq" version: "main" @@ -167,8 +172,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/executable/gtf2bed/gtf2bed b/target/executable/gtf2bed/gtf2bed index 5f5d060..a563ff0 100755 --- a/target/executable/gtf2bed/gtf2bed +++ b/target/executable/gtf2bed/gtf2bed @@ -466,9 +466,9 @@ RUN apt-get update && \ rm -rf /var/lib/apt/lists/* LABEL org.opencontainers.image.description="Companion container for running component gtf2bed" -LABEL org.opencontainers.image.created="2024-11-27T17:11:17Z" -LABEL org.opencontainers.image.source="https://x-access-token/ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" -LABEL org.opencontainers.image.revision="d63250ae704b6bd9a11792c4f979be2309999a2e" +LABEL org.opencontainers.image.created="2024-12-05T08:04:24Z" +LABEL org.opencontainers.image.source="https://x-access-token/ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" +LABEL org.opencontainers.image.revision="4adb388c7d928eea02bccf890214f3b932b08714" LABEL org.opencontainers.image.version="main" VIASHDOCKER diff --git a/target/executable/gtf2bed/nextflow_labels.config b/target/executable/gtf2bed/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/executable/gtf2bed/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/executable/gtf_filter/.config.vsh.yaml b/target/executable/gtf_filter/.config.vsh.yaml index d117761..b694ff0 100644 --- a/target/executable/gtf_filter/.config.vsh.yaml +++ b/target/executable/gtf_filter/.config.vsh.yaml @@ -44,6 +44,9 @@ resources: - type: "python_script" path: "script.py" is_executable: true +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "Filters a GTF file based on sequence names in a FASTA file.\n" test_resources: - type: "bash_script" @@ -135,6 +138,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -155,8 +160,8 @@ build_info: output: "target/executable/gtf_filter" executable: "target/executable/gtf_filter/gtf_filter" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" package_config: name: "rnaseq" version: "main" @@ -177,8 +182,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/executable/gtf_filter/gtf_filter b/target/executable/gtf_filter/gtf_filter index ca8565e..5149e7a 100755 --- a/target/executable/gtf_filter/gtf_filter +++ b/target/executable/gtf_filter/gtf_filter @@ -470,9 +470,9 @@ function ViashDockerfile { FROM python:latest ENTRYPOINT [] LABEL org.opencontainers.image.description="Companion container for running component gtf_filter" -LABEL org.opencontainers.image.created="2024-11-27T17:11:15Z" -LABEL org.opencontainers.image.source="https://x-access-token/ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" -LABEL org.opencontainers.image.revision="d63250ae704b6bd9a11792c4f979be2309999a2e" +LABEL org.opencontainers.image.created="2024-12-05T08:04:23Z" +LABEL org.opencontainers.image.source="https://x-access-token/ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" +LABEL org.opencontainers.image.revision="4adb388c7d928eea02bccf890214f3b932b08714" LABEL org.opencontainers.image.version="main" VIASHDOCKER diff --git a/target/executable/gtf_filter/nextflow_labels.config b/target/executable/gtf_filter/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/executable/gtf_filter/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/executable/gunzip/.config.vsh.yaml b/target/executable/gunzip/.config.vsh.yaml index 9bff6d9..a67a8be 100644 --- a/target/executable/gunzip/.config.vsh.yaml +++ b/target/executable/gunzip/.config.vsh.yaml @@ -29,6 +29,9 @@ resources: - type: "bash_script" path: "script.sh" is_executable: true +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "Compress or uncompress a file or list of files.\n" test_resources: - type: "bash_script" @@ -119,6 +122,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -144,8 +149,8 @@ build_info: output: "target/executable/gunzip" executable: "target/executable/gunzip/gunzip" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" package_config: name: "rnaseq" version: "main" @@ -166,8 +171,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/executable/gunzip/gunzip b/target/executable/gunzip/gunzip index 1796f8f..e6bc9c8 100755 --- a/target/executable/gunzip/gunzip +++ b/target/executable/gunzip/gunzip @@ -466,9 +466,9 @@ RUN apt-get update && \ rm -rf /var/lib/apt/lists/* LABEL org.opencontainers.image.description="Companion container for running component gunzip" -LABEL org.opencontainers.image.created="2024-11-27T17:11:12Z" -LABEL org.opencontainers.image.source="https://x-access-token/ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" -LABEL org.opencontainers.image.revision="d63250ae704b6bd9a11792c4f979be2309999a2e" +LABEL org.opencontainers.image.created="2024-12-05T08:04:19Z" +LABEL org.opencontainers.image.source="https://x-access-token/ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" +LABEL org.opencontainers.image.revision="4adb388c7d928eea02bccf890214f3b932b08714" LABEL org.opencontainers.image.version="main" VIASHDOCKER diff --git a/target/executable/gunzip/nextflow_labels.config b/target/executable/gunzip/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/executable/gunzip/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/executable/multiqc_custom_biotype/.config.vsh.yaml b/target/executable/multiqc_custom_biotype/.config.vsh.yaml index c365ce3..d1c045c 100644 --- a/target/executable/multiqc_custom_biotype/.config.vsh.yaml +++ b/target/executable/multiqc_custom_biotype/.config.vsh.yaml @@ -63,6 +63,9 @@ resources: is_executable: true - type: "file" path: "biotypes_header.txt" +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "Calculate features percentage for biotype counts" test_resources: - type: "bash_script" @@ -145,6 +148,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -165,8 +170,8 @@ build_info: output: "target/executable/multiqc_custom_biotype" executable: "target/executable/multiqc_custom_biotype/multiqc_custom_biotype" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" package_config: name: "rnaseq" version: "main" @@ -187,8 +192,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/executable/multiqc_custom_biotype/multiqc_custom_biotype b/target/executable/multiqc_custom_biotype/multiqc_custom_biotype index 086a5ab..0de64f7 100755 --- a/target/executable/multiqc_custom_biotype/multiqc_custom_biotype +++ b/target/executable/multiqc_custom_biotype/multiqc_custom_biotype @@ -476,9 +476,9 @@ function ViashDockerfile { FROM python:latest ENTRYPOINT [] LABEL org.opencontainers.image.description="Companion container for running component multiqc_custom_biotype" -LABEL org.opencontainers.image.created="2024-11-27T17:11:14Z" -LABEL org.opencontainers.image.source="https://x-access-token/ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" -LABEL org.opencontainers.image.revision="d63250ae704b6bd9a11792c4f979be2309999a2e" +LABEL org.opencontainers.image.created="2024-12-05T08:04:22Z" +LABEL org.opencontainers.image.source="https://x-access-token/ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" +LABEL org.opencontainers.image.revision="4adb388c7d928eea02bccf890214f3b932b08714" LABEL org.opencontainers.image.version="main" VIASHDOCKER diff --git a/target/executable/multiqc_custom_biotype/nextflow_labels.config b/target/executable/multiqc_custom_biotype/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/executable/multiqc_custom_biotype/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/executable/picard_markduplicates/.config.vsh.yaml b/target/executable/picard_markduplicates/.config.vsh.yaml index 87eb75b..a0df7f4 100644 --- a/target/executable/picard_markduplicates/.config.vsh.yaml +++ b/target/executable/picard_markduplicates/.config.vsh.yaml @@ -87,6 +87,9 @@ resources: - type: "bash_script" path: "script.sh" is_executable: true +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "Locate and tag duplicate reads in a BAM file\n" test_resources: - type: "bash_script" @@ -179,6 +182,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -207,8 +212,8 @@ build_info: output: "target/executable/picard_markduplicates" executable: "target/executable/picard_markduplicates/picard_markduplicates" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" package_config: name: "rnaseq" version: "main" @@ -229,8 +234,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/executable/picard_markduplicates/nextflow_labels.config b/target/executable/picard_markduplicates/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/executable/picard_markduplicates/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/executable/picard_markduplicates/picard_markduplicates b/target/executable/picard_markduplicates/picard_markduplicates index 272f127..8b9ca9a 100755 --- a/target/executable/picard_markduplicates/picard_markduplicates +++ b/target/executable/picard_markduplicates/picard_markduplicates @@ -494,9 +494,9 @@ wget --no-check-certificate https://github.com/broadinstitute/picard/releases/do mv picard.jar /usr/local/bin LABEL org.opencontainers.image.description="Companion container for running component picard_markduplicates" -LABEL org.opencontainers.image.created="2024-11-27T17:11:12Z" -LABEL org.opencontainers.image.source="https://x-access-token/ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" -LABEL org.opencontainers.image.revision="d63250ae704b6bd9a11792c4f979be2309999a2e" +LABEL org.opencontainers.image.created="2024-12-05T08:04:20Z" +LABEL org.opencontainers.image.source="https://x-access-token/ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" +LABEL org.opencontainers.image.revision="4adb388c7d928eea02bccf890214f3b932b08714" LABEL org.opencontainers.image.version="main" VIASHDOCKER diff --git a/target/executable/prepare_multiqc_input/.config.vsh.yaml b/target/executable/prepare_multiqc_input/.config.vsh.yaml index 444b4f2..e115ee4 100644 --- a/target/executable/prepare_multiqc_input/.config.vsh.yaml +++ b/target/executable/prepare_multiqc_input/.config.vsh.yaml @@ -287,6 +287,7 @@ argument_groups: multiple_sep: "," - type: "file" name: "--multiqc_config" + description: "Custom multiqc configuration file\n" info: null must_exist: true create_parent: true @@ -311,6 +312,11 @@ resources: - type: "bash_script" path: "script.sh" is_executable: true +- type: "file" + path: "multiqc_config.yml" +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "Prepare directory with all the input files for MultiQC.\n" info: null status: "enabled" @@ -389,6 +395,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -409,8 +417,8 @@ build_info: output: "target/executable/prepare_multiqc_input" executable: "target/executable/prepare_multiqc_input/prepare_multiqc_input" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" package_config: name: "rnaseq" version: "main" @@ -431,8 +439,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/executable/prepare_multiqc_input/multiqc_config.yml b/target/executable/prepare_multiqc_input/multiqc_config.yml new file mode 100644 index 0000000..0ac2fb1 --- /dev/null +++ b/target/executable/prepare_multiqc_input/multiqc_config.yml @@ -0,0 +1,164 @@ +report_comment: > + This report has been generated by the + analysis pipeline. +report_section_order: + "rnaseq-methods-description": + order: -1000 + software_versions: + order: -1001 + "rnaseq.vsh-summary": + order: -1002 + +export_plots: true +disable_version_detection: true + +# Run only these modules +run_modules: + - custom_content + - fastqc + - cutadapt + - fastp + - sortmerna + - star + - rsem + - salmon + - kallisto + - samtools + - picard + - preseq + - rseqc + - qualimap + +# Order of modules +top_modules: + - "fail_trimming" + - "fail_mapping" + - "fail_strand" + - "star_rsem_deseq2_pca" + - "star_rsem_deseq2_clustering" + - "star_salmon_deseq2_pca" + - "star_salmon_deseq2_clustering" + - "salmon_deseq2_pca" + - "salmon_deseq2_clustering" + - "kallisto_deseq2_pca" + - "kallisto_deseq2_clustering" + - "biotype_counts" + - "dupradar" + +module_order: + - fastqc: + name: "FastQC (raw)" + info: "This section of the report shows FastQC results before adapter trimming." + path_filters: + - "*.read_*.fastqc.zip" + - cutadapt + - fastp + - fastqc: + name: "FastQC (trimmed)" + info: "This section of the report shows FastQC results after adapter trimming." + path_filters: + - "*.trimgalore.read_*.fastqc.zip" + +# Don't show % Dups in the General Stats table (we have this from Picard) +table_columns_visible: + fastqc: + percent_duplicates: False + +extra_fn_clean_extn: + # - ".mapping_quality" + # - ".MarkDuplicates_flagstat.output.flagstat" + # - ".MarkDuplicates_idxstats.output.idxstats" + # - ".MarkDuplicates_stats.output.txt" + # - ".genome_sorted_MarkDuplicates.output.bam" + # - ".genome_sorted_MarkDuplicates" + - ".read_1" + - ".read_2" + +# See https://github.com/ewels/MultiQC_TestData/blob/master/data/custom_content/with_config/table_headerconfig/multiqc_config.yaml +custom_data: + fail_trimming: + section_name: "WARNING: Fail Trimming Check" + description: "List of samples that failed the minimum trimmed reads threshold specified via the '--min_trimmed_reads' parameter, and hence were ignored for the downstream processing steps." + plot_type: "table" + pconfig: + id: "fail_trimmed_samples_table" + table_title: "Samples failed trimming threshold" + namespace: "Samples failed trimming threshold" + format: "{:.0f}" + fail_mapping: + section_name: "WARNING: Fail Alignment Check" + description: "List of samples that failed the STAR minimum mapped reads threshold specified via the '--min_mapped_reads' parameter, and hence were ignored for the downstream processing steps." + plot_type: "table" + pconfig: + id: "fail_mapped_samples_table" + table_title: "Samples failed mapping threshold" + namespace: "Samples failed mapping threshold" + format: "{:.2f}" + fail_strand: + section_name: "WARNING: Fail Strand Check" + description: "List of samples that failed the strandedness check between that provided in the samplesheet and calculated by the RSeQC infer_experiment.py tool." + plot_type: "table" + pconfig: + id: "fail_strand_check_table" + table_title: "Samples failed strandedness check" + namespace: "Samples failed strandedness check" + format: "{:.2f}" + +# Customise the module search patterns to speed up execution time +# - Skip module sub-tools that we are not interested in +# - Replace file-content searching with filename pattern searching +# - Don't add anything that is the same as the MultiQC default +# See https://multiqc.info/docs/#optimise-file-search-patterns for details +sp: + + fastqc/zip: + fn: "*.fastqc.zip" + + cutadapt: + fn: "*.trimming_report*.txt" + + fastp: + fn: "*.fastp_out.json" + + sortmerna: + fn: "*sortmerna*.log" + + star: + fn: "*.star_align_reads.log.txt" + + # hisat2: + # fn: "*.hisat2.summary.log" + # salmon: + # fn: "*meta_info.json" + + preseq: + fn: "*.lc_extrap.txt" + + samtools/stats: + fn: "*_stats.output.txt" + samtools/flagstat: + fn: "*_flagstat.output.flagstat" + samtools/idxstats: + fn: "*_idxstats.output.idxstats" + + rseqc/bam_stat: + fn: "*.mapping_quality.txt" + rseqc/junction_saturation: + fn: "*.junction_saturation_plot.r" + rseqc/junction_annotation: + fn: "*.junction_annotation.log" + rseqc/read_duplication_pos: + fn: "*.duplication_rate_mapping.xls" + rseqc/read_distribution: + fn: "*.read_distribution.txt" + rseqc/infer_experiment: + fn: "*.strandedness.txt" + rseqc/inner_distance: + fn: "*.inner_distance_freq.txt" + rseqc/tin: + fn: "*.tin_summary.txt" + + picard/markdups: + fn: "*.MarkDuplicates.metrics.txt" + +skip_versions_section: true diff --git a/target/executable/prepare_multiqc_input/nextflow_labels.config b/target/executable/prepare_multiqc_input/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/executable/prepare_multiqc_input/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/executable/prepare_multiqc_input/prepare_multiqc_input b/target/executable/prepare_multiqc_input/prepare_multiqc_input index e364a0d..964b57e 100755 --- a/target/executable/prepare_multiqc_input/prepare_multiqc_input +++ b/target/executable/prepare_multiqc_input/prepare_multiqc_input @@ -274,6 +274,7 @@ function ViashHelp { echo "" echo " --multiqc_config" echo " type: file, file must exist" + echo " Custom multiqc configuration file" echo "" echo "Ouput:" echo " --output" @@ -557,9 +558,9 @@ function ViashDockerfile { FROM ubuntu:22.04 ENTRYPOINT [] LABEL org.opencontainers.image.description="Companion container for running component prepare_multiqc_input" -LABEL org.opencontainers.image.created="2024-11-27T17:11:11Z" -LABEL org.opencontainers.image.source="https://x-access-token/ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" -LABEL org.opencontainers.image.revision="d63250ae704b6bd9a11792c4f979be2309999a2e" +LABEL org.opencontainers.image.created="2024-12-05T08:04:18Z" +LABEL org.opencontainers.image.source="https://x-access-token/ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" +LABEL org.opencontainers.image.revision="4adb388c7d928eea02bccf890214f3b932b08714" LABEL org.opencontainers.image.version="main" VIASHDOCKER @@ -2333,7 +2334,23 @@ IFS="," read -ra readduplication_multiqc <<< \$par_readduplication_multiqc && fo IFS="," read -ra tin_multiqc <<< \$par_tin_multiqc && for file in "\${tin_multiqc[@]}"; do [ -e "\$file" ] && cp -r "\$file" "\$par_output/"; done -[ -e "\$par_multiqc_config" ] && cp -r \$par_multiqc_config "\$par_output/" +echo "Checking for custom multiqc_config" +# If the variable is empty, we use the default one (registered as a resource) +if [ -z \$par_multiqc_config ]; then + echo "No multiqc_config provided, using the default" + cp \$meta_resources_dir/multiqc_config.yml "\$par_output" +else + echo "Optional file provided" + if [ -f \$par_multiqc_config ]; then + cp \$par_multiqc_config "\$par_output"/multiqc_config.yml + else + # Unreachable: the Viash-generated module checks this + echo "Optional file does not exist" + exit 1 + fi +fi + +echo "Done" VIASHMAIN bash "\$tempscript" & wait "\$!" diff --git a/target/executable/preprocess_transcripts_fasta/.config.vsh.yaml b/target/executable/preprocess_transcripts_fasta/.config.vsh.yaml index f376fc8..9d4d79e 100644 --- a/target/executable/preprocess_transcripts_fasta/.config.vsh.yaml +++ b/target/executable/preprocess_transcripts_fasta/.config.vsh.yaml @@ -29,6 +29,9 @@ resources: - type: "bash_script" path: "script.sh" is_executable: true +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "Process transcripts FASTA if GTF file is GENOCODE format\n" test_resources: - type: "bash_script" @@ -118,6 +121,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -138,8 +143,8 @@ build_info: output: "target/executable/preprocess_transcripts_fasta" executable: "target/executable/preprocess_transcripts_fasta/preprocess_transcripts_fasta" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" package_config: name: "rnaseq" version: "main" @@ -160,8 +165,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/executable/preprocess_transcripts_fasta/nextflow_labels.config b/target/executable/preprocess_transcripts_fasta/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/executable/preprocess_transcripts_fasta/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/executable/preprocess_transcripts_fasta/preprocess_transcripts_fasta b/target/executable/preprocess_transcripts_fasta/preprocess_transcripts_fasta index 327bb88..18a0f48 100755 --- a/target/executable/preprocess_transcripts_fasta/preprocess_transcripts_fasta +++ b/target/executable/preprocess_transcripts_fasta/preprocess_transcripts_fasta @@ -462,9 +462,9 @@ function ViashDockerfile { FROM ubuntu:22.04 ENTRYPOINT [] LABEL org.opencontainers.image.description="Companion container for running component preprocess_transcripts_fasta" -LABEL org.opencontainers.image.created="2024-11-27T17:11:13Z" -LABEL org.opencontainers.image.source="https://x-access-token/ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" -LABEL org.opencontainers.image.revision="d63250ae704b6bd9a11792c4f979be2309999a2e" +LABEL org.opencontainers.image.created="2024-12-05T08:04:20Z" +LABEL org.opencontainers.image.source="https://x-access-token/ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" +LABEL org.opencontainers.image.revision="4adb388c7d928eea02bccf890214f3b932b08714" LABEL org.opencontainers.image.version="main" VIASHDOCKER diff --git a/target/executable/preseq_lcextrap/.config.vsh.yaml b/target/executable/preseq_lcextrap/.config.vsh.yaml index 2fbf733..d76c7c3 100644 --- a/target/executable/preseq_lcextrap/.config.vsh.yaml +++ b/target/executable/preseq_lcextrap/.config.vsh.yaml @@ -45,6 +45,9 @@ resources: - type: "bash_script" path: "script.sh" is_executable: true +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "Computing the expected future yield of distinct reads and bounds on\ \ the number of total distinct reads in the library and the associated confidence\ \ intervals." @@ -139,6 +142,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -191,8 +196,8 @@ build_info: output: "target/executable/preseq_lcextrap" executable: "target/executable/preseq_lcextrap/preseq_lcextrap" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" package_config: name: "rnaseq" version: "main" @@ -213,8 +218,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/executable/preseq_lcextrap/nextflow_labels.config b/target/executable/preseq_lcextrap/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/executable/preseq_lcextrap/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/executable/preseq_lcextrap/preseq_lcextrap b/target/executable/preseq_lcextrap/preseq_lcextrap index e48d52e..9384191 100755 --- a/target/executable/preseq_lcextrap/preseq_lcextrap +++ b/target/executable/preseq_lcextrap/preseq_lcextrap @@ -495,9 +495,9 @@ mkdir build && cd build && \ make && make install && make HAVE_HTSLIB=1 all LABEL org.opencontainers.image.description="Companion container for running component preseq_lcextrap" -LABEL org.opencontainers.image.created="2024-11-27T17:11:12Z" -LABEL org.opencontainers.image.source="https://x-access-token/ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" -LABEL org.opencontainers.image.revision="d63250ae704b6bd9a11792c4f979be2309999a2e" +LABEL org.opencontainers.image.created="2024-12-05T08:04:19Z" +LABEL org.opencontainers.image.source="https://x-access-token/ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" +LABEL org.opencontainers.image.revision="4adb388c7d928eea02bccf890214f3b932b08714" LABEL org.opencontainers.image.version="main" VIASHDOCKER diff --git a/target/executable/rsem_merge_counts/.config.vsh.yaml b/target/executable/rsem_merge_counts/.config.vsh.yaml index 5a1dad7..8170704 100644 --- a/target/executable/rsem_merge_counts/.config.vsh.yaml +++ b/target/executable/rsem_merge_counts/.config.vsh.yaml @@ -77,6 +77,9 @@ resources: - type: "bash_script" path: "script.sh" is_executable: true +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "Merge the transcript quantification results obtained from rsem calculate-expression\ \ across all samples.\n" info: @@ -161,6 +164,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -181,8 +186,8 @@ build_info: output: "target/executable/rsem_merge_counts" executable: "target/executable/rsem_merge_counts/rsem_merge_counts" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" package_config: name: "rnaseq" version: "main" @@ -203,8 +208,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/executable/rsem_merge_counts/nextflow_labels.config b/target/executable/rsem_merge_counts/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/executable/rsem_merge_counts/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/executable/rsem_merge_counts/rsem_merge_counts b/target/executable/rsem_merge_counts/rsem_merge_counts index a2b8a93..16f1ecf 100755 --- a/target/executable/rsem_merge_counts/rsem_merge_counts +++ b/target/executable/rsem_merge_counts/rsem_merge_counts @@ -483,9 +483,9 @@ function ViashDockerfile { FROM ubuntu:22.04 ENTRYPOINT [] LABEL org.opencontainers.image.description="Companion container for running component rsem_merge_counts" -LABEL org.opencontainers.image.created="2024-11-27T17:11:14Z" -LABEL org.opencontainers.image.source="https://x-access-token/ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" -LABEL org.opencontainers.image.revision="d63250ae704b6bd9a11792c4f979be2309999a2e" +LABEL org.opencontainers.image.created="2024-12-05T08:04:21Z" +LABEL org.opencontainers.image.source="https://x-access-token/ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" +LABEL org.opencontainers.image.revision="4adb388c7d928eea02bccf890214f3b932b08714" LABEL org.opencontainers.image.version="main" VIASHDOCKER diff --git a/target/executable/rseqc/rseqc_junctionannotation/.config.vsh.yaml b/target/executable/rseqc/rseqc_junctionannotation/.config.vsh.yaml index d0fe49d..58b9398 100644 --- a/target/executable/rseqc/rseqc_junctionannotation/.config.vsh.yaml +++ b/target/executable/rseqc/rseqc_junctionannotation/.config.vsh.yaml @@ -139,6 +139,9 @@ resources: - type: "bash_script" path: "script.sh" is_executable: true +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "Compare detected splice junctions to reference gene model.\n" test_resources: - type: "bash_script" @@ -229,6 +232,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -260,8 +265,8 @@ build_info: output: "target/executable/rseqc/rseqc_junctionannotation" executable: "target/executable/rseqc/rseqc_junctionannotation/rseqc_junctionannotation" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" package_config: name: "rnaseq" version: "main" @@ -282,8 +287,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/executable/rseqc/rseqc_junctionannotation/nextflow_labels.config b/target/executable/rseqc/rseqc_junctionannotation/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/executable/rseqc/rseqc_junctionannotation/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/executable/rseqc/rseqc_junctionannotation/rseqc_junctionannotation b/target/executable/rseqc/rseqc_junctionannotation/rseqc_junctionannotation index 1bec1f0..a6b8d6c 100755 --- a/target/executable/rseqc/rseqc_junctionannotation/rseqc_junctionannotation +++ b/target/executable/rseqc/rseqc_junctionannotation/rseqc_junctionannotation @@ -519,9 +519,9 @@ RUN pip install --upgrade pip && \ pip install --upgrade --no-cache-dir "RSeQC" LABEL org.opencontainers.image.description="Companion container for running component rseqc rseqc_junctionannotation" -LABEL org.opencontainers.image.created="2024-11-27T17:11:13Z" -LABEL org.opencontainers.image.source="https://x-access-token/ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" -LABEL org.opencontainers.image.revision="d63250ae704b6bd9a11792c4f979be2309999a2e" +LABEL org.opencontainers.image.created="2024-12-05T08:04:21Z" +LABEL org.opencontainers.image.source="https://x-access-token/ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" +LABEL org.opencontainers.image.revision="4adb388c7d928eea02bccf890214f3b932b08714" LABEL org.opencontainers.image.version="main" VIASHDOCKER diff --git a/target/executable/rseqc/rseqc_junctionsaturation/.config.vsh.yaml b/target/executable/rseqc/rseqc_junctionsaturation/.config.vsh.yaml index b79aded..c8fcd28 100644 --- a/target/executable/rseqc/rseqc_junctionsaturation/.config.vsh.yaml +++ b/target/executable/rseqc/rseqc_junctionsaturation/.config.vsh.yaml @@ -128,6 +128,9 @@ resources: - type: "bash_script" path: "script.sh" is_executable: true +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "Compare detected splice junctions to reference gene model.\n" test_resources: - type: "bash_script" @@ -218,6 +221,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -249,8 +254,8 @@ build_info: output: "target/executable/rseqc/rseqc_junctionsaturation" executable: "target/executable/rseqc/rseqc_junctionsaturation/rseqc_junctionsaturation" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" package_config: name: "rnaseq" version: "main" @@ -271,8 +276,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/executable/rseqc/rseqc_junctionsaturation/nextflow_labels.config b/target/executable/rseqc/rseqc_junctionsaturation/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/executable/rseqc/rseqc_junctionsaturation/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/executable/rseqc/rseqc_junctionsaturation/rseqc_junctionsaturation b/target/executable/rseqc/rseqc_junctionsaturation/rseqc_junctionsaturation index 9db18e1..019c544 100755 --- a/target/executable/rseqc/rseqc_junctionsaturation/rseqc_junctionsaturation +++ b/target/executable/rseqc/rseqc_junctionsaturation/rseqc_junctionsaturation @@ -522,9 +522,9 @@ RUN pip install --upgrade pip && \ pip install --upgrade --no-cache-dir "RSeQC" LABEL org.opencontainers.image.description="Companion container for running component rseqc rseqc_junctionsaturation" -LABEL org.opencontainers.image.created="2024-11-27T17:11:14Z" -LABEL org.opencontainers.image.source="https://x-access-token/ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" -LABEL org.opencontainers.image.revision="d63250ae704b6bd9a11792c4f979be2309999a2e" +LABEL org.opencontainers.image.created="2024-12-05T08:04:22Z" +LABEL org.opencontainers.image.source="https://x-access-token/ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" +LABEL org.opencontainers.image.revision="4adb388c7d928eea02bccf890214f3b932b08714" LABEL org.opencontainers.image.version="main" VIASHDOCKER diff --git a/target/executable/rseqc/rseqc_readdistribution/.config.vsh.yaml b/target/executable/rseqc/rseqc_readdistribution/.config.vsh.yaml index 5829326..ae89023 100644 --- a/target/executable/rseqc/rseqc_readdistribution/.config.vsh.yaml +++ b/target/executable/rseqc/rseqc_readdistribution/.config.vsh.yaml @@ -42,6 +42,9 @@ resources: - type: "bash_script" path: "script.sh" is_executable: true +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "Calculate how mapped reads are distributed over genomic features.\n" test_resources: - type: "bash_script" @@ -132,6 +135,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -162,8 +167,8 @@ build_info: output: "target/executable/rseqc/rseqc_readdistribution" executable: "target/executable/rseqc/rseqc_readdistribution/rseqc_readdistribution" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" package_config: name: "rnaseq" version: "main" @@ -184,8 +189,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/executable/rseqc/rseqc_readdistribution/nextflow_labels.config b/target/executable/rseqc/rseqc_readdistribution/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/executable/rseqc/rseqc_readdistribution/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/executable/rseqc/rseqc_readdistribution/rseqc_readdistribution b/target/executable/rseqc/rseqc_readdistribution/rseqc_readdistribution index 06907de..7ea1f7c 100755 --- a/target/executable/rseqc/rseqc_readdistribution/rseqc_readdistribution +++ b/target/executable/rseqc/rseqc_readdistribution/rseqc_readdistribution @@ -474,9 +474,9 @@ RUN pip install --upgrade pip && \ pip install --upgrade --no-cache-dir "RSeQC" LABEL org.opencontainers.image.description="Companion container for running component rseqc rseqc_readdistribution" -LABEL org.opencontainers.image.created="2024-11-27T17:11:14Z" -LABEL org.opencontainers.image.source="https://x-access-token/ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" -LABEL org.opencontainers.image.revision="d63250ae704b6bd9a11792c4f979be2309999a2e" +LABEL org.opencontainers.image.created="2024-12-05T08:04:21Z" +LABEL org.opencontainers.image.source="https://x-access-token/ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" +LABEL org.opencontainers.image.revision="4adb388c7d928eea02bccf890214f3b932b08714" LABEL org.opencontainers.image.version="main" VIASHDOCKER diff --git a/target/executable/rseqc/rseqc_readduplication/.config.vsh.yaml b/target/executable/rseqc/rseqc_readduplication/.config.vsh.yaml index 889ce32..c423fcb 100644 --- a/target/executable/rseqc/rseqc_readduplication/.config.vsh.yaml +++ b/target/executable/rseqc/rseqc_readduplication/.config.vsh.yaml @@ -92,6 +92,9 @@ resources: - type: "bash_script" path: "script.sh" is_executable: true +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "Calculate read duplication rate.\n" test_resources: - type: "bash_script" @@ -180,6 +183,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -211,8 +216,8 @@ build_info: output: "target/executable/rseqc/rseqc_readduplication" executable: "target/executable/rseqc/rseqc_readduplication/rseqc_readduplication" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" package_config: name: "rnaseq" version: "main" @@ -233,8 +238,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/executable/rseqc/rseqc_readduplication/nextflow_labels.config b/target/executable/rseqc/rseqc_readduplication/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/executable/rseqc/rseqc_readduplication/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/executable/rseqc/rseqc_readduplication/rseqc_readduplication b/target/executable/rseqc/rseqc_readduplication/rseqc_readduplication index 0079298..bd49844 100755 --- a/target/executable/rseqc/rseqc_readduplication/rseqc_readduplication +++ b/target/executable/rseqc/rseqc_readduplication/rseqc_readduplication @@ -499,9 +499,9 @@ RUN pip install --upgrade pip && \ pip install --upgrade --no-cache-dir "RSeQC" LABEL org.opencontainers.image.description="Companion container for running component rseqc rseqc_readduplication" -LABEL org.opencontainers.image.created="2024-11-27T17:11:13Z" -LABEL org.opencontainers.image.source="https://x-access-token/ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" -LABEL org.opencontainers.image.revision="d63250ae704b6bd9a11792c4f979be2309999a2e" +LABEL org.opencontainers.image.created="2024-12-05T08:04:20Z" +LABEL org.opencontainers.image.source="https://x-access-token/ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" +LABEL org.opencontainers.image.revision="4adb388c7d928eea02bccf890214f3b932b08714" LABEL org.opencontainers.image.version="main" VIASHDOCKER diff --git a/target/executable/rseqc/rseqc_tin/.config.vsh.yaml b/target/executable/rseqc/rseqc_tin/.config.vsh.yaml index 0342b97..affeb50 100644 --- a/target/executable/rseqc/rseqc_tin/.config.vsh.yaml +++ b/target/executable/rseqc/rseqc_tin/.config.vsh.yaml @@ -94,6 +94,9 @@ resources: - type: "bash_script" path: "script.sh" is_executable: true +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "Calculte TIN (transcript integrity number) from RNA-seq reads\n" test_resources: - type: "bash_script" @@ -186,6 +189,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -214,8 +219,8 @@ build_info: output: "target/executable/rseqc/rseqc_tin" executable: "target/executable/rseqc/rseqc_tin/rseqc_tin" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" package_config: name: "rnaseq" version: "main" @@ -236,8 +241,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/executable/rseqc/rseqc_tin/nextflow_labels.config b/target/executable/rseqc/rseqc_tin/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/executable/rseqc/rseqc_tin/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/executable/rseqc/rseqc_tin/rseqc_tin b/target/executable/rseqc/rseqc_tin/rseqc_tin index 84318bd..abee8ad 100755 --- a/target/executable/rseqc/rseqc_tin/rseqc_tin +++ b/target/executable/rseqc/rseqc_tin/rseqc_tin @@ -501,9 +501,9 @@ RUN apt-get update && \ RUN pip3 install RSeQC LABEL org.opencontainers.image.description="Companion container for running component rseqc rseqc_tin" -LABEL org.opencontainers.image.created="2024-11-27T17:11:14Z" -LABEL org.opencontainers.image.source="https://x-access-token/ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" -LABEL org.opencontainers.image.revision="d63250ae704b6bd9a11792c4f979be2309999a2e" +LABEL org.opencontainers.image.created="2024-12-05T08:04:21Z" +LABEL org.opencontainers.image.source="https://x-access-token/ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" +LABEL org.opencontainers.image.revision="4adb388c7d928eea02bccf890214f3b932b08714" LABEL org.opencontainers.image.version="main" VIASHDOCKER diff --git a/target/executable/sortmerna/.config.vsh.yaml b/target/executable/sortmerna/.config.vsh.yaml index 726b535..aac02a2 100644 --- a/target/executable/sortmerna/.config.vsh.yaml +++ b/target/executable/sortmerna/.config.vsh.yaml @@ -74,6 +74,9 @@ resources: - type: "bash_script" path: "script.sh" is_executable: true +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "Local sequence alignment tool for filtering, mapping and clustering.\ \ The main application of SortMeRNA is filtering rRNA from metatranscriptomic data.\ \ SortMeRNA takes as input files of reads (fasta, fastq, fasta.gz, fastq.gz) and\ @@ -172,6 +175,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -192,8 +197,8 @@ build_info: output: "target/executable/sortmerna" executable: "target/executable/sortmerna/sortmerna" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" package_config: name: "rnaseq" version: "main" @@ -214,8 +219,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/executable/sortmerna/nextflow_labels.config b/target/executable/sortmerna/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/executable/sortmerna/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/executable/sortmerna/sortmerna b/target/executable/sortmerna/sortmerna index 51ad0c7..efbbe2c 100755 --- a/target/executable/sortmerna/sortmerna +++ b/target/executable/sortmerna/sortmerna @@ -486,9 +486,9 @@ function ViashDockerfile { FROM quay.io/biocontainers/sortmerna:4.3.6--h9ee0642_0 ENTRYPOINT [] LABEL org.opencontainers.image.description="Companion container for running component sortmerna" -LABEL org.opencontainers.image.created="2024-11-27T17:11:17Z" -LABEL org.opencontainers.image.source="https://x-access-token/ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" -LABEL org.opencontainers.image.revision="d63250ae704b6bd9a11792c4f979be2309999a2e" +LABEL org.opencontainers.image.created="2024-12-05T08:04:25Z" +LABEL org.opencontainers.image.source="https://x-access-token/ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" +LABEL org.opencontainers.image.revision="4adb388c7d928eea02bccf890214f3b932b08714" LABEL org.opencontainers.image.version="main" VIASHDOCKER diff --git a/target/executable/stringtie/.config.vsh.yaml b/target/executable/stringtie/.config.vsh.yaml index 5148024..127c840 100644 --- a/target/executable/stringtie/.config.vsh.yaml +++ b/target/executable/stringtie/.config.vsh.yaml @@ -97,6 +97,9 @@ resources: - type: "bash_script" path: "script.sh" is_executable: true +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "Transcript assembly and quantification for RNA-Seq\n" test_resources: - type: "bash_script" @@ -189,6 +192,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -216,8 +221,8 @@ build_info: output: "target/executable/stringtie" executable: "target/executable/stringtie/stringtie" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" package_config: name: "rnaseq" version: "main" @@ -238,8 +243,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/executable/stringtie/nextflow_labels.config b/target/executable/stringtie/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/executable/stringtie/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/executable/stringtie/stringtie b/target/executable/stringtie/stringtie index dc165bb..10171ca 100755 --- a/target/executable/stringtie/stringtie +++ b/target/executable/stringtie/stringtie @@ -496,9 +496,9 @@ tar -xzf stringtie-2.2.1.Linux_x86_64.tar.gz && \ cp stringtie-2.2.1.Linux_x86_64/stringtie /usr/local/bin/ LABEL org.opencontainers.image.description="Companion container for running component stringtie" -LABEL org.opencontainers.image.created="2024-11-27T17:11:18Z" -LABEL org.opencontainers.image.source="https://x-access-token/ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" -LABEL org.opencontainers.image.revision="d63250ae704b6bd9a11792c4f979be2309999a2e" +LABEL org.opencontainers.image.created="2024-12-05T08:04:25Z" +LABEL org.opencontainers.image.source="https://x-access-token/ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" +LABEL org.opencontainers.image.revision="4adb388c7d928eea02bccf890214f3b932b08714" LABEL org.opencontainers.image.version="main" VIASHDOCKER diff --git a/target/executable/summarizedexperiment/.config.vsh.yaml b/target/executable/summarizedexperiment/.config.vsh.yaml index 9e078e1..7b8ce5a 100644 --- a/target/executable/summarizedexperiment/.config.vsh.yaml +++ b/target/executable/summarizedexperiment/.config.vsh.yaml @@ -85,6 +85,9 @@ resources: is_executable: true - type: "file" path: "summarizedexperiment.r" +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "Create SummarizedExperiment object from Salmon counts" info: migration_info: @@ -168,6 +171,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -199,8 +204,8 @@ build_info: output: "target/executable/summarizedexperiment" executable: "target/executable/summarizedexperiment/summarizedexperiment" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" package_config: name: "rnaseq" version: "main" @@ -221,8 +226,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/executable/summarizedexperiment/nextflow_labels.config b/target/executable/summarizedexperiment/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/executable/summarizedexperiment/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/executable/summarizedexperiment/summarizedexperiment b/target/executable/summarizedexperiment/summarizedexperiment index 137df93..2bb4614 100755 --- a/target/executable/summarizedexperiment/summarizedexperiment +++ b/target/executable/summarizedexperiment/summarizedexperiment @@ -487,9 +487,9 @@ RUN Rscript -e 'if (!requireNamespace("BiocManager", quietly = TRUE)) install.pa Rscript -e 'if (!requireNamespace("tximeta", quietly = TRUE)) BiocManager::install("tximeta")' LABEL org.opencontainers.image.description="Companion container for running component summarizedexperiment" -LABEL org.opencontainers.image.created="2024-11-27T17:11:17Z" -LABEL org.opencontainers.image.source="https://x-access-token/ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" -LABEL org.opencontainers.image.revision="d63250ae704b6bd9a11792c4f979be2309999a2e" +LABEL org.opencontainers.image.created="2024-12-05T08:04:24Z" +LABEL org.opencontainers.image.source="https://x-access-token/ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" +LABEL org.opencontainers.image.revision="4adb388c7d928eea02bccf890214f3b932b08714" LABEL org.opencontainers.image.version="main" VIASHDOCKER diff --git a/target/executable/tx2gene/.config.vsh.yaml b/target/executable/tx2gene/.config.vsh.yaml index 2a8a9d9..3552d7b 100644 --- a/target/executable/tx2gene/.config.vsh.yaml +++ b/target/executable/tx2gene/.config.vsh.yaml @@ -69,6 +69,9 @@ resources: is_executable: true - type: "file" path: "tx2gene.py" +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "Get transcript id (tx) to gene names for tximport" test_resources: - type: "bash_script" @@ -156,6 +159,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -185,8 +190,8 @@ build_info: output: "target/executable/tx2gene" executable: "target/executable/tx2gene/tx2gene" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" package_config: name: "rnaseq" version: "main" @@ -207,8 +212,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/executable/tx2gene/nextflow_labels.config b/target/executable/tx2gene/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/executable/tx2gene/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/executable/tx2gene/tx2gene b/target/executable/tx2gene/tx2gene index 34a912f..00f16c7 100755 --- a/target/executable/tx2gene/tx2gene +++ b/target/executable/tx2gene/tx2gene @@ -483,9 +483,9 @@ RUN apt-get update && \ RUN pip install --upgrade pip LABEL org.opencontainers.image.description="Companion container for running component tx2gene" -LABEL org.opencontainers.image.created="2024-11-27T17:11:16Z" -LABEL org.opencontainers.image.source="https://x-access-token/ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" -LABEL org.opencontainers.image.revision="d63250ae704b6bd9a11792c4f979be2309999a2e" +LABEL org.opencontainers.image.created="2024-12-05T08:04:23Z" +LABEL org.opencontainers.image.source="https://x-access-token/ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" +LABEL org.opencontainers.image.revision="4adb388c7d928eea02bccf890214f3b932b08714" LABEL org.opencontainers.image.version="main" VIASHDOCKER diff --git a/target/executable/tximport/.config.vsh.yaml b/target/executable/tximport/.config.vsh.yaml index 1a70ba9..878235a 100644 --- a/target/executable/tximport/.config.vsh.yaml +++ b/target/executable/tximport/.config.vsh.yaml @@ -128,6 +128,9 @@ resources: is_executable: true - type: "file" path: "tximport.r" +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "Get dataframe linking transcript ID, gene ID, and gene name" test_resources: - type: "bash_script" @@ -215,6 +218,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -251,8 +256,8 @@ build_info: output: "target/executable/tximport" executable: "target/executable/tximport/tximport" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" package_config: name: "rnaseq" version: "main" @@ -273,8 +278,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/executable/tximport/nextflow_labels.config b/target/executable/tximport/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/executable/tximport/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/executable/tximport/tximport b/target/executable/tximport/tximport index 3d17192..ded7b98 100755 --- a/target/executable/tximport/tximport +++ b/target/executable/tximport/tximport @@ -508,9 +508,9 @@ RUN Rscript -e 'if (!requireNamespace("remotes", quietly = TRUE)) install.packag Rscript -e 'remotes::install_cran(c("jsonlite"), repos = "https://cran.rstudio.com")' LABEL org.opencontainers.image.description="Companion container for running component tximport" -LABEL org.opencontainers.image.created="2024-11-27T17:11:16Z" -LABEL org.opencontainers.image.source="https://x-access-token/ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" -LABEL org.opencontainers.image.revision="d63250ae704b6bd9a11792c4f979be2309999a2e" +LABEL org.opencontainers.image.created="2024-12-05T08:04:24Z" +LABEL org.opencontainers.image.source="https://x-access-token/ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" +LABEL org.opencontainers.image.revision="4adb388c7d928eea02bccf890214f3b932b08714" LABEL org.opencontainers.image.version="main" VIASHDOCKER diff --git a/target/executable/ucsc/bedclip/.config.vsh.yaml b/target/executable/ucsc/bedclip/.config.vsh.yaml index d9e3300..3f30324 100644 --- a/target/executable/ucsc/bedclip/.config.vsh.yaml +++ b/target/executable/ucsc/bedclip/.config.vsh.yaml @@ -42,6 +42,9 @@ resources: - type: "bash_script" path: "script.sh" is_executable: true +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "Remove lines from bed file that refer to off-chromosome locations" test_resources: - type: "bash_script" @@ -134,6 +137,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -164,8 +169,8 @@ build_info: output: "target/executable/ucsc/bedclip" executable: "target/executable/ucsc/bedclip/bedclip" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" package_config: name: "rnaseq" version: "main" @@ -186,8 +191,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/executable/ucsc/bedclip/bedclip b/target/executable/ucsc/bedclip/bedclip index 24d779d..5c2756e 100755 --- a/target/executable/ucsc/bedclip/bedclip +++ b/target/executable/ucsc/bedclip/bedclip @@ -473,9 +473,9 @@ RUN apt-get update && \ RUN rsync -aP rsync://hgdownload.soe.ucsc.edu/genome/admin/exe/linux.x86_64/bedClip /usr/local/bin/ LABEL org.opencontainers.image.description="Companion container for running component ucsc bedclip" -LABEL org.opencontainers.image.created="2024-11-27T17:11:15Z" -LABEL org.opencontainers.image.source="https://x-access-token/ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" -LABEL org.opencontainers.image.revision="d63250ae704b6bd9a11792c4f979be2309999a2e" +LABEL org.opencontainers.image.created="2024-12-05T08:04:22Z" +LABEL org.opencontainers.image.source="https://x-access-token/ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" +LABEL org.opencontainers.image.revision="4adb388c7d928eea02bccf890214f3b932b08714" LABEL org.opencontainers.image.version="main" VIASHDOCKER diff --git a/target/executable/ucsc/bedclip/nextflow_labels.config b/target/executable/ucsc/bedclip/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/executable/ucsc/bedclip/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/executable/ucsc/bedgraphtobigwig/.config.vsh.yaml b/target/executable/ucsc/bedgraphtobigwig/.config.vsh.yaml index c8c93a6..5145e0c 100644 --- a/target/executable/ucsc/bedgraphtobigwig/.config.vsh.yaml +++ b/target/executable/ucsc/bedgraphtobigwig/.config.vsh.yaml @@ -42,6 +42,9 @@ resources: - type: "bash_script" path: "script.sh" is_executable: true +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "Convert a bedGraph file to bigWig format" test_resources: - type: "bash_script" @@ -134,6 +137,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -164,8 +169,8 @@ build_info: output: "target/executable/ucsc/bedgraphtobigwig" executable: "target/executable/ucsc/bedgraphtobigwig/bedgraphtobigwig" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" package_config: name: "rnaseq" version: "main" @@ -186,8 +191,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/executable/ucsc/bedgraphtobigwig/bedgraphtobigwig b/target/executable/ucsc/bedgraphtobigwig/bedgraphtobigwig index 79ee642..b9d5fe3 100755 --- a/target/executable/ucsc/bedgraphtobigwig/bedgraphtobigwig +++ b/target/executable/ucsc/bedgraphtobigwig/bedgraphtobigwig @@ -473,9 +473,9 @@ RUN apt-get update && \ RUN rsync -aP rsync://hgdownload.soe.ucsc.edu/genome/admin/exe/linux.x86_64/bedGraphToBigWig /usr/local/bin/ LABEL org.opencontainers.image.description="Companion container for running component ucsc bedgraphtobigwig" -LABEL org.opencontainers.image.created="2024-11-27T17:11:15Z" -LABEL org.opencontainers.image.source="https://x-access-token/ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" -LABEL org.opencontainers.image.revision="d63250ae704b6bd9a11792c4f979be2309999a2e" +LABEL org.opencontainers.image.created="2024-12-05T08:04:23Z" +LABEL org.opencontainers.image.source="https://x-access-token/ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" +LABEL org.opencontainers.image.revision="4adb388c7d928eea02bccf890214f3b932b08714" LABEL org.opencontainers.image.version="main" VIASHDOCKER diff --git a/target/executable/ucsc/bedgraphtobigwig/nextflow_labels.config b/target/executable/ucsc/bedgraphtobigwig/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/executable/ucsc/bedgraphtobigwig/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/executable/workflows/genome_alignment_and_quant/.config.vsh.yaml b/target/executable/workflows/genome_alignment_and_quant/.config.vsh.yaml index f63f3f1..91cd5e3 100644 --- a/target/executable/workflows/genome_alignment_and_quant/.config.vsh.yaml +++ b/target/executable/workflows/genome_alignment_and_quant/.config.vsh.yaml @@ -448,6 +448,9 @@ resources: path: "main.nf" is_executable: true entrypoint: "run_wf" +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "A viash sub-workflow for genome alignment and quantification stage of\ \ nf-core/rnaseq pipeline.\n" info: null @@ -578,6 +581,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -590,8 +595,8 @@ build_info: output: "target/executable/workflows/genome_alignment_and_quant" executable: "target/executable/workflows/genome_alignment_and_quant/genome_alignment_and_quant" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" dependencies: - "target/dependencies/vsh/vsh/biobox/main/nextflow/star/star_align_reads" - "target/dependencies/vsh/vsh/biobox/main/nextflow/samtools/samtools_sort" @@ -623,8 +628,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/executable/workflows/genome_alignment_and_quant/genome_alignment_and_quant b/target/executable/workflows/genome_alignment_and_quant/genome_alignment_and_quant index b7055be..b3a7c32 100755 --- a/target/executable/workflows/genome_alignment_and_quant/genome_alignment_and_quant +++ b/target/executable/workflows/genome_alignment_and_quant/genome_alignment_and_quant @@ -1326,86 +1326,92 @@ workflow run_wf { [ id, state + [ paired: paired, input: input ] ] } - | star_align_reads.run ( - runIf: { id, state -> state.aligner == 'star_salmon' }, - fromState: [ - "input": "fastq_1", - "input_r2": "fastq_2", - "genome_dir": "star_index", - "sjdb_gtf_file": "gtf", - "out_sam_attr_rg_line": "star_sam_attr_rg_line", - "sjdb_gtf_feature_exon": "star_sjdb_gtf_feature_exon" - ], - toState: [ - "genome_bam": "aligned_reads", - "transcriptome_bam": "reads_aligned_to_transcriptome", - "star_multiqc": "log" - ], - args: [ - quant_mode: "TranscriptomeSAM", - twopass_mode: "Basic", - out_sam_type: "BAM;Unsorted", - run_rng_seed: 0, - out_filter_multimap_nmax: 20, - align_sjdb_overhang_min: 1, - out_sam_attributes: "NH;HI;AS;NM;MD", - quant_transcriptome_sam_output: "BanSingleEnd" - ] + | star_align_reads.run( + runIf: { id, state -> state.aligner == 'star_salmon' }, + fromState: [ + "input": "fastq_1", + "input_r2": "fastq_2", + "genome_dir": "star_index", + "sjdb_gtf_file": "gtf", + "out_sam_attr_rg_line": "star_sam_attr_rg_line", + "sjdb_gtf_feature_exon": "star_sjdb_gtf_feature_exon" + ], + toState: [ + "genome_bam": "aligned_reads", + "transcriptome_bam": "reads_aligned_to_transcriptome", + "star_multiqc": "log" + ], + args: [ + quant_mode: "TranscriptomeSAM", + twopass_mode: "Basic", + out_sam_type: "BAM;Unsorted", + run_rng_seed: 0, + out_filter_multimap_nmax: 20, + align_sjdb_overhang_min: 1, + out_sam_attributes: "NH;HI;AS;NM;MD", + quant_transcriptome_sam_output: "BanSingleEnd" + ], + directives: [ label: [ "highmem", "midcpu" ] ] ) // GENOME BAM - | samtools_sort.run ( - runIf: { id, state -> state.aligner == 'star_salmon' }, - fromState: ["input": "genome_bam"], - toState: ["genome_bam_sorted": "output"], - key: "genome_sorted" + | samtools_sort.run( + runIf: { id, state -> state.aligner == 'star_salmon' }, + fromState: ["input": "genome_bam"], + toState: ["genome_bam_sorted": "output"], + key: "genome_sorted", + directives: [ label: [ "highmem", "midcpu" ] ] ) - | samtools_index.run ( - runIf: { id, state -> state.aligner == 'star_salmon' }, - fromState: [ - "input": "genome_bam_sorted", - "csi": "bam_csi_index" - ], - toState: [ "genome_bam_index": "output" ], - key: "genome_sorted" + | samtools_index.run( + runIf: { id, state -> state.aligner == 'star_salmon' }, + fromState: [ + "input": "genome_bam_sorted", + "csi": "bam_csi_index" + ], + toState: [ "genome_bam_index": "output" ], + key: "genome_sorted", + directives: [ label: [ "highmem", "midcpu" ] ] ) - | samtools_stats.run ( - runIf: { id, state -> state.aligner == 'star_salmon' }, - fromState: [ - "input": "genome_bam_sorted", - "bai": "genome_bam_index", - "fasta": "fasta" - ], - toState: [ "genome_bam_stats": "output" ], - key: "genome_stats" + | samtools_stats.run( + runIf: { id, state -> state.aligner == 'star_salmon' }, + fromState: [ + "input": "genome_bam_sorted", + "bai": "genome_bam_index", + "fasta": "fasta" + ], + toState: [ "genome_bam_stats": "output" ], + key: "genome_stats", + directives: [ label: [ "highmem", "midcpu" ] ] ) - | samtools_flagstat.run ( - runIf: { id, state -> state.aligner == 'star_salmon' }, - fromState: [ - "bam": "genome_bam_sorted", - "bai": "genome_bam_index", - "fasta": "fasta" - ], - toState: [ "genome_bam_flagstat": "output" ], - key: "genome_flagstat" + | samtools_flagstat.run( + runIf: { id, state -> state.aligner == 'star_salmon' }, + fromState: [ + "bam": "genome_bam_sorted", + "bai": "genome_bam_index", + "fasta": "fasta" + ], + toState: [ "genome_bam_flagstat": "output" ], + key: "genome_flagstat", + directives: [ label: [ "highmem", "midcpu" ] ] ) | samtools_idxstats.run( - runIf: { id, state -> state.aligner == 'star_salmon' }, - fromState: [ - "bam": "genome_bam_sorted", - "bai": "genome_bam_index", - "fasta": "fasta" - ], - toState: [ "genome_bam_idxstats": "output" ], - key: "genome_idxstats" + runIf: { id, state -> state.aligner == 'star_salmon' }, + fromState: [ + "bam": "genome_bam_sorted", + "bai": "genome_bam_index", + "fasta": "fasta" + ], + toState: [ "genome_bam_idxstats": "output" ], + key: "genome_idxstats", + directives: [ label: [ "highmem", "midcpu" ] ] ) - // - // Remove duplicate reads from BAM file based on UMIs - // - - // Deduplicate genome BAM file - | umi_tools_dedup.run ( + // + // Remove duplicate reads from BAM file based on UMIs + // + + // Deduplicate genome BAM file + | umi_tools_dedup.run( runIf: { id, state -> state.with_umi && state.aligner == 'star_salmon' }, fromState: { id, state -> def output_stats = state.umi_dedup_stats ? state.id : @@ -1415,18 +1421,20 @@ workflow run_wf { output_stats: output_stats] }, toState: [ "genome_bam_sorted": "output" ], - key: "genome_deduped" - ) - | samtools_index.run ( + key: "genome_deduped", + directives: [ label: [ "highmem", "midcpu" ] ] + ) + | samtools_index.run( runIf: { id, state -> state.with_umi && state.aligner == 'star_salmon' }, fromState: [ "input": "genome_bam_sorted", "csi": "bam_csi_index" ], toState: [ "genome_bam_index": "output" ], - key: "genome_deduped" - ) - | samtools_stats.run ( + key: "genome_deduped", + directives: [ label: [ "highmem", "midcpu" ] ] + ) + | samtools_stats.run( runIf: { id, state -> state.with_umi && state.aligner == 'star_salmon' }, fromState: [ "input": "genome_bam_sorted", @@ -1434,9 +1442,10 @@ workflow run_wf { "fasta": "fasta" ], toState: [ "genome_bam_stats": "output" ], - key: "genome_deduped_stats" - ) - | samtools_flagstat.run ( + key: "genome_deduped_stats", + directives: [ label: [ "highmem", "midcpu" ] ] + ) + | samtools_flagstat.run( runIf: { id, state -> state.with_umi && state.aligner == 'star_salmon' }, fromState: [ "bam": "genome_bam_sorted", @@ -1444,9 +1453,10 @@ workflow run_wf { "fasta": "fasta" ], toState: [ "genome_bam_flagstat": "output" ], - key: "genome_deduped_flagstat" - ) - | samtools_idxstats.run( + key: "genome_deduped_flagstat", + directives: [ label: [ "highmem", "midcpu" ] ] + ) + | samtools_idxstats.run( runIf: { id, state -> state.with_umi && state.aligner == 'star_salmon' }, fromState: [ "bam": "genome_bam_sorted", @@ -1454,55 +1464,61 @@ workflow run_wf { "fasta": "fasta", ], toState: [ "genome_bam_idxstats": "output" ], - key: "genome_deduped_idxstats" - ) + key: "genome_deduped_idxstats", + directives: [ label: [ "highmem", "midcpu" ] ] + ) // Deduplicate transcriptome BAM file - | samtools_sort.run ( + | samtools_sort.run( runIf: { id, state -> state.with_umi && state.aligner == 'star_salmon' }, fromState: [ "input": "transcriptome_bam" ], toState: [ "transcriptome_bam": "output" ], - key: "transcriptome_sorted" - ) - | samtools_index.run ( + key: "transcriptome_sorted", + directives: [ label: [ "highmem", "midcpu" ] ] + ) + | samtools_index.run( runIf: { id, state -> state.with_umi && state.aligner == 'star_salmon' }, fromState: [ "input": "transcriptome_bam", "csi": "bam_csi_index" ], toState: [ "transcriptome_bam_index": "output" ], - key: "transcriptome_sorted" - ) - | samtools_stats.run ( + key: "transcriptome_sorted", + directives: [ label: [ "highmem", "midcpu" ] ] + ) + | samtools_stats.run( runIf: { id, state -> state.with_umi && state.aligner == 'star_salmon' }, fromState: [ "input": "transcriptome_bam", "bai": "transcriptome_bam_index", ], toState: [ "transcriptome_bam_stats": "output" ], - key: "transcriptome_stats" - ) - | samtools_flagstat.run ( + key: "transcriptome_stats", + directives: [ label: [ "highmem", "midcpu" ] ] + ) + | samtools_flagstat.run( runIf: { id, state -> state.with_umi && state.aligner == 'star_salmon' }, fromState: [ "bam": "transcriptome_bam", "bai": "transcriptome_bam_index" ], toState: [ "transcriptome_bam_flagstat": "output" ], - key: "transcriptome_flagstat" - ) - | samtools_idxstats.run( + key: "transcriptome_flagstat", + directives: [ label: [ "highmem", "midcpu" ] ] + ) + | samtools_idxstats.run( runIf: { id, state -> state.with_umi && state.aligner == 'star_salmon' }, fromState: [ "bam": "transcriptome_bam", "bai": "transcriptome_bam_index" ], toState: [ "transcriptome_bam_idxstats": "output" ], - key: "transcriptome_idxstats" - ) - - | umi_tools_dedup.run ( + key: "transcriptome_idxstats", + directives: [ label: [ "highmem", "midcpu" ] ] + ) + + | umi_tools_dedup.run( runIf: { id, state -> state.with_umi && state.aligner == 'star_salmon' }, fromState: { id, state -> def output_stats = state.umi_dedup_stats ? state.id : @@ -1512,57 +1528,64 @@ workflow run_wf { output_stats: output_stats] }, toState: [ "transcriptome_bam_deduped": "output" ], - key: "transcriptome_deduped" - ) - | samtools_sort.run ( + key: "transcriptome_deduped", + directives: [ label: [ "highmem", "midcpu" ] ] + ) + | samtools_sort.run( runIf: { id, state -> state.with_umi && state.aligner == 'star_salmon' }, fromState: [ "input": "transcriptome_bam_deduped" ], toState: [ "transcriptome_bam": "output" ], - key: "transcriptome_deduped_sorted" - ) - | samtools_index.run ( - runIf: { id, state -> state.with_umi && state.aligner == 'star_salmon' }, - fromState: [ - "input": "transcriptome_bam", - "csi": "bam_csi_index" - ], - toState: [ "transcriptome_bam_index": "output" ], - key: "transcriptome_deduped_sorted" - ) - | samtools_stats.run ( + key: "transcriptome_deduped_sorted", + directives: [ label: [ "highmem", "midcpu" ] ] + ) + | samtools_index.run( + runIf: { id, state -> state.with_umi && state.aligner == 'star_salmon' }, + fromState: [ + "input": "transcriptome_bam", + "csi": "bam_csi_index" + ], + toState: [ "transcriptome_bam_index": "output" ], + key: "transcriptome_deduped_sorted", + directives: [ label: [ "highmem", "midcpu" ] ] + ) + | samtools_stats.run( runIf: { id, state -> state.with_umi && state.aligner == 'star_salmon' }, fromState: [ "input": "transcriptome_bam", "bai": "transcriptome_bam_index" ], toState: [ "transcriptome_bam_stats": "output" ], - key: "transcriptome_deduped_stats" - ) - | samtools_flagstat.run ( + key: "transcriptome_deduped_stats", + directives: [ label: [ "highmem", "midcpu" ] ] + ) + | samtools_flagstat.run( runIf: { id, state -> state.with_umi && state.aligner == 'star_salmon' }, fromState: [ "bam": "transcriptome_bam", "bai": "transcriptome_bam_index" ], toState: [ "transcriptome_bam_flagstat": "output" ], - key: "transcriptome_deduped_flagstat" - ) - | samtools_idxstats.run( + key: "transcriptome_deduped_flagstat", + directives: [ label: [ "highmem", "midcpu" ] ] + ) + | samtools_idxstats.run( runIf: { id, state -> state.with_umi && state.aligner == 'star_salmon' }, fromState: [ "bam": "transcriptome_bam", "bai": "transcriptome_bam_index" ], toState: [ "transcriptome_bam_idxstats": "output" ], - key: "transcriptome_deduped_idxstats" - ) + key: "transcriptome_deduped_idxstats", + directives: [ label: [ "highmem", "midcpu" ] ] + ) - // Fix paired-end reads in name sorted BAM file - | umi_tools_prepareforrsem.run ( + // Fix paired-end reads in name sorted BAM file + | umi_tools_prepareforrsem.run( runIf: { id, state -> state.with_umi && state.paired && state.aligner == 'star_salmon' }, fromState: [ "input": "transcriptome_bam" ], - toState: [ "transcriptome_bam": "output" ] - ) + toState: [ "transcriptome_bam": "output" ], + directives: [ label: [ "highmem", "midcpu" ] ] + ) // Infer lib-type for salmon quant | map { id, state -> @@ -1585,26 +1608,27 @@ workflow run_wf { } // Count reads from BAM alignments using Salmon - | salmon_quant.run ( - runIf: { id, state -> state.aligner == 'star_salmon' }, - fromState: [ - "lib_type": "lib_type", - "alignments": "transcriptome_bam", - "targets": "transcript_fasta", - "gene_map": "gtf" - ], - toState: [ - "quant_out_dir": "output", - "quant_results_file": "quant_results" - ] + | salmon_quant.run( + runIf: { id, state -> state.aligner == 'star_salmon' }, + fromState: [ + "lib_type": "lib_type", + "alignments": "transcriptome_bam", + "targets": "transcript_fasta", + "gene_map": "gtf" + ], + toState: [ + "quant_out_dir": "output", + "quant_results_file": "quant_results" + ], + directives: [ label: [ "highmem", "midcpu" ] ] ) - | map { id, state -> - def mod_state = (state.aligner == 'star_salmon') ? state + [salmon_multiqc: state.quant_out_dir] : state - [ id, mod_state ] - } - - | rsem_calculate_expression.run ( + | map { id, state -> + def mod_state = (state.aligner == 'star_salmon') ? state + [salmon_multiqc: state.quant_out_dir] : state + [ id, mod_state ] + } + + | rsem_calculate_expression.run( runIf: { id, state -> state.aligner == 'star_rsem' }, fromState: [ "id": "id", @@ -1635,26 +1659,29 @@ workflow run_wf { "bam_star_rsem": "bam_star", "bam_genome_rsem": "bam_genome", "bam_transcript_rsem": "bam_transcript" - ] - ) - - // RSEM_Star BAM - | samtools_sort.run ( + ], + directives: [ label: [ "highmem", "midcpu" ] ] + ) + + // RSEM_Star BAM + | samtools_sort.run( runIf: { id, state -> state.aligner == 'star_rsem' }, fromState: ["input": "bam_star_rsem"], toState: ["genome_bam_sorted": "output"], - key: "genome_sorted" - ) - | samtools_index.run ( + key: "genome_sorted", + directives: [ label: [ "highmem", "midcpu" ] ] + ) + | samtools_index.run( runIf: { id, state -> state.aligner == 'star_rsem' }, fromState: [ "input": "genome_bam_sorted", "csi": "bam_csi_index" ], toState: [ "genome_bam_index": "output" ], - key: "genome_sorted" - ) - | samtools_stats.run ( + key: "genome_sorted", + directives: [ label: [ "highmem", "midcpu" ] ] + ) + | samtools_stats.run( runIf: { id, state -> state.aligner == 'star_rsem' }, fromState: [ "input": "genome_bam_sorted", @@ -1662,9 +1689,10 @@ workflow run_wf { "fasta": "fasta" ], toState: [ "genome_bam_stats": "output" ], - key: "genome_stats" - ) - | samtools_flagstat.run ( + key: "genome_stats", + directives: [ label: [ "highmem", "midcpu" ] ] + ) + | samtools_flagstat.run( runIf: { id, state -> state.aligner == 'star_rsem' }, fromState: [ "bam": "genome_bam_sorted", @@ -1672,9 +1700,10 @@ workflow run_wf { "fasta": "fasta" ], toState: [ "genome_bam_flagstat": "output" ], - key: "genome_flagstat" - ) - | samtools_idxstats.run( + key: "genome_flagstat", + directives: [ label: [ "highmem", "midcpu" ] ] + ) + | samtools_idxstats.run( runIf: { id, state -> state.aligner == 'star_rsem' }, fromState: [ "bam": "genome_bam_sorted", @@ -1682,9 +1711,9 @@ workflow run_wf { "fasta": "fasta" ], toState: [ "genome_bam_idxstats": "output" ], - key: "genome_idxstats" - ) - + key: "genome_idxstats", + directives: [ label: [ "highmem", "midcpu" ] ] + ) | map { id, state -> def mod_state = state.findAll { key, value -> value instanceof java.nio.file.Path && value.exists() } [ id, mod_state ] @@ -1709,9 +1738,10 @@ workflow run_wf { "rsem_counts_gene": "rsem_counts_gene", "rsem_counts_transcripts": "rsem_counts_transcripts", "bam_genome_rsem": "bam_genome_rsem", - "bam_transcript_rsem": "bam_transcript_rsem" ] + "bam_transcript_rsem": "bam_transcript_rsem" + ] ) - + emit: output_ch } diff --git a/target/executable/workflows/genome_alignment_and_quant/nextflow_labels.config b/target/executable/workflows/genome_alignment_and_quant/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/executable/workflows/genome_alignment_and_quant/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/executable/workflows/merge_quant_results/.config.vsh.yaml b/target/executable/workflows/merge_quant_results/.config.vsh.yaml index b1a654b..7cab2af 100644 --- a/target/executable/workflows/merge_quant_results/.config.vsh.yaml +++ b/target/executable/workflows/merge_quant_results/.config.vsh.yaml @@ -177,6 +177,9 @@ resources: path: "main.nf" is_executable: true entrypoint: "run_wf" +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "A sub-workflow to merge the counts obtained from salmon quant across\ \ all samples." info: null @@ -266,6 +269,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -278,8 +283,8 @@ build_info: output: "target/executable/workflows/merge_quant_results" executable: "target/executable/workflows/merge_quant_results/merge_quant_results" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" dependencies: - "target/nextflow/tx2gene" - "target/nextflow/tximport" @@ -304,8 +309,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/executable/workflows/merge_quant_results/nextflow_labels.config b/target/executable/workflows/merge_quant_results/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/executable/workflows/merge_quant_results/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/executable/workflows/post_processing/.config.vsh.yaml b/target/executable/workflows/post_processing/.config.vsh.yaml index ca49fc0..eb42de8 100644 --- a/target/executable/workflows/post_processing/.config.vsh.yaml +++ b/target/executable/workflows/post_processing/.config.vsh.yaml @@ -343,6 +343,9 @@ resources: path: "main.nf" is_executable: true entrypoint: "run_wf" +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "A viash sub-workflow for the post-processing stage of nf-core/rnaseq\ \ pipeline.\n" info: null @@ -465,6 +468,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -477,8 +482,8 @@ build_info: output: "target/executable/workflows/post_processing" executable: "target/executable/workflows/post_processing/post_processing" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" dependencies: - "target/nextflow/picard_markduplicates" - "target/dependencies/vsh/vsh/biobox/main/nextflow/samtools/samtools_sort" @@ -510,8 +515,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/executable/workflows/post_processing/nextflow_labels.config b/target/executable/workflows/post_processing/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/executable/workflows/post_processing/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/executable/workflows/post_processing/post_processing b/target/executable/workflows/post_processing/post_processing index 8c32850..85ca3e6 100755 --- a/target/executable/workflows/post_processing/post_processing +++ b/target/executable/workflows/post_processing/post_processing @@ -1150,180 +1150,194 @@ cat > "\$tempscript" << 'VIASHMAIN' // Note: some helper functionality is added at the end of this file workflow run_wf { - take: + take: input_ch - main: - output_ch = input_ch + main: - | picard_markduplicates.run ( - runIf: { id, state -> !state.skip_markduplicates && !state.with_umi }, - fromState: [ - "bam": "genome_bam", - "fasta": "fasta", - "fai": "fai", - "extra_picard_args": "extra_picard_args" - ], - toState: [ - "processed_genome_bam": "output_bam", - "markduplicates_metrics": "metrics" - ] - ) - | samtools_sort.run ( - runIf: { id, state -> !state.skip_markduplicates && !state.with_umi }, - fromState: [ "input": "processed_genome_bam" ], - toState: [ "processed_genome_bam": "output" ], - key: "genome_sorted_MarkDuplicates" - ) - | samtools_index.run ( - runIf: { id, state -> !state.skip_markduplicates && !state.with_umi }, - fromState: [ - "input": "processed_genome_bam", - "csi": "bam_csi_index" - ], - toState: [ "genome_bam_index": "output" ], - key: "genome_sorted_MarkDuplicates", - ) - | samtools_stats.run ( - runIf: { id, state -> !state.skip_markduplicates && !state.with_umi }, - fromState: [ - "input": "processed_genome_bam", - "bai": "genome_bam_index" - ], - toState: [ "genome_bam_stats": "output" ], - key: "MarkDuplicates_stats" - ) - | samtools_flagstat.run ( - runIf: { id, state -> !state.skip_markduplicates && !state.with_umi }, - fromState: [ - "bam": "processed_genome_bam", - "bai": "genome_bam_index" - ], - toState: [ "genome_bam_flagstat": "output" ], - key: "MarkDuplicates_flagstat" - ) - | samtools_idxstats.run( - runIf: { id, state -> !state.skip_markduplicates && !state.with_umi }, - fromState: [ - "bam": "processed_genome_bam", - "bai": "genome_bam_index" - ], - toState: [ "genome_bam_idxstats": "output" ], - key: "MarkDuplicates_idxstats" - ) + output_ch = input_ch - | stringtie.run ( - runIf: { id, state -> !state.skip_stringtie }, - fromState: [ - "strandedness": "strandedness", - "bam": "processed_genome_bam", - "annotation_gtf": "gtf", - "extra_stringtie_args": "extra_stringtie_args" - ], - toState: [ - "stringtie_transcript_gtf": "transcript_gtf", - "stringtie_coverage_gtf": "coverage_gtf", - "stringtie_abundance": "abundance", - "stringtie_ballgown": "ballgown" - ] - ) + | picard_markduplicates.run ( + runIf: { id, state -> !state.skip_markduplicates && !state.with_umi }, + fromState: [ + "bam": "genome_bam", + "fasta": "fasta", + "fai": "fai", + "extra_picard_args": "extra_picard_args" + ], + toState: [ + "processed_genome_bam": "output_bam", + "markduplicates_metrics": "metrics" + ], + directives: [ label: [ "midmem", "midcpu" ] ] + ) + | samtools_sort.run ( + runIf: { id, state -> !state.skip_markduplicates && !state.with_umi }, + fromState: [ "input": "processed_genome_bam" ], + toState: [ "processed_genome_bam": "output" ], + key: "genome_sorted_MarkDuplicates", + directives: [ label: [ "midmem", "midcpu" ] ] + ) + | samtools_index.run ( + runIf: { id, state -> !state.skip_markduplicates && !state.with_umi }, + fromState: [ + "input": "processed_genome_bam", + "csi": "bam_csi_index" + ], + toState: [ "genome_bam_index": "output" ], + key: "genome_sorted_MarkDuplicates", + directives: [ label: [ "midmem", "midcpu" ] ] + ) + | samtools_stats.run ( + runIf: { id, state -> !state.skip_markduplicates && !state.with_umi }, + fromState: [ + "input": "processed_genome_bam", + "bai": "genome_bam_index" + ], + toState: [ "genome_bam_stats": "output" ], + key: "MarkDuplicates_stats", + directives: [ label: [ "midmem", "midcpu" ] ] + ) + | samtools_flagstat.run ( + runIf: { id, state -> !state.skip_markduplicates && !state.with_umi }, + fromState: [ + "bam": "processed_genome_bam", + "bai": "genome_bam_index" + ], + toState: [ "genome_bam_flagstat": "output" ], + key: "MarkDuplicates_flagstat", + directives: [ label: [ "midmem", "midcpu" ] ] + ) + | samtools_idxstats.run( + runIf: { id, state -> !state.skip_markduplicates && !state.with_umi }, + fromState: [ + "bam": "processed_genome_bam", + "bai": "genome_bam_index" + ], + toState: [ "genome_bam_idxstats": "output" ], + key: "MarkDuplicates_idxstats", + directives: [ label: [ "midmem", "midcpu" ] ] + ) - // Genome-wide coverage with BEDTools + | stringtie.run ( + runIf: { id, state -> !state.skip_stringtie }, + fromState: [ + "strandedness": "strandedness", + "bam": "processed_genome_bam", + "annotation_gtf": "gtf", + "extra_stringtie_args": "extra_stringtie_args" + ], + toState: [ + "stringtie_transcript_gtf": "transcript_gtf", + "stringtie_coverage_gtf": "coverage_gtf", + "stringtie_abundance": "abundance", + "stringtie_ballgown": "ballgown" + ], + directives: [ label: [ "midmem", "midcpu" ] ] + ) - | bedtools_genomecov.run ( - runIf: { id, state -> !state.skip_bigwig }, - fromState: [ - "input_bam": "processed_genome_bam", - ], - args: [ - split: true, - du: true, - bed_graph: true, - strand: "+" - ], - toState: [ "bedgraph_forward": "output" ], - key: "bedtools_genomecov_forward" - ) + // Genome-wide coverage with BEDTools - | bedtools_genomecov.run ( - runIf: { id, state -> !state.skip_bigwig }, - fromState: [ - "input_bam": "processed_genome_bam", - ], - args: [ - split: true, - du: true, - bed_graph: true, - strand: "-" - ], - toState: [ "bedgraph_reverse": "output" ], - key: "bedtools_genomecov_reverse" - ) + | bedtools_genomecov.run ( + runIf: { id, state -> !state.skip_bigwig }, + fromState: [ + "input_bam": "processed_genome_bam", + ], + args: [ + split: true, + du: true, + bed_graph: true, + strand: "+" + ], + toState: [ "bedgraph_forward": "output" ], + key: "bedtools_genomecov_forward", + directives: [ label: [ "midmem", "midcpu" ] ] + ) - | bedclip.run ( - runIf: { id, state -> !state.skip_bigwig }, - fromState: [ - "input_bedgraph": "bedgraph_forward", - "sizes": "chrom_sizes" - ], - toState: [ "bedgraph_forward": "output_bedgraph" ], - key: "bedclip_forward" - ) + | bedtools_genomecov.run ( + runIf: { id, state -> !state.skip_bigwig }, + fromState: [ + "input_bam": "processed_genome_bam", + ], + args: [ + split: true, + du: true, + bed_graph: true, + strand: "-" + ], + toState: [ "bedgraph_reverse": "output" ], + key: "bedtools_genomecov_reverse", + directives: [ label: [ "midmem", "midcpu" ] ] + ) - | bedgraphtobigwig.run ( - runIf: { id, state -> !state.skip_bigwig }, - fromState: [ - "bedgraph": "bedgraph_forward", - "sizes": "chrom_sizes" - ], - toState: [ "bigwig_forward": "bigwig" ], - key: "bedgraphtobigwig_forward" - ) + | bedclip.run ( + runIf: { id, state -> !state.skip_bigwig }, + fromState: [ + "input_bedgraph": "bedgraph_forward", + "sizes": "chrom_sizes" + ], + toState: [ "bedgraph_forward": "output_bedgraph" ], + key: "bedclip_forward", + directives: [ label: [ "midmem", "midcpu" ] ] + ) - | bedclip.run ( - runIf: { id, state -> !state.skip_bigwig }, - fromState: [ - "input_bedgraph": "bedgraph_reverse", - "sizes": "chrom_sizes", - ], - toState: [ "bedgraph_reverse": "output_bedgraph" ], - key: "bedclip_reverse" - ) + | bedgraphtobigwig.run ( + runIf: { id, state -> !state.skip_bigwig }, + fromState: [ + "bedgraph": "bedgraph_forward", + "sizes": "chrom_sizes" + ], + toState: [ "bigwig_forward": "bigwig" ], + key: "bedgraphtobigwig_forward", + directives: [ label: [ "midmem", "midcpu" ] ] + ) - | bedgraphtobigwig.run ( - runIf: { id, state -> !state.skip_bigwig }, - fromState: [ - "bedgraph": "bedgraph_reverse", - "sizes": "chrom_sizes" - ], - toState: [ "bigwig_reverse": "bigwig" ], - key: "bedgraphtobigwig_reverse" - ) + | bedclip.run ( + runIf: { id, state -> !state.skip_bigwig }, + fromState: [ + "input_bedgraph": "bedgraph_reverse", + "sizes": "chrom_sizes", + ], + toState: [ "bedgraph_reverse": "output_bedgraph" ], + key: "bedclip_reverse", + directives: [ label: [ "midmem", "midcpu" ] ] + ) - | map { id, state -> - def mod_state = state.findAll { key, value -> value instanceof java.nio.file.Path && value.exists() } - [ id, mod_state ] - } + | bedgraphtobigwig.run ( + runIf: { id, state -> !state.skip_bigwig }, + fromState: [ + "bedgraph": "bedgraph_reverse", + "sizes": "chrom_sizes" + ], + toState: [ "bigwig_reverse": "bigwig" ], + key: "bedgraphtobigwig_reverse", + directives: [ label: [ "midmem", "midcpu" ] ] + ) - | setState ( - "processed_genome_bam": "processed_genome_bam", - "genome_bam_index": "genome_bam_index", - "genome_bam_stats": "genome_bam_stats", - "genome_bam_flagstat": "genome_bam_flagstat", - "genome_bam_idxstats": "genome_bam_idxstats", - "markduplicates_metrics": "markduplicates_metrics", - "stringtie_transcript_gtf": "stringtie_transcript_gtf", - "stringtie_coverage_gtf": "stringtie_coverage_gtf", - "stringtie_abundance": "stringtie_abundance", - "stringtie_ballgown": "stringtie_ballgown", - "bedgraph_forward": "bedgraph_forward", - "bedgraph_reverse": "bedgraph_reverse", - "bigwig_forward": "bigwig_forward", - "bigwig_reverse": "bigwig_reverse" - ) + | map { id, state -> + def mod_state = state.findAll { key, value -> value instanceof java.nio.file.Path && value.exists() } + [ id, mod_state ] + } - emit: - output_ch + | setState ( + "processed_genome_bam": "processed_genome_bam", + "genome_bam_index": "genome_bam_index", + "genome_bam_stats": "genome_bam_stats", + "genome_bam_flagstat": "genome_bam_flagstat", + "genome_bam_idxstats": "genome_bam_idxstats", + "markduplicates_metrics": "markduplicates_metrics", + "stringtie_transcript_gtf": "stringtie_transcript_gtf", + "stringtie_coverage_gtf": "stringtie_coverage_gtf", + "stringtie_abundance": "stringtie_abundance", + "stringtie_ballgown": "stringtie_ballgown", + "bedgraph_forward": "bedgraph_forward", + "bedgraph_reverse": "bedgraph_reverse", + "bigwig_forward": "bigwig_forward", + "bigwig_reverse": "bigwig_reverse" + ) + + emit: + output_ch } VIASHMAIN nextflow run . -main-script "\$tempscript" & diff --git a/target/executable/workflows/pre_processing/.config.vsh.yaml b/target/executable/workflows/pre_processing/.config.vsh.yaml index 2afe8eb..eb88689 100644 --- a/target/executable/workflows/pre_processing/.config.vsh.yaml +++ b/target/executable/workflows/pre_processing/.config.vsh.yaml @@ -501,6 +501,9 @@ resources: path: "main.nf" is_executable: true entrypoint: "run_wf" +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "A subworkflow for the pre-processing stage of the nf-core/rnaseq pipeline.\n" info: null status: "enabled" @@ -620,6 +623,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -632,8 +637,8 @@ build_info: output: "target/executable/workflows/pre_processing" executable: "target/executable/workflows/pre_processing/pre_processing" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" dependencies: - "target/dependencies/vsh/vsh/biobox/main/nextflow/fastqc" - "target/dependencies/vsh/vsh/biobox/main/nextflow/umi_tools/umi_tools_extract" @@ -663,8 +668,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/executable/workflows/pre_processing/nextflow_labels.config b/target/executable/workflows/pre_processing/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/executable/workflows/pre_processing/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/executable/workflows/pre_processing/pre_processing b/target/executable/workflows/pre_processing/pre_processing index 4f45ec0..cf025d8 100755 --- a/target/executable/workflows/pre_processing/pre_processing +++ b/target/executable/workflows/pre_processing/pre_processing @@ -1478,7 +1478,8 @@ workflow run_wf { def new_state = state + newKeys return new_state }, - args: [html: "*.html", zip: "*.zip"] + args: [html: "*.html", zip: "*.zip"], + directives: [ label: [ "midmem", "highcpu" ] ] ) // Extract UMIs from fastq files and discard read 1 or read 2 if required @@ -1501,7 +1502,8 @@ workflow run_wf { toState: [ "fastq_1": "output", "fastq_2": "read2_out" - ] + ], + directives: [ label: [ "midmem", "midcpu" ] ] ) // Discard read if required @@ -1540,7 +1542,8 @@ workflow run_wf { "trim_zip_2": "trimmed_fastqc_zip_2", "trim_html_1": "trimmed_fastqc_html_1", "trim_html_2": "trimmed_fastqc_html_2" - ] + ], + directives: [ label: [ "midmem", "midcpu" ] ] ) // Trim reads using fastp @@ -1565,7 +1568,8 @@ workflow run_wf { "trim_json": "json", "trim_html": "html", "trim_merged_out": "merged_out" - ] + ], + directives: [ label: [ "midmem", "midcpu" ] ] ) // Perform FASTQC on reads trimmed using fastp @@ -1586,7 +1590,8 @@ workflow run_wf { return new_state }, args: [html: "*.html", zip: "*.zip"], - key: "fastqc_trimming" + key: "fastqc_trimming", + directives: [ label: [ "midmem", "midcpu" ] ] ) // Filter out contaminant RNA @@ -1602,7 +1607,8 @@ workflow run_wf { toState: [ "fastq_1": "fastq_1", "fastq_2": "fastq_2" - ] + ], + directives: [ label: [ "midmem", "midcpu" ] ] ) // Sort reads by rRNA and non-rRNA @@ -1627,7 +1633,8 @@ workflow run_wf { ] def new_state = state + newKeys return new_state - } + }, + directives: [ label: [ "highmem", "midcpu" ] ] ) | map { id, state -> if (state.remove_ribo_rna) { @@ -1653,7 +1660,8 @@ workflow run_wf { toState: [ "subsampled_fastq_1": "output_1", "subsampled_fastq_2": "output_2" - ] + ], + directives: [ label: [ "midmem", "midcpu" ] ] ) // Infer lib-type for salmon quant @@ -1690,39 +1698,40 @@ workflow run_wf { lib_type: state.lib_type ] }, args: [ "skip_quant": true ], - toState: [ "salmon_quant_output": "output" ] + toState: [ "salmon_quant_output": "output" ], + directives: [ label: [ "highmem", "highcpu" ] ] ) - | map { id, state -> - def mod_state = (!state.paired) ? - [trim_log_2: state.remove(state.trim_log_2), trim_zip_2: state.remove(state.trim_zip_2), trim_html_2: state.remove(state.trim_html_2), failed_trim_unpaired2: state.remove(state.failed_trim_unpaired2)] : - [] - [ id, state + mod_state ] - } + | map { id, state -> + def mod_state = (!state.paired) ? + [trim_log_2: state.remove(state.trim_log_2), trim_zip_2: state.remove(state.trim_zip_2), trim_html_2: state.remove(state.trim_html_2), failed_trim_unpaired2: state.remove(state.failed_trim_unpaired2)] : + [] + [ id, state + mod_state ] + } - | map { id, state -> - def mod_state = state.findAll { key, value -> value instanceof java.nio.file.Path && value.exists() } - [ id, mod_state ] - } + | map { id, state -> + def mod_state = state.findAll { key, value -> value instanceof java.nio.file.Path && value.exists() } + [ id, mod_state ] + } | setState ( - "fastqc_html_1": "fastqc_html_1", - "fastqc_html_2": "fastqc_html_2", - "fastqc_zip_1": "fastqc_zip_1", - "fastqc_zip_2": "fastqc_zip_2", - "qc_output1": "fastq_1", - "qc_output2": "fastq_2", - "trim_log_1": "trim_log_1", - "trim_log_2": "trim_log_2", - "trim_zip_1": "trim_zip_1", - "trim_zip_2": "trim_zip_2", - "trim_html_1": "trim_html_1", - "trim_html_2": "trim_html_2", - "sortmerna_log": "sortmerna_log", - "trim_json": "trim_json", - "trim_html": "trim_html", - "trim_merged_out": "trim_merged_out", - "salmon_quant_output": "salmon_quant_output" + "fastqc_html_1": "fastqc_html_1", + "fastqc_html_2": "fastqc_html_2", + "fastqc_zip_1": "fastqc_zip_1", + "fastqc_zip_2": "fastqc_zip_2", + "qc_output1": "fastq_1", + "qc_output2": "fastq_2", + "trim_log_1": "trim_log_1", + "trim_log_2": "trim_log_2", + "trim_zip_1": "trim_zip_1", + "trim_zip_2": "trim_zip_2", + "trim_html_1": "trim_html_1", + "trim_html_2": "trim_html_2", + "sortmerna_log": "sortmerna_log", + "trim_json": "trim_json", + "trim_html": "trim_html", + "trim_merged_out": "trim_merged_out", + "salmon_quant_output": "salmon_quant_output" ) emit: diff --git a/target/executable/workflows/prepare_genome/.config.vsh.yaml b/target/executable/workflows/prepare_genome/.config.vsh.yaml index ddaf468..b0439f3 100644 --- a/target/executable/workflows/prepare_genome/.config.vsh.yaml +++ b/target/executable/workflows/prepare_genome/.config.vsh.yaml @@ -358,6 +358,9 @@ resources: path: "main.nf" is_executable: true entrypoint: "run_wf" +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "A subworkflow for preparing all the required genome references\n" info: null status: "enabled" @@ -490,6 +493,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -502,8 +507,8 @@ build_info: output: "target/executable/workflows/prepare_genome" executable: "target/executable/workflows/prepare_genome/prepare_genome" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" dependencies: - "target/nextflow/gunzip" - "target/dependencies/vsh/vsh/biobox/main/nextflow/gffread" @@ -538,8 +543,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/executable/workflows/prepare_genome/nextflow_labels.config b/target/executable/workflows/prepare_genome/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/executable/workflows/prepare_genome/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/executable/workflows/prepare_genome/prepare_genome b/target/executable/workflows/prepare_genome/prepare_genome index f8fcf0b..848aec9 100755 --- a/target/executable/workflows/prepare_genome/prepare_genome +++ b/target/executable/workflows/prepare_genome/prepare_genome @@ -1171,291 +1171,314 @@ cat > "\$tempscript" << 'VIASHMAIN' //// VIASH END workflow run_wf { - take: - input_ch + take: + input_ch - main: - output_ch = input_ch - - // Uncompress fasta - | gunzip.run ( - fromState: [ "input": "fasta" ], - toState: [ "fasta": "output" ], - key: "gunzip_fasta", - args: [ output: "reference_genome.fasta" ] - ) + main: + output_ch = input_ch - // uncompress gtf - | gunzip.run ( - runIf: {id, state -> state.gtf}, - fromState: [ "input": "gtf" ], - toState: [ "gtf": "output" ], - key: "gunzip_gtf", - args: [output: "gene_annotation.gtf"] - ) + // Uncompress fasta + | gunzip.run ( + fromState: [ "input": "fasta" ], + toState: [ "fasta": "output" ], + key: "gunzip_fasta", + args: [ output: "reference_genome.fasta" ], + directives: [ label: [ "lowmem", "midcpu" ] ] + ) - // uncompress gff - | gunzip.run ( - runIf: {id, state -> !state.gtf && state.gff}, - fromState: [ "input": "gff" ], - toState: [ "gff": "output" ], - key: "gunzip_gff", - args: [output: "gene_annotation.gff"] - ) + // uncompress gtf + | gunzip.run ( + runIf: {id, state -> state.gtf}, + fromState: [ "input": "gtf" ], + toState: [ "gtf": "output" ], + key: "gunzip_gtf", + args: [output: "gene_annotation.gtf"], + directives: [ label: [ "lowmem", "midcpu" ] ] + ) - // gff to gtf - | gffread.run ( - runIf: {id, state -> !state.gtf && state.gff}, - fromState: [ - "input": "gff", - "genome": "fasta" - ], - toState: [ "gtf": "outfile" ], - args: [ - outfile: "gene_annotation.gtf", - gtf_output: true, - keep_attrs: true, - keep_exon_attrs: true - ] - ) + // uncompress gff + | gunzip.run ( + runIf: {id, state -> !state.gtf && state.gff}, + fromState: [ "input": "gff" ], + toState: [ "gff": "output" ], + key: "gunzip_gff", + args: [output: "gene_annotation.gff"], + directives: [ label: [ "lowmem", "midcpu" ] ] + ) - | gtf_filter.run( - runIf: {id, state -> state.gtf && state.filter_gtf}, - fromState: [ - "fasta": "fasta", - "gtf": "gtf" - ], - toState: [ "gtf": "filtered_gtf" ], - args: [filtered_gtf: "gene_annotation.gtf"] - ) + // gff to gtf + | gffread.run ( + runIf: {id, state -> !state.gtf && state.gff}, + fromState: [ + "input": "gff", + "genome": "fasta" + ], + toState: [ "gtf": "outfile" ], + args: [ + outfile: "gene_annotation.gtf", + gtf_output: true, + keep_attrs: true, + keep_exon_attrs: true + ], + directives: [ label: [ "lowmem", "midcpu" ] ] + ) - // uncompress additional fasta - | gunzip.run ( - runIf: {id, state -> state.additional_fasta}, - fromState: [ "input": "additional_fasta" ], - toState: [ "additional_fasta": "output" ], - key: "gunzip_additional_fasta", - args: [output: "additional.fasta"] - ) + | gtf_filter.run( + runIf: {id, state -> state.gtf && state.filter_gtf}, + fromState: [ + "fasta": "fasta", + "gtf": "gtf" + ], + toState: [ "gtf": "filtered_gtf" ], + args: [filtered_gtf: "gene_annotation.gtf"], + directives: [ label: [ "lowmem", "midcpu" ] ] + ) - // concatenate additional fasta - | cat_additional_fasta.run ( - runIf: {id, state -> state.additional_fasta}, - fromState: [ - "fasta": "fasta", - "gtf": "gtf", - "additional_fasta": "additional_fasta", - "biotype": "biotype" - ], - toState: [ - "fasta": "fasta_output", - "gtf": "gtf_output" - ], - args: [ - fasta_output: "genome_additional.fasta", - gtf_output: "genome_additional.gtf" - ] - ) + // uncompress additional fasta + | gunzip.run ( + runIf: {id, state -> state.additional_fasta}, + fromState: [ "input": "additional_fasta" ], + toState: [ "additional_fasta": "output" ], + key: "gunzip_additional_fasta", + args: [output: "additional.fasta"], + directives: [ label: [ "lowmem", "midcpu" ] ] + ) - // uncompress bed file - | gunzip.run ( - runIf: {id, state -> state.gene_bed}, - fromState: [ "input": "gene_bed" ], - toState: [ "gene_bed": "output" ], - key: "gunzip_gene_bed", - args: [output: "genome_additional.bed"] - ) + // concatenate additional fasta + | cat_additional_fasta.run ( + runIf: {id, state -> state.additional_fasta}, + fromState: [ + "fasta": "fasta", + "gtf": "gtf", + "additional_fasta": "additional_fasta", + "biotype": "biotype" + ], + toState: [ + "fasta": "fasta_output", + "gtf": "gtf_output" + ], + args: [ + fasta_output: "genome_additional.fasta", + gtf_output: "genome_additional.gtf" + ], + directives: [ label: [ "lowmem", "midcpu" ] ] + ) - // gtf to bed - | gtf2bed.run ( - runIf: { id, state -> !state.gene_bed}, - fromState: [ "gtf": "gtf" ], - toState: [ "gene_bed": "bed_output" ], - args: [bed_output: "genome_additional.bed"] - ) + // uncompress bed file + | gunzip.run ( + runIf: {id, state -> state.gene_bed}, + fromState: [ "input": "gene_bed" ], + toState: [ "gene_bed": "output" ], + key: "gunzip_gene_bed", + args: [output: "genome_additional.bed"], + directives: [ label: [ "lowmem", "midcpu" ] ] + ) - // uncompress transcript fasta - | gunzip.run ( - runIf: {id, state -> state.transcript_fasta}, - fromState: [ "input": "transcript_fasta" ], - toState: [ "transcript_fasta": "output" ], - key: "transcript_fasta", - args: [output: "transcriptome.fasta"] - ) + // gtf to bed + | gtf2bed.run ( + runIf: { id, state -> !state.gene_bed}, + fromState: [ "gtf": "gtf" ], + toState: [ "gene_bed": "bed_output" ], + args: [bed_output: "genome_additional.bed"], + directives: [ label: [ "lowmem", "midcpu" ] ] + ) - // preprocess transcripts fasta if gtf is in gencode format - | preprocess_transcripts_fasta.run ( - runIf: {id, state -> state.transcript_fasta && state.gencode}, - fromState: [ "transcript_fasta": "transcript_fasta" ], - toState: [ "transcript_fasta": "output" ], - args: [output: "transcriptome.fasta"] - ) + // uncompress transcript fasta + | gunzip.run ( + runIf: {id, state -> state.transcript_fasta}, + fromState: [ "input": "transcript_fasta" ], + toState: [ "transcript_fasta": "output" ], + key: "transcript_fasta", + args: [output: "transcriptome.fasta"], + directives: [ label: [ "lowmem", "midcpu" ] ] + ) - // make transcript FASTA if not provided - | rsem_prepare_reference.run ( - runIf: {id, state -> !state.transcript_fasta}, - fromState: [ - "reference_fasta_files": "fasta", - "gtf": "gtf" - ], - toState: [ "make_transcript_fasta_output": "output" ], - key: "make_transcript_fasta", - args: [reference_name: "genome"] - ) - | map { id, state -> - def transcript_fasta = (!state.transcript_fasta) ? - state.make_transcript_fasta_output.listFiles().find{it.name == "genome.transcripts.fa"} : - state.transcript_fasta - [ id, state + [transcript_fasta: transcript_fasta] ] - } + // preprocess transcripts fasta if gtf is in gencode format + | preprocess_transcripts_fasta.run ( + runIf: {id, state -> state.transcript_fasta && state.gencode}, + fromState: [ "transcript_fasta": "transcript_fasta" ], + toState: [ "transcript_fasta": "output" ], + args: [output: "transcriptome.fasta"], + directives: [ label: [ "lowmem", "midcpu" ] ] + ) - // chromosome size and fai index - | getchromsizes.run ( - fromState: [ "fasta": "fasta" ], - toState: [ - "fai": "fai", - "sizes": "sizes" - ], - key: "chromsizes", - args: [ - fai: "genome_additional.fasta.fai", - sizes: "genome_additional.fasta.sizes" - ] - ) - - // untar bbsplit index, if available - | untar.run ( - runIf: {id, state -> state.bbsplit_index}, - fromState: [ "input": "bbsplit_index" ], - toState: [ "bbsplit_index": "output" ], - key: "untar_bbsplit_index", - args: [output: "BBSplit_index"] - ) + // make transcript FASTA if not provided + | rsem_prepare_reference.run ( + runIf: {id, state -> !state.transcript_fasta}, + fromState: [ + "reference_fasta_files": "fasta", + "gtf": "gtf" + ], + toState: [ "make_transcript_fasta_output": "output" ], + key: "make_transcript_fasta", + args: [reference_name: "genome"], + directives: [ label: [ "lowmem", "midcpu" ] ] + ) + | map { id, state -> + def transcript_fasta = (!state.transcript_fasta) ? + state.make_transcript_fasta_output.listFiles().find{it.name == "genome.transcripts.fa"} : + state.transcript_fasta + [ id, state + [transcript_fasta: transcript_fasta] ] + } - | map {id, state -> - def ref = [state.fasta] + state.bbsplit_fasta_list - [id, state + [bbsplit_ref: ref] ] - } + // chromosome size and fai index + | getchromsizes.run ( + fromState: [ "fasta": "fasta" ], + toState: [ + "fai": "fai", + "sizes": "sizes" + ], + key: "chromsizes", + args: [ + fai: "genome_additional.fasta.fai", + sizes: "genome_additional.fasta.sizes" + ], + directives: [ label: [ "lowmem", "midcpu" ] ] + ) - // create bbsplit index, if not already availble - | bbmap_bbsplit.run ( - runIf: {id, state -> !state.skip_bbsplit && !state.bbsplit_index}, - fromState: ["ref": "bbsplit_ref"], - toState: [ "bbsplit_index": "index" ], - args: [ - only_build_index: true, - index: "BBSplit_index" - ], - key: "generate_bbsplit_index" - ) + // untar bbsplit index, if available + | untar.run ( + runIf: {id, state -> state.bbsplit_index}, + fromState: [ "input": "bbsplit_index" ], + toState: [ "bbsplit_index": "output" ], + key: "untar_bbsplit_index", + directives: [ label: [ "lowmem", "midcpu" ] ] + ) - // Uncompress STAR index or generate from scratch if required - | untar.run ( - runIf: {id, state -> state.star_index}, - fromState: [ "input": "star_index" ], - toState: [ "star_index": "output" ], - key: "untar_star_index", - args: [output: "STAR_index"] - ) - - // TODO: Add to viah-hub or adapt star_align_reads to enable the generateGenome runMode - | star_genome_generate.run ( - runIf: {id, state -> !state.star_index && !state.skip_alignment}, - fromState: [ - "genome_fasta_files": "fasta", - "sjdb_gtf_file": "gtf", - "sjdb_gtf_feature_exon": "star_sjdb_gtf_feature_exon" - ], - toState: [ "star_index": "index" ], - key: "generate_star_index", - args: [index: "STAR_index"] - ) + | map { id, state -> + // Check if bbsplit_fasta_list is defined + def ref = (state.bbsplit_fasta_list) ? + [state.fasta] + state.bbsplit_fasta_list : + [state.fasta] + [id, state + [bbsplit_ref: ref] ] + } - // Uncompress RSEM index or generate from scratch if required - | untar.run ( - runIf: {id, state -> state.rsem_index}, - fromState: [ "input": "rsem_index" ], - toState: [ "rsem_index": "output" ], - key: "untar_rsem_index", - args: [output: "RSEM_index"] - ) + // create bbsplit index, if not already available + | bbmap_bbsplit.run ( + runIf: {id, state -> !state.skip_bbsplit && !state.bbsplit_index}, + fromState: ["ref": "bbsplit_ref"], + toState: [ "bbsplit_index": "index" ], + args: [ + only_build_index: true, + index: "BBSplit_index" + ], + key: "generate_bbsplit_index" + ) - | rsem_prepare_reference.run ( - runIf: {id, state -> !state.rsem_index && state.aligner == 'star_rsem'}, - fromState: [ - "reference_fasta_files": "fasta", - "gtf": "gtf" - ], - toState: [ "rsem_index": "output" ], - key: "generate_rsem_index", - args: [reference_name: "genome"] - ) - - // TODO: Uncompress HISAT2 index or generate from scratch if required + // Uncompress STAR index or generate from scratch if required + | untar.run ( + runIf: {id, state -> state.star_index}, + fromState: [ "input": "star_index" ], + toState: [ "star_index": "output" ], + key: "untar_star_index", + args: [output: "STAR_index"], + directives: [ label: [ "lowmem", "midcpu" ] ] + ) - // Uncompress Salmon index or generate from scratch if required - | untar.run ( - runIf: {id, state -> state.salmon_index}, - fromState: [ "input": "salmon_index" ], - toState: [ "salmon_index": "output" ], - key: "untar_salmon_index", - args: [output: "Salmon_index"] - ) + | star_genome_generate.run ( + runIf: {id, state -> !state.star_index && !state.skip_alignment}, + fromState: [ + "genome_fasta_files": "fasta", + "sjdb_gtf_file": "gtf", + "sjdb_gtf_feature_exon": "star_sjdb_gtf_feature_exon" + ], + toState: [ "star_index": "index" ], + key: "generate_star_index", + args: [index: "STAR_index"], + directives: [ label: [ "highmem", "highcpu" ] ] + ) - | salmon_index.run ( - runIf: {id, state -> (state.aligner == 'star_salmon' || state.pseudo_aligner == "salmon") && !state.salmon_index}, - fromState: [ - "genome": "fasta", - "transcripts": "transcript_fasta", - "kmer_len": "pseudo_aligner_kmer_size", - "gencode": "gencode" - ], - toState: [ "salmon_index": "index" ], - key: "generate_salmon_index", - args: [index: "Salmon_index"] - ) + // Uncompress RSEM index or generate from scratch if required + | untar.run ( + runIf: {id, state -> state.rsem_index}, + fromState: [ "input": "rsem_index" ], + toState: [ "rsem_index": "output" ], + key: "untar_rsem_index", + args: [output: "RSEM_index"], + directives: [ label: [ "lowmem", "midcpu" ] ] + ) - // Uncompress Kallisto index or generate from scratch if required - | untar.run ( - runIf: {id, state -> state.kallisto_index}, - fromState: [ "input": "kallisto_index" ], - toState: [ "kallisto_index": "output" ], - key: "untar_kallisto_index", - args: [output: "Kallisto_index"] - ) + | rsem_prepare_reference.run ( + runIf: {id, state -> !state.rsem_index && state.aligner == 'star_rsem'}, + fromState: [ + "reference_fasta_files": "fasta", + "gtf": "gtf" + ], + toState: [ "rsem_index": "output" ], + key: "generate_rsem_index", + args: [reference_name: "genome"], + directives: [ label: [ "lowmem", "midcpu" ] ] + ) + + // TODO: Uncompress HISAT2 index or generate from scratch if required - | kallisto_index.run( - runIf: {id, state -> state.pseudo_aligner == "kallisto" && !state.kallisto_index}, - fromState: [ - "input": "transcript_fasta", - "kmer_size": "pseudo_aligner_kmer_size" - ], - toState: [ "kallisto_index": "index" ], - key: "generate_kallisto_index", - args: [index: "Kallisto_index"] - ) + // Uncompress Salmon index or generate from scratch if required + | untar.run ( + runIf: {id, state -> state.salmon_index}, + fromState: [ "input": "salmon_index" ], + toState: [ "salmon_index": "output" ], + key: "untar_salmon_index", + args: [output: "Salmon_index"], + directives: [ label: [ "lowmem", "midcpu" ] ] + ) - | map { id, state -> - def mod_state = state.findAll { key, value -> value instanceof java.nio.file.Path && value.exists() } - [ id, mod_state ] - } + | salmon_index.run ( + runIf: {id, state -> (state.aligner == 'star_salmon' || state.pseudo_aligner == "salmon") && !state.salmon_index}, + fromState: [ + "genome": "fasta", + "transcripts": "transcript_fasta", + "kmer_len": "pseudo_aligner_kmer_size", + "gencode": "gencode" + ], + toState: [ "salmon_index": "index" ], + key: "generate_salmon_index", + args: [index: "Salmon_index"], + directives: [ label: [ "lowmem", "midcpu" ] ] + ) - | setState ( - "fasta_uncompressed": "fasta", - "gtf_uncompressed": "gtf", - "transcript_fasta_uncompressed": "transcript_fasta", - "gene_bed_uncompressed": "gene_bed", - "star_index_uncompressed": "star_index", - "salmon_index_uncompressed": "salmon_index", - "kallisto_index_uncompressed": "kallisto_index", - "bbsplit_index_uncompressed": "bbsplit_index", - "rsem_index_uncompressed": "rsem_index", - "chrom_sizes": "sizes", - "fai": "fai" - ) + // Uncompress Kallisto index or generate from scratch if required + | untar.run ( + runIf: {id, state -> state.kallisto_index}, + fromState: [ "input": "kallisto_index" ], + toState: [ "kallisto_index": "output" ], + key: "untar_kallisto_index", + args: [output: "Kallisto_index"], + directives: [ label: [ "lowmem", "midcpu" ] ] + ) - emit: - output_ch + | kallisto_index.run( + runIf: {id, state -> state.pseudo_aligner == "kallisto" && !state.kallisto_index}, + fromState: [ + "input": "transcript_fasta", + "kmer_size": "pseudo_aligner_kmer_size" + ], + toState: [ "kallisto_index": "index" ], + key: "generate_kallisto_index", + args: [index: "Kallisto_index"], + directives: [ label: [ "lowmem", "midcpu" ] ] + ) + + | map { id, state -> + def mod_state = state.findAll { key, value -> value instanceof java.nio.file.Path && value.exists() } + [ id, mod_state ] + } + + | setState ( + "fasta_uncompressed": "fasta", + "gtf_uncompressed": "gtf", + "transcript_fasta_uncompressed": "transcript_fasta", + "gene_bed_uncompressed": "gene_bed", + "star_index_uncompressed": "star_index", + "salmon_index_uncompressed": "salmon_index", + "kallisto_index_uncompressed": "kallisto_index", + "bbsplit_index_uncompressed": "bbsplit_index", + "rsem_index_uncompressed": "rsem_index", + "chrom_sizes": "sizes", + "fai": "fai" + ) + + emit: + output_ch } VIASHMAIN nextflow run . -main-script "\$tempscript" & diff --git a/target/executable/workflows/pseudo_alignment_and_quant/.config.vsh.yaml b/target/executable/workflows/pseudo_alignment_and_quant/.config.vsh.yaml index def0876..b10de4e 100644 --- a/target/executable/workflows/pseudo_alignment_and_quant/.config.vsh.yaml +++ b/target/executable/workflows/pseudo_alignment_and_quant/.config.vsh.yaml @@ -183,6 +183,9 @@ resources: path: "main.nf" is_executable: true entrypoint: "run_wf" +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "A viash sub-workflow for pseudo alignment and quantification stage of\ \ nf-core/rnaseq pipeline.\n" info: null @@ -273,6 +276,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -285,8 +290,8 @@ build_info: output: "target/executable/workflows/pseudo_alignment_and_quant" executable: "target/executable/workflows/pseudo_alignment_and_quant/pseudo_alignment_and_quant" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" dependencies: - "target/dependencies/vsh/vsh/biobox/main/nextflow/salmon/salmon_quant" - "target/dependencies/vsh/vsh/biobox/main/nextflow/kallisto/kallisto_quant" @@ -310,8 +315,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/executable/workflows/pseudo_alignment_and_quant/nextflow_labels.config b/target/executable/workflows/pseudo_alignment_and_quant/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/executable/workflows/pseudo_alignment_and_quant/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/executable/workflows/pseudo_alignment_and_quant/pseudo_alignment_and_quant b/target/executable/workflows/pseudo_alignment_and_quant/pseudo_alignment_and_quant index 40bfd44..b6e3d82 100755 --- a/target/executable/workflows/pseudo_alignment_and_quant/pseudo_alignment_and_quant +++ b/target/executable/workflows/pseudo_alignment_and_quant/pseudo_alignment_and_quant @@ -836,22 +836,23 @@ workflow run_wf { // Count reads from BAM alignments using Salmon | salmon_quant.run ( - runIf: { id, state -> state.pseudo_aligner == 'salmon' }, - fromState: { id, state -> - def unmated_reads = !state.paired ? state.fastq_1 : null - def mates1 = state.paired ? state.fastq_1 : null - def mates2 = state.paired ? state.fastq_2 : null - [ unmated_reads: unmated_reads, - mates1: mates1, - mates2: mates2, - gene_map: state.gtf, - index: state.salmon_index, - lib_type: state.lib_type ] - }, - toState: [ - "quant_out_dir": "output", - "salmon_quant_results_file": "quant_results" - ] + runIf: { id, state -> state.pseudo_aligner == 'salmon' }, + fromState: { id, state -> + def unmated_reads = !state.paired ? state.fastq_1 : null + def mates1 = state.paired ? state.fastq_1 : null + def mates2 = state.paired ? state.fastq_2 : null + [ unmated_reads: unmated_reads, + mates1: mates1, + mates2: mates2, + gene_map: state.gtf, + index: state.salmon_index, + lib_type: state.lib_type ] + }, + toState: [ + "quant_out_dir": "output", + "salmon_quant_results_file": "quant_results" + ], + directives: [ label: [ "midmem", "highcpu" ] ] ) | map { id, state -> @@ -859,7 +860,7 @@ workflow run_wf { [ id, mod_state ] } - | kallisto_quant.run ( + | kallisto_quant.run ( runIf: { id, state -> state.pseudo_aligner == 'kallisto'}, fromState: { id, state -> def fr_stranded = state.strandedness == 'forward' @@ -883,8 +884,9 @@ workflow run_wf { ] def new_state = state + newKeys return new_state - } - ) + }, + directives: [ label: [ "midmem", "highcpu" ] ] + ) | map { id, state -> def mod_state = state.findAll { key, value -> value instanceof java.nio.file.Path && value.exists() } @@ -895,7 +897,8 @@ workflow run_wf { [ "pseudo_multiqc": "quant_results", "quant_out_dir": "quant_out_dir", "salmon_quant_results_file": "salmon_quant_results_file", - "kallisto_quant_results_file": "kallisto_quant_results_file" ] + "kallisto_quant_results_file": "kallisto_quant_results_file" + ] ) emit: diff --git a/target/executable/workflows/quality_control/.config.vsh.yaml b/target/executable/workflows/quality_control/.config.vsh.yaml index 607e24b..56be1a2 100644 --- a/target/executable/workflows/quality_control/.config.vsh.yaml +++ b/target/executable/workflows/quality_control/.config.vsh.yaml @@ -547,6 +547,7 @@ argument_groups: multiple_sep: ";" - type: "file" name: "--multiqc_custom_config" + description: "Custom multiqc configuration file\n" info: null must_exist: true create_parent: true @@ -556,6 +557,7 @@ argument_groups: multiple_sep: ";" - type: "string" name: "--multiqc_title" + description: "Custom multiqc title\n" info: null required: false direction: "input" @@ -1396,6 +1398,9 @@ resources: path: "main.nf" is_executable: true entrypoint: "run_wf" +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "A subworkflow for the final quality control stage of the nf-core/rnaseq\ \ pipeline.\n" info: null @@ -1542,6 +1547,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -1554,8 +1561,8 @@ build_info: output: "target/executable/workflows/quality_control" executable: "target/executable/workflows/quality_control/quality_control" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" dependencies: - "target/dependencies/vsh/vsh/biobox/main/nextflow/rseqc/rseqc_bamstat" - "target/dependencies/vsh/vsh/biobox/main/nextflow/rseqc/rseqc_inferexperiment" @@ -1595,8 +1602,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/executable/workflows/quality_control/nextflow_labels.config b/target/executable/workflows/quality_control/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/executable/workflows/quality_control/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/executable/workflows/quality_control/quality_control b/target/executable/workflows/quality_control/quality_control index 7bc4d83..40f5031 100755 --- a/target/executable/workflows/quality_control/quality_control +++ b/target/executable/workflows/quality_control/quality_control @@ -467,9 +467,11 @@ function ViashHelp { echo "" echo " --multiqc_custom_config" echo " type: file, file must exist" + echo " Custom multiqc configuration file" echo "" echo " --multiqc_title" echo " type: string" + echo " Custom multiqc title" echo "" echo " --multiqc_methods_description" echo " type: file, file must exist" @@ -3302,802 +3304,828 @@ cat > "\$tempscript" << 'VIASHMAIN' //// VIASH END workflow run_wf { - - take: - input_ch - main: + take: + input_ch - qc_ch = input_ch + main: - // temporary fix to force assignment when alignment in skipped - | map {it} + qc_ch = input_ch - // Feature biotype QC using featureCounts - | map { id, state -> - def biotype_in_gtf = biotypeInGtf(state.gtf, state.biotype) - def attribute_type = state.gencode ? "gene_type" : state.featurecounts_group_type - def strand = (state.strandedness == "forward") ? 1 : ((state.strandedness == "reverse") ? 2 : 0) - [ id, state + [biotype_in_gtf: biotype_in_gtf, attribute_type: attribute_type, strand: strand] ] + // temporary fix to force assignment when alignment is skipped + | map {it} + + // Feature biotype QC using featureCounts + | map { id, state -> + def biotype_in_gtf = biotypeInGtf(state.gtf, state.biotype) + def attribute_type = state.gencode ? "gene_type" : state.featurecounts_group_type + def strand = (state.strandedness == "forward") ? 1 : ((state.strandedness == "reverse") ? 2 : 0) + [ id, state + [biotype_in_gtf: biotype_in_gtf, attribute_type: attribute_type, strand: strand] ] + } + + | featurecounts.run ( + runIf: { id, state -> !state.skip_qc && !state.skip_biotype_qc && state.biotype && state.biotype_in_gtf && !state.skip_align }, + fromState: [ + "paired": "paired", + "strand": "strand", + "annotation": "gtf", + "input": "genome_bam", + "attribute_type": "attribute_type", + "feature_type": "featurecounts_feature_type", + "count_read_pairs": "paired" + ], + toState: [ + "featurecounts": "counts", + "featurecounts_summary": "summary" + ], + args: [ + both_aligned: true, + same_strand: true + ], + directives: [ label: [ "midmem", "midcpu" ] ] + ) + + | multiqc_custom_biotype.run ( + runIf: { id, state -> !state.skip_qc && !state.skip_biotype_qc && state.biotype && state.featurecounts && !state.skip_align }, + fromState: [ + "id": "id", + "biocounts": "featurecounts", + "biotypes_header": "biotypes_header" + ], + toState: [ + "featurecounts_multiqc": "featurecounts_multiqc", + "featurecounts_rrna_multiqc": "featurecounts_rrna_multiqc" + ], + directives: [ label: [ "midmem", "midcpu" ] ] + ) + + | preseq_lcextrap.run ( + runIf: { id, state -> !state.skip_qc && !state.skip_preseq && !state.skip_align }, + fromState: [ + "paired": "paired", + "input": "genome_bam", + "extra_preseq_args": "extra_preseq_args" + ], + toState: [ "preseq_output": "output" ], + directives: [ label: [ "midmem", "midcpu" ] ] + ) + + | rseqc_bamstat.run ( + runIf: { id, state -> !state.skip_qc && !state.skip_rseqc && "bam_stat" in state.rseqc_modules && !state.skip_align }, + fromState: [ + "input_file": "genome_bam", + "mapq": "map_qual" + ], + toState: [ "bamstat_output": "output" ], + directives: [ label: [ "midmem", "midcpu" ] ] + ) + | rseqc_inferexperiment.run( + runIf: { id, state -> !state.skip_qc && !state.skip_rseqc && "infer_experiment" in state.rseqc_modules && !state.skip_align }, + fromState: [ + "input_file": "genome_bam", + "refgene": "gene_bed", + "sample_size": "sample_size", + "mapq": "map_qual" + ], + toState: [ "strandedness_output": "output" ], + directives: [ label: [ "midmem", "midcpu" ] ] + ) + // Get predicted strandedness from the RSeQC infer_experiment.py output + | map { id, state -> + def inferred_strand = getInferexperimentStrandedness(state.strandedness_output, 30) + def passed_strand_check = (state.strandedness != inferred_strand[0]) ? false : true + [ id, state + [ inferred_strand: inferred_strand, passed_strand_check: passed_strand_check ] ] + } + | rseqc_inner_distance.run( + runIf: { id, state -> !state.skip_qc && !state.skip_rseqc && state.paired && "inner_distance" in state.rseqc_modules && !state.skip_align }, + key: "inner_distance", + args: ["output_prefix": "output"], + fromState: [ + "input_file": "genome_bam", + "refgene": "gene_bed", + "sample_size": "sample_size", + "mapq": "map_qual", + "lower_bound": "lower_bound_size", + "upper_bound": "upper_bound_size", + "step": "step_size", + ], + toState: [ + "inner_dist_output_stats": "output_stats", + "inner_dist_output_dist": "output_dist", + "inner_dist_output_freq": "output_freq", + "inner_dist_output_plot": "output_plot", + "inner_dist_output_plot_r": "output_plot_r" + ], + directives: [ label: [ "midmem", "midcpu" ] ] + ) + | rseqc_junctionannotation.run( + runIf: { id, state -> !state.skip_qc && !state.skip_rseqc && "junction_annotation" in state.rseqc_modules && !state.skip_align }, + fromState: [ + "input": "genome_bam", + "refgene": "gene_bed", + "map_qual": "map_qual", + "min_intron": "min_intron" + ], + toState: [ + "junction_annotation_output_log": "output_log", + "junction_annotation_output_plot_r": "output_plot_r", + "junction_annotation_output_junction_bed": "output_junction_bed", + "junction_annotation_output_junction_interact": "output_junction_interact", + "junction_annotation_output_junction_sheet": "output_junction_sheet", + "junction_annotation_output_splice_events_plot": "output_splice_events_plot", + "junction_annotation_output_splice_junctions_plot": "output_splice_junctions_plot" + ], + directives: [ label: [ "midmem", "midcpu" ] ] + ) + | rseqc_junctionsaturation.run( + runIf: { id, state -> !state.skip_qc && !state.skip_rseqc && "junction_saturation" in state.rseqc_modules && !state.skip_align }, + fromState: [ + "input": "genome_bam", + "refgene": "gene_bed", + "sampling_percentile_lower_bound": "sampling_percentile_lower_bound", + "sampling_percentile_upper_bound": "sampling_percentile_upper_bound", + "sampling_percentile_step": "sampling_percentile_step", + "min_intron": "min_intron", + "min_splice_read": "min_splice_read", + "map_qual": "map_qual" + ], + toState: [ + "junction_saturation_output_plot_r": "output_plot_r", + "junction_saturation_output_plot": "output_plot" + ], + directives: [ label: [ "midmem", "midcpu" ] ] + ) + | rseqc_readdistribution.run( + runIf: { id, state -> !state.skip_qc && !state.skip_rseqc && "read_distribution" in state.rseqc_modules && !state.skip_align }, + fromState: [ + "input": "genome_bam", + "refgene": "gene_bed", + ], + toState: [ "read_distribution_output": "output" ], + directives: [ label: [ "midmem", "midcpu" ] ] + ) + | rseqc_readduplication.run( + runIf: { id, state -> !state.skip_qc && !state.skip_rseqc && "read_duplication" in state.rseqc_modules && !state.skip_align }, + fromState: [ + "input": "genome_bam", + "read_count_upper_limit": "read_count_upper_limit", + "map_qual": "map_qual" + ], + toState: [ + "read_duplication_output_duplication_rate_plot_r": "output_duplication_rate_plot_r", + "read_duplication_output_duplication_rate_plot": "output_duplication_rate_plot", + "read_duplication_output_duplication_rate_mapping": "output_duplication_rate_mapping", + "read_duplication_output_duplication_rate_sequence": "output_duplication_rate_sequence" + ], + directives: [ label: [ "midmem", "midcpu" ] ] + ) + | rseqc_tin.run( + runIf: { id, state -> !state.skip_qc && !state.skip_rseqc && "tin" in state.rseqc_modules && !state.skip_align }, + fromState: [ + "bam_input": "genome_bam", + "bai_input": "genome_bam_index", + "refgene": "gene_bed", + "minimum_coverage": "minimum_coverage", + "sample_size": "tin_sample_size", + "subtract_background": "subtract_background" + ], + toState: [ + "tin_output_summary": "output_tin_summary", + "tin_output_metrics": "output_tin" + ], + directives: [ label: [ "midmem", "midcpu" ] ] + ) + + | dupradar.run( + runIf: { id, state -> !state.skip_qc && !state.skip_dupradar && !state.skip_align }, + fromState: [ + "id": "id", + "input": "genome_bam", + "gtf_annotation": "gtf", + "paired": "paired", + "strandedness": "strandedness" + ], + toState: [ + "dupradar_output_dupmatrix": "output_dupmatrix", + "dupradar_output_dup_intercept_mqc": "output_dup_intercept_mqc", + "dupradar_output_duprate_exp_boxplot": "output_duprate_exp_boxplot", + "dupradar_output_duprate_exp_densplot": "output_duprate_exp_densplot", + "dupradar_output_duprate_exp_denscurve_mqc": "output_duprate_exp_denscurve_mqc", + "dupradar_output_expression_histogram": "output_expression_histogram", + "dupradar_output_intercept_slope": "output_intercept_slope" + ], + directives: [ label: [ "midmem", "midcpu" ] ] + ) + + // TODO: Add outdir as an output argument to the qualimap module on biobox. + // Qualimap ouputs a few more raw data files to outdir but since the module is using a temporary directory as output dir these files are lost. + | qualimap_rnaseq.run( + runIf: { id, state -> !state.skip_qc && !state.skip_qualimap && !state.skip_align }, + fromState: [ + "bam": "genome_bam", + "gtf": "gtf", + "num_pr_bases": "pr_bases", + "num_tr_bias": "tr_bias", + "algorithm": "algorithm", + "sequencing_protocol": "sequencing_protocol", + "sorted": "sorted", + "java_memory_size": "java_memory_size", + ], + toState: [ + "qualimap_report": "report", + "qualimap_qc_report": "qc_report", + "qualimap_counts": "counts" + ], + directives: [ label: [ "midmem", "midcpu" ] ] + ) + + merged_ch = qc_ch + | toSortedList + | map { list -> + def ids = list.collect { id, state -> id } + def strandedness = list.collect { id, state -> state.strandedness } + def num_trimmed_reads = list.collect { id, state -> state.num_trimmed_reads } + def passed_trimmed_reads = list.collect { id, state -> state.passed_trimmed_reads } + def passed_mapping = list.collect { id, state -> state.passed_mapping } + def percent_mapped = list.collect { id, state -> state.percent_mapped } + def inferred_strand = list.collect { id, state -> state.inferred_strand } + def passed_strand_check = list.collect { id, state -> state.passed_strand_check } + def gtf = list.collect { id, state -> state.gtf }.unique()[0] + def gtf_extra_attributes = list.collect { id, state -> state.gtf_extra_attributes }.unique()[0] + def gtf_group_features = list.collect { id, state -> state.gtf_group_features }.unique()[0] + def pca_header_multiqc = list.collect { id, state -> state.pca_header_multiqc }.unique()[0] + def clustering_header_multiqc = list.collect { id, state -> state.clustering_header_multiqc }.unique()[0] + def aligner = list.collect { id, state -> state.aligner }.unique()[0] + def pseudo_aligner = list.collect { id, state -> state.pseudo_aligner }.unique()[0] + def deseq2_vst = list.collect { id, state -> state.deseq2_vst }.unique()[0] + def extra_deseq2_args = list.collect { id, state -> state.extra_deseq2_args }.unique()[0] + def extra_deseq2_args2 = list.collect { id, state -> state.extra_deseq2_args2 }.unique()[0] + def skip_deseq2_qc = list.collect { id, state -> state.skip_deseq2_qc }.unique()[0] + def skip_qc = list.collect { id, state -> state.skip_qc }.unique()[0] + def skip_align = list.collect { id, state -> state.skip_align }.unique()[0] + def skip_pseudo_align = list.collect { id, state -> state.skip_pseudo_align }.unique()[0] + def quant_results = list.collect { id, state -> + (state.quant_results_file instanceof java.nio.file.Path && state.quant_results_file.exists()) ? + state.quant_results_file : + null } + def rsem_counts_gene = list.collect { id, state -> + (state.rsem_counts_gene instanceof java.nio.file.Path && state.rsem_counts_gene.exists()) ? + state.rsem_counts_gene : + null } + def rsem_counts_transcripts = list.collect { id, state -> + (state.rsem_counts_transcripts instanceof java.nio.file.Path && state.rsem_counts_transcripts.exists()) ? + state.rsem_counts_transcripts : + null } + def pseudo_quant_out_dir = list.collect { id, state -> + (state.pseudo_quant_out_dir instanceof java.nio.file.Path && state.pseudo_quant_out_dir.exists()) ? + state.pseudo_quant_out_dir : + null } + def pseudo_salmon_quant_results = list.collect { id, state -> + (state.pseudo_salmon_quant_results_file instanceof java.nio.file.Path && state.pseudo_salmon_quant_results_file.exists()) ? + state.pseudo_salmon_quant_results_file : + null } + def pseudo_kallisto_quant_results = list.collect { id, state -> + (state.pseudo_kallisto_quant_results_file instanceof java.nio.file.Path && state.pseudo_kallisto_quant_results_file.exists()) ? + state.pseudo_kallisto_quant_results_file : + null } + def fastqc_zip_1 = list.collect { id, state -> + (state.fastqc_zip_1 instanceof java.nio.file.Path && state.fastqc_zip_1.exists()) ? + state.fastqc_zip_1 : + null } + def fastqc_zip_2 = list.collect { id, state -> + (state.fastqc_zip_2 instanceof java.nio.file.Path && state.fastqc_zip_2.exists()) ? + state.fastqc_zip_2 : + null } + def trim_zip_1 = list.collect { id, state -> + (state.trim_zip_1 instanceof java.nio.file.Path && state.trim_zip_1.exists()) ? + state.trim_zip_1 : + null } + def trim_zip_2 = list.collect { id, state -> + (state.trim_zip_2 instanceof java.nio.file.Path && state.trim_zip_2.exists()) ? + state.trim_zip_2 : + null } + def trim_log_1 = list.collect { id, state -> + (state.trim_log_1 instanceof java.nio.file.Path && state.trim_log_1.exists()) ? + state.trim_log_1 : + null } + def trim_log_2 = list.collect { id, state -> + (state.trim_log_2 instanceof java.nio.file.Path && state.trim_log_2.exists()) ? + state.trim_log_2 : + null } + def sortmerna_multiqc = list.collect { id, state -> + (state.sortmerna_multiqc instanceof java.nio.file.Path && state.sortmerna_multiqc.exists()) ? + state.sortmerna_multiqc : + null } + def star_multiqc = list.collect { id, state -> + (state.star_multiqc instanceof java.nio.file.Path && state.star_multiqc.exists()) ? + state.star_multiqc : + null } + def genome_bam_stats = list.collect { id, state -> + (state.genome_bam_stats instanceof java.nio.file.Path && state.genome_bam_stats.exists()) ? + state.genome_bam_stats : + null } + def genome_bam_flagstat = list.collect { id, state -> + (state.genome_bam_flagstat instanceof java.nio.file.Path && state.genome_bam_flagstat.exists()) ? + state.genome_bam_flagstat : + null } + def genome_bam_idxstats = list.collect { id, state -> + (state.genome_bam_idxstats instanceof java.nio.file.Path && state.genome_bam_idxstats.exists()) ? + state.genome_bam_idxstats : + null } + def markduplicates_multiqc = list.collect { id, state -> + (state.markduplicates_multiqc instanceof java.nio.file.Path && state.markduplicates_multiqc.exists()) ? + state.markduplicates_multiqc : + null } + def salmon_multiqc = list.collect { id, state -> + (state.salmon_multiqc instanceof java.nio.file.Path && state.salmon_multiqc.exists()) ? + state.salmon_multiqc : + null } + def rsem_multiqc = list.collect { id, state -> + (state.rsem_multiqc instanceof java.nio.file.Path && state.rsem_multiqc.exists()) ? + state.rsem_multiqc : + null } + def pseudo_multiqc = list.collect { id, state -> + (state.pseudo_multiqc instanceof java.nio.file.Path && state.pseudo_multiqc.exists()) ? + state.pseudo_multiqc : + null } + def featurecounts_multiqc = list.collect { id, state -> + (state.featurecounts_multiqc instanceof java.nio.file.Path && state.featurecounts_multiqc.exists()) ? + state.featurecounts_multiqc : + null } + def featurecounts_rrna_multiqc = list.collect { id, state -> + (state.featurecounts_rrna_multiqc instanceof java.nio.file.Path && state.featurecounts_rrna_multiqc.exists()) ? + state.featurecounts_rrna_multiqc : + null } + def preseq_output = list.collect { id, state -> + (state.preseq_output instanceof java.nio.file.Path && state.preseq_output.exists()) ? + state.preseq_output : + null } + // def qualimap_output_dir = list.collect { id, state -> + // (state.qualimap_output_dir instanceof java.nio.file.Path && state.qualimap_output_dir.exists()) ? + // state.qualimap_output_dir : + // null } + def dupradar_output_dup_intercept_mqc = list.collect { id, state -> + (state.dupradar_output_dup_intercept_mqc instanceof java.nio.file.Path && state.dupradar_output_dup_intercept_mqc.exists()) ? + state.dupradar_output_dup_intercept_mqc : + null } + def dupradar_output_duprate_exp_denscurve_mqc = list.collect { id, state -> + (state.dupradar_output_duprate_exp_denscurve_mqc instanceof java.nio.file.Path && state.dupradar_output_duprate_exp_denscurve_mqc.exists()) ? + state.dupradar_output_duprate_exp_denscurve_mqc : + null } + def bamstat_output = list.collect { id, state -> + (state.bamstat_output instanceof java.nio.file.Path && state.bamstat_output.exists()) ? + state.bamstat_output : + null } + def inferexperiment_multiqc = list.collect { id, state -> + (state.strandedness_output instanceof java.nio.file.Path && state.strandedness_output.exists()) ? + state.strandedness_output : + null } + def inner_dist_output_freq = list.collect { id, state -> + (state.inner_dist_output_freq instanceof java.nio.file.Path && state.inner_dist_output_freq.exists()) ? + state.inner_dist_output_freq : + null } + def junction_annotation_output_log = list.collect { id, state -> + (state.junction_annotation_output_log instanceof java.nio.file.Path && state.junction_annotation_output_log.exists()) ? + state.junction_annotation_output_log : + null } + def junction_saturation_output_plot_r = list.collect { id, state -> + (state.junction_saturation_output_plot_r instanceof java.nio.file.Path && state.junction_saturation_output_plot_r.exists()) ? + state.junction_saturation_output_plot_r : + null } + def read_distribution_output = list.collect { id, state -> + (state.read_distribution_output instanceof java.nio.file.Path && state.read_distribution_output.exists()) ? + state.read_distribution_output : + null } + def read_duplication_output_duplication_rate_mapping = list.collect { id, state -> + (state.read_duplication_output_duplication_rate_mapping instanceof java.nio.file.Path && state.read_duplication_output_duplication_rate_mapping.exists()) ? + state.read_duplication_output_duplication_rate_mapping : + null } + def tin_output_summary = list.collect { id, state -> + (state.tin_output_summary instanceof java.nio.file.Path && state.tin_output_summary.exists()) ? + state.tin_output_summary : + null } + def multiqc_custom_config = list.collect { id, state -> state.multiqc_custom_config }.unique()[0] + + ["merged", + [ + ids: ids, + strandedness: strandedness, + num_trimmed_reads: num_trimmed_reads, + passed_trimmed_reads: passed_trimmed_reads, + passed_mapping: passed_mapping, + percent_mapped: percent_mapped, + inferred_strand: inferred_strand, + passed_strand_check: passed_strand_check, + skip_align: skip_align, + skip_pseudo_align: skip_pseudo_align, + quant_results: quant_results.findAll { it != null }, + rsem_counts_gene: rsem_counts_gene.findAll { it != null }, + rsem_counts_transcripts: rsem_counts_transcripts.findAll { it != null }, + pseudo_quant_out_dir: pseudo_quant_out_dir.findAll { it != null }, + pseudo_salmon_quant_results: pseudo_salmon_quant_results.findAll { it != null }, + pseudo_kallisto_quant_results: pseudo_kallisto_quant_results.findAll { it != null }, + gtf: gtf, + gtf_extra_attributes: gtf_extra_attributes, + gtf_group_features: gtf_group_features, + pca_header_multiqc: pca_header_multiqc, + clustering_header_multiqc: clustering_header_multiqc, + aligner: aligner, + pseudo_aligner: pseudo_aligner, + deseq2_vst: deseq2_vst, + extra_deseq2_args: extra_deseq2_args, + extra_deseq2_args2: extra_deseq2_args2, + skip_deseq2_qc: skip_deseq2_qc, + fastqc_zip: fastqc_zip_1 + fastqc_zip_2, + trim_zip: trim_zip_1 + trim_zip_2, + trim_log: trim_log_1 + trim_log_2, + sortmerna_multiqc: sortmerna_multiqc, + star_multiqc: star_multiqc, + genome_bam_stats: genome_bam_stats, + genome_bam_flagstat: genome_bam_flagstat, + genome_bam_idxstats: genome_bam_idxstats, + markduplicates_multiqc: markduplicates_multiqc, + salmon_multiqc: salmon_multiqc, + rsem_multiqc: rsem_multiqc, + pseudo_multiqc: pseudo_multiqc, + featurecounts_multiqc: featurecounts_multiqc, + featurecounts_rrna_multiqc: featurecounts_rrna_multiqc, + preseq_output: preseq_output, + // qualimap_output_dir: qualimap_output_dir, + dupradar_output_dup_intercept_mqc: dupradar_output_dup_intercept_mqc, + dupradar_output_duprate_exp_denscurve_mqc: dupradar_output_duprate_exp_denscurve_mqc, + bamstat_output: bamstat_output, + inner_dist_output_freq: inner_dist_output_freq, + inferexperiment_multiqc: inferexperiment_multiqc, + junction_annotation_output_log: junction_annotation_output_log, + junction_saturation_output_plot_r: junction_saturation_output_plot_r, + read_distribution_output: read_distribution_output, + read_duplication_output_duplication_rate_mapping: read_duplication_output_duplication_rate_mapping, + tin_output_summary: tin_output_summary, + multiqc_custom_config: multiqc_custom_config + ] + ] + } + + // Merge quantification results of alignment + | merge_quant_results.run ( + runIf: { id, state -> !state.skip_align && state.aligner == 'star_salmon' }, + fromState: [ + "salmon_quant_results": "quant_results", + "gtf": "gtf", + "gtf_extra_attributes": "gtf_extra_attributes", + "gtf_group_features": "gtf_group_features" + ], + args: [ quant_type: "salmon"], + toState: [ + "tpm_gene": "tpm_gene", + "counts_gene": "counts_gene", + "counts_gene_length_scaled": "counts_gene_length_scaled", + "counts_gene_scaled": "counts_gene_scaled", + "tpm_transcript": "tpm_transcript", + "counts_transcript": "counts_transcript", + "lengths_gene": "lengths_gene", + "lengths_transcript": "lengths_transcript", + "quant_merged_summarizedexperiment": "quant_merged_summarizedexperiment" + ], + key: "merge_quant_results", + directives: [ label: [ "midmem", "midcpu" ] ] + ) + + | rsem_merge_counts.run ( + runIf: { id, state -> state.aligner == 'star_rsem' }, + fromState: [ + "counts_gene": "rsem_counts_gene", + "counts_transcripts": "rsem_counts_transcripts" + ], + toState: [ + "tpm_gene": "merged_gene_tpm", + "counts_gene": "merged_gene_counts", + "tpm_transcript": "merged_transcript_tpm", + "counts_transcript": "merged_transcript_counts" + ], + directives: [ label: [ "midmem", "midcpu" ] ] + ) + + | deseq2_qc.run ( + runIf: { id, state -> !state.skip_qc && !state.skip_deseq2_qc && !state.skip_align }, + fromState: { id, state -> + def counts = (state.aligner == "star_rsem") ? state.counts_gene : state.counts_gene_length_scaled + [ + counts: counts, + vst: state.deseq2_vst, + label: state.aligner + ] + }, + args: [count_col: 3, id_col: 1, outprefix: "deseq2"], + toState: [ + "deseq2_output": "outdir", + "deseq2_pca_multiqc": "pca_multiqc", + "deseq2_dists_multiqc": "dists_multiqc" + ], + key: "deseq2_qc_align_quant", + directives: [ label: [ "midmem", "midcpu" ] ] + ) + + // Merge quantification results of pseudo alignment + | merge_quant_results.run ( + runIf: { id, state -> !state.skip_pseudo_align }, + fromState: [ + "salmon_quant_results": "pseudo_salmon_quant_results", + "kallisto_quant_results": "pseudo_kallisto_quant_results", + "gtf": "gtf", + "gtf_extra_attributes": "gtf_extra_attributes", + "gtf_group_features": "gtf_group_features", + "quant_type": "pseudo_aligner" + ], + toState: [ + "pseudo_tpm_gene": "tpm_gene", + "pseudo_counts_gene": "counts_gene", + "pseudo_counts_gene_length_scaled": "counts_gene_length_scaled", + "pseudo_counts_gene_scaled": "counts_gene_scaled", + "pseudo_tpm_transcript": "tpm_transcript", + "pseudo_counts_transcript": "counts_transcript", + "pseudo_lengths_gene": "lengths_gene", + "pseudo_lengths_transcript": "lengths_transcript", + "pseudo_quant_merged_summarizedexperiment": "quant_merged_summarizedexperiment" + ], + key: "merge_pseudo_quant_results", + directives: [ label: [ "midmem", "midcpu" ] ] + ) + + | deseq2_qc.run ( + runIf: { id, state -> !state.skip_qc && !state.skip_deseq2_qc && !state.skip_pseudo_align }, + fromState: [ + "counts": "pseudo_counts_gene_length_scaled", + "vst": "deseq2_vst", + "label": "pseudo_aligner" + ], + args: [count_col: 3, id_col: 1, outprefix: "deseq2"], + toState: [ + "deseq2_output_pseudo": "outdir", + "deseq2_pca_multiqc_pseudo": "pca_multiqc", + "deseq2_dists_multiqc_pseudo": "dists_multiqc" + ], + key: "deseq2_qc_pseuso_align_quant", + directives: [ label: [ "midmem", "midcpu" ] ] + ) + + // Get list of samples that failed trimming, mapping, and strand check for MultiQC report + | map { id, state -> + def fail_trimming_header = ["Sample", "Reads after trimming"] + def fail_trimming_multiqc = "" + def star_mapping_header = ["Sample", "STAR uniquely mapped reads (%)"] + def fail_mapping_multiqc = "" + def strand_check_header = ["Sample", "Provided strandedness", "Inferred strandedness", "Sense (%)", "Antisense (%)", "Undetermined (%)"] + def fail_strand_multiqc = "" + if (state.ids.size() > 0) { + fail_trimming_multiqc += "\${fail_trimming_header.join('\\t')}\\n" + fail_mapping_multiqc += "\${star_mapping_header.join('\\t')}\\n" + fail_strand_multiqc += "\${strand_check_header.join('\\t')}\\n" + for (i=0; i !state.skip_qc && !state.skip_biotype_qc && state.biotype && state.biotype_in_gtf && !state.skip_align }, - fromState: [ - "paired": "paired", - "strand": "strand", - "annotation": "gtf", - "input": "genome_bam", - "attribute_type": "attribute_type", - "feature_type": "featurecounts_feature_type", - "count_read_pairs": "paired" - ], - toState: [ - "featurecounts": "counts", - "featurecounts_summary": "summary" - ], - args: [ - both_aligned: true, - same_strand: true - ] - ) - - | multiqc_custom_biotype.run ( - runIf: { id, state -> !state.skip_qc && !state.skip_biotype_qc && state.biotype && state.featurecounts && !state.skip_align }, - fromState: [ - "id": "id", - "biocounts": "featurecounts", - "biotypes_header": "biotypes_header" - ], - toState: [ - "featurecounts_multiqc": "featurecounts_multiqc", - "featurecounts_rrna_multiqc": "featurecounts_rrna_multiqc" - ] - ) - - | preseq_lcextrap.run ( - runIf: { id, state -> !state.skip_qc && !state.skip_preseq && !state.skip_align }, - fromState: [ - "paired": "paired", - "input": "genome_bam", - "extra_preseq_args": "extra_preseq_args" - ], - toState: [ "preseq_output": "output" ] - ) - - | rseqc_bamstat.run ( - runIf: { id, state -> !state.skip_qc && !state.skip_rseqc && "bam_stat" in state.rseqc_modules && !state.skip_align }, - fromState: [ - "input_file": "genome_bam", - "mapq": "map_qual" - ], - toState: [ "bamstat_output": "output" ] - ) - | rseqc_inferexperiment.run( - runIf: { id, state -> !state.skip_qc && !state.skip_rseqc && "infer_experiment" in state.rseqc_modules && !state.skip_align }, - fromState: [ - "input_file": "genome_bam", - "refgene": "gene_bed", - "sample_size": "sample_size", - "mapq": "map_qual" - ], - toState: [ "strandedness_output": "output" ] - ) - // Get predicted strandedness from the RSeQC infer_experiment.py output - | map { id, state -> - def inferred_strand = getInferexperimentStrandedness(state.strandedness_output, 30) - def passed_strand_check = (state.strandedness != inferred_strand[0]) ? false : true - [ id, state + [ inferred_strand: inferred_strand, passed_strand_check: passed_strand_check ] ] + if (!state.passed_mapping[i]) { + tsv_data = [state.ids[i], state.percent_mapped[i]].join('\\t') + fail_mapping_multiqc += tsv_data.join('\\n') + } + if (!state.passed_strand_check[i]) { + tsv_data = ([state.ids[i], state.strandedness[i]] + state.inferred_strand[i]).join('\\t') + fail_strand_multiqc += tsv_data.join('\\n') + } + } } - | rseqc_inner_distance.run( - runIf: { id, state -> !state.skip_qc && !state.skip_rseqc && state.paired && "inner_distance" in state.rseqc_modules && !state.skip_align }, - key: "inner_distance", - fromState: [ - "input_file": "genome_bam", - "refgene": "gene_bed", - "sample_size": "sample_size", - "mapq": "map_qual", - "lower_bound": "lower_bound_size", - "upper_bound": "upper_bound_size", - "step": "step_size" - ], - toState: [ - "inner_dist_output_stats": "output_stats", - "inner_dist_output_dist": "output_dist", - "inner_dist_output_freq": "output_freq", - "inner_dist_output_plot": "output_plot", - "inner_dist_output_plot_r": "output_plot_r" - ] - ) - | rseqc_junctionannotation.run( - runIf: { id, state -> !state.skip_qc && !state.skip_rseqc && "junction_annotation" in state.rseqc_modules && !state.skip_align }, - fromState: [ - "input": "genome_bam", - "refgene": "gene_bed", - "map_qual": "map_qual", - "min_intron": "min_intron" - ], - toState: [ - "junction_annotation_output_log": "output_log", - "junction_annotation_output_plot_r": "output_plot_r", - "junction_annotation_output_junction_bed": "output_junction_bed", - "junction_annotation_output_junction_interact": "output_junction_interact", - "junction_annotation_output_junction_sheet": "output_junction_sheet", - "junction_annotation_output_splice_events_plot": "output_splice_events_plot", - "junction_annotation_output_splice_junctions_plot": "output_splice_junctions_plot" - ] - ) - | rseqc_junctionsaturation.run( - runIf: { id, state -> !state.skip_qc && !state.skip_rseqc && "junction_saturation" in state.rseqc_modules && !state.skip_align }, - fromState: [ - "input": "genome_bam", - "refgene": "gene_bed", - "sampling_percentile_lower_bound": "sampling_percentile_lower_bound", - "sampling_percentile_upper_bound": "sampling_percentile_upper_bound", - "sampling_percentile_step": "sampling_percentile_step", - "min_intron": "min_intron", - "min_splice_read": "min_splice_read", - "map_qual": "map_qual" - ], - toState: [ - "junction_saturation_output_plot_r": "output_plot_r", - "junction_saturation_output_plot": "output_plot" - ] - ) - | rseqc_readdistribution.run( - runIf: { id, state -> !state.skip_qc && !state.skip_rseqc && "read_distribution" in state.rseqc_modules && !state.skip_align }, - fromState: [ - "input": "genome_bam", - "refgene": "gene_bed", - ], - toState: [ "read_distribution_output": "output" ] - ) - | rseqc_readduplication.run( - runIf: { id, state -> !state.skip_qc && !state.skip_rseqc && "read_duplication" in state.rseqc_modules && !state.skip_align }, - fromState: [ - "input": "genome_bam", - "read_count_upper_limit": "read_count_upper_limit", - "map_qual": "map_qual" - ], - toState: [ - "read_duplication_output_duplication_rate_plot_r": "output_duplication_rate_plot_r", - "read_duplication_output_duplication_rate_plot": "output_duplication_rate_plot", - "read_duplication_output_duplication_rate_mapping": "output_duplication_rate_mapping", - "read_duplication_output_duplication_rate_sequence": "output_duplication_rate_sequence" - ] - ) - | rseqc_tin.run( - runIf: { id, state -> !state.skip_qc && !state.skip_rseqc && "tin" in state.rseqc_modules && !state.skip_align }, - fromState: [ - "bam_input": "genome_bam", - "bai_input": "genome_bam_index", - "refgene": "gene_bed", - "minimum_coverage": "minimum_coverage", - "sample_size": "tin_sample_size", - "subtract_background": "subtract_background" - ], - toState: [ - "tin_output_summary": "output_tin_summary", - "tin_output_metrics": "output_tin" - ] - ) - | dupradar.run( - runIf: { id, state -> !state.skip_qc && !state.skip_dupradar && !state.skip_align }, - fromState: [ - "id": "id", - "input": "genome_bam", - "gtf_annotation": "gtf", - "paired": "paired", - "strandedness": "strandedness" - ], - toState: [ - "dupradar_output_dupmatrix": "output_dupmatrix", - "dupradar_output_dup_intercept_mqc": "output_dup_intercept_mqc", - "dupradar_output_duprate_exp_boxplot": "output_duprate_exp_boxplot", - "dupradar_output_duprate_exp_densplot": "output_duprate_exp_densplot", - "dupradar_output_duprate_exp_denscurve_mqc": "output_duprate_exp_denscurve_mqc", - "dupradar_output_expression_histogram": "output_expression_histogram", - "dupradar_output_intercept_slope": "output_intercept_slope" - ] - ) + [ id, state + [fail_trimming_multiqc: fail_trimming_multiqc, fail_mapping_multiqc: fail_mapping_multiqc, fail_strand_multiqc: fail_strand_multiqc] ] + } - // TODO: Add outdir as an output argument to the qualimap module on biobox. - // Qualimap ouputs a few more raw data files to outdir but since the module is using a temporary directory as output dir these files are lost. - | qualimap_rnaseq.run( - runIf: { id, state -> !state.skip_qc && !state.skip_qualimap && !state.skip_align }, - fromState: [ - "bam": "genome_bam", - "gtf": "gtf", - "num_pr_bases": "pr_bases", - "num_tr_bias": "tr_bias", - "algorithm": "algorithm", - "sequencing_protocol": "sequencing_protocol", - "sorted": "sorted", - "java_memory_size": "java_memory_size", - ], - toState: [ - "qualimap_report": "report", - "qualimap_qc_report": "qc_report", - "qualimap_counts": "counts" - ] - ) + | map { id, state -> + state.each { key, value -> + if (value instanceof ArrayList) { + value.removeAll { it == null } + } + } + mod_state = state.findAll { key, value -> value != null } + [ id, mod_state ] + } - merged_ch = qc_ch - | toSortedList - | map { list -> - def ids = list.collect { id, state -> id } - def strandedness = list.collect { id, state -> state.strandedness } - def num_trimmed_reads = list.collect { id, state -> state.num_trimmed_reads } - def passed_trimmed_reads = list.collect { id, state -> state.passed_trimmed_reads } - def passed_mapping = list.collect { id, state -> state.passed_mapping } - def percent_mapped = list.collect { id, state -> state.percent_mapped } - def inferred_strand = list.collect { id, state -> state.inferred_strand } - def passed_strand_check = list.collect { id, state -> state.passed_strand_check } - def gtf = list.collect { id, state -> state.gtf }.unique()[0] - def gtf_extra_attributes = list.collect { id, state -> state.gtf_extra_attributes }.unique()[0] - def gtf_group_features = list.collect { id, state -> state.gtf_group_features }.unique()[0] - def pca_header_multiqc = list.collect { id, state -> state.pca_header_multiqc }.unique()[0] - def clustering_header_multiqc = list.collect { id, state -> state.clustering_header_multiqc }.unique()[0] - def aligner = list.collect { id, state -> state.aligner }.unique()[0] - def pseudo_aligner = list.collect { id, state -> state.pseudo_aligner }.unique()[0] - def deseq2_vst = list.collect { id, state -> state.deseq2_vst }.unique()[0] - def extra_deseq2_args = list.collect { id, state -> state.extra_deseq2_args }.unique()[0] - def extra_deseq2_args2 = list.collect { id, state -> state.extra_deseq2_args2 }.unique()[0] - def skip_deseq2_qc = list.collect { id, state -> state.skip_deseq2_qc }.unique()[0] - def skip_qc = list.collect { id, state -> state.skip_qc }.unique()[0] - def skip_align = list.collect { id, state -> state.skip_align }.unique()[0] - def skip_pseudo_align = list.collect { id, state -> state.skip_pseudo_align }.unique()[0] - def quant_results = list.collect { id, state -> - (state.quant_results_file instanceof java.nio.file.Path && state.quant_results_file.exists()) ? - state.quant_results_file : - null } - def rsem_counts_gene = list.collect { id, state -> - (state.rsem_counts_gene instanceof java.nio.file.Path && state.rsem_counts_gene.exists()) ? - state.rsem_counts_gene : - null } - def rsem_counts_transcripts = list.collect { id, state -> - (state.rsem_counts_transcripts instanceof java.nio.file.Path && state.rsem_counts_transcripts.exists()) ? - state.rsem_counts_transcripts : - null } - def pseudo_quant_out_dir = list.collect { id, state -> - (state.pseudo_quant_out_dir instanceof java.nio.file.Path && state.pseudo_quant_out_dir.exists()) ? - state.pseudo_quant_out_dir : - null } - def pseudo_salmon_quant_results = list.collect { id, state -> - (state.pseudo_salmon_quant_results_file instanceof java.nio.file.Path && state.pseudo_salmon_quant_results_file.exists()) ? - state.pseudo_salmon_quant_results_file : - null } - def pseudo_kallisto_quant_results = list.collect { id, state -> - (state.pseudo_kallisto_quant_results_file instanceof java.nio.file.Path && state.pseudo_kallisto_quant_results_file.exists()) ? - state.pseudo_kallisto_quant_results_file : - null } - def fastqc_zip_1 = list.collect { id, state -> - (state.fastqc_zip_1 instanceof java.nio.file.Path && state.fastqc_zip_1.exists()) ? - state.fastqc_zip_1 : - null } - def fastqc_zip_2 = list.collect { id, state -> - (state.fastqc_zip_2 instanceof java.nio.file.Path && state.fastqc_zip_2.exists()) ? - state.fastqc_zip_2 : - null } - def trim_zip_1 = list.collect { id, state -> - (state.trim_zip_1 instanceof java.nio.file.Path && state.trim_zip_1.exists()) ? - state.trim_zip_1 : - null } - def trim_zip_2 = list.collect { id, state -> - (state.trim_zip_2 instanceof java.nio.file.Path && state.trim_zip_2.exists()) ? - state.trim_zip_2 : - null } - def trim_log_1 = list.collect { id, state -> - (state.trim_log_1 instanceof java.nio.file.Path && state.trim_log_1.exists()) ? - state.trim_log_1 : - null } - def trim_log_2 = list.collect { id, state -> - (state.trim_log_2 instanceof java.nio.file.Path && state.trim_log_2.exists()) ? - state.trim_log_2 : - null } - def sortmerna_multiqc = list.collect { id, state -> - (state.sortmerna_multiqc instanceof java.nio.file.Path && state.sortmerna_multiqc.exists()) ? - state.sortmerna_multiqc : - null } - def star_multiqc = list.collect { id, state -> - (state.star_multiqc instanceof java.nio.file.Path && state.star_multiqc.exists()) ? - state.star_multiqc : - null } - def genome_bam_stats = list.collect { id, state -> - (state.genome_bam_stats instanceof java.nio.file.Path && state.genome_bam_stats.exists()) ? - state.genome_bam_stats : - null } - def genome_bam_flagstat = list.collect { id, state -> - (state.genome_bam_flagstat instanceof java.nio.file.Path && state.genome_bam_flagstat.exists()) ? - state.genome_bam_flagstat : - null } - def genome_bam_idxstats = list.collect { id, state -> - (state.genome_bam_idxstats instanceof java.nio.file.Path && state.genome_bam_idxstats.exists()) ? - state.genome_bam_idxstats : - null } - def markduplicates_multiqc = list.collect { id, state -> - (state.markduplicates_multiqc instanceof java.nio.file.Path && state.markduplicates_multiqc.exists()) ? - state.markduplicates_multiqc : - null } - def salmon_multiqc = list.collect { id, state -> - (state.salmon_multiqc instanceof java.nio.file.Path && state.salmon_multiqc.exists()) ? - state.salmon_multiqc : - null } - def rsem_multiqc = list.collect { id, state -> - (state.rsem_multiqc instanceof java.nio.file.Path && state.rsem_multiqc.exists()) ? - state.rsem_multiqc : - null } - def pseudo_multiqc = list.collect { id, state -> - (state.pseudo_multiqc instanceof java.nio.file.Path && state.pseudo_multiqc.exists()) ? - state.pseudo_multiqc : - null } - def featurecounts_multiqc = list.collect { id, state -> - (state.featurecounts_multiqc instanceof java.nio.file.Path && state.featurecounts_multiqc.exists()) ? - state.featurecounts_multiqc : - null } - def featurecounts_rrna_multiqc = list.collect { id, state -> - (state.featurecounts_rrna_multiqc instanceof java.nio.file.Path && state.featurecounts_rrna_multiqc.exists()) ? - state.featurecounts_rrna_multiqc : - null } - def preseq_output = list.collect { id, state -> - (state.preseq_output instanceof java.nio.file.Path && state.preseq_output.exists()) ? - state.preseq_output : - null } - // def qualimap_output_dir = list.collect { id, state -> - // (state.qualimap_output_dir instanceof java.nio.file.Path && state.qualimap_output_dir.exists()) ? - // state.qualimap_output_dir : - // null } - def dupradar_output_dup_intercept_mqc = list.collect { id, state -> - (state.dupradar_output_dup_intercept_mqc instanceof java.nio.file.Path && state.dupradar_output_dup_intercept_mqc.exists()) ? - state.dupradar_output_dup_intercept_mqc : - null } - def dupradar_output_duprate_exp_denscurve_mqc = list.collect { id, state -> - (state.dupradar_output_duprate_exp_denscurve_mqc instanceof java.nio.file.Path && state.dupradar_output_duprate_exp_denscurve_mqc.exists()) ? - state.dupradar_output_duprate_exp_denscurve_mqc : - null } - def bamstat_output = list.collect { id, state -> - (state.bamstat_output instanceof java.nio.file.Path && state.bamstat_output.exists()) ? - state.bamstat_output : - null } - def inferexperiment_multiqc = list.collect { id, state -> - (state.strandedness_output instanceof java.nio.file.Path && state.strandedness_output.exists()) ? - state.strandedness_output : - null } - def inner_dist_output_freq = list.collect { id, state -> - (state.inner_dist_output_freq instanceof java.nio.file.Path && state.inner_dist_output_freq.exists()) ? - state.inner_dist_output_freq : - null } - def junction_annotation_output_log = list.collect { id, state -> - (state.junction_annotation_output_log instanceof java.nio.file.Path && state.junction_annotation_output_log.exists()) ? - state.junction_annotation_output_log : - null } - def junction_saturation_output_plot_r = list.collect { id, state -> - (state.junction_saturation_output_plot_r instanceof java.nio.file.Path && state.junction_saturation_output_plot_r.exists()) ? - state.junction_saturation_output_plot_r : - null } - def read_distribution_output = list.collect { id, state -> - (state.read_distribution_output instanceof java.nio.file.Path && state.read_distribution_output.exists()) ? - state.read_distribution_output : - null } - def read_duplication_output_duplication_rate_mapping = list.collect { id, state -> - (state.read_duplication_output_duplication_rate_mapping instanceof java.nio.file.Path && state.read_duplication_output_duplication_rate_mapping.exists()) ? - state.read_duplication_output_duplication_rate_mapping : - null } - def tin_output_summary = list.collect { id, state -> - (state.tin_output_summary instanceof java.nio.file.Path && state.tin_output_summary.exists()) ? - state.tin_output_summary : - null } - def multiqc_custom_config = list.collect { id, state -> state.multiqc_custom_config }.unique()[0] - ["merged", [ - ids: ids, - strandedness: strandedness, - num_trimmed_reads: num_trimmed_reads, - passed_trimmed_reads: passed_trimmed_reads, - passed_mapping: passed_mapping, - percent_mapped: percent_mapped, - inferred_strand: inferred_strand, - passed_strand_check: passed_strand_check, - skip_align: skip_align, - skip_pseudo_align: skip_pseudo_align, - quant_results: quant_results.findAll { it != null }, - rsem_counts_gene: rsem_counts_gene.findAll { it != null }, - rsem_counts_transcripts: rsem_counts_transcripts.findAll { it != null }, - pseudo_quant_out_dir: pseudo_quant_out_dir.findAll { it != null }, - pseudo_salmon_quant_results: pseudo_salmon_quant_results.findAll { it != null }, - pseudo_kallisto_quant_results: pseudo_kallisto_quant_results.findAll { it != null }, - gtf: gtf, - gtf_extra_attributes: gtf_extra_attributes, - gtf_group_features: gtf_group_features, - pca_header_multiqc: pca_header_multiqc, - clustering_header_multiqc: clustering_header_multiqc, - aligner: aligner, - pseudo_aligner: pseudo_aligner, - deseq2_vst: deseq2_vst, - extra_deseq2_args: extra_deseq2_args, - extra_deseq2_args2: extra_deseq2_args2, - skip_deseq2_qc: skip_deseq2_qc, - fastqc_zip: fastqc_zip_1 + fastqc_zip_2, - trim_zip: trim_zip_1 + trim_zip_2, - trim_log: trim_log_1 + trim_log_2, - sortmerna_multiqc: sortmerna_multiqc, - star_multiqc: star_multiqc, - genome_bam_stats: genome_bam_stats, - genome_bam_flagstat: genome_bam_flagstat, - genome_bam_idxstats: genome_bam_idxstats, - markduplicates_multiqc: markduplicates_multiqc, - salmon_multiqc: salmon_multiqc, - rsem_multiqc: rsem_multiqc, - pseudo_multiqc: pseudo_multiqc, - featurecounts_multiqc: featurecounts_multiqc, - featurecounts_rrna_multiqc: featurecounts_rrna_multiqc, - preseq_output: preseq_output, - // qualimap_output_dir: qualimap_output_dir, - dupradar_output_dup_intercept_mqc: dupradar_output_dup_intercept_mqc, - dupradar_output_duprate_exp_denscurve_mqc: dupradar_output_duprate_exp_denscurve_mqc, - bamstat_output: bamstat_output, - inner_dist_output_freq: inner_dist_output_freq, - inferexperiment_multiqc: inferexperiment_multiqc, - junction_annotation_output_log: junction_annotation_output_log, - junction_saturation_output_plot_r: junction_saturation_output_plot_r, - read_distribution_output: read_distribution_output, - read_duplication_output_duplication_rate_mapping: read_duplication_output_duplication_rate_mapping, - tin_output_summary: tin_output_summary, - multiqc_custom_config: multiqc_custom_config - ] ] - } + | prepare_multiqc_input.run( + runIf: { id, state -> !state.skip_qc && !state.skip_multiqc }, + fromState: [ + "fail_trimming_multiqc": "fail_trimming_multiqc", + "fail_mapping_multiqc": "fail_mapping_multiqc", + "fail_strand_multiqc": "fail_strand_multiqc", + "fastqc_raw_multiqc": "fastqc_zip", + "fastqc_trim_multiqc": "trim_zip", + "trim_log_multiqc": "trim_log", + "sortmerna_multiqc": "sortmerna_multiqc", + "star_multiqc": "star_multiqc", + "salmon_multiqc": "salmon_multiqc", + "rsem_multiqc": "rsem_multiqc", + "pseudo_multiqc": "pseudo_multiqc", + "samtools_stats": "genome_bam_stats", + "samtools_flagstat": "genome_bam_flagstat", + "samtools_idxstats": "genome_bam_idxstats", + "markduplicates_multiqc": "markduplicates_multiqc", + "featurecounts_multiqc": "featurecounts_multiqc", + "featurecounts_rrna_multiqc": "featurecounts_rrna_multiqc", + "aligner_pca_multiqc": "deseq2_pca_multiqc", + "aligner_clustering_multiqc": "deseq2_dists_multiqc", + "pseudo_aligner_pca_multiqc": "deseq2_pca_multiqc_pseudo", + "pseudo_aligner_clustering_multiqc": "deseq2_dists_multiqc_pseudo", + "preseq_multiqc": "preseq_output", + // "qualimap_multiqc": "qualimap_output_dir", + "dupradar_output_dup_intercept_mqc": "dupradar_output_dup_intercept_mqc", + "dupradar_output_duprate_exp_denscurve_mqc": "dupradar_output_duprate_exp_denscurve_mqc", + "bamstat_multiqc": "bamstat_output", + "inferexperiment_multiqc": "inferexperiment_multiqc", + "innerdistance_multiqc": "inner_dist_output_freq", + "junctionannotation_multiqc": "junction_annotation_output_log", + "junctionsaturation_multiqc": "junction_saturation_output_plot_r", + "readdistribution_multiqc": "read_distribution_output", + "readduplication_multiqc": "read_duplication_output_duplication_rate_mapping", + "tin_multiqc": "tin_output_summary", + "multiqc_config": "multiqc_custom_config" + ], + toState: [ "multiqc_input": "output" ], + directives: [ label: [ "midmem", "midcpu" ] ] + ) - // Merge quantification results of alignment - | merge_quant_results.run ( - runIf: { id, state -> !state.skip_align && state.aligner == 'star_salmon' }, - fromState: [ - "salmon_quant_results": "quant_results", - "gtf": "gtf", - "gtf_extra_attributes": "gtf_extra_attributes", - "gtf_group_features": "gtf_group_features" - ], - args: [ quant_type: "salmon"], - toState: [ - "tpm_gene": "tpm_gene", - "counts_gene": "counts_gene", - "counts_gene_length_scaled": "counts_gene_length_scaled", - "counts_gene_scaled": "counts_gene_scaled", - "tpm_transcript": "tpm_transcript", - "counts_transcript": "counts_transcript", - "lengths_gene": "lengths_gene", - "lengths_transcript": "lengths_transcript", - "quant_merged_summarizedexperiment": "quant_merged_summarizedexperiment" - ], - key: "merge_quant_results" - ) + | multiqc.run ( + runIf: { id, state -> !state.skip_qc && !state.skip_multiqc }, + fromState: [ + "title": "multiqc_title", + "input": "multiqc_input", + ], + args: [exclude_modules: "general_stats"], + toState: [ + "multiqc_report": "output_report", + "multiqc_data": "output_data", + "multiqc_plots": "output_plots" + ], + directives: [ label: [ "highmem", "highcpu" ] ] + ) - | rsem_merge_counts.run ( - runIf: { id, state -> state.aligner == 'star_rsem' }, - fromState: [ - "counts_gene": "rsem_counts_gene", - "counts_transcripts": "rsem_counts_transcripts" - ], - toState: [ - "tpm_gene": "merged_gene_tpm", - "counts_gene": "merged_gene_counts", - "tpm_transcript": "merged_transcript_tpm", - "counts_transcript": "merged_transcript_counts" - ] - ) + | map { id, state -> + [ + id, [ + tpm_gene: state.tpm_gene, + counts_gene: state.counts_gene, + counts_gene_length_scaled: state.counts_gene_length_scaled, + counts_gene_scaled: state.counts_gene_scaled, + tpm_transcript: state.tpm_transcript, + counts_transcript: state.counts_transcript, + quant_merged_summarizedexperiment: state.quant_merged_summarizedexperiment, + deseq2_output: state.deseq2_output, + pseudo_tpm_gene: state.pseudo_tpm_gene, + pseudo_counts_gene: state.pseudo_counts_gene, + pseudo_counts_gene_length_scaled: state.pseudo_counts_gene_length_scaled, + pseudo_counts_gene_scaled: state.pseudo_counts_gene_scaled, + pseudo_tpm_transcript: state.pseudo_tpm_transcript, + pseudo_counts_transcript: state.pseudo_counts_transcript, + pseudo_quant_merged_summarizedexperiment: state.pseudo_quant_merged_summarizedexperiment, + deseq2_output_pseudo: state.deseq2_output_pseudo, + multiqc_report: state.multiqc_report, + multiqc_data: state.multiqc_data, + multiqc_plots: state.multiqc_plots + ] + ] + } - | deseq2_qc.run ( - runIf: { id, state -> !state.skip_qc && !state.skip_deseq2_qc && !state.skip_align }, - fromState: { id, state -> - def counts = (state.aligner == "star_rsem") ? state.counts_gene : state.counts_gene_length_scaled - [ - counts: counts, - vst: state.deseq2_vst, - label: state.aligner - ] - }, - args: [count_col: 3, id_col: 1, outprefix: "deseq2"], - toState: [ - "deseq2_output": "outdir", - "deseq2_pca_multiqc": "pca_multiqc", - "deseq2_dists_multiqc": "dists_multiqc" - ], - key: "deseq2_qc_align_quant" - ) + | map { list -> list[1]} - // Merge quantification results of pseudo alignment - | merge_quant_results.run ( - runIf: { id, state -> !state.skip_pseudo_align }, - fromState: [ - "salmon_quant_results": "pseudo_salmon_quant_results", - "kallisto_quant_results": "pseudo_kallisto_quant_results", - "gtf": "gtf", - "gtf_extra_attributes": "gtf_extra_attributes", - "gtf_group_features": "gtf_group_features", - "quant_type": "pseudo_aligner" - ], - toState: [ - "pseudo_tpm_gene": "tpm_gene", - "pseudo_counts_gene": "counts_gene", - "pseudo_counts_gene_length_scaled": "counts_gene_length_scaled", - "pseudo_counts_gene_scaled": "counts_gene_scaled", - "pseudo_tpm_transcript": "tpm_transcript", - "pseudo_counts_transcript": "counts_transcript", - "pseudo_lengths_gene": "lengths_gene", - "pseudo_lengths_transcript": "lengths_transcript", - "pseudo_quant_merged_summarizedexperiment": "quant_merged_summarizedexperiment" - ], - key: "merge_pseudo_quant_results" - ) + output_ch = qc_ch - | deseq2_qc.run ( - runIf: { id, state -> !state.skip_qc && !state.skip_deseq2_qc && !state.skip_pseudo_align }, - fromState: [ - "counts": "pseudo_counts_gene_length_scaled", - "vst": "deseq2_vst", - "label": "pseudo_aligner" - ], - args: [count_col: 3, id_col: 1, outprefix: "deseq2"], - toState: [ - "deseq2_output_pseudo": "outdir", - "deseq2_pca_multiqc_pseudo": "pca_multiqc", - "deseq2_dists_multiqc_pseudo": "dists_multiqc" - ], - key: "deseq2_qc_pseuso_align_quant" - ) - - // Get list of samples that failed trimming, mapping, and strand check for MultiQC report - | map { id, state -> - def fail_trimming_header = ["Sample", "Reads after trimming"] - def fail_trimming_multiqc = "" - def star_mapping_header = ["Sample", "STAR uniquely mapped reads (%)"] - def fail_mapping_multiqc = "" - def strand_check_header = ["Sample", "Provided strandedness", "Inferred strandedness", "Sense (%)", "Antisense (%)", "Undetermined (%)"] - def fail_strand_multiqc = "" - if (state.ids.size() > 0) { - fail_trimming_multiqc += "\${fail_trimming_header.join('\\t')}\\n" - fail_mapping_multiqc += "\${star_mapping_header.join('\\t')}\\n" - fail_strand_multiqc += "\${strand_check_header.join('\\t')}\\n" - for (i=0; i - state.each { key, value -> - if (value instanceof ArrayList) { - value.removeAll { it == null } - } - } - mod_state = state.findAll { key, value -> value != null } - [ id, mod_state ] - } + | map { list -> [list[0], list[1] + list[2]] } - | prepare_multiqc_input.run( - runIf: { id, state -> !state.skip_qc && !state.skip_multiqc }, - fromState: [ - "fail_trimming_multiqc": "fail_trimming_multiqc", - "fail_mapping_multiqc": "fail_mapping_multiqc", - "fail_strand_multiqc": "fail_strand_multiqc", - "fastqc_raw_multiqc": "fastqc_zip", - "fastqc_trim_multiqc": "trim_zip", - "trim_log_multiqc": "trim_log", - "sortmerna_multiqc": "sortmerna_multiqc", - "star_multiqc": "star_multiqc", - "salmon_multiqc": "salmon_multiqc", - "rsem_multiqc": "rsem_multiqc", - "pseudo_multiqc": "pseudo_multiqc", - "samtools_stats": "genome_bam_stats", - "samtools_flagstat": "genome_bam_flagstat", - "samtools_idxstats": "genome_bam_idxstats", - "markduplicates_multiqc": "markduplicates_multiqc", - "featurecounts_multiqc": "featurecounts_multiqc", - "featurecounts_rrna_multiqc": "featurecounts_rrna_multiqc", - "aligner_pca_multiqc": "deseq2_pca_multiqc", - "aligner_clustering_multiqc": "deseq2_dists_multiqc", - "pseudo_aligner_pca_multiqc": "deseq2_pca_multiqc_pseudo", - "pseudo_aligner_clustering_multiqc": "deseq2_dists_multiqc_pseudo", - "preseq_multiqc": "preseq_output", - // "qualimap_multiqc": "qualimap_output_dir", - "dupradar_output_dup_intercept_mqc": "dupradar_output_dup_intercept_mqc", - "dupradar_output_duprate_exp_denscurve_mqc": "dupradar_output_duprate_exp_denscurve_mqc", - "bamstat_multiqc": "bamstat_output", - "inferexperiment_multiqc": "inferexperiment_multiqc", - "innerdistance_multiqc": "inner_dist_output_freq", - "junctionannotation_multiqc": "junction_annotation_output_log", - "junctionsaturation_multiqc": "junction_saturation_output_plot_r", - "readdistribution_multiqc": "read_distribution_output", - "readduplication_multiqc": "read_duplication_output_duplication_rate_mapping", - "tin_multiqc": "tin_output_summary", - "multiqc_config": "multiqc_custom_config" - ], - toState: [ "multiqc_input": "output" ] - ) + | map { id, state -> + def mod_state = state.findAll { key, value -> value instanceof java.nio.file.Path && value.exists() } + [ id, mod_state ] + } - | multiqc.run ( - runIf: { id, state -> !state.skip_qc && !state.skip_multiqc }, - fromState: [ - "title": "multiqc_title", - "input": "multiqc_input", - ], - args: [exclude_modules: "general_stats"], - toState: [ - "multiqc_report": "output_report", - "multiqc_data": "output_data", - "multiqc_plots": "output_plots" - ] - ) + | setState ( + [ + "preseq_output": "preseq_output", + "bamstat_output": "bamstat_output", + "strandedness_output": "strandedness_output", + "inner_dist_output_stats": "inner_dist_output_stats", + "inner_dist_output_dist": "inner_dist_output_dist", + "inner_dist_output_freq": "inner_dist_output_freq", + "inner_dist_output_plot": "inner_dist_output_plot", + "inner_dist_output_plot_r": "inner_dist_output_plot_r", + "junction_annotation_output_log": "junction_annotation_output_log", + "junction_annotation_output_plot_r": "junction_annotation_output_plot_r", + "junction_annotation_output_junction_bed": "junction_annotation_output_junction_bed", + "junction_annotation_output_junction_interact": "junction_annotation_output_junction_interact", + "junction_annotation_output_junction_sheet": "junction_annotation_output_junction_sheet", + "junction_annotation_output_splice_events_plot": "junction_annotation_output_splice_events_plot", + "junction_annotation_output_splice_junctions_plot": "junction_annotation_output_splice_junctions_plot", + "junction_saturation_output_plot_r": "junction_saturation_output_plot_r", + "junction_saturation_output_plot": "junction_saturation_output_plot", + "read_distribution_output": "read_distribution_output", + "read_duplication_output_duplication_rate_plot_r": "read_duplication_output_duplication_rate_plot_r", + "read_duplication_output_duplication_rate_plot": "read_duplication_output_duplication_rate_plot", + "read_duplication_output_duplication_rate_mapping": "read_duplication_output_duplication_rate_mapping", + "read_duplication_output_duplication_rate_sequence": "read_duplication_output_duplication_rate_sequence", + "tin_output_summary": "tin_output_summary", + "tin_output_metrics": "tin_output_metrics", + "dupradar_output_dupmatrix": "dupradar_output_dupmatrix", + "dupradar_output_dup_intercept_mqc": "dupradar_output_dup_intercept_mqc", + "dupradar_output_duprate_exp_boxplot": "dupradar_output_duprate_exp_boxplot", + "dupradar_output_duprate_exp_densplot": "dupradar_output_duprate_exp_densplot", + "dupradar_output_duprate_exp_denscurve_mqc": "dupradar_output_duprate_exp_denscurve_mqc", + "dupradar_output_expression_histogram": "dupradar_output_expression_histogram", + "dupradar_output_intercept_slope": "dupradar_output_intercept_slope", + "qualimap_report": "qualimap_report", + "qualimap_qc_report": "qualimap_qc_report", + "qualimap_counts": "qualimap_counts", + "featurecounts": "featurecounts", + "featurecounts_summary": "featurecounts_summary", + "featurecounts_multiqc": "featurecounts_multiqc", + "featurecounts_rrna_multiqc": "featurecounts_rrna_multiqc", + "tpm_gene": "tpm_gene", + "counts_gene": "counts_gene", + "counts_gene_length_scaled": "counts_gene_length_scaled", + "counts_gene_scaled": "counts_gene_scaled", + "tpm_transcript": "tpm_transcript", + "counts_transcript": "counts_transcript", + "lengths_gene": "lengths_gene", + "lengths_transcript": "lengths_transcript", + "quant_merged_summarizedexperiment": "quant_merged_summarizedexperiment", + "deseq2_output": "deseq2_output", + "pseudo_tpm_gene": "pseudo_tpm_gene", + "pseudo_counts_gene": "pseudo_counts_gene", + "pseudo_counts_gene_length_scaled": "pseudo_counts_gene_length_scaled", + "pseudo_counts_gene_scaled": "pseudo_counts_gene_scaled", + "pseudo_tpm_transcript": "pseudo_tpm_transcript", + "pseudo_counts_transcript": "pseudo_counts_transcript", + "pseudo_lengths_gene": "pseudo_lengths_gene", + "pseudo_lengths_transcript": "pseudo_lengths_transcript", + "pseudo_quant_merged_summarizedexperiment": "pseudo_quant_merged_summarizedexperiment", + "deseq2_output_pseudo": "deseq2_output_pseudo", + "multiqc_report": "multiqc_report", + "multiqc_data": "multiqc_data", + "multiqc_plots": "multiqc_plots" + ] + ) - | map { id, state -> - [ id, [ - tpm_gene: state.tpm_gene, - counts_gene: state.counts_gene, - counts_gene_length_scaled: state.counts_gene_length_scaled, - counts_gene_scaled: state.counts_gene_scaled, - tpm_transcript: state.tpm_transcript, - counts_transcript: state.counts_transcript, - quant_merged_summarizedexperiment: state.quant_merged_summarizedexperiment, - deseq2_output: state.deseq2_output, - pseudo_tpm_gene: state.pseudo_tpm_gene, - pseudo_counts_gene: state.pseudo_counts_gene, - pseudo_counts_gene_length_scaled: state.pseudo_counts_gene_length_scaled, - pseudo_counts_gene_scaled: state.pseudo_counts_gene_scaled, - pseudo_tpm_transcript: state.pseudo_tpm_transcript, - pseudo_counts_transcript: state.pseudo_counts_transcript, - pseudo_quant_merged_summarizedexperiment: state.pseudo_quant_merged_summarizedexperiment, - deseq2_output_pseudo: state.deseq2_output_pseudo, - multiqc_report: state.multiqc_report, - multiqc_data: state.multiqc_data, - multiqc_plots: state.multiqc_plots - ] ] - } - - | map { list -> list[1]} - - output_ch = qc_ch - - | combine(merged_ch) - - | map { list -> [list[0], list[1] + list[2]] } - - | map { id, state -> - def mod_state = state.findAll { key, value -> value instanceof java.nio.file.Path && value.exists() } - [ id, mod_state ] - } - - | setState ( - [ - "preseq_output": "preseq_output", - "bamstat_output": "bamstat_output", - "strandedness_output": "strandedness_output", - "inner_dist_output_stats": "inner_dist_output_stats", - "inner_dist_output_dist": "inner_dist_output_dist", - "inner_dist_output_freq": "inner_dist_output_freq", - "inner_dist_output_plot": "inner_dist_output_plot", - "inner_dist_output_plot_r": "inner_dist_output_plot_r", - "junction_annotation_output_log": "junction_annotation_output_log", - "junction_annotation_output_plot_r": "junction_annotation_output_plot_r", - "junction_annotation_output_junction_bed": "junction_annotation_output_junction_bed", - "junction_annotation_output_junction_interact": "junction_annotation_output_junction_interact", - "junction_annotation_output_junction_sheet": "junction_annotation_output_junction_sheet", - "junction_annotation_output_splice_events_plot": "junction_annotation_output_splice_events_plot", - "junction_annotation_output_splice_junctions_plot": "junction_annotation_output_splice_junctions_plot", - "junction_saturation_output_plot_r": "junction_saturation_output_plot_r", - "junction_saturation_output_plot": "junction_saturation_output_plot", - "read_distribution_output": "read_distribution_output", - "read_duplication_output_duplication_rate_plot_r": "read_duplication_output_duplication_rate_plot_r", - "read_duplication_output_duplication_rate_plot": "read_duplication_output_duplication_rate_plot", - "read_duplication_output_duplication_rate_mapping": "read_duplication_output_duplication_rate_mapping", - "read_duplication_output_duplication_rate_sequence": "read_duplication_output_duplication_rate_sequence", - "tin_output_summary": "tin_output_summary", - "tin_output_metrics": "tin_output_metrics", - "dupradar_output_dupmatrix": "dupradar_output_dupmatrix", - "dupradar_output_dup_intercept_mqc": "dupradar_output_dup_intercept_mqc", - "dupradar_output_duprate_exp_boxplot": "dupradar_output_duprate_exp_boxplot", - "dupradar_output_duprate_exp_densplot": "dupradar_output_duprate_exp_densplot", - "dupradar_output_duprate_exp_denscurve_mqc": "dupradar_output_duprate_exp_denscurve_mqc", - "dupradar_output_expression_histogram": "dupradar_output_expression_histogram", - "dupradar_output_intercept_slope": "dupradar_output_intercept_slope", - "qualimap_report": "qualimap_report", - "qualimap_qc_report": "qualimap_qc_report", - "qualimap_counts": "qualimap_counts", - "featurecounts": "featurecounts", - "featurecounts_summary": "featurecounts_summary", - "featurecounts_multiqc": "featurecounts_multiqc", - "featurecounts_rrna_multiqc": "featurecounts_rrna_multiqc", - "tpm_gene": "tpm_gene", - "counts_gene": "counts_gene", - "counts_gene_length_scaled": "counts_gene_length_scaled", - "counts_gene_scaled": "counts_gene_scaled", - "tpm_transcript": "tpm_transcript", - "counts_transcript": "counts_transcript", - "lengths_gene": "lengths_gene", - "lengths_transcript": "lengths_transcript", - "quant_merged_summarizedexperiment": "quant_merged_summarizedexperiment", - "deseq2_output": "deseq2_output", - "pseudo_tpm_gene": "pseudo_tpm_gene", - "pseudo_counts_gene": "pseudo_counts_gene", - "pseudo_counts_gene_length_scaled": "pseudo_counts_gene_length_scaled", - "pseudo_counts_gene_scaled": "pseudo_counts_gene_scaled", - "pseudo_tpm_transcript": "pseudo_tpm_transcript", - "pseudo_counts_transcript": "pseudo_counts_transcript", - "pseudo_lengths_gene": "pseudo_lengths_gene", - "pseudo_lengths_transcript": "pseudo_lengths_transcript", - "pseudo_quant_merged_summarizedexperiment": "pseudo_quant_merged_summarizedexperiment", - "deseq2_output_pseudo": "deseq2_output_pseudo", - "multiqc_report": "multiqc_report", - "multiqc_data": "multiqc_data", - "multiqc_plots": "multiqc_plots" - ] - ) - - emit: - output_ch + emit: + output_ch } // // Function to check whether biotype field exists in GTF file // def biotypeInGtf(gtf_file, biotype) { - def hits = 0 - gtf_file.eachLine { line -> - def attributes = line.split('\\t')[-1].split() - if (attributes.contains(biotype)) { - hits += 1 - } - } - if (hits) { - return true - } else { - log.warn "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\\n" + - " Biotype attribute '\${biotype}' not found in the last column of the GTF file!\\n\\n" + - " Biotype QC will be skipped to circumvent the issue below:\\n" + - " https://github.com/nf-core/rnaseq/issues/460\\n\\n" + - " Amend '--featurecounts_group_type' to change this behaviour.\\n" + - "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" - return false + def hits = 0 + gtf_file.eachLine { line -> + def attributes = line.split('\\t')[-1].split() + if (attributes.contains(biotype)) { + hits += 1 } + } + if (hits) { + return true + } else { + log.warn "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\\n" + + " Biotype attribute '\${biotype}' not found in the last column of the GTF file!\\n\\n" + + " Biotype QC will be skipped to circumvent the issue below:\\n" + + " https://github.com/nf-core/rnaseq/issues/460\\n\\n" + + " Amend '--featurecounts_group_type' to change this behaviour.\\n" + + "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" + return false + } } // // Function that parses and returns the predicted strandedness from the RSeQC infer_experiment.py output // def getInferexperimentStrandedness(inferexperiment_file, cutoff=30) { - def sense = 0 - def antisense = 0 - def undetermined = 0 - inferexperiment_file.eachLine { line -> - def undetermined_matcher = line =~ /Fraction of reads failed to determine:\\s([\\d\\.]+)/ - def se_sense_matcher = line =~ /Fraction of reads explained by "\\++,--":\\s([\\d\\.]+)/ - def se_antisense_matcher = line =~ /Fraction of reads explained by "\\+-,-\\+":\\s([\\d\\.]+)/ - def pe_sense_matcher = line =~ /Fraction of reads explained by "1\\++,1--,2\\+-,2-\\+":\\s([\\d\\.]+)/ - def pe_antisense_matcher = line =~ /Fraction of reads explained by "1\\+-,1-\\+,2\\+\\+,2--":\\s([\\d\\.]+)/ - if (undetermined_matcher) undetermined = undetermined_matcher[0][1].toFloat() * 100 - if (se_sense_matcher) sense = se_sense_matcher[0][1].toFloat() * 100 - if (se_antisense_matcher) antisense = se_antisense_matcher[0][1].toFloat() * 100 - if (pe_sense_matcher) sense = pe_sense_matcher[0][1].toFloat() * 100 - if (pe_antisense_matcher) antisense = pe_antisense_matcher[0][1].toFloat() * 100 - } - def strandedness = 'unstranded' - if (sense >= 100-cutoff) { - strandedness = 'forward' - } else if (antisense >= 100-cutoff) { - strandedness = 'reverse' - } - return [ strandedness, sense, antisense, undetermined ] + def sense = 0 + def antisense = 0 + def undetermined = 0 + inferexperiment_file.eachLine { line -> + def undetermined_matcher = line =~ /Fraction of reads failed to determine:\\s([\\d\\.]+)/ + def se_sense_matcher = line =~ /Fraction of reads explained by "\\++,--":\\s([\\d\\.]+)/ + def se_antisense_matcher = line =~ /Fraction of reads explained by "\\+-,-\\+":\\s([\\d\\.]+)/ + def pe_sense_matcher = line =~ /Fraction of reads explained by "1\\++,1--,2\\+-,2-\\+":\\s([\\d\\.]+)/ + def pe_antisense_matcher = line =~ /Fraction of reads explained by "1\\+-,1-\\+,2\\+\\+,2--":\\s([\\d\\.]+)/ + if (undetermined_matcher) undetermined = undetermined_matcher[0][1].toFloat() * 100 + if (se_sense_matcher) sense = se_sense_matcher[0][1].toFloat() * 100 + if (se_antisense_matcher) antisense = se_antisense_matcher[0][1].toFloat() * 100 + if (pe_sense_matcher) sense = pe_sense_matcher[0][1].toFloat() * 100 + if (pe_antisense_matcher) antisense = pe_antisense_matcher[0][1].toFloat() * 100 + } + def strandedness = 'unstranded' + if (sense >= 100-cutoff) { + strandedness = 'forward' + } else if (antisense >= 100-cutoff) { + strandedness = 'reverse' + } + return [ strandedness, sense, antisense, undetermined ] } VIASHMAIN nextflow run . -main-script "\$tempscript" & diff --git a/target/executable/workflows/rnaseq/.config.vsh.yaml b/target/executable/workflows/rnaseq/.config.vsh.yaml index 7959698..c100f6c 100644 --- a/target/executable/workflows/rnaseq/.config.vsh.yaml +++ b/target/executable/workflows/rnaseq/.config.vsh.yaml @@ -521,11 +521,6 @@ argument_groups: direction: "input" multiple: false multiple_sep: ";" - - type: "boolean_true" - name: "--skip_bbsplit" - description: "Skip BBSplit for removal of non-reference genome reads." - info: null - direction: "input" - type: "boolean" name: "--skip_umi_extract" description: "Skip umi_tools extract step." @@ -566,11 +561,6 @@ argument_groups: description: "Skip Preseq." info: null direction: "input" - - type: "boolean_true" - name: "--skip_deseq2_qc" - description: "Skip DESeq2 PCA and heatmap plotting." - info: null - direction: "input" - type: "boolean_true" name: "--skip_dupradar" description: "Skip dupRadar." @@ -649,9 +639,8 @@ argument_groups: arguments: - type: "file" name: "--multiqc_custom_config" + description: "Custom multiqc configuration file\n" info: null - default: - - "src/assets/multiqc_config.yml" must_exist: true create_parent: true required: false @@ -660,6 +649,7 @@ argument_groups: multiple_sep: ";" - type: "string" name: "--multiqc_title" + description: "Custom multiqc title\n" info: null required: false direction: "input" @@ -668,8 +658,6 @@ argument_groups: - type: "file" name: "--multiqc_methods_description" info: null - default: - - "src/assets/methods_description_template.yml" must_exist: true create_parent: true required: false @@ -1949,7 +1937,15 @@ resources: path: "main.nf" is_executable: true entrypoint: "run_wf" +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "A viash workflow for the nf-core/rnaseq pipeline.\n" +test_resources: +- type: "nextflow_script" + path: "test.nf" + is_executable: true + entrypoint: "test_wf" info: null status: "enabled" requirements: @@ -2049,6 +2045,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -2061,8 +2059,8 @@ build_info: output: "target/executable/workflows/rnaseq" executable: "target/executable/workflows/rnaseq/rnaseq" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" dependencies: - "target/nextflow/workflows/prepare_genome" - "target/nextflow/cat_fastq" @@ -2091,8 +2089,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/executable/workflows/rnaseq/nextflow_labels.config b/target/executable/workflows/rnaseq/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/executable/workflows/rnaseq/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/executable/workflows/rnaseq/rnaseq b/target/executable/workflows/rnaseq/rnaseq index fb6c439..9224adf 100755 --- a/target/executable/workflows/rnaseq/rnaseq +++ b/target/executable/workflows/rnaseq/rnaseq @@ -441,10 +441,6 @@ function ViashHelp { echo " default: false" echo " Skip the adapter trimming step." echo "" - echo " --skip_bbsplit" - echo " type: boolean_true" - echo " Skip BBSplit for removal of non-reference genome reads." - echo "" echo " --skip_umi_extract" echo " type: boolean" echo " default: false" @@ -474,10 +470,6 @@ function ViashHelp { echo " type: boolean_true" echo " Skip Preseq." echo "" - echo " --skip_deseq2_qc" - echo " type: boolean_true" - echo " Skip DESeq2 PCA and heatmap plotting." - echo "" echo " --skip_dupradar" echo " type: boolean_true" echo " Skip dupRadar." @@ -525,14 +517,14 @@ function ViashHelp { echo "MultiQC paramenters:" echo " --multiqc_custom_config" echo " type: file, file must exist" - echo " default: src/assets/multiqc_config.yml" + echo " Custom multiqc configuration file" echo "" echo " --multiqc_title" echo " type: string" + echo " Custom multiqc title" echo "" echo " --multiqc_methods_description" echo " type: file, file must exist" - echo " default: src/assets/methods_description_template.yml" echo "" echo "Output:" echo " --output_fasta" @@ -1583,11 +1575,6 @@ while [[ $# -gt 0 ]]; do VIASH_PAR_SKIP_TRIMMING=$(ViashRemoveFlags "$1") shift 1 ;; - --skip_bbsplit) - [ -n "$VIASH_PAR_SKIP_BBSPLIT" ] && ViashError Bad arguments for option \'--skip_bbsplit\': \'$VIASH_PAR_SKIP_BBSPLIT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 - VIASH_PAR_SKIP_BBSPLIT=true - shift 1 - ;; --skip_umi_extract) [ -n "$VIASH_PAR_SKIP_UMI_EXTRACT" ] && ViashError Bad arguments for option \'--skip_umi_extract\': \'$VIASH_PAR_SKIP_UMI_EXTRACT\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 VIASH_PAR_SKIP_UMI_EXTRACT="$2" @@ -1629,11 +1616,6 @@ while [[ $# -gt 0 ]]; do VIASH_PAR_SKIP_PRESEQ=true shift 1 ;; - --skip_deseq2_qc) - [ -n "$VIASH_PAR_SKIP_DESEQ2_QC" ] && ViashError Bad arguments for option \'--skip_deseq2_qc\': \'$VIASH_PAR_SKIP_DESEQ2_QC\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 - VIASH_PAR_SKIP_DESEQ2_QC=true - shift 1 - ;; --skip_dupradar) [ -n "$VIASH_PAR_SKIP_DUPRADAR" ] && ViashError Bad arguments for option \'--skip_dupradar\': \'$VIASH_PAR_SKIP_DUPRADAR\' \& \'$2\' - you should provide exactly one argument for this option. && exit 1 VIASH_PAR_SKIP_DUPRADAR=true @@ -3175,9 +3157,6 @@ fi if [ -z ${VIASH_PAR_SKIP_TRIMMING+x} ]; then VIASH_PAR_SKIP_TRIMMING="false" fi -if [ -z ${VIASH_PAR_SKIP_BBSPLIT+x} ]; then - VIASH_PAR_SKIP_BBSPLIT="false" -fi if [ -z ${VIASH_PAR_SKIP_UMI_EXTRACT+x} ]; then VIASH_PAR_SKIP_UMI_EXTRACT="false" fi @@ -3199,9 +3178,6 @@ fi if [ -z ${VIASH_PAR_SKIP_PRESEQ+x} ]; then VIASH_PAR_SKIP_PRESEQ="false" fi -if [ -z ${VIASH_PAR_SKIP_DESEQ2_QC+x} ]; then - VIASH_PAR_SKIP_DESEQ2_QC="false" -fi if [ -z ${VIASH_PAR_SKIP_DUPRADAR+x} ]; then VIASH_PAR_SKIP_DUPRADAR="false" fi @@ -3226,12 +3202,6 @@ fi if [ -z ${VIASH_PAR_RSEQC_MODULES+x} ]; then VIASH_PAR_RSEQC_MODULES="bam_stat;inner_distance;infer_experiment;junction_annotation;junction_saturation;read_distribution;read_duplication" fi -if [ -z ${VIASH_PAR_MULTIQC_CUSTOM_CONFIG+x} ]; then - VIASH_PAR_MULTIQC_CUSTOM_CONFIG="src/assets/multiqc_config.yml" -fi -if [ -z ${VIASH_PAR_MULTIQC_METHODS_DESCRIPTION+x} ]; then - VIASH_PAR_MULTIQC_METHODS_DESCRIPTION="src/assets/methods_description_template.yml" -fi if [ -z ${VIASH_PAR_OUTPUT_FASTA+x} ]; then VIASH_PAR_OUTPUT_FASTA="reference/genome.fasta" fi @@ -3755,12 +3725,6 @@ if [[ -n "$VIASH_PAR_SKIP_TRIMMING" ]]; then exit 1 fi fi -if [[ -n "$VIASH_PAR_SKIP_BBSPLIT" ]]; then - if ! [[ "$VIASH_PAR_SKIP_BBSPLIT" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then - ViashError '--skip_bbsplit' has to be a boolean_true. Use "--help" to get more information on the parameters. - exit 1 - fi -fi if [[ -n "$VIASH_PAR_SKIP_UMI_EXTRACT" ]]; then if ! [[ "$VIASH_PAR_SKIP_UMI_EXTRACT" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then ViashError '--skip_umi_extract' has to be a boolean. Use "--help" to get more information on the parameters. @@ -3803,12 +3767,6 @@ if [[ -n "$VIASH_PAR_SKIP_PRESEQ" ]]; then exit 1 fi fi -if [[ -n "$VIASH_PAR_SKIP_DESEQ2_QC" ]]; then - if ! [[ "$VIASH_PAR_SKIP_DESEQ2_QC" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then - ViashError '--skip_deseq2_qc' has to be a boolean_true. Use "--help" to get more information on the parameters. - exit 1 - fi -fi if [[ -n "$VIASH_PAR_SKIP_DUPRADAR" ]]; then if ! [[ "$VIASH_PAR_SKIP_DUPRADAR" =~ ^(true|True|TRUE|false|False|FALSE|yes|Yes|YES|no|No|NO)$ ]]; then ViashError '--skip_dupradar' has to be a boolean_true. Use "--help" to get more information on the parameters. @@ -4385,6 +4343,7 @@ workflow run_wf { input_ch main: + reference_ch = input_ch | map { id, state -> @@ -4403,8 +4362,8 @@ workflow run_wf { | toSortedList | map { list -> - [ "ref", - [ fasta: list.collect { id, state -> state.fasta }.unique()[0], + [ "ref", [ + fasta: list.collect { id, state -> state.fasta }.unique()[0], gtf: list.collect { id, state -> state.gtf }.unique()[0], gff: list.collect { id, state -> state.gff }.unique()[0], additional_fasta: list.collect { id, state -> state.additional_fasta }.unique()[0], @@ -4420,7 +4379,8 @@ workflow run_wf { // splicesites: list.collect { id, state -> state.splicesites }.unique()[0], // hisat2_index: list.collect { id, state -> state.hisat2_index }.unique()[0], bbsplit_index: list.collect { id, state -> state.bbsplit_index }.unique()[0], - skip_bbsplit: list.collect { id, state -> state.skip_bbsplit }.unique()[0], + // See: + skip_bbsplit: true, // list.collect { id, state -> state.skip_bbsplit }.unique()[0], skip_alignment: list.collect { id, state -> state.skip_alignment }.unique()[0], gencode: list.collect { id, state -> state.gencode }.unique()[0], biotype: list.collect { id, state -> state.biotype }.unique()[0], @@ -4432,43 +4392,43 @@ workflow run_wf { // prepare all the necessary files for reference genome | prepare_genome.run ( - fromState: [ - "fasta": "fasta", - "gtf": "gtf", - "gff": "gff", - "additional_fasta": "additional_fasta", - "transcript_fasta": "transcript_fasta", - "gene_bed": "gene_bed", - "bbsplit_fasta_list": "bbsplit_fasta_list", - "star_index": "star_index", - "rsem_index": "rsem_index", - "salmon_index": "salmon_index", - "kallisto_index": "kallisto_index", - "pseudo_aligner_kmer_size": "pseudo_aligner_kmer_size", - // "splicesites": "splicesites", - // "hisat2_index": "hisat2_index", - "bbsplit_index": "bbsplit_index", - "skip_bbsplit": "skip_bbsplit", - "gencode": "gencode", - "biotype": "biotype", - "filter_gtf": "filter_gtf", - "aligner": "aligner", - "pseudo_aligner": "pseudo_aligner", - "skip_alignment": "skip_alignment", - "star_sjdb_gtf_feature_exon": "star_sjdb_gtf_feature_exon" - ], - toState: [ - "fasta": "uncompressed_fasta", - "gtf": "gtf_uncompressed", - "transcript_fasta": "transcript_fasta_uncompressed", - "fai": "fai", - "chrom_sizes": "chrom_sizes", - "bbsplit_index": "bbsplit_index_uncompressed", - "star_index": "star_index_uncompressed", - "salmon_index": "salmon_index_uncompressed", - "kallisto_index": "kallisto_index_uncompressed", - "gene_bed": "gene_bed_uncompressed" - ] + fromState: [ + "fasta": "fasta", + "gtf": "gtf", + "gff": "gff", + "additional_fasta": "additional_fasta", + "transcript_fasta": "transcript_fasta", + "gene_bed": "gene_bed", + "bbsplit_fasta_list": "bbsplit_fasta_list", + "star_index": "star_index", + "rsem_index": "rsem_index", + "salmon_index": "salmon_index", + "kallisto_index": "kallisto_index", + "pseudo_aligner_kmer_size": "pseudo_aligner_kmer_size", + // "splicesites": "splicesites", + // "hisat2_index": "hisat2_index", + "bbsplit_index": "bbsplit_index", + "skip_bbsplit": "skip_bbsplit", + "gencode": "gencode", + "biotype": "biotype", + "filter_gtf": "filter_gtf", + "aligner": "aligner", + "pseudo_aligner": "pseudo_aligner", + "skip_alignment": "skip_alignment", + "star_sjdb_gtf_feature_exon": "star_sjdb_gtf_feature_exon" + ], + toState: [ + "fasta": "uncompressed_fasta", + "gtf": "gtf_uncompressed", + "transcript_fasta": "transcript_fasta_uncompressed", + "fai": "fai", + "chrom_sizes": "chrom_sizes", + "bbsplit_index": "bbsplit_index_uncompressed", + "star_index": "star_index_uncompressed", + "salmon_index": "salmon_index_uncompressed", + "kallisto_index": "kallisto_index_uncompressed", + "gene_bed": "gene_bed_uncompressed" + ] ) // Check if contigs in genome fasta file > 512 Mbp @@ -4476,6 +4436,7 @@ workflow run_wf { (isBelowMaxContigSize(state.fai)) ? [id, state] : [id, state + [bam_csi_index: true]] } + // Pick out the state | map { list -> list[1]} analysis_ch = input_ch @@ -4486,73 +4447,74 @@ workflow run_wf { // Concatenate FastQ files from same sample if required | cat_fastq.run ( - fromState: [ - "read_1": "fastq_1", - "read_2": "fastq_2" - ], - toState: [ - "fastq_1": "fastq_1", - "fastq_2": "fastq_2" - ] + fromState: [ + "read_1": "fastq_1", + "read_2": "fastq_2" + ], + toState: [ + "fastq_1": "fastq_1", + "fastq_2": "fastq_2" + ], + directives: [ label: [ "lowmem", "midcpu" ] ] ) // Pre-process fastq files | pre_processing.run ( - fromState: [ - "id": "id", - "fastq_1": "fastq_1", - "fastq_2": "fastq_2", - "umitools_bc_pattern": "umitools_bc_pattern", - "umitools_bc_pattern2": "umitools_bc_pattern2", - "strandedness": "strandedness", - "transcript_fasta": "transcript_fasta", - "gtf": "gtf", - "with_umi": "with_umi", - "bbsplit_index": "bbsplit_index", - "bbsplit_fasta_list": "bbsplit_fasta_list", - "bc_pattern": "bc_pattern", - "ribo_database_manifest": "ribo_database_manifest", - "salmon_index": "salmon_index", - "skip_qc": "skip_qc", - "skip_fastqc": "skip_fastqc", - "skip_skip_umi_extract": "skip_umi_extract", - "umi_discard_read": "umi_discard_read", - "skip_trimming": "skip_trimming", - "trimmer": "trimmer", - "skip_bbsplit": "skip_bbsplit", - "remove_ribo_rna": "remove_ribo_rna" - ], - toState: [ - "fastqc_html_1": "fastqc_html_1", - "fastqc_html_2": "fastqc_html_2", - "fastqc_zip_1": "fastqc_zip_1", - "fastqc_zip_2": "fastqc_zip_2", - "fastq_1": "qc_output1", - "fastq_2": "qc_output2", - "trim_log_1": "trim_log_1", - "trim_log_2": "trim_log_2", - "trim_zip_1": "trim_zip_1", - "trim_zip_2": "trim_zip_2", - "trim_html_1": "trim_html_1", - "trim_html_2": "trim_html_2", - "passed_trimmed_reads": "passed_trimmed_reads", - "num_trimmed_reads": "num_trimmed_reads", - "sortmerna_log": "sortmerna_log", - "salmon_quant_output": "salmon_quant_output", - "fastp_failed_trim": "failed_trim", - "fastp_failed_trim_unpaired1": "failed_trim_unpaired1", - "fastp_failed_trim_unpaired2": "failed_trim_unpaired2", - "fastp_trim_json": "trim_json", - "fastp_trim_html": "trim_html", - "fastp_trim_merged_out": "trim_merged_out" - ] + fromState: [ + "id": "id", + "fastq_1": "fastq_1", + "fastq_2": "fastq_2", + "umitools_bc_pattern": "umitools_bc_pattern", + "umitools_bc_pattern2": "umitools_bc_pattern2", + "strandedness": "strandedness", + "transcript_fasta": "transcript_fasta", + "gtf": "gtf", + "with_umi": "with_umi", + "bbsplit_index": "bbsplit_index", + "bbsplit_fasta_list": "bbsplit_fasta_list", + "bc_pattern": "bc_pattern", + "ribo_database_manifest": "ribo_database_manifest", + "salmon_index": "salmon_index", + "skip_qc": "skip_qc", + "skip_fastqc": "skip_fastqc", + "skip_skip_umi_extract": "skip_umi_extract", + "umi_discard_read": "umi_discard_read", + "skip_trimming": "skip_trimming", + "trimmer": "trimmer", + "skip_bbsplit": "skip_bbsplit", + "remove_ribo_rna": "remove_ribo_rna" + ], + toState: [ + "fastqc_html_1": "fastqc_html_1", + "fastqc_html_2": "fastqc_html_2", + "fastqc_zip_1": "fastqc_zip_1", + "fastqc_zip_2": "fastqc_zip_2", + "fastq_1": "qc_output1", + "fastq_2": "qc_output2", + "trim_log_1": "trim_log_1", + "trim_log_2": "trim_log_2", + "trim_zip_1": "trim_zip_1", + "trim_zip_2": "trim_zip_2", + "trim_html_1": "trim_html_1", + "trim_html_2": "trim_html_2", + "passed_trimmed_reads": "passed_trimmed_reads", + "num_trimmed_reads": "num_trimmed_reads", + "sortmerna_log": "sortmerna_log", + "salmon_quant_output": "salmon_quant_output", + "fastp_failed_trim": "failed_trim", + "fastp_failed_trim_unpaired1": "failed_trim_unpaired1", + "fastp_failed_trim_unpaired2": "failed_trim_unpaired2", + "fastp_trim_json": "trim_json", + "fastp_trim_html": "trim_html", + "fastp_trim_merged_out": "trim_merged_out" + ] ) // Infer strandedness from Salmon pseudo-alignment results | map { id, state -> - (state.strandedness == 'auto') ? - [ id, state + [strandedness: getSalmonInferredStrandedness(state.salmon_quant_output)] ] : - [id, state] + (state.strandedness == 'auto') ? + [ id, state + [strandedness: getSalmonInferredStrandedness(state.salmon_quant_output)] ] : + [id, state] } // Filter FastQ files based on minimum trimmed read count after adapter trimming @@ -4578,49 +4540,49 @@ workflow run_wf { // Genome alignment and quantification | genome_alignment_and_quant.run ( - runIf: { id, state -> !state.skip_alignment && state.passed_trimmed_reads }, - fromState: [ - "id": "id", - "fastq_1": "fastq_1", - "fastq_2": "fastq_2", - "strandedness": "strandedness", - "gtf": "gtf", - "transcript_fasta": "transcript_fasta", - "bam_csi_index": "bam_csi_index", - "aligner": "aligner", - "rsem_index": "rsem_index", - "star_index": "star_index", - "star_sjdb_gtf_feature_exon": "star_sjdb_gtf_feature_exon", - "star_ignore_sjdbgtf": "star_ignore_sjdbgtf", - "with_umi": "with_umi", - "umi_dedup_stats": "umi_dedup_stats", - "gtf_group_features": "gtf_group_features", - "gtf_extra_attributes": "gtf_extra_attributes", - "salmon_quant_libtype": "salmon_quant_libtype", - "salmon_index": "salmon_index", - "extra_rsem_calculate_expression_args": "extra_rsem_calculate_expression_args" - ], - toState: [ - "star_multiqc": "star_multiqc", - "rsem_multiqc": "rsem_multiqc", - "salmon_multiqc": "salmon_multiqc", - "genome_bam_sorted": "genome_bam_sorted", - "genome_bam_index": "genome_bam_index", - "genome_bam_stats": "genome_bam_stats", - "genome_bam_flagstat": "genome_bam_flagstat", - "genome_bam_idxstats": "genome_bam_idxstats", - "transcriptome_bam": "transcriptome_bam", - "transcriptome_bam_index": "transcriptome_bam_index", - "transcriptome_bam_stats": "transcriptome_bam_stats", - "transcriptome_bam_flagstat": "transcriptome_bam_flagstat", - "transcriptome_bam_idxstats": "transcriptome_bam_idxstats", - "quant_out_dir": "quant_out_dir", - "quant_results_file": "quant_results_file", - "rsem_counts_gene": "rsem_counts_gene", - "rsem_counts_transcripts": "rsem_counts_transcripts", - "bam_genome_rsem": "bam_genome_rsem", - "bam_transcript_rsem": "bam_transcript_rsem" - ] + runIf: { id, state -> !state.skip_alignment && state.passed_trimmed_reads }, + fromState: [ + "id": "id", + "fastq_1": "fastq_1", + "fastq_2": "fastq_2", + "strandedness": "strandedness", + "gtf": "gtf", + "transcript_fasta": "transcript_fasta", + "bam_csi_index": "bam_csi_index", + "aligner": "aligner", + "rsem_index": "rsem_index", + "star_index": "star_index", + "star_sjdb_gtf_feature_exon": "star_sjdb_gtf_feature_exon", + "star_ignore_sjdbgtf": "star_ignore_sjdbgtf", + "with_umi": "with_umi", + "umi_dedup_stats": "umi_dedup_stats", + "gtf_group_features": "gtf_group_features", + "gtf_extra_attributes": "gtf_extra_attributes", + "salmon_quant_libtype": "salmon_quant_libtype", + "salmon_index": "salmon_index", + "extra_rsem_calculate_expression_args": "extra_rsem_calculate_expression_args" + ], + toState: [ + "star_multiqc": "star_multiqc", + "rsem_multiqc": "rsem_multiqc", + "salmon_multiqc": "salmon_multiqc", + "genome_bam_sorted": "genome_bam_sorted", + "genome_bam_index": "genome_bam_index", + "genome_bam_stats": "genome_bam_stats", + "genome_bam_flagstat": "genome_bam_flagstat", + "genome_bam_idxstats": "genome_bam_idxstats", + "transcriptome_bam": "transcriptome_bam", + "transcriptome_bam_index": "transcriptome_bam_index", + "transcriptome_bam_stats": "transcriptome_bam_stats", + "transcriptome_bam_flagstat": "transcriptome_bam_flagstat", + "transcriptome_bam_idxstats": "transcriptome_bam_idxstats", + "quant_out_dir": "quant_out_dir", + "quant_results_file": "quant_results_file", + "rsem_counts_gene": "rsem_counts_gene", + "rsem_counts_transcripts": "rsem_counts_transcripts", + "bam_genome_rsem": "bam_genome_rsem", + "bam_transcript_rsem": "bam_transcript_rsem" + ] ) // Filter channels to get samples that passed STAR minimum mapping percentage @@ -4632,35 +4594,35 @@ workflow run_wf { // Pseudo-alignment and quantification | pseudo_alignment_and_quant.run ( - runIf: { id, state -> !state.skip_pseudo_alignment && state.passed_trimmed_reads }, - fromState: [ - "id": "id", - "fastq_1": "fastq_1", - "fastq_2": "fastq_2", - "strandedness": "strandedness", - "gtf": "gtf", - "transcript_fasta": "transcript_fasta", - "pseudo_aligner": "pseudo_aligner", - "salmon_index": "salmon_index", - "kallisto_index": "kallisto_index", - "extra_star_align_args": "extra_star_align_args", - "star_ignore_sjdbgtf": "star_ignore_sjdbgtf", - "seq_platform": "seq_platform", - "seq_center": "seq_center", - "with_umi": "with_umi", - "umi_dedup_stats": "umi_dedup_stats", - "gtf_group_features": "gtf_group_features", - "gtf_extra_attributes": "gtf_extra_attributes", - "lib_type": "salmon_quant_libtype", - "kallisto_quant_fragment_length": "kallisto_quant_fragment_length", - "kallisto_quant_fragment_length_sd": "kallisto_quant_fragment_length_sd" - ], - toState: [ - "pseudo_quant_out_dir": "quant_out_dir", - "pseudo_salmon_quant_results_file": "salmon_quant_results_file", - "pseudo_kallisto_quant_results_file": "kallisto_quant_results_file", - "pseudo_multiqc": "pseudo_multiqc" - ] + runIf: { id, state -> !state.skip_pseudo_alignment && state.passed_trimmed_reads }, + fromState: [ + "id": "id", + "fastq_1": "fastq_1", + "fastq_2": "fastq_2", + "strandedness": "strandedness", + "gtf": "gtf", + "transcript_fasta": "transcript_fasta", + "pseudo_aligner": "pseudo_aligner", + "salmon_index": "salmon_index", + "kallisto_index": "kallisto_index", + "extra_star_align_args": "extra_star_align_args", + "star_ignore_sjdbgtf": "star_ignore_sjdbgtf", + "seq_platform": "seq_platform", + "seq_center": "seq_center", + "with_umi": "with_umi", + "umi_dedup_stats": "umi_dedup_stats", + "gtf_group_features": "gtf_group_features", + "gtf_extra_attributes": "gtf_extra_attributes", + "lib_type": "salmon_quant_libtype", + "kallisto_quant_fragment_length": "kallisto_quant_fragment_length", + "kallisto_quant_fragment_length_sd": "kallisto_quant_fragment_length_sd" + ], + toState: [ + "pseudo_quant_out_dir": "quant_out_dir", + "pseudo_salmon_quant_results_file": "salmon_quant_results_file", + "pseudo_kallisto_quant_results_file": "kallisto_quant_results_file", + "pseudo_multiqc": "pseudo_multiqc" + ] ) | map { id, state -> @@ -4671,165 +4633,170 @@ workflow run_wf { // Post-processing | post_processing.run ( - runIf: { id, state -> !state.skip_alignment && state.passed_trimmed_reads && state.passed_mapping }, - fromState: [ - "id": "id", - "paired": "paired", - "strandedness": "strandedness", - "fasta": "fasta", - "fai": "fai", - "gtf": "gtf", - "genome_bam": "genome_bam_sorted", - "chrom_sizes": "chrom_sizes", - "star_multiqc": "star_multiqc", - "extra_picard_args": "extra_picard_args", - "extra_stringtie_args": "extra_stringtie_args", - "stringtie_ignore_gtf": "stringtie_ignore_gtf", - "extra_bedtools_args": "extra_bedtools_args", - "bam_csi_index": "bam_csi_index", - "min_mapped_reads": "min_mapped_reads", - "with_umi": "with_umi", - "skip_qc": "skip_qc", - "skip_markduplicates": "skip_markduplicates", - "skip_stringtie": "skip_stringtie", - "skip_bigwig":"gencode" - ], - toState: [ - "genome_bam_sorted": "processed_genome_bam", - "genome_bam_index": "genome_bam_index", - "genome_bam_stats": "genome_bam_stats", - "genome_bam_flagstat": "genome_bam_flagstat", - "genome_bam_idxstats": "genome_bam_idxstats", - "markduplicates_metrics": "markduplicates_metrics", - "stringtie_transcript_gtf": "stringtie_transcript_gtf", - "stringtie_coverage_gtf": "stringtie_coverage_gtf", - "stringtie_abundance": "stringtie_abundance", - "stringtie_ballgown": "stringtie_ballgown", - "bedgraph_forward": "bedgraph_forward", - "bedgraph_reverse": "bedgraph_reverse", - "bigwig_forward": "bigwig_forward", - "bigwig_reverse": "bigwig_reverse" - ] + runIf: { id, state -> !state.skip_alignment && state.passed_trimmed_reads && state.passed_mapping }, + fromState: [ + "id": "id", + "paired": "paired", + "strandedness": "strandedness", + "fasta": "fasta", + "fai": "fai", + "gtf": "gtf", + "genome_bam": "genome_bam_sorted", + "chrom_sizes": "chrom_sizes", + "star_multiqc": "star_multiqc", + "extra_picard_args": "extra_picard_args", + "extra_stringtie_args": "extra_stringtie_args", + "stringtie_ignore_gtf": "stringtie_ignore_gtf", + "extra_bedtools_args": "extra_bedtools_args", + "bam_csi_index": "bam_csi_index", + "min_mapped_reads": "min_mapped_reads", + "with_umi": "with_umi", + "skip_qc": "skip_qc", + "skip_markduplicates": "skip_markduplicates", + "skip_stringtie": "skip_stringtie", + "skip_bigwig":"gencode" + ], + toState: [ + "genome_bam_sorted": "processed_genome_bam", + "genome_bam_index": "genome_bam_index", + "genome_bam_stats": "genome_bam_stats", + "genome_bam_flagstat": "genome_bam_flagstat", + "genome_bam_idxstats": "genome_bam_idxstats", + "markduplicates_metrics": "markduplicates_metrics", + "stringtie_transcript_gtf": "stringtie_transcript_gtf", + "stringtie_coverage_gtf": "stringtie_coverage_gtf", + "stringtie_abundance": "stringtie_abundance", + "stringtie_ballgown": "stringtie_ballgown", + "bedgraph_forward": "bedgraph_forward", + "bedgraph_reverse": "bedgraph_reverse", + "bigwig_forward": "bigwig_forward", + "bigwig_reverse": "bigwig_reverse" + ] ) // Final QC + + // Temporarily skip DESeq2 QC for now + // https://github.com/viash-hub/rnaseq/issues/31 + | map{ id, state -> [ id, state + [ skip_deseq2_qc: true ] ] } + | quality_control.run ( - fromState: [ - "id": "id", - "paired": "paired", - "strandedness": "strandedness", - "skip_align": "skip_alignment", - "skip_pseudo_align": "skip_pseudo_alignment", - "skip_dupradar": "skip_dupradar", - "skip_qualimap": "skip_qualimap", - "skip_rseqc": "skip_rseqc", - "skip_multiqc": "skip_multiqc", - "skip_preseq": "skip_preseq", - "gtf": "gtf", - "num_trimmed_reads": "num_trimmed_reads", - "passed_trimmed_reads": "passed_trimmed_reads", - "passed_mapping": "passed_mapping", - "percent_mapped": "percent_mapped", - "genome_bam": "genome_bam_sorted", - "genome_bam_index": "genome_bam_index", - "salmon_multiqc": "salmon_multiqc", - "quant_results_file": "quant_results_file", - "rsem_multiqc": "rsem_multiqc", - "rsem_counts_gene": "rsem_counts_gene", - "rsem_counts_transcripts": "rsem_counts_transcripts", - "pseudo_multiqc": "pseudo_multiqc", - "pseudo_quant_out_dir": "pseudo_quant_out_dir", - "pseudo_salmon_quant_results_file": "pseudo_salmon_quant_results_file", - "pseudo_kallisto_quant_results_file": "pseudo_kallisto_quant_results_file", - "aligner": "aligner", - "pseudo_aligner": "pseudo_aligner", - "gene_bed": "gene_bed", - "extra_preseq_args": "extra_preseq_args", - "biotype": "biotype", - "skip_biotype_qc": "skip_biotype_qc", - "featurecounts_group_type": "featurecounts_group_type", - "featurecounts_feature_type": "featurecounts_feature_type", - "gencode": "gencode", - "skip_deseq2_qc": "skip_deseq2_qc", - "deseq2_vst": "deseq2_vst", - "multiqc_custom_config": "multiqc_custom_config", - "multiqc_title": "multiqc_title", - "multiqc_methods_description": "multiqc_methods_description", - "fastqc_zip_1": "fastqc_zip_1", - "fastqc_zip_2": "fastqc_zip_2", - "trim_log_1": "trim_log_1", - "trim_log_2": "trim_log_2", - "trim_zip_1": "trim_zip_1", - "trim_zip_2": "trim_zip_2", - "sortmerna_multiqc": "sortmerna_log", - "star_multiqc": "star_multiqc", - "genome_bam_stats": "genome_bam_stats", - "genome_bam_flagstat": "genome_bam_flagstat", - "genome_bam_idxstats": "genome_bam_idxstats", - "markduplicates_multiqc": "markduplicates_metrics", - "rseqc_modules": "rseqc_modules" - ], - toState: [ - "preseq_output": "preseq_output", - "bamstat_output": "bamstat_output", - "strandedness_output": "strandedness_output", - "inner_dist_output_stats": "inner_dist_output_stats", - "inner_dist_output_dist": "inner_dist_output_dist", - "inner_dist_output_freq": "inner_dist_output_freq", - "inner_dist_output_plot": "inner_dist_output_plot", - "inner_dist_output_plot_r": "inner_dist_output_plot_r", - "junction_annotation_output_log": "junction_annotation_output_log", - "junction_annotation_output_plot_r": "junction_annotation_output_plot_r", - "junction_annotation_output_junction_bed": "junction_annotation_output_junction_bed", - "junction_annotation_output_junction_interact": "junction_annotation_output_junction_interact", - "junction_annotation_output_junction_sheet": "junction_annotation_output_junction_sheet", - "junction_annotation_output_splice_events_plot": "junction_annotation_output_splice_events_plot", - "junction_annotation_output_splice_junctions_plot": "junction_annotation_output_splice_junctions_plot", - "junction_saturation_output_plot_r": "junction_saturation_output_plot_r", - "junction_saturation_output_plot": "junction_saturation_output_plot", - "read_distribution_output": "read_distribution_output", - "read_duplication_output_duplication_rate_plot_r": "read_duplication_output_duplication_rate_plot_r", - "read_duplication_output_duplication_rate_plot": "read_duplication_output_duplication_rate_plot", - "read_duplication_output_duplication_rate_mapping": "read_duplication_output_duplication_rate_mapping", - "read_duplication_output_duplication_rate_sequence": "read_duplication_output_duplication_rate_sequence", - "tin_output_summary": "tin_output_summary", - "tin_output_metrics": "tin_output_metrics", - "dupradar_output_dupmatrix": "dupradar_output_dupmatrix", - "dupradar_output_dup_intercept_mqc": "dupradar_output_dup_intercept_mqc", - "dupradar_output_duprate_exp_boxplot": "dupradar_output_duprate_exp_boxplot", - "dupradar_output_duprate_exp_densplot": "dupradar_output_duprate_exp_densplot", - "dupradar_output_duprate_exp_denscurve_mqc": "dupradar_output_duprate_exp_denscurve_mqc", - "dupradar_output_expression_histogram": "dupradar_output_expression_histogram", - "dupradar_output_intercept_slope": "dupradar_output_intercept_slope", - "qualimap_report": "qualimap_report", - "qualimap_qc_report": "qualimap_qc_report", - "qualimap_counts": "qualimap_counts", - "featurecounts": "featurecounts", - "featurecounts_summary": "featurecounts_summary", - "featurecounts_multiqc": "featurecounts_multiqc", - "featurecounts_rrna_multiqc": "featurecounts_rrna_multiqc", - "tpm_gene": "tpm_gene", - "counts_gene": "counts_gene", - "counts_gene_length_scaled": "counts_gene_length_scaled", - "counts_gene_scaled": "counts_gene_scaled", - "tpm_transcript": "tpm_transcript", - "counts_transcript": "counts_transcript", - "qunat_merged_summarizedexperiment": "quant_merged_summarizedexperiment", - "deseq2_output": "deseq2_output", - "pseudo_tpm_gene": "pseudo_tpm_gene", - "pseudo_counts_gene": "pseudo_counts_gene", - "pseudo_counts_gene_length_scaled": "pseudo_counts_gene_length_scaled", - "pseudo_counts_gene_scaled": "pseudo_counts_gene_scaled", - "pseudo_tpm_transcript": "pseudo_tpm_transcript", - "pseudo_counts_transcript": "pseudo_counts_transcript", - "pseudo_lengths_gene": "pseudo_lengths_gene", - "pseudo_lengths_transcript": "pseudo_lengths_transcript", - "pseudo_quant_merged_summarizedexperiment": "pseudo_quant_merged_summarizedexperiment", - "deseq2_output_pseudo": "deseq2_output_pseudo", - "multiqc_report": "multiqc_report", - "multiqc_data": "multiqc_data", - "multiqc_plots": "multiqc_plots" - ] + fromState: [ + "id": "id", + "paired": "paired", + "strandedness": "strandedness", + "skip_align": "skip_alignment", + "skip_pseudo_align": "skip_pseudo_alignment", + "skip_dupradar": "skip_dupradar", + "skip_qualimap": "skip_qualimap", + "skip_rseqc": "skip_rseqc", + "skip_multiqc": "skip_multiqc", + "skip_preseq": "skip_preseq", + "gtf": "gtf", + "num_trimmed_reads": "num_trimmed_reads", + "passed_trimmed_reads": "passed_trimmed_reads", + "passed_mapping": "passed_mapping", + "percent_mapped": "percent_mapped", + "genome_bam": "genome_bam_sorted", + "genome_bam_index": "genome_bam_index", + "salmon_multiqc": "salmon_multiqc", + "quant_results_file": "quant_results_file", + "rsem_multiqc": "rsem_multiqc", + "rsem_counts_gene": "rsem_counts_gene", + "rsem_counts_transcripts": "rsem_counts_transcripts", + "pseudo_multiqc": "pseudo_multiqc", + "pseudo_quant_out_dir": "pseudo_quant_out_dir", + "pseudo_salmon_quant_results_file": "pseudo_salmon_quant_results_file", + "pseudo_kallisto_quant_results_file": "pseudo_kallisto_quant_results_file", + "aligner": "aligner", + "pseudo_aligner": "pseudo_aligner", + "gene_bed": "gene_bed", + "extra_preseq_args": "extra_preseq_args", + "biotype": "biotype", + "skip_biotype_qc": "skip_biotype_qc", + "featurecounts_group_type": "featurecounts_group_type", + "featurecounts_feature_type": "featurecounts_feature_type", + "gencode": "gencode", + "skip_deseq2_qc": "skip_deseq2_qc", + "deseq2_vst": "deseq2_vst", + "multiqc_custom_config": "multiqc_custom_config", + "multiqc_title": "multiqc_title", + "multiqc_methods_description": "multiqc_methods_description", + "fastqc_zip_1": "fastqc_zip_1", + "fastqc_zip_2": "fastqc_zip_2", + "trim_log_1": "trim_log_1", + "trim_log_2": "trim_log_2", + "trim_zip_1": "trim_zip_1", + "trim_zip_2": "trim_zip_2", + "sortmerna_multiqc": "sortmerna_log", + "star_multiqc": "star_multiqc", + "genome_bam_stats": "genome_bam_stats", + "genome_bam_flagstat": "genome_bam_flagstat", + "genome_bam_idxstats": "genome_bam_idxstats", + "markduplicates_multiqc": "markduplicates_metrics", + "rseqc_modules": "rseqc_modules" + ], + toState: [ + "preseq_output": "preseq_output", + "bamstat_output": "bamstat_output", + "strandedness_output": "strandedness_output", + "inner_dist_output_stats": "inner_dist_output_stats", + "inner_dist_output_dist": "inner_dist_output_dist", + "inner_dist_output_freq": "inner_dist_output_freq", + "inner_dist_output_plot": "inner_dist_output_plot", + "inner_dist_output_plot_r": "inner_dist_output_plot_r", + "junction_annotation_output_log": "junction_annotation_output_log", + "junction_annotation_output_plot_r": "junction_annotation_output_plot_r", + "junction_annotation_output_junction_bed": "junction_annotation_output_junction_bed", + "junction_annotation_output_junction_interact": "junction_annotation_output_junction_interact", + "junction_annotation_output_junction_sheet": "junction_annotation_output_junction_sheet", + "junction_annotation_output_splice_events_plot": "junction_annotation_output_splice_events_plot", + "junction_annotation_output_splice_junctions_plot": "junction_annotation_output_splice_junctions_plot", + "junction_saturation_output_plot_r": "junction_saturation_output_plot_r", + "junction_saturation_output_plot": "junction_saturation_output_plot", + "read_distribution_output": "read_distribution_output", + "read_duplication_output_duplication_rate_plot_r": "read_duplication_output_duplication_rate_plot_r", + "read_duplication_output_duplication_rate_plot": "read_duplication_output_duplication_rate_plot", + "read_duplication_output_duplication_rate_mapping": "read_duplication_output_duplication_rate_mapping", + "read_duplication_output_duplication_rate_sequence": "read_duplication_output_duplication_rate_sequence", + "tin_output_summary": "tin_output_summary", + "tin_output_metrics": "tin_output_metrics", + "dupradar_output_dupmatrix": "dupradar_output_dupmatrix", + "dupradar_output_dup_intercept_mqc": "dupradar_output_dup_intercept_mqc", + "dupradar_output_duprate_exp_boxplot": "dupradar_output_duprate_exp_boxplot", + "dupradar_output_duprate_exp_densplot": "dupradar_output_duprate_exp_densplot", + "dupradar_output_duprate_exp_denscurve_mqc": "dupradar_output_duprate_exp_denscurve_mqc", + "dupradar_output_expression_histogram": "dupradar_output_expression_histogram", + "dupradar_output_intercept_slope": "dupradar_output_intercept_slope", + "qualimap_report": "qualimap_report", + "qualimap_qc_report": "qualimap_qc_report", + "qualimap_counts": "qualimap_counts", + "featurecounts": "featurecounts", + "featurecounts_summary": "featurecounts_summary", + "featurecounts_multiqc": "featurecounts_multiqc", + "featurecounts_rrna_multiqc": "featurecounts_rrna_multiqc", + "tpm_gene": "tpm_gene", + "counts_gene": "counts_gene", + "counts_gene_length_scaled": "counts_gene_length_scaled", + "counts_gene_scaled": "counts_gene_scaled", + "tpm_transcript": "tpm_transcript", + "counts_transcript": "counts_transcript", + "quant_merged_summarizedexperiment": "quant_merged_summarizedexperiment", + "deseq2_output": "deseq2_output", + "pseudo_tpm_gene": "pseudo_tpm_gene", + "pseudo_counts_gene": "pseudo_counts_gene", + "pseudo_counts_gene_length_scaled": "pseudo_counts_gene_length_scaled", + "pseudo_counts_gene_scaled": "pseudo_counts_gene_scaled", + "pseudo_tpm_transcript": "pseudo_tpm_transcript", + "pseudo_counts_transcript": "pseudo_counts_transcript", + "pseudo_lengths_gene": "pseudo_lengths_gene", + "pseudo_lengths_transcript": "pseudo_lengths_transcript", + "pseudo_quant_merged_summarizedexperiment": "pseudo_quant_merged_summarizedexperiment", + "deseq2_output_pseudo": "deseq2_output_pseudo", + "multiqc_report": "multiqc_report", + "multiqc_data": "multiqc_data", + "multiqc_plots": "multiqc_plots" + ] ) | map { id, state -> @@ -5021,8 +4988,8 @@ def getTrimGaloreReadsAfterFiltering(log_file) { // Function that parses fastp json output file to get total number of reads after trimming // def getFastpReadsAfterFiltering(json_file) { - def Map json = (Map) new JsonSlurper().parseText(json_file.text).get('summary') - return json['after_filtering']['total_reads'].toLong() + def Map json = (Map) new JsonSlurper().parseText(json_file.text).get('summary') + return json['after_filtering']['total_reads'].toLong() } // diff --git a/target/nextflow/bedtools_genomecov/.config.vsh.yaml b/target/nextflow/bedtools_genomecov/.config.vsh.yaml index 345ecf3..8948d7e 100644 --- a/target/nextflow/bedtools_genomecov/.config.vsh.yaml +++ b/target/nextflow/bedtools_genomecov/.config.vsh.yaml @@ -63,6 +63,9 @@ resources: - type: "bash_script" path: "script.sh" is_executable: true +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "Compute BEDGRAPH (-bg) summaries of feature coverage" test_resources: - type: "bash_script" @@ -152,6 +155,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -178,8 +183,8 @@ build_info: output: "target/nextflow/bedtools_genomecov" executable: "target/nextflow/bedtools_genomecov/main.nf" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" package_config: name: "rnaseq" version: "main" @@ -200,8 +205,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/nextflow/bedtools_genomecov/main.nf b/target/nextflow/bedtools_genomecov/main.nf index 53888df..606d3ec 100644 --- a/target/nextflow/bedtools_genomecov/main.nf +++ b/target/nextflow/bedtools_genomecov/main.nf @@ -2886,6 +2886,11 @@ meta = [ "type" : "bash_script", "path" : "script.sh", "is_executable" : true + }, + { + "type" : "file", + "path" : "/src/workflows/utils/labels.config", + "dest" : "nextflow_labels.config" } ], "description" : "Compute BEDGRAPH (-bg) summaries of feature coverage", @@ -2997,7 +3002,10 @@ meta = [ "cpu200" : "cpus = 200", "cpu500" : "cpus = 500", "cpu1000" : "cpus = 1000" - } + }, + "script" : [ + "includeConfig(\\"nextflow_labels.config\\")" + ] }, "debug" : false, "container" : "docker" @@ -3031,8 +3039,8 @@ meta = [ "engine" : "docker|native", "output" : "/workdir/root/repo/target/nextflow/bedtools_genomecov", "viash_version" : "0.9.0", - "git_commit" : "d63250ae704b6bd9a11792c4f979be2309999a2e", - "git_remote" : "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + "git_commit" : "4adb388c7d928eea02bccf890214f3b932b08714", + "git_remote" : "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" }, "package_config" : { "name" : "rnaseq", @@ -3063,7 +3071,7 @@ meta = [ "source" : "/workdir/root/repo/src", "target" : "/workdir/root/repo/target", "config_mods" : [ - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag := '$id'\n", + ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config', dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\\"nextflow_labels.config\\")'\n", ".engines += { type: \\"native\\" }", ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'", ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/nextflow/bedtools_genomecov/nextflow.config b/target/nextflow/bedtools_genomecov/nextflow.config index e452a97..94312cf 100644 --- a/target/nextflow/bedtools_genomecov/nextflow.config +++ b/target/nextflow/bedtools_genomecov/nextflow.config @@ -122,4 +122,4 @@ process{ withLabel: cpu1000 { cpus = 1000 } } - +includeConfig("nextflow_labels.config") diff --git a/target/nextflow/bedtools_genomecov/nextflow_labels.config b/target/nextflow/bedtools_genomecov/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/nextflow/bedtools_genomecov/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/nextflow/cat_additional_fasta/.config.vsh.yaml b/target/nextflow/cat_additional_fasta/.config.vsh.yaml index a88ab90..2a27bf9 100644 --- a/target/nextflow/cat_additional_fasta/.config.vsh.yaml +++ b/target/nextflow/cat_additional_fasta/.config.vsh.yaml @@ -69,6 +69,9 @@ resources: - type: "python_script" path: "script.py" is_executable: true +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "Concatenate addional fasta file to reference FASTA and GTF files.\n" test_resources: - type: "bash_script" @@ -162,6 +165,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -182,8 +187,8 @@ build_info: output: "target/nextflow/cat_additional_fasta" executable: "target/nextflow/cat_additional_fasta/main.nf" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" package_config: name: "rnaseq" version: "main" @@ -204,8 +209,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/nextflow/cat_additional_fasta/main.nf b/target/nextflow/cat_additional_fasta/main.nf index 0e2627e..cb50f64 100644 --- a/target/nextflow/cat_additional_fasta/main.nf +++ b/target/nextflow/cat_additional_fasta/main.nf @@ -2887,6 +2887,11 @@ meta = [ "type" : "python_script", "path" : "script.py", "is_executable" : true + }, + { + "type" : "file", + "path" : "/src/workflows/utils/labels.config", + "dest" : "nextflow_labels.config" } ], "description" : "Concatenate addional fasta file to reference FASTA and GTF files.\n", @@ -3006,7 +3011,10 @@ meta = [ "cpu200" : "cpus = 200", "cpu500" : "cpus = 500", "cpu1000" : "cpus = 1000" - } + }, + "script" : [ + "includeConfig(\\"nextflow_labels.config\\")" + ] }, "debug" : false, "container" : "docker" @@ -3032,8 +3040,8 @@ meta = [ "engine" : "docker|native", "output" : "/workdir/root/repo/target/nextflow/cat_additional_fasta", "viash_version" : "0.9.0", - "git_commit" : "d63250ae704b6bd9a11792c4f979be2309999a2e", - "git_remote" : "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + "git_commit" : "4adb388c7d928eea02bccf890214f3b932b08714", + "git_remote" : "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" }, "package_config" : { "name" : "rnaseq", @@ -3064,7 +3072,7 @@ meta = [ "source" : "/workdir/root/repo/src", "target" : "/workdir/root/repo/target", "config_mods" : [ - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag := '$id'\n", + ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config', dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\\"nextflow_labels.config\\")'\n", ".engines += { type: \\"native\\" }", ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'", ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/nextflow/cat_additional_fasta/nextflow.config b/target/nextflow/cat_additional_fasta/nextflow.config index 1ce2454..d7cac7b 100644 --- a/target/nextflow/cat_additional_fasta/nextflow.config +++ b/target/nextflow/cat_additional_fasta/nextflow.config @@ -122,4 +122,4 @@ process{ withLabel: cpu1000 { cpus = 1000 } } - +includeConfig("nextflow_labels.config") diff --git a/target/nextflow/cat_additional_fasta/nextflow_labels.config b/target/nextflow/cat_additional_fasta/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/nextflow/cat_additional_fasta/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/nextflow/cat_fastq/.config.vsh.yaml b/target/nextflow/cat_fastq/.config.vsh.yaml index 86269e6..6181966 100644 --- a/target/nextflow/cat_fastq/.config.vsh.yaml +++ b/target/nextflow/cat_fastq/.config.vsh.yaml @@ -53,6 +53,9 @@ resources: - type: "bash_script" path: "script.sh" is_executable: true +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "Concatenate multiple fastq files" test_resources: - type: "bash_script" @@ -149,6 +152,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -169,8 +174,8 @@ build_info: output: "target/nextflow/cat_fastq" executable: "target/nextflow/cat_fastq/main.nf" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" package_config: name: "rnaseq" version: "main" @@ -191,8 +196,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/nextflow/cat_fastq/main.nf b/target/nextflow/cat_fastq/main.nf index 3d0fe6f..d15ec20 100644 --- a/target/nextflow/cat_fastq/main.nf +++ b/target/nextflow/cat_fastq/main.nf @@ -2873,6 +2873,11 @@ meta = [ "type" : "bash_script", "path" : "script.sh", "is_executable" : true + }, + { + "type" : "file", + "path" : "/src/workflows/utils/labels.config", + "dest" : "nextflow_labels.config" } ], "description" : "Concatenate multiple fastq files", @@ -2997,7 +3002,10 @@ meta = [ "cpu200" : "cpus = 200", "cpu500" : "cpus = 500", "cpu1000" : "cpus = 1000" - } + }, + "script" : [ + "includeConfig(\\"nextflow_labels.config\\")" + ] }, "debug" : false, "container" : "docker" @@ -3023,8 +3031,8 @@ meta = [ "engine" : "docker|native", "output" : "/workdir/root/repo/target/nextflow/cat_fastq", "viash_version" : "0.9.0", - "git_commit" : "d63250ae704b6bd9a11792c4f979be2309999a2e", - "git_remote" : "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + "git_commit" : "4adb388c7d928eea02bccf890214f3b932b08714", + "git_remote" : "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" }, "package_config" : { "name" : "rnaseq", @@ -3055,7 +3063,7 @@ meta = [ "source" : "/workdir/root/repo/src", "target" : "/workdir/root/repo/target", "config_mods" : [ - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag := '$id'\n", + ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config', dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\\"nextflow_labels.config\\")'\n", ".engines += { type: \\"native\\" }", ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'", ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/nextflow/cat_fastq/nextflow.config b/target/nextflow/cat_fastq/nextflow.config index 6e90c6f..1a28f6d 100644 --- a/target/nextflow/cat_fastq/nextflow.config +++ b/target/nextflow/cat_fastq/nextflow.config @@ -122,4 +122,4 @@ process{ withLabel: cpu1000 { cpus = 1000 } } - +includeConfig("nextflow_labels.config") diff --git a/target/nextflow/cat_fastq/nextflow_labels.config b/target/nextflow/cat_fastq/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/nextflow/cat_fastq/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/nextflow/deseq2_qc/.config.vsh.yaml b/target/nextflow/deseq2_qc/.config.vsh.yaml index 96fa759..bd3f80c 100644 --- a/target/nextflow/deseq2_qc/.config.vsh.yaml +++ b/target/nextflow/deseq2_qc/.config.vsh.yaml @@ -115,6 +115,9 @@ resources: path: "deseq2_pca_header.txt" - type: "file" path: "deseq2_clustering_header.txt" +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "run deseq2, perform pca, generate heatmaps and scatterplots for samples\ \ in the counts files\n" test_resources: @@ -205,6 +208,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -237,8 +242,8 @@ build_info: output: "target/nextflow/deseq2_qc" executable: "target/nextflow/deseq2_qc/main.nf" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" package_config: name: "rnaseq" version: "main" @@ -259,8 +264,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/nextflow/deseq2_qc/main.nf b/target/nextflow/deseq2_qc/main.nf index f8a0f2d..7a27021 100644 --- a/target/nextflow/deseq2_qc/main.nf +++ b/target/nextflow/deseq2_qc/main.nf @@ -2950,6 +2950,11 @@ meta = [ { "type" : "file", "path" : "deseq2_clustering_header.txt" + }, + { + "type" : "file", + "path" : "/src/workflows/utils/labels.config", + "dest" : "nextflow_labels.config" } ], "description" : "run deseq2, perform pca, generate heatmaps and scatterplots for samples in the counts files\n", @@ -3061,7 +3066,10 @@ meta = [ "cpu200" : "cpus = 200", "cpu500" : "cpus = 500", "cpu1000" : "cpus = 1000" - } + }, + "script" : [ + "includeConfig(\\"nextflow_labels.config\\")" + ] }, "debug" : false, "container" : "docker" @@ -3104,8 +3112,8 @@ meta = [ "engine" : "docker|native", "output" : "/workdir/root/repo/target/nextflow/deseq2_qc", "viash_version" : "0.9.0", - "git_commit" : "d63250ae704b6bd9a11792c4f979be2309999a2e", - "git_remote" : "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + "git_commit" : "4adb388c7d928eea02bccf890214f3b932b08714", + "git_remote" : "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" }, "package_config" : { "name" : "rnaseq", @@ -3136,7 +3144,7 @@ meta = [ "source" : "/workdir/root/repo/src", "target" : "/workdir/root/repo/target", "config_mods" : [ - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag := '$id'\n", + ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config', dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\\"nextflow_labels.config\\")'\n", ".engines += { type: \\"native\\" }", ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'", ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/nextflow/deseq2_qc/nextflow.config b/target/nextflow/deseq2_qc/nextflow.config index 2275751..75eb43e 100644 --- a/target/nextflow/deseq2_qc/nextflow.config +++ b/target/nextflow/deseq2_qc/nextflow.config @@ -122,4 +122,4 @@ process{ withLabel: cpu1000 { cpus = 1000 } } - +includeConfig("nextflow_labels.config") diff --git a/target/nextflow/deseq2_qc/nextflow_labels.config b/target/nextflow/deseq2_qc/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/nextflow/deseq2_qc/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/nextflow/dupradar/.config.vsh.yaml b/target/nextflow/dupradar/.config.vsh.yaml index 0168541..da5ef34 100644 --- a/target/nextflow/dupradar/.config.vsh.yaml +++ b/target/nextflow/dupradar/.config.vsh.yaml @@ -146,6 +146,9 @@ resources: is_executable: true - type: "file" path: "dupradar.r" +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "Assessment of duplication rates in RNA-Seq datasets\n" test_resources: - type: "bash_script" @@ -237,6 +240,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -266,8 +271,8 @@ build_info: output: "target/nextflow/dupradar" executable: "target/nextflow/dupradar/main.nf" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" package_config: name: "rnaseq" version: "main" @@ -288,8 +293,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/nextflow/dupradar/main.nf b/target/nextflow/dupradar/main.nf index 8a34405..5ce3e0c 100644 --- a/target/nextflow/dupradar/main.nf +++ b/target/nextflow/dupradar/main.nf @@ -2979,6 +2979,11 @@ meta = [ { "type" : "file", "path" : "dupradar.r" + }, + { + "type" : "file", + "path" : "/src/workflows/utils/labels.config", + "dest" : "nextflow_labels.config" } ], "description" : "Assessment of duplication rates in RNA-Seq datasets\n", @@ -3094,7 +3099,10 @@ meta = [ "cpu200" : "cpus = 200", "cpu500" : "cpus = 500", "cpu1000" : "cpus = 1000" - } + }, + "script" : [ + "includeConfig(\\"nextflow_labels.config\\")" + ] }, "debug" : false, "container" : "docker" @@ -3136,8 +3144,8 @@ meta = [ "engine" : "docker|native", "output" : "/workdir/root/repo/target/nextflow/dupradar", "viash_version" : "0.9.0", - "git_commit" : "d63250ae704b6bd9a11792c4f979be2309999a2e", - "git_remote" : "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + "git_commit" : "4adb388c7d928eea02bccf890214f3b932b08714", + "git_remote" : "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" }, "package_config" : { "name" : "rnaseq", @@ -3168,7 +3176,7 @@ meta = [ "source" : "/workdir/root/repo/src", "target" : "/workdir/root/repo/target", "config_mods" : [ - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag := '$id'\n", + ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config', dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\\"nextflow_labels.config\\")'\n", ".engines += { type: \\"native\\" }", ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'", ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/nextflow/dupradar/nextflow.config b/target/nextflow/dupradar/nextflow.config index debef72..61a4493 100644 --- a/target/nextflow/dupradar/nextflow.config +++ b/target/nextflow/dupradar/nextflow.config @@ -122,4 +122,4 @@ process{ withLabel: cpu1000 { cpus = 1000 } } - +includeConfig("nextflow_labels.config") diff --git a/target/nextflow/dupradar/nextflow_labels.config b/target/nextflow/dupradar/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/nextflow/dupradar/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/nextflow/getchromsizes/.config.vsh.yaml b/target/nextflow/getchromsizes/.config.vsh.yaml index 7ae934e..172ce00 100644 --- a/target/nextflow/getchromsizes/.config.vsh.yaml +++ b/target/nextflow/getchromsizes/.config.vsh.yaml @@ -49,6 +49,9 @@ resources: - type: "bash_script" path: "script.sh" is_executable: true +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "Generates a FASTA file of chromosome sizes and a fasta index file.\n" test_resources: - type: "bash_script" @@ -139,6 +142,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -167,8 +172,8 @@ build_info: output: "target/nextflow/getchromsizes" executable: "target/nextflow/getchromsizes/main.nf" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" package_config: name: "rnaseq" version: "main" @@ -189,8 +194,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/nextflow/getchromsizes/main.nf b/target/nextflow/getchromsizes/main.nf index eb0f9d1..3fa6891 100644 --- a/target/nextflow/getchromsizes/main.nf +++ b/target/nextflow/getchromsizes/main.nf @@ -2867,6 +2867,11 @@ meta = [ "type" : "bash_script", "path" : "script.sh", "is_executable" : true + }, + { + "type" : "file", + "path" : "/src/workflows/utils/labels.config", + "dest" : "nextflow_labels.config" } ], "description" : "Generates a FASTA file of chromosome sizes and a fasta index file.\n", @@ -2979,7 +2984,10 @@ meta = [ "cpu200" : "cpus = 200", "cpu500" : "cpus = 500", "cpu1000" : "cpus = 1000" - } + }, + "script" : [ + "includeConfig(\\"nextflow_labels.config\\")" + ] }, "debug" : false, "container" : "docker" @@ -3013,8 +3021,8 @@ meta = [ "engine" : "docker|native", "output" : "/workdir/root/repo/target/nextflow/getchromsizes", "viash_version" : "0.9.0", - "git_commit" : "d63250ae704b6bd9a11792c4f979be2309999a2e", - "git_remote" : "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + "git_commit" : "4adb388c7d928eea02bccf890214f3b932b08714", + "git_remote" : "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" }, "package_config" : { "name" : "rnaseq", @@ -3045,7 +3053,7 @@ meta = [ "source" : "/workdir/root/repo/src", "target" : "/workdir/root/repo/target", "config_mods" : [ - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag := '$id'\n", + ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config', dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\\"nextflow_labels.config\\")'\n", ".engines += { type: \\"native\\" }", ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'", ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/nextflow/getchromsizes/nextflow.config b/target/nextflow/getchromsizes/nextflow.config index 9de7ca7..cc14e46 100644 --- a/target/nextflow/getchromsizes/nextflow.config +++ b/target/nextflow/getchromsizes/nextflow.config @@ -122,4 +122,4 @@ process{ withLabel: cpu1000 { cpus = 1000 } } - +includeConfig("nextflow_labels.config") diff --git a/target/nextflow/getchromsizes/nextflow_labels.config b/target/nextflow/getchromsizes/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/nextflow/getchromsizes/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/nextflow/gtf2bed/.config.vsh.yaml b/target/nextflow/gtf2bed/.config.vsh.yaml index 7721d0f..53bb7f3 100644 --- a/target/nextflow/gtf2bed/.config.vsh.yaml +++ b/target/nextflow/gtf2bed/.config.vsh.yaml @@ -31,6 +31,9 @@ resources: is_executable: true - type: "file" path: "gtf2bed.pl" +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "Create BED annotation file from GTF.\n" test_resources: - type: "bash_script" @@ -120,6 +123,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -145,8 +150,8 @@ build_info: output: "target/nextflow/gtf2bed" executable: "target/nextflow/gtf2bed/main.nf" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" package_config: name: "rnaseq" version: "main" @@ -167,8 +172,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/nextflow/gtf2bed/main.nf b/target/nextflow/gtf2bed/main.nf index 24241c6..ec554f6 100644 --- a/target/nextflow/gtf2bed/main.nf +++ b/target/nextflow/gtf2bed/main.nf @@ -2849,6 +2849,11 @@ meta = [ { "type" : "file", "path" : "gtf2bed.pl" + }, + { + "type" : "file", + "path" : "/src/workflows/utils/labels.config", + "dest" : "nextflow_labels.config" } ], "description" : "Create BED annotation file from GTF.\n", @@ -2960,7 +2965,10 @@ meta = [ "cpu200" : "cpus = 200", "cpu500" : "cpus = 500", "cpu1000" : "cpus = 1000" - } + }, + "script" : [ + "includeConfig(\\"nextflow_labels.config\\")" + ] }, "debug" : false, "container" : "docker" @@ -2995,8 +3003,8 @@ meta = [ "engine" : "docker|native", "output" : "/workdir/root/repo/target/nextflow/gtf2bed", "viash_version" : "0.9.0", - "git_commit" : "d63250ae704b6bd9a11792c4f979be2309999a2e", - "git_remote" : "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + "git_commit" : "4adb388c7d928eea02bccf890214f3b932b08714", + "git_remote" : "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" }, "package_config" : { "name" : "rnaseq", @@ -3027,7 +3035,7 @@ meta = [ "source" : "/workdir/root/repo/src", "target" : "/workdir/root/repo/target", "config_mods" : [ - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag := '$id'\n", + ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config', dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\\"nextflow_labels.config\\")'\n", ".engines += { type: \\"native\\" }", ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'", ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/nextflow/gtf2bed/nextflow.config b/target/nextflow/gtf2bed/nextflow.config index bb58016..8dbc78c 100644 --- a/target/nextflow/gtf2bed/nextflow.config +++ b/target/nextflow/gtf2bed/nextflow.config @@ -122,4 +122,4 @@ process{ withLabel: cpu1000 { cpus = 1000 } } - +includeConfig("nextflow_labels.config") diff --git a/target/nextflow/gtf2bed/nextflow_labels.config b/target/nextflow/gtf2bed/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/nextflow/gtf2bed/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/nextflow/gtf_filter/.config.vsh.yaml b/target/nextflow/gtf_filter/.config.vsh.yaml index 4b07550..19f131a 100644 --- a/target/nextflow/gtf_filter/.config.vsh.yaml +++ b/target/nextflow/gtf_filter/.config.vsh.yaml @@ -44,6 +44,9 @@ resources: - type: "python_script" path: "script.py" is_executable: true +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "Filters a GTF file based on sequence names in a FASTA file.\n" test_resources: - type: "bash_script" @@ -135,6 +138,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -155,8 +160,8 @@ build_info: output: "target/nextflow/gtf_filter" executable: "target/nextflow/gtf_filter/main.nf" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" package_config: name: "rnaseq" version: "main" @@ -177,8 +182,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/nextflow/gtf_filter/main.nf b/target/nextflow/gtf_filter/main.nf index b220d1b..24c333d 100644 --- a/target/nextflow/gtf_filter/main.nf +++ b/target/nextflow/gtf_filter/main.nf @@ -2862,6 +2862,11 @@ meta = [ "type" : "python_script", "path" : "script.py", "is_executable" : true + }, + { + "type" : "file", + "path" : "/src/workflows/utils/labels.config", + "dest" : "nextflow_labels.config" } ], "description" : "Filters a GTF file based on sequence names in a FASTA file.\n", @@ -2977,7 +2982,10 @@ meta = [ "cpu200" : "cpus = 200", "cpu500" : "cpus = 500", "cpu1000" : "cpus = 1000" - } + }, + "script" : [ + "includeConfig(\\"nextflow_labels.config\\")" + ] }, "debug" : false, "container" : "docker" @@ -3003,8 +3011,8 @@ meta = [ "engine" : "docker|native", "output" : "/workdir/root/repo/target/nextflow/gtf_filter", "viash_version" : "0.9.0", - "git_commit" : "d63250ae704b6bd9a11792c4f979be2309999a2e", - "git_remote" : "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + "git_commit" : "4adb388c7d928eea02bccf890214f3b932b08714", + "git_remote" : "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" }, "package_config" : { "name" : "rnaseq", @@ -3035,7 +3043,7 @@ meta = [ "source" : "/workdir/root/repo/src", "target" : "/workdir/root/repo/target", "config_mods" : [ - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag := '$id'\n", + ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config', dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\\"nextflow_labels.config\\")'\n", ".engines += { type: \\"native\\" }", ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'", ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/nextflow/gtf_filter/nextflow.config b/target/nextflow/gtf_filter/nextflow.config index f94680a..54c22ec 100644 --- a/target/nextflow/gtf_filter/nextflow.config +++ b/target/nextflow/gtf_filter/nextflow.config @@ -122,4 +122,4 @@ process{ withLabel: cpu1000 { cpus = 1000 } } - +includeConfig("nextflow_labels.config") diff --git a/target/nextflow/gtf_filter/nextflow_labels.config b/target/nextflow/gtf_filter/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/nextflow/gtf_filter/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/nextflow/gunzip/.config.vsh.yaml b/target/nextflow/gunzip/.config.vsh.yaml index 09bd2a0..61057d2 100644 --- a/target/nextflow/gunzip/.config.vsh.yaml +++ b/target/nextflow/gunzip/.config.vsh.yaml @@ -29,6 +29,9 @@ resources: - type: "bash_script" path: "script.sh" is_executable: true +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "Compress or uncompress a file or list of files.\n" test_resources: - type: "bash_script" @@ -119,6 +122,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -144,8 +149,8 @@ build_info: output: "target/nextflow/gunzip" executable: "target/nextflow/gunzip/main.nf" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" package_config: name: "rnaseq" version: "main" @@ -166,8 +171,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/nextflow/gunzip/main.nf b/target/nextflow/gunzip/main.nf index 90e5029..8ac2340 100644 --- a/target/nextflow/gunzip/main.nf +++ b/target/nextflow/gunzip/main.nf @@ -2845,6 +2845,11 @@ meta = [ "type" : "bash_script", "path" : "script.sh", "is_executable" : true + }, + { + "type" : "file", + "path" : "/src/workflows/utils/labels.config", + "dest" : "nextflow_labels.config" } ], "description" : "Compress or uncompress a file or list of files.\n", @@ -2957,7 +2962,10 @@ meta = [ "cpu200" : "cpus = 200", "cpu500" : "cpus = 500", "cpu1000" : "cpus = 1000" - } + }, + "script" : [ + "includeConfig(\\"nextflow_labels.config\\")" + ] }, "debug" : false, "container" : "docker" @@ -2992,8 +3000,8 @@ meta = [ "engine" : "docker|native", "output" : "/workdir/root/repo/target/nextflow/gunzip", "viash_version" : "0.9.0", - "git_commit" : "d63250ae704b6bd9a11792c4f979be2309999a2e", - "git_remote" : "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + "git_commit" : "4adb388c7d928eea02bccf890214f3b932b08714", + "git_remote" : "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" }, "package_config" : { "name" : "rnaseq", @@ -3024,7 +3032,7 @@ meta = [ "source" : "/workdir/root/repo/src", "target" : "/workdir/root/repo/target", "config_mods" : [ - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag := '$id'\n", + ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config', dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\\"nextflow_labels.config\\")'\n", ".engines += { type: \\"native\\" }", ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'", ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/nextflow/gunzip/nextflow.config b/target/nextflow/gunzip/nextflow.config index 8096e3b..f62cb23 100644 --- a/target/nextflow/gunzip/nextflow.config +++ b/target/nextflow/gunzip/nextflow.config @@ -122,4 +122,4 @@ process{ withLabel: cpu1000 { cpus = 1000 } } - +includeConfig("nextflow_labels.config") diff --git a/target/nextflow/gunzip/nextflow_labels.config b/target/nextflow/gunzip/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/nextflow/gunzip/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/nextflow/multiqc_custom_biotype/.config.vsh.yaml b/target/nextflow/multiqc_custom_biotype/.config.vsh.yaml index d615642..883420c 100644 --- a/target/nextflow/multiqc_custom_biotype/.config.vsh.yaml +++ b/target/nextflow/multiqc_custom_biotype/.config.vsh.yaml @@ -63,6 +63,9 @@ resources: is_executable: true - type: "file" path: "biotypes_header.txt" +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "Calculate features percentage for biotype counts" test_resources: - type: "bash_script" @@ -145,6 +148,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -165,8 +170,8 @@ build_info: output: "target/nextflow/multiqc_custom_biotype" executable: "target/nextflow/multiqc_custom_biotype/main.nf" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" package_config: name: "rnaseq" version: "main" @@ -187,8 +192,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/nextflow/multiqc_custom_biotype/main.nf b/target/nextflow/multiqc_custom_biotype/main.nf index b6dd723..d2fb309 100644 --- a/target/nextflow/multiqc_custom_biotype/main.nf +++ b/target/nextflow/multiqc_custom_biotype/main.nf @@ -2888,6 +2888,11 @@ meta = [ { "type" : "file", "path" : "biotypes_header.txt" + }, + { + "type" : "file", + "path" : "/src/workflows/utils/labels.config", + "dest" : "nextflow_labels.config" } ], "description" : "Calculate features percentage for biotype counts", @@ -2986,7 +2991,10 @@ meta = [ "cpu200" : "cpus = 200", "cpu500" : "cpus = 500", "cpu1000" : "cpus = 1000" - } + }, + "script" : [ + "includeConfig(\\"nextflow_labels.config\\")" + ] }, "debug" : false, "container" : "docker" @@ -3012,8 +3020,8 @@ meta = [ "engine" : "docker|native", "output" : "/workdir/root/repo/target/nextflow/multiqc_custom_biotype", "viash_version" : "0.9.0", - "git_commit" : "d63250ae704b6bd9a11792c4f979be2309999a2e", - "git_remote" : "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + "git_commit" : "4adb388c7d928eea02bccf890214f3b932b08714", + "git_remote" : "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" }, "package_config" : { "name" : "rnaseq", @@ -3044,7 +3052,7 @@ meta = [ "source" : "/workdir/root/repo/src", "target" : "/workdir/root/repo/target", "config_mods" : [ - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag := '$id'\n", + ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config', dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\\"nextflow_labels.config\\")'\n", ".engines += { type: \\"native\\" }", ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'", ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/nextflow/multiqc_custom_biotype/nextflow.config b/target/nextflow/multiqc_custom_biotype/nextflow.config index b16ee23..6a38a8a 100644 --- a/target/nextflow/multiqc_custom_biotype/nextflow.config +++ b/target/nextflow/multiqc_custom_biotype/nextflow.config @@ -122,4 +122,4 @@ process{ withLabel: cpu1000 { cpus = 1000 } } - +includeConfig("nextflow_labels.config") diff --git a/target/nextflow/multiqc_custom_biotype/nextflow_labels.config b/target/nextflow/multiqc_custom_biotype/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/nextflow/multiqc_custom_biotype/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/nextflow/picard_markduplicates/.config.vsh.yaml b/target/nextflow/picard_markduplicates/.config.vsh.yaml index 2565c14..b33107e 100644 --- a/target/nextflow/picard_markduplicates/.config.vsh.yaml +++ b/target/nextflow/picard_markduplicates/.config.vsh.yaml @@ -87,6 +87,9 @@ resources: - type: "bash_script" path: "script.sh" is_executable: true +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "Locate and tag duplicate reads in a BAM file\n" test_resources: - type: "bash_script" @@ -179,6 +182,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -207,8 +212,8 @@ build_info: output: "target/nextflow/picard_markduplicates" executable: "target/nextflow/picard_markduplicates/main.nf" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" package_config: name: "rnaseq" version: "main" @@ -229,8 +234,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/nextflow/picard_markduplicates/main.nf b/target/nextflow/picard_markduplicates/main.nf index 8269ec1..6df272a 100644 --- a/target/nextflow/picard_markduplicates/main.nf +++ b/target/nextflow/picard_markduplicates/main.nf @@ -2910,6 +2910,11 @@ meta = [ "type" : "bash_script", "path" : "script.sh", "is_executable" : true + }, + { + "type" : "file", + "path" : "/src/workflows/utils/labels.config", + "dest" : "nextflow_labels.config" } ], "description" : "Locate and tag duplicate reads in a BAM file\n", @@ -3026,7 +3031,10 @@ meta = [ "cpu200" : "cpus = 200", "cpu500" : "cpus = 500", "cpu1000" : "cpus = 1000" - } + }, + "script" : [ + "includeConfig(\\"nextflow_labels.config\\")" + ] }, "debug" : false, "container" : "docker" @@ -3063,8 +3071,8 @@ meta = [ "engine" : "docker|native", "output" : "/workdir/root/repo/target/nextflow/picard_markduplicates", "viash_version" : "0.9.0", - "git_commit" : "d63250ae704b6bd9a11792c4f979be2309999a2e", - "git_remote" : "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + "git_commit" : "4adb388c7d928eea02bccf890214f3b932b08714", + "git_remote" : "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" }, "package_config" : { "name" : "rnaseq", @@ -3095,7 +3103,7 @@ meta = [ "source" : "/workdir/root/repo/src", "target" : "/workdir/root/repo/target", "config_mods" : [ - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag := '$id'\n", + ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config', dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\\"nextflow_labels.config\\")'\n", ".engines += { type: \\"native\\" }", ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'", ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/nextflow/picard_markduplicates/nextflow.config b/target/nextflow/picard_markduplicates/nextflow.config index ffcdf85..2b2b6b3 100644 --- a/target/nextflow/picard_markduplicates/nextflow.config +++ b/target/nextflow/picard_markduplicates/nextflow.config @@ -122,4 +122,4 @@ process{ withLabel: cpu1000 { cpus = 1000 } } - +includeConfig("nextflow_labels.config") diff --git a/target/nextflow/picard_markduplicates/nextflow_labels.config b/target/nextflow/picard_markduplicates/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/nextflow/picard_markduplicates/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/nextflow/prepare_multiqc_input/.config.vsh.yaml b/target/nextflow/prepare_multiqc_input/.config.vsh.yaml index 2d44ef4..03dca3a 100644 --- a/target/nextflow/prepare_multiqc_input/.config.vsh.yaml +++ b/target/nextflow/prepare_multiqc_input/.config.vsh.yaml @@ -287,6 +287,7 @@ argument_groups: multiple_sep: "," - type: "file" name: "--multiqc_config" + description: "Custom multiqc configuration file\n" info: null must_exist: true create_parent: true @@ -311,6 +312,11 @@ resources: - type: "bash_script" path: "script.sh" is_executable: true +- type: "file" + path: "multiqc_config.yml" +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "Prepare directory with all the input files for MultiQC.\n" info: null status: "enabled" @@ -389,6 +395,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -409,8 +417,8 @@ build_info: output: "target/nextflow/prepare_multiqc_input" executable: "target/nextflow/prepare_multiqc_input/main.nf" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" package_config: name: "rnaseq" version: "main" @@ -431,8 +439,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/nextflow/prepare_multiqc_input/main.nf b/target/nextflow/prepare_multiqc_input/main.nf index e1e38ca..91a948f 100644 --- a/target/nextflow/prepare_multiqc_input/main.nf +++ b/target/nextflow/prepare_multiqc_input/main.nf @@ -3127,6 +3127,7 @@ meta = [ { "type" : "file", "name" : "--multiqc_config", + "description" : "Custom multiqc configuration file\n", "must_exist" : true, "create_parent" : true, "required" : false, @@ -3160,6 +3161,15 @@ meta = [ "type" : "bash_script", "path" : "script.sh", "is_executable" : true + }, + { + "type" : "file", + "path" : "/src/assets/multiqc_config.yml" + }, + { + "type" : "file", + "path" : "/src/workflows/utils/labels.config", + "dest" : "nextflow_labels.config" } ], "description" : "Prepare directory with all the input files for MultiQC.\n", @@ -3251,7 +3261,10 @@ meta = [ "cpu200" : "cpus = 200", "cpu500" : "cpus = 500", "cpu1000" : "cpus = 1000" - } + }, + "script" : [ + "includeConfig(\\"nextflow_labels.config\\")" + ] }, "debug" : false, "container" : "docker" @@ -3277,8 +3290,8 @@ meta = [ "engine" : "docker|native", "output" : "/workdir/root/repo/target/nextflow/prepare_multiqc_input", "viash_version" : "0.9.0", - "git_commit" : "d63250ae704b6bd9a11792c4f979be2309999a2e", - "git_remote" : "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + "git_commit" : "4adb388c7d928eea02bccf890214f3b932b08714", + "git_remote" : "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" }, "package_config" : { "name" : "rnaseq", @@ -3309,7 +3322,7 @@ meta = [ "source" : "/workdir/root/repo/src", "target" : "/workdir/root/repo/target", "config_mods" : [ - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag := '$id'\n", + ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config', dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\\"nextflow_labels.config\\")'\n", ".engines += { type: \\"native\\" }", ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'", ".engines[.type == 'docker'].target_tag := 'main'" @@ -3456,7 +3469,23 @@ IFS="," read -ra readduplication_multiqc <<< \\$par_readduplication_multiqc && f IFS="," read -ra tin_multiqc <<< \\$par_tin_multiqc && for file in "\\${tin_multiqc[@]}"; do [ -e "\\$file" ] && cp -r "\\$file" "\\$par_output/"; done -[ -e "\\$par_multiqc_config" ] && cp -r \\$par_multiqc_config "\\$par_output/" +echo "Checking for custom multiqc_config" +# If the variable is empty, we use the default one (registered as a resource) +if [ -z \\$par_multiqc_config ]; then + echo "No multiqc_config provided, using the default" + cp \\$meta_resources_dir/multiqc_config.yml "\\$par_output" +else + echo "Optional file provided" + if [ -f \\$par_multiqc_config ]; then + cp \\$par_multiqc_config "\\$par_output"/multiqc_config.yml + else + # Unreachable: the Viash-generated module checks this + echo "Optional file does not exist" + exit 1 + fi +fi + +echo "Done" VIASHMAIN bash "$tempscript" ''' diff --git a/target/nextflow/prepare_multiqc_input/multiqc_config.yml b/target/nextflow/prepare_multiqc_input/multiqc_config.yml new file mode 100644 index 0000000..0ac2fb1 --- /dev/null +++ b/target/nextflow/prepare_multiqc_input/multiqc_config.yml @@ -0,0 +1,164 @@ +report_comment: > + This report has been generated by the + analysis pipeline. +report_section_order: + "rnaseq-methods-description": + order: -1000 + software_versions: + order: -1001 + "rnaseq.vsh-summary": + order: -1002 + +export_plots: true +disable_version_detection: true + +# Run only these modules +run_modules: + - custom_content + - fastqc + - cutadapt + - fastp + - sortmerna + - star + - rsem + - salmon + - kallisto + - samtools + - picard + - preseq + - rseqc + - qualimap + +# Order of modules +top_modules: + - "fail_trimming" + - "fail_mapping" + - "fail_strand" + - "star_rsem_deseq2_pca" + - "star_rsem_deseq2_clustering" + - "star_salmon_deseq2_pca" + - "star_salmon_deseq2_clustering" + - "salmon_deseq2_pca" + - "salmon_deseq2_clustering" + - "kallisto_deseq2_pca" + - "kallisto_deseq2_clustering" + - "biotype_counts" + - "dupradar" + +module_order: + - fastqc: + name: "FastQC (raw)" + info: "This section of the report shows FastQC results before adapter trimming." + path_filters: + - "*.read_*.fastqc.zip" + - cutadapt + - fastp + - fastqc: + name: "FastQC (trimmed)" + info: "This section of the report shows FastQC results after adapter trimming." + path_filters: + - "*.trimgalore.read_*.fastqc.zip" + +# Don't show % Dups in the General Stats table (we have this from Picard) +table_columns_visible: + fastqc: + percent_duplicates: False + +extra_fn_clean_extn: + # - ".mapping_quality" + # - ".MarkDuplicates_flagstat.output.flagstat" + # - ".MarkDuplicates_idxstats.output.idxstats" + # - ".MarkDuplicates_stats.output.txt" + # - ".genome_sorted_MarkDuplicates.output.bam" + # - ".genome_sorted_MarkDuplicates" + - ".read_1" + - ".read_2" + +# See https://github.com/ewels/MultiQC_TestData/blob/master/data/custom_content/with_config/table_headerconfig/multiqc_config.yaml +custom_data: + fail_trimming: + section_name: "WARNING: Fail Trimming Check" + description: "List of samples that failed the minimum trimmed reads threshold specified via the '--min_trimmed_reads' parameter, and hence were ignored for the downstream processing steps." + plot_type: "table" + pconfig: + id: "fail_trimmed_samples_table" + table_title: "Samples failed trimming threshold" + namespace: "Samples failed trimming threshold" + format: "{:.0f}" + fail_mapping: + section_name: "WARNING: Fail Alignment Check" + description: "List of samples that failed the STAR minimum mapped reads threshold specified via the '--min_mapped_reads' parameter, and hence were ignored for the downstream processing steps." + plot_type: "table" + pconfig: + id: "fail_mapped_samples_table" + table_title: "Samples failed mapping threshold" + namespace: "Samples failed mapping threshold" + format: "{:.2f}" + fail_strand: + section_name: "WARNING: Fail Strand Check" + description: "List of samples that failed the strandedness check between that provided in the samplesheet and calculated by the RSeQC infer_experiment.py tool." + plot_type: "table" + pconfig: + id: "fail_strand_check_table" + table_title: "Samples failed strandedness check" + namespace: "Samples failed strandedness check" + format: "{:.2f}" + +# Customise the module search patterns to speed up execution time +# - Skip module sub-tools that we are not interested in +# - Replace file-content searching with filename pattern searching +# - Don't add anything that is the same as the MultiQC default +# See https://multiqc.info/docs/#optimise-file-search-patterns for details +sp: + + fastqc/zip: + fn: "*.fastqc.zip" + + cutadapt: + fn: "*.trimming_report*.txt" + + fastp: + fn: "*.fastp_out.json" + + sortmerna: + fn: "*sortmerna*.log" + + star: + fn: "*.star_align_reads.log.txt" + + # hisat2: + # fn: "*.hisat2.summary.log" + # salmon: + # fn: "*meta_info.json" + + preseq: + fn: "*.lc_extrap.txt" + + samtools/stats: + fn: "*_stats.output.txt" + samtools/flagstat: + fn: "*_flagstat.output.flagstat" + samtools/idxstats: + fn: "*_idxstats.output.idxstats" + + rseqc/bam_stat: + fn: "*.mapping_quality.txt" + rseqc/junction_saturation: + fn: "*.junction_saturation_plot.r" + rseqc/junction_annotation: + fn: "*.junction_annotation.log" + rseqc/read_duplication_pos: + fn: "*.duplication_rate_mapping.xls" + rseqc/read_distribution: + fn: "*.read_distribution.txt" + rseqc/infer_experiment: + fn: "*.strandedness.txt" + rseqc/inner_distance: + fn: "*.inner_distance_freq.txt" + rseqc/tin: + fn: "*.tin_summary.txt" + + picard/markdups: + fn: "*.MarkDuplicates.metrics.txt" + +skip_versions_section: true diff --git a/target/nextflow/prepare_multiqc_input/nextflow.config b/target/nextflow/prepare_multiqc_input/nextflow.config index 2b827a1..8d4be35 100644 --- a/target/nextflow/prepare_multiqc_input/nextflow.config +++ b/target/nextflow/prepare_multiqc_input/nextflow.config @@ -122,4 +122,4 @@ process{ withLabel: cpu1000 { cpus = 1000 } } - +includeConfig("nextflow_labels.config") diff --git a/target/nextflow/prepare_multiqc_input/nextflow_labels.config b/target/nextflow/prepare_multiqc_input/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/nextflow/prepare_multiqc_input/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/nextflow/prepare_multiqc_input/nextflow_schema.json b/target/nextflow/prepare_multiqc_input/nextflow_schema.json index cbe5fba..6e1e1db 100644 --- a/target/nextflow/prepare_multiqc_input/nextflow_schema.json +++ b/target/nextflow/prepare_multiqc_input/nextflow_schema.json @@ -337,8 +337,8 @@ "multiqc_config": { "type": "string", - "description": "Type: `file`. ", - "help_text": "Type: `file`. " + "description": "Type: `file`. Custom multiqc configuration file\n", + "help_text": "Type: `file`. Custom multiqc configuration file\n" } diff --git a/target/nextflow/preprocess_transcripts_fasta/.config.vsh.yaml b/target/nextflow/preprocess_transcripts_fasta/.config.vsh.yaml index 93ca217..3da2b8a 100644 --- a/target/nextflow/preprocess_transcripts_fasta/.config.vsh.yaml +++ b/target/nextflow/preprocess_transcripts_fasta/.config.vsh.yaml @@ -29,6 +29,9 @@ resources: - type: "bash_script" path: "script.sh" is_executable: true +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "Process transcripts FASTA if GTF file is GENOCODE format\n" test_resources: - type: "bash_script" @@ -118,6 +121,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -138,8 +143,8 @@ build_info: output: "target/nextflow/preprocess_transcripts_fasta" executable: "target/nextflow/preprocess_transcripts_fasta/main.nf" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" package_config: name: "rnaseq" version: "main" @@ -160,8 +165,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/nextflow/preprocess_transcripts_fasta/main.nf b/target/nextflow/preprocess_transcripts_fasta/main.nf index 1b5377b..b1c0ab1 100644 --- a/target/nextflow/preprocess_transcripts_fasta/main.nf +++ b/target/nextflow/preprocess_transcripts_fasta/main.nf @@ -2845,6 +2845,11 @@ meta = [ "type" : "bash_script", "path" : "script.sh", "is_executable" : true + }, + { + "type" : "file", + "path" : "/src/workflows/utils/labels.config", + "dest" : "nextflow_labels.config" } ], "description" : "Process transcripts FASTA if GTF file is GENOCODE format\n", @@ -2956,7 +2961,10 @@ meta = [ "cpu200" : "cpus = 200", "cpu500" : "cpus = 500", "cpu1000" : "cpus = 1000" - } + }, + "script" : [ + "includeConfig(\\"nextflow_labels.config\\")" + ] }, "debug" : false, "container" : "docker" @@ -2982,8 +2990,8 @@ meta = [ "engine" : "docker|native", "output" : "/workdir/root/repo/target/nextflow/preprocess_transcripts_fasta", "viash_version" : "0.9.0", - "git_commit" : "d63250ae704b6bd9a11792c4f979be2309999a2e", - "git_remote" : "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + "git_commit" : "4adb388c7d928eea02bccf890214f3b932b08714", + "git_remote" : "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" }, "package_config" : { "name" : "rnaseq", @@ -3014,7 +3022,7 @@ meta = [ "source" : "/workdir/root/repo/src", "target" : "/workdir/root/repo/target", "config_mods" : [ - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag := '$id'\n", + ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config', dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\\"nextflow_labels.config\\")'\n", ".engines += { type: \\"native\\" }", ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'", ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/nextflow/preprocess_transcripts_fasta/nextflow.config b/target/nextflow/preprocess_transcripts_fasta/nextflow.config index 7655273..abe51ae 100644 --- a/target/nextflow/preprocess_transcripts_fasta/nextflow.config +++ b/target/nextflow/preprocess_transcripts_fasta/nextflow.config @@ -122,4 +122,4 @@ process{ withLabel: cpu1000 { cpus = 1000 } } - +includeConfig("nextflow_labels.config") diff --git a/target/nextflow/preprocess_transcripts_fasta/nextflow_labels.config b/target/nextflow/preprocess_transcripts_fasta/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/nextflow/preprocess_transcripts_fasta/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/nextflow/preseq_lcextrap/.config.vsh.yaml b/target/nextflow/preseq_lcextrap/.config.vsh.yaml index 5551486..343be29 100644 --- a/target/nextflow/preseq_lcextrap/.config.vsh.yaml +++ b/target/nextflow/preseq_lcextrap/.config.vsh.yaml @@ -45,6 +45,9 @@ resources: - type: "bash_script" path: "script.sh" is_executable: true +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "Computing the expected future yield of distinct reads and bounds on\ \ the number of total distinct reads in the library and the associated confidence\ \ intervals." @@ -139,6 +142,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -191,8 +196,8 @@ build_info: output: "target/nextflow/preseq_lcextrap" executable: "target/nextflow/preseq_lcextrap/main.nf" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" package_config: name: "rnaseq" version: "main" @@ -213,8 +218,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/nextflow/preseq_lcextrap/main.nf b/target/nextflow/preseq_lcextrap/main.nf index 1243e12..ccda8b1 100644 --- a/target/nextflow/preseq_lcextrap/main.nf +++ b/target/nextflow/preseq_lcextrap/main.nf @@ -2864,6 +2864,11 @@ meta = [ "type" : "bash_script", "path" : "script.sh", "is_executable" : true + }, + { + "type" : "file", + "path" : "/src/workflows/utils/labels.config", + "dest" : "nextflow_labels.config" } ], "description" : "Computing the expected future yield of distinct reads and bounds on the number of total distinct reads in the library and the associated confidence intervals.", @@ -2980,7 +2985,10 @@ meta = [ "cpu200" : "cpus = 200", "cpu500" : "cpus = 500", "cpu1000" : "cpus = 1000" - } + }, + "script" : [ + "includeConfig(\\"nextflow_labels.config\\")" + ] }, "debug" : false, "container" : "docker" @@ -3035,8 +3043,8 @@ meta = [ "engine" : "docker|native", "output" : "/workdir/root/repo/target/nextflow/preseq_lcextrap", "viash_version" : "0.9.0", - "git_commit" : "d63250ae704b6bd9a11792c4f979be2309999a2e", - "git_remote" : "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + "git_commit" : "4adb388c7d928eea02bccf890214f3b932b08714", + "git_remote" : "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" }, "package_config" : { "name" : "rnaseq", @@ -3067,7 +3075,7 @@ meta = [ "source" : "/workdir/root/repo/src", "target" : "/workdir/root/repo/target", "config_mods" : [ - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag := '$id'\n", + ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config', dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\\"nextflow_labels.config\\")'\n", ".engines += { type: \\"native\\" }", ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'", ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/nextflow/preseq_lcextrap/nextflow.config b/target/nextflow/preseq_lcextrap/nextflow.config index c2a0d88..f8bca4d 100644 --- a/target/nextflow/preseq_lcextrap/nextflow.config +++ b/target/nextflow/preseq_lcextrap/nextflow.config @@ -122,4 +122,4 @@ process{ withLabel: cpu1000 { cpus = 1000 } } - +includeConfig("nextflow_labels.config") diff --git a/target/nextflow/preseq_lcextrap/nextflow_labels.config b/target/nextflow/preseq_lcextrap/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/nextflow/preseq_lcextrap/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/nextflow/rsem_merge_counts/.config.vsh.yaml b/target/nextflow/rsem_merge_counts/.config.vsh.yaml index f289265..946dc0a 100644 --- a/target/nextflow/rsem_merge_counts/.config.vsh.yaml +++ b/target/nextflow/rsem_merge_counts/.config.vsh.yaml @@ -77,6 +77,9 @@ resources: - type: "bash_script" path: "script.sh" is_executable: true +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "Merge the transcript quantification results obtained from rsem calculate-expression\ \ across all samples.\n" info: @@ -161,6 +164,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -181,8 +186,8 @@ build_info: output: "target/nextflow/rsem_merge_counts" executable: "target/nextflow/rsem_merge_counts/main.nf" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" package_config: name: "rnaseq" version: "main" @@ -203,8 +208,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/nextflow/rsem_merge_counts/main.nf b/target/nextflow/rsem_merge_counts/main.nf index 6c5675b..68905e8 100644 --- a/target/nextflow/rsem_merge_counts/main.nf +++ b/target/nextflow/rsem_merge_counts/main.nf @@ -2901,6 +2901,11 @@ meta = [ "type" : "bash_script", "path" : "script.sh", "is_executable" : true + }, + { + "type" : "file", + "path" : "/src/workflows/utils/labels.config", + "dest" : "nextflow_labels.config" } ], "description" : "Merge the transcript quantification results obtained from rsem calculate-expression across all samples.\n", @@ -3001,7 +3006,10 @@ meta = [ "cpu200" : "cpus = 200", "cpu500" : "cpus = 500", "cpu1000" : "cpus = 1000" - } + }, + "script" : [ + "includeConfig(\\"nextflow_labels.config\\")" + ] }, "debug" : false, "container" : "docker" @@ -3027,8 +3035,8 @@ meta = [ "engine" : "docker|native", "output" : "/workdir/root/repo/target/nextflow/rsem_merge_counts", "viash_version" : "0.9.0", - "git_commit" : "d63250ae704b6bd9a11792c4f979be2309999a2e", - "git_remote" : "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + "git_commit" : "4adb388c7d928eea02bccf890214f3b932b08714", + "git_remote" : "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" }, "package_config" : { "name" : "rnaseq", @@ -3059,7 +3067,7 @@ meta = [ "source" : "/workdir/root/repo/src", "target" : "/workdir/root/repo/target", "config_mods" : [ - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag := '$id'\n", + ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config', dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\\"nextflow_labels.config\\")'\n", ".engines += { type: \\"native\\" }", ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'", ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/nextflow/rsem_merge_counts/nextflow.config b/target/nextflow/rsem_merge_counts/nextflow.config index 7ce84a9..0c073bf 100644 --- a/target/nextflow/rsem_merge_counts/nextflow.config +++ b/target/nextflow/rsem_merge_counts/nextflow.config @@ -122,4 +122,4 @@ process{ withLabel: cpu1000 { cpus = 1000 } } - +includeConfig("nextflow_labels.config") diff --git a/target/nextflow/rsem_merge_counts/nextflow_labels.config b/target/nextflow/rsem_merge_counts/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/nextflow/rsem_merge_counts/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/nextflow/rseqc/rseqc_junctionannotation/.config.vsh.yaml b/target/nextflow/rseqc/rseqc_junctionannotation/.config.vsh.yaml index 0e7f343..f0e95d3 100644 --- a/target/nextflow/rseqc/rseqc_junctionannotation/.config.vsh.yaml +++ b/target/nextflow/rseqc/rseqc_junctionannotation/.config.vsh.yaml @@ -139,6 +139,9 @@ resources: - type: "bash_script" path: "script.sh" is_executable: true +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "Compare detected splice junctions to reference gene model.\n" test_resources: - type: "bash_script" @@ -229,6 +232,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -260,8 +265,8 @@ build_info: output: "target/nextflow/rseqc/rseqc_junctionannotation" executable: "target/nextflow/rseqc/rseqc_junctionannotation/main.nf" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" package_config: name: "rnaseq" version: "main" @@ -282,8 +287,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/nextflow/rseqc/rseqc_junctionannotation/main.nf b/target/nextflow/rseqc/rseqc_junctionannotation/main.nf index 44465a6..40c0b28 100644 --- a/target/nextflow/rseqc/rseqc_junctionannotation/main.nf +++ b/target/nextflow/rseqc/rseqc_junctionannotation/main.nf @@ -2970,6 +2970,11 @@ meta = [ "type" : "bash_script", "path" : "script.sh", "is_executable" : true + }, + { + "type" : "file", + "path" : "/src/workflows/utils/labels.config", + "dest" : "nextflow_labels.config" } ], "description" : "Compare detected splice junctions to reference gene model.\n", @@ -3084,7 +3089,10 @@ meta = [ "cpu200" : "cpus = 200", "cpu500" : "cpus = 500", "cpu1000" : "cpus = 1000" - } + }, + "script" : [ + "includeConfig(\\"nextflow_labels.config\\")" + ] }, "debug" : false, "container" : "docker" @@ -3128,8 +3136,8 @@ meta = [ "engine" : "docker|native", "output" : "/workdir/root/repo/target/nextflow/rseqc/rseqc_junctionannotation", "viash_version" : "0.9.0", - "git_commit" : "d63250ae704b6bd9a11792c4f979be2309999a2e", - "git_remote" : "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + "git_commit" : "4adb388c7d928eea02bccf890214f3b932b08714", + "git_remote" : "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" }, "package_config" : { "name" : "rnaseq", @@ -3160,7 +3168,7 @@ meta = [ "source" : "/workdir/root/repo/src", "target" : "/workdir/root/repo/target", "config_mods" : [ - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag := '$id'\n", + ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config', dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\\"nextflow_labels.config\\")'\n", ".engines += { type: \\"native\\" }", ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'", ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/nextflow/rseqc/rseqc_junctionannotation/nextflow.config b/target/nextflow/rseqc/rseqc_junctionannotation/nextflow.config index eb57771..defebbc 100644 --- a/target/nextflow/rseqc/rseqc_junctionannotation/nextflow.config +++ b/target/nextflow/rseqc/rseqc_junctionannotation/nextflow.config @@ -122,4 +122,4 @@ process{ withLabel: cpu1000 { cpus = 1000 } } - +includeConfig("nextflow_labels.config") diff --git a/target/nextflow/rseqc/rseqc_junctionannotation/nextflow_labels.config b/target/nextflow/rseqc/rseqc_junctionannotation/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/nextflow/rseqc/rseqc_junctionannotation/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/nextflow/rseqc/rseqc_junctionsaturation/.config.vsh.yaml b/target/nextflow/rseqc/rseqc_junctionsaturation/.config.vsh.yaml index 36de4a9..2bbf914 100644 --- a/target/nextflow/rseqc/rseqc_junctionsaturation/.config.vsh.yaml +++ b/target/nextflow/rseqc/rseqc_junctionsaturation/.config.vsh.yaml @@ -128,6 +128,9 @@ resources: - type: "bash_script" path: "script.sh" is_executable: true +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "Compare detected splice junctions to reference gene model.\n" test_resources: - type: "bash_script" @@ -218,6 +221,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -249,8 +254,8 @@ build_info: output: "target/nextflow/rseqc/rseqc_junctionsaturation" executable: "target/nextflow/rseqc/rseqc_junctionsaturation/main.nf" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" package_config: name: "rnaseq" version: "main" @@ -271,8 +276,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/nextflow/rseqc/rseqc_junctionsaturation/main.nf b/target/nextflow/rseqc/rseqc_junctionsaturation/main.nf index 05ce0f2..fd9486b 100644 --- a/target/nextflow/rseqc/rseqc_junctionsaturation/main.nf +++ b/target/nextflow/rseqc/rseqc_junctionsaturation/main.nf @@ -2955,6 +2955,11 @@ meta = [ "type" : "bash_script", "path" : "script.sh", "is_executable" : true + }, + { + "type" : "file", + "path" : "/src/workflows/utils/labels.config", + "dest" : "nextflow_labels.config" } ], "description" : "Compare detected splice junctions to reference gene model.\n", @@ -3069,7 +3074,10 @@ meta = [ "cpu200" : "cpus = 200", "cpu500" : "cpus = 500", "cpu1000" : "cpus = 1000" - } + }, + "script" : [ + "includeConfig(\\"nextflow_labels.config\\")" + ] }, "debug" : false, "container" : "docker" @@ -3113,8 +3121,8 @@ meta = [ "engine" : "docker|native", "output" : "/workdir/root/repo/target/nextflow/rseqc/rseqc_junctionsaturation", "viash_version" : "0.9.0", - "git_commit" : "d63250ae704b6bd9a11792c4f979be2309999a2e", - "git_remote" : "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + "git_commit" : "4adb388c7d928eea02bccf890214f3b932b08714", + "git_remote" : "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" }, "package_config" : { "name" : "rnaseq", @@ -3145,7 +3153,7 @@ meta = [ "source" : "/workdir/root/repo/src", "target" : "/workdir/root/repo/target", "config_mods" : [ - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag := '$id'\n", + ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config', dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\\"nextflow_labels.config\\")'\n", ".engines += { type: \\"native\\" }", ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'", ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/nextflow/rseqc/rseqc_junctionsaturation/nextflow.config b/target/nextflow/rseqc/rseqc_junctionsaturation/nextflow.config index 6374563..2d61e98 100644 --- a/target/nextflow/rseqc/rseqc_junctionsaturation/nextflow.config +++ b/target/nextflow/rseqc/rseqc_junctionsaturation/nextflow.config @@ -122,4 +122,4 @@ process{ withLabel: cpu1000 { cpus = 1000 } } - +includeConfig("nextflow_labels.config") diff --git a/target/nextflow/rseqc/rseqc_junctionsaturation/nextflow_labels.config b/target/nextflow/rseqc/rseqc_junctionsaturation/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/nextflow/rseqc/rseqc_junctionsaturation/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/nextflow/rseqc/rseqc_readdistribution/.config.vsh.yaml b/target/nextflow/rseqc/rseqc_readdistribution/.config.vsh.yaml index d9bb816..123d5e1 100644 --- a/target/nextflow/rseqc/rseqc_readdistribution/.config.vsh.yaml +++ b/target/nextflow/rseqc/rseqc_readdistribution/.config.vsh.yaml @@ -42,6 +42,9 @@ resources: - type: "bash_script" path: "script.sh" is_executable: true +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "Calculate how mapped reads are distributed over genomic features.\n" test_resources: - type: "bash_script" @@ -132,6 +135,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -162,8 +167,8 @@ build_info: output: "target/nextflow/rseqc/rseqc_readdistribution" executable: "target/nextflow/rseqc/rseqc_readdistribution/main.nf" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" package_config: name: "rnaseq" version: "main" @@ -184,8 +189,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/nextflow/rseqc/rseqc_readdistribution/main.nf b/target/nextflow/rseqc/rseqc_readdistribution/main.nf index ac0c69d..030d607 100644 --- a/target/nextflow/rseqc/rseqc_readdistribution/main.nf +++ b/target/nextflow/rseqc/rseqc_readdistribution/main.nf @@ -2860,6 +2860,11 @@ meta = [ "type" : "bash_script", "path" : "script.sh", "is_executable" : true + }, + { + "type" : "file", + "path" : "/src/workflows/utils/labels.config", + "dest" : "nextflow_labels.config" } ], "description" : "Calculate how mapped reads are distributed over genomic features.\n", @@ -2974,7 +2979,10 @@ meta = [ "cpu200" : "cpus = 200", "cpu500" : "cpus = 500", "cpu1000" : "cpus = 1000" - } + }, + "script" : [ + "includeConfig(\\"nextflow_labels.config\\")" + ] }, "debug" : false, "container" : "docker" @@ -3017,8 +3025,8 @@ meta = [ "engine" : "docker|native", "output" : "/workdir/root/repo/target/nextflow/rseqc/rseqc_readdistribution", "viash_version" : "0.9.0", - "git_commit" : "d63250ae704b6bd9a11792c4f979be2309999a2e", - "git_remote" : "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + "git_commit" : "4adb388c7d928eea02bccf890214f3b932b08714", + "git_remote" : "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" }, "package_config" : { "name" : "rnaseq", @@ -3049,7 +3057,7 @@ meta = [ "source" : "/workdir/root/repo/src", "target" : "/workdir/root/repo/target", "config_mods" : [ - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag := '$id'\n", + ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config', dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\\"nextflow_labels.config\\")'\n", ".engines += { type: \\"native\\" }", ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'", ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/nextflow/rseqc/rseqc_readdistribution/nextflow.config b/target/nextflow/rseqc/rseqc_readdistribution/nextflow.config index 9bd4e6b..458e99c 100644 --- a/target/nextflow/rseqc/rseqc_readdistribution/nextflow.config +++ b/target/nextflow/rseqc/rseqc_readdistribution/nextflow.config @@ -122,4 +122,4 @@ process{ withLabel: cpu1000 { cpus = 1000 } } - +includeConfig("nextflow_labels.config") diff --git a/target/nextflow/rseqc/rseqc_readdistribution/nextflow_labels.config b/target/nextflow/rseqc/rseqc_readdistribution/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/nextflow/rseqc/rseqc_readdistribution/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/nextflow/rseqc/rseqc_readduplication/.config.vsh.yaml b/target/nextflow/rseqc/rseqc_readduplication/.config.vsh.yaml index a41dfcb..ec69d29 100644 --- a/target/nextflow/rseqc/rseqc_readduplication/.config.vsh.yaml +++ b/target/nextflow/rseqc/rseqc_readduplication/.config.vsh.yaml @@ -92,6 +92,9 @@ resources: - type: "bash_script" path: "script.sh" is_executable: true +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "Calculate read duplication rate.\n" test_resources: - type: "bash_script" @@ -180,6 +183,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -211,8 +216,8 @@ build_info: output: "target/nextflow/rseqc/rseqc_readduplication" executable: "target/nextflow/rseqc/rseqc_readduplication/main.nf" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" package_config: name: "rnaseq" version: "main" @@ -233,8 +238,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/nextflow/rseqc/rseqc_readduplication/main.nf b/target/nextflow/rseqc/rseqc_readduplication/main.nf index ca12d30..81737b1 100644 --- a/target/nextflow/rseqc/rseqc_readduplication/main.nf +++ b/target/nextflow/rseqc/rseqc_readduplication/main.nf @@ -2917,6 +2917,11 @@ meta = [ "type" : "bash_script", "path" : "script.sh", "is_executable" : true + }, + { + "type" : "file", + "path" : "/src/workflows/utils/labels.config", + "dest" : "nextflow_labels.config" } ], "description" : "Calculate read duplication rate.\n", @@ -3027,7 +3032,10 @@ meta = [ "cpu200" : "cpus = 200", "cpu500" : "cpus = 500", "cpu1000" : "cpus = 1000" - } + }, + "script" : [ + "includeConfig(\\"nextflow_labels.config\\")" + ] }, "debug" : false, "container" : "docker" @@ -3071,8 +3079,8 @@ meta = [ "engine" : "docker|native", "output" : "/workdir/root/repo/target/nextflow/rseqc/rseqc_readduplication", "viash_version" : "0.9.0", - "git_commit" : "d63250ae704b6bd9a11792c4f979be2309999a2e", - "git_remote" : "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + "git_commit" : "4adb388c7d928eea02bccf890214f3b932b08714", + "git_remote" : "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" }, "package_config" : { "name" : "rnaseq", @@ -3103,7 +3111,7 @@ meta = [ "source" : "/workdir/root/repo/src", "target" : "/workdir/root/repo/target", "config_mods" : [ - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag := '$id'\n", + ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config', dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\\"nextflow_labels.config\\")'\n", ".engines += { type: \\"native\\" }", ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'", ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/nextflow/rseqc/rseqc_readduplication/nextflow.config b/target/nextflow/rseqc/rseqc_readduplication/nextflow.config index a5046c4..172e850 100644 --- a/target/nextflow/rseqc/rseqc_readduplication/nextflow.config +++ b/target/nextflow/rseqc/rseqc_readduplication/nextflow.config @@ -122,4 +122,4 @@ process{ withLabel: cpu1000 { cpus = 1000 } } - +includeConfig("nextflow_labels.config") diff --git a/target/nextflow/rseqc/rseqc_readduplication/nextflow_labels.config b/target/nextflow/rseqc/rseqc_readduplication/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/nextflow/rseqc/rseqc_readduplication/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/nextflow/rseqc/rseqc_tin/.config.vsh.yaml b/target/nextflow/rseqc/rseqc_tin/.config.vsh.yaml index 5ed13ce..d6218ad 100644 --- a/target/nextflow/rseqc/rseqc_tin/.config.vsh.yaml +++ b/target/nextflow/rseqc/rseqc_tin/.config.vsh.yaml @@ -94,6 +94,9 @@ resources: - type: "bash_script" path: "script.sh" is_executable: true +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "Calculte TIN (transcript integrity number) from RNA-seq reads\n" test_resources: - type: "bash_script" @@ -186,6 +189,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -214,8 +219,8 @@ build_info: output: "target/nextflow/rseqc/rseqc_tin" executable: "target/nextflow/rseqc/rseqc_tin/main.nf" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" package_config: name: "rnaseq" version: "main" @@ -236,8 +241,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/nextflow/rseqc/rseqc_tin/main.nf b/target/nextflow/rseqc/rseqc_tin/main.nf index ba14fd6..a7b945d 100644 --- a/target/nextflow/rseqc/rseqc_tin/main.nf +++ b/target/nextflow/rseqc/rseqc_tin/main.nf @@ -2917,6 +2917,11 @@ meta = [ "type" : "bash_script", "path" : "script.sh", "is_executable" : true + }, + { + "type" : "file", + "path" : "/src/workflows/utils/labels.config", + "dest" : "nextflow_labels.config" } ], "description" : "Calculte TIN (transcript integrity number) from RNA-seq reads\n", @@ -3035,7 +3040,10 @@ meta = [ "cpu200" : "cpus = 200", "cpu500" : "cpus = 500", "cpu1000" : "cpus = 1000" - } + }, + "script" : [ + "includeConfig(\\"nextflow_labels.config\\")" + ] }, "debug" : false, "container" : "docker" @@ -3076,8 +3084,8 @@ meta = [ "engine" : "docker|native", "output" : "/workdir/root/repo/target/nextflow/rseqc/rseqc_tin", "viash_version" : "0.9.0", - "git_commit" : "d63250ae704b6bd9a11792c4f979be2309999a2e", - "git_remote" : "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + "git_commit" : "4adb388c7d928eea02bccf890214f3b932b08714", + "git_remote" : "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" }, "package_config" : { "name" : "rnaseq", @@ -3108,7 +3116,7 @@ meta = [ "source" : "/workdir/root/repo/src", "target" : "/workdir/root/repo/target", "config_mods" : [ - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag := '$id'\n", + ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config', dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\\"nextflow_labels.config\\")'\n", ".engines += { type: \\"native\\" }", ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'", ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/nextflow/rseqc/rseqc_tin/nextflow.config b/target/nextflow/rseqc/rseqc_tin/nextflow.config index 49de227..45f555a 100644 --- a/target/nextflow/rseqc/rseqc_tin/nextflow.config +++ b/target/nextflow/rseqc/rseqc_tin/nextflow.config @@ -122,4 +122,4 @@ process{ withLabel: cpu1000 { cpus = 1000 } } - +includeConfig("nextflow_labels.config") diff --git a/target/nextflow/rseqc/rseqc_tin/nextflow_labels.config b/target/nextflow/rseqc/rseqc_tin/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/nextflow/rseqc/rseqc_tin/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/nextflow/sortmerna/.config.vsh.yaml b/target/nextflow/sortmerna/.config.vsh.yaml index a3dc2ea..6e88fca 100644 --- a/target/nextflow/sortmerna/.config.vsh.yaml +++ b/target/nextflow/sortmerna/.config.vsh.yaml @@ -74,6 +74,9 @@ resources: - type: "bash_script" path: "script.sh" is_executable: true +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "Local sequence alignment tool for filtering, mapping and clustering.\ \ The main application of SortMeRNA is filtering rRNA from metatranscriptomic data.\ \ SortMeRNA takes as input files of reads (fasta, fastq, fasta.gz, fastq.gz) and\ @@ -172,6 +175,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -192,8 +197,8 @@ build_info: output: "target/nextflow/sortmerna" executable: "target/nextflow/sortmerna/main.nf" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" package_config: name: "rnaseq" version: "main" @@ -214,8 +219,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/nextflow/sortmerna/main.nf b/target/nextflow/sortmerna/main.nf index 9309953..914d3f4 100644 --- a/target/nextflow/sortmerna/main.nf +++ b/target/nextflow/sortmerna/main.nf @@ -2896,6 +2896,11 @@ meta = [ "type" : "bash_script", "path" : "script.sh", "is_executable" : true + }, + { + "type" : "file", + "path" : "/src/workflows/utils/labels.config", + "dest" : "nextflow_labels.config" } ], "description" : "Local sequence alignment tool for filtering, mapping and clustering. The main application of SortMeRNA is filtering rRNA from metatranscriptomic data. SortMeRNA takes as input files of reads (fasta, fastq, fasta.gz, fastq.gz) and one or multiple rRNA database file(s), and sorts apart aligned and rejected reads into two files.\n", @@ -3016,7 +3021,10 @@ meta = [ "cpu200" : "cpus = 200", "cpu500" : "cpus = 500", "cpu1000" : "cpus = 1000" - } + }, + "script" : [ + "includeConfig(\\"nextflow_labels.config\\")" + ] }, "debug" : false, "container" : "docker" @@ -3042,8 +3050,8 @@ meta = [ "engine" : "docker|native", "output" : "/workdir/root/repo/target/nextflow/sortmerna", "viash_version" : "0.9.0", - "git_commit" : "d63250ae704b6bd9a11792c4f979be2309999a2e", - "git_remote" : "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + "git_commit" : "4adb388c7d928eea02bccf890214f3b932b08714", + "git_remote" : "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" }, "package_config" : { "name" : "rnaseq", @@ -3074,7 +3082,7 @@ meta = [ "source" : "/workdir/root/repo/src", "target" : "/workdir/root/repo/target", "config_mods" : [ - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag := '$id'\n", + ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config', dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\\"nextflow_labels.config\\")'\n", ".engines += { type: \\"native\\" }", ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'", ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/nextflow/sortmerna/nextflow.config b/target/nextflow/sortmerna/nextflow.config index d7604ef..f06756b 100644 --- a/target/nextflow/sortmerna/nextflow.config +++ b/target/nextflow/sortmerna/nextflow.config @@ -122,4 +122,4 @@ process{ withLabel: cpu1000 { cpus = 1000 } } - +includeConfig("nextflow_labels.config") diff --git a/target/nextflow/sortmerna/nextflow_labels.config b/target/nextflow/sortmerna/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/nextflow/sortmerna/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/nextflow/stringtie/.config.vsh.yaml b/target/nextflow/stringtie/.config.vsh.yaml index 960e3e0..f12ff86 100644 --- a/target/nextflow/stringtie/.config.vsh.yaml +++ b/target/nextflow/stringtie/.config.vsh.yaml @@ -97,6 +97,9 @@ resources: - type: "bash_script" path: "script.sh" is_executable: true +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "Transcript assembly and quantification for RNA-Seq\n" test_resources: - type: "bash_script" @@ -189,6 +192,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -216,8 +221,8 @@ build_info: output: "target/nextflow/stringtie" executable: "target/nextflow/stringtie/main.nf" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" package_config: name: "rnaseq" version: "main" @@ -238,8 +243,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/nextflow/stringtie/main.nf b/target/nextflow/stringtie/main.nf index e0ec024..e03a68b 100644 --- a/target/nextflow/stringtie/main.nf +++ b/target/nextflow/stringtie/main.nf @@ -2923,6 +2923,11 @@ meta = [ "type" : "bash_script", "path" : "script.sh", "is_executable" : true + }, + { + "type" : "file", + "path" : "/src/workflows/utils/labels.config", + "dest" : "nextflow_labels.config" } ], "description" : "Transcript assembly and quantification for RNA-Seq\n", @@ -3039,7 +3044,10 @@ meta = [ "cpu200" : "cpus = 200", "cpu500" : "cpus = 500", "cpu1000" : "cpus = 1000" - } + }, + "script" : [ + "includeConfig(\\"nextflow_labels.config\\")" + ] }, "debug" : false, "container" : "docker" @@ -3073,8 +3081,8 @@ meta = [ "engine" : "docker|native", "output" : "/workdir/root/repo/target/nextflow/stringtie", "viash_version" : "0.9.0", - "git_commit" : "d63250ae704b6bd9a11792c4f979be2309999a2e", - "git_remote" : "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + "git_commit" : "4adb388c7d928eea02bccf890214f3b932b08714", + "git_remote" : "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" }, "package_config" : { "name" : "rnaseq", @@ -3105,7 +3113,7 @@ meta = [ "source" : "/workdir/root/repo/src", "target" : "/workdir/root/repo/target", "config_mods" : [ - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag := '$id'\n", + ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config', dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\\"nextflow_labels.config\\")'\n", ".engines += { type: \\"native\\" }", ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'", ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/nextflow/stringtie/nextflow.config b/target/nextflow/stringtie/nextflow.config index 942b3d8..965bfb7 100644 --- a/target/nextflow/stringtie/nextflow.config +++ b/target/nextflow/stringtie/nextflow.config @@ -122,4 +122,4 @@ process{ withLabel: cpu1000 { cpus = 1000 } } - +includeConfig("nextflow_labels.config") diff --git a/target/nextflow/stringtie/nextflow_labels.config b/target/nextflow/stringtie/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/nextflow/stringtie/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/nextflow/summarizedexperiment/.config.vsh.yaml b/target/nextflow/summarizedexperiment/.config.vsh.yaml index 217e15f..fab4c5e 100644 --- a/target/nextflow/summarizedexperiment/.config.vsh.yaml +++ b/target/nextflow/summarizedexperiment/.config.vsh.yaml @@ -85,6 +85,9 @@ resources: is_executable: true - type: "file" path: "summarizedexperiment.r" +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "Create SummarizedExperiment object from Salmon counts" info: migration_info: @@ -168,6 +171,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -199,8 +204,8 @@ build_info: output: "target/nextflow/summarizedexperiment" executable: "target/nextflow/summarizedexperiment/main.nf" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" package_config: name: "rnaseq" version: "main" @@ -221,8 +226,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/nextflow/summarizedexperiment/main.nf b/target/nextflow/summarizedexperiment/main.nf index ec285d6..1c68f68 100644 --- a/target/nextflow/summarizedexperiment/main.nf +++ b/target/nextflow/summarizedexperiment/main.nf @@ -2910,6 +2910,11 @@ meta = [ { "type" : "file", "path" : "summarizedexperiment.r" + }, + { + "type" : "file", + "path" : "/src/workflows/utils/labels.config", + "dest" : "nextflow_labels.config" } ], "description" : "Create SummarizedExperiment object from Salmon counts", @@ -3010,7 +3015,10 @@ meta = [ "cpu200" : "cpus = 200", "cpu500" : "cpus = 500", "cpu1000" : "cpus = 1000" - } + }, + "script" : [ + "includeConfig(\\"nextflow_labels.config\\")" + ] }, "debug" : false, "container" : "docker" @@ -3054,8 +3062,8 @@ meta = [ "engine" : "docker|native", "output" : "/workdir/root/repo/target/nextflow/summarizedexperiment", "viash_version" : "0.9.0", - "git_commit" : "d63250ae704b6bd9a11792c4f979be2309999a2e", - "git_remote" : "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + "git_commit" : "4adb388c7d928eea02bccf890214f3b932b08714", + "git_remote" : "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" }, "package_config" : { "name" : "rnaseq", @@ -3086,7 +3094,7 @@ meta = [ "source" : "/workdir/root/repo/src", "target" : "/workdir/root/repo/target", "config_mods" : [ - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag := '$id'\n", + ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config', dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\\"nextflow_labels.config\\")'\n", ".engines += { type: \\"native\\" }", ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'", ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/nextflow/summarizedexperiment/nextflow.config b/target/nextflow/summarizedexperiment/nextflow.config index d9511b3..a6e39e1 100644 --- a/target/nextflow/summarizedexperiment/nextflow.config +++ b/target/nextflow/summarizedexperiment/nextflow.config @@ -122,4 +122,4 @@ process{ withLabel: cpu1000 { cpus = 1000 } } - +includeConfig("nextflow_labels.config") diff --git a/target/nextflow/summarizedexperiment/nextflow_labels.config b/target/nextflow/summarizedexperiment/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/nextflow/summarizedexperiment/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/nextflow/tx2gene/.config.vsh.yaml b/target/nextflow/tx2gene/.config.vsh.yaml index 60cbe93..7624f3c 100644 --- a/target/nextflow/tx2gene/.config.vsh.yaml +++ b/target/nextflow/tx2gene/.config.vsh.yaml @@ -69,6 +69,9 @@ resources: is_executable: true - type: "file" path: "tx2gene.py" +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "Get transcript id (tx) to gene names for tximport" test_resources: - type: "bash_script" @@ -156,6 +159,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -185,8 +190,8 @@ build_info: output: "target/nextflow/tx2gene" executable: "target/nextflow/tx2gene/main.nf" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" package_config: name: "rnaseq" version: "main" @@ -207,8 +212,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/nextflow/tx2gene/main.nf b/target/nextflow/tx2gene/main.nf index befe030..ca51b19 100644 --- a/target/nextflow/tx2gene/main.nf +++ b/target/nextflow/tx2gene/main.nf @@ -2895,6 +2895,11 @@ meta = [ { "type" : "file", "path" : "tx2gene.py" + }, + { + "type" : "file", + "path" : "/src/workflows/utils/labels.config", + "dest" : "nextflow_labels.config" } ], "description" : "Get transcript id (tx) to gene names for tximport", @@ -3002,7 +3007,10 @@ meta = [ "cpu200" : "cpus = 200", "cpu500" : "cpus = 500", "cpu1000" : "cpus = 1000" - } + }, + "script" : [ + "includeConfig(\\"nextflow_labels.config\\")" + ] }, "debug" : false, "container" : "docker" @@ -3043,8 +3051,8 @@ meta = [ "engine" : "docker|native", "output" : "/workdir/root/repo/target/nextflow/tx2gene", "viash_version" : "0.9.0", - "git_commit" : "d63250ae704b6bd9a11792c4f979be2309999a2e", - "git_remote" : "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + "git_commit" : "4adb388c7d928eea02bccf890214f3b932b08714", + "git_remote" : "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" }, "package_config" : { "name" : "rnaseq", @@ -3075,7 +3083,7 @@ meta = [ "source" : "/workdir/root/repo/src", "target" : "/workdir/root/repo/target", "config_mods" : [ - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag := '$id'\n", + ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config', dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\\"nextflow_labels.config\\")'\n", ".engines += { type: \\"native\\" }", ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'", ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/nextflow/tx2gene/nextflow.config b/target/nextflow/tx2gene/nextflow.config index fd3875e..3dbb7a8 100644 --- a/target/nextflow/tx2gene/nextflow.config +++ b/target/nextflow/tx2gene/nextflow.config @@ -122,4 +122,4 @@ process{ withLabel: cpu1000 { cpus = 1000 } } - +includeConfig("nextflow_labels.config") diff --git a/target/nextflow/tx2gene/nextflow_labels.config b/target/nextflow/tx2gene/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/nextflow/tx2gene/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/nextflow/tximport/.config.vsh.yaml b/target/nextflow/tximport/.config.vsh.yaml index d8ba713..5ab5684 100644 --- a/target/nextflow/tximport/.config.vsh.yaml +++ b/target/nextflow/tximport/.config.vsh.yaml @@ -128,6 +128,9 @@ resources: is_executable: true - type: "file" path: "tximport.r" +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "Get dataframe linking transcript ID, gene ID, and gene name" test_resources: - type: "bash_script" @@ -215,6 +218,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -251,8 +256,8 @@ build_info: output: "target/nextflow/tximport" executable: "target/nextflow/tximport/main.nf" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" package_config: name: "rnaseq" version: "main" @@ -273,8 +278,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/nextflow/tximport/main.nf b/target/nextflow/tximport/main.nf index 0e8b382..a5a90e8 100644 --- a/target/nextflow/tximport/main.nf +++ b/target/nextflow/tximport/main.nf @@ -2964,6 +2964,11 @@ meta = [ { "type" : "file", "path" : "tximport.r" + }, + { + "type" : "file", + "path" : "/src/workflows/utils/labels.config", + "dest" : "nextflow_labels.config" } ], "description" : "Get dataframe linking transcript ID, gene ID, and gene name", @@ -3071,7 +3076,10 @@ meta = [ "cpu200" : "cpus = 200", "cpu500" : "cpus = 500", "cpu1000" : "cpus = 1000" - } + }, + "script" : [ + "includeConfig(\\"nextflow_labels.config\\")" + ] }, "debug" : false, "container" : "docker" @@ -3121,8 +3129,8 @@ meta = [ "engine" : "docker|native", "output" : "/workdir/root/repo/target/nextflow/tximport", "viash_version" : "0.9.0", - "git_commit" : "d63250ae704b6bd9a11792c4f979be2309999a2e", - "git_remote" : "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + "git_commit" : "4adb388c7d928eea02bccf890214f3b932b08714", + "git_remote" : "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" }, "package_config" : { "name" : "rnaseq", @@ -3153,7 +3161,7 @@ meta = [ "source" : "/workdir/root/repo/src", "target" : "/workdir/root/repo/target", "config_mods" : [ - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag := '$id'\n", + ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config', dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\\"nextflow_labels.config\\")'\n", ".engines += { type: \\"native\\" }", ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'", ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/nextflow/tximport/nextflow.config b/target/nextflow/tximport/nextflow.config index 4ec3acb..d358055 100644 --- a/target/nextflow/tximport/nextflow.config +++ b/target/nextflow/tximport/nextflow.config @@ -122,4 +122,4 @@ process{ withLabel: cpu1000 { cpus = 1000 } } - +includeConfig("nextflow_labels.config") diff --git a/target/nextflow/tximport/nextflow_labels.config b/target/nextflow/tximport/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/nextflow/tximport/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/nextflow/ucsc/bedclip/.config.vsh.yaml b/target/nextflow/ucsc/bedclip/.config.vsh.yaml index 1f800be..8dd6684 100644 --- a/target/nextflow/ucsc/bedclip/.config.vsh.yaml +++ b/target/nextflow/ucsc/bedclip/.config.vsh.yaml @@ -42,6 +42,9 @@ resources: - type: "bash_script" path: "script.sh" is_executable: true +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "Remove lines from bed file that refer to off-chromosome locations" test_resources: - type: "bash_script" @@ -134,6 +137,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -164,8 +169,8 @@ build_info: output: "target/nextflow/ucsc/bedclip" executable: "target/nextflow/ucsc/bedclip/main.nf" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" package_config: name: "rnaseq" version: "main" @@ -186,8 +191,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/nextflow/ucsc/bedclip/main.nf b/target/nextflow/ucsc/bedclip/main.nf index cd6e5ee..41a248b 100644 --- a/target/nextflow/ucsc/bedclip/main.nf +++ b/target/nextflow/ucsc/bedclip/main.nf @@ -2860,6 +2860,11 @@ meta = [ "type" : "bash_script", "path" : "script.sh", "is_executable" : true + }, + { + "type" : "file", + "path" : "/src/workflows/utils/labels.config", + "dest" : "nextflow_labels.config" } ], "description" : "Remove lines from bed file that refer to off-chromosome locations", @@ -2976,7 +2981,10 @@ meta = [ "cpu200" : "cpus = 200", "cpu500" : "cpus = 500", "cpu1000" : "cpus = 1000" - } + }, + "script" : [ + "includeConfig(\\"nextflow_labels.config\\")" + ] }, "debug" : false, "container" : "docker" @@ -3018,8 +3026,8 @@ meta = [ "engine" : "docker|native", "output" : "/workdir/root/repo/target/nextflow/ucsc/bedclip", "viash_version" : "0.9.0", - "git_commit" : "d63250ae704b6bd9a11792c4f979be2309999a2e", - "git_remote" : "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + "git_commit" : "4adb388c7d928eea02bccf890214f3b932b08714", + "git_remote" : "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" }, "package_config" : { "name" : "rnaseq", @@ -3050,7 +3058,7 @@ meta = [ "source" : "/workdir/root/repo/src", "target" : "/workdir/root/repo/target", "config_mods" : [ - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag := '$id'\n", + ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config', dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\\"nextflow_labels.config\\")'\n", ".engines += { type: \\"native\\" }", ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'", ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/nextflow/ucsc/bedclip/nextflow.config b/target/nextflow/ucsc/bedclip/nextflow.config index 38976ff..b7d68ac 100644 --- a/target/nextflow/ucsc/bedclip/nextflow.config +++ b/target/nextflow/ucsc/bedclip/nextflow.config @@ -122,4 +122,4 @@ process{ withLabel: cpu1000 { cpus = 1000 } } - +includeConfig("nextflow_labels.config") diff --git a/target/nextflow/ucsc/bedclip/nextflow_labels.config b/target/nextflow/ucsc/bedclip/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/nextflow/ucsc/bedclip/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/nextflow/ucsc/bedgraphtobigwig/.config.vsh.yaml b/target/nextflow/ucsc/bedgraphtobigwig/.config.vsh.yaml index ad805dd..520313a 100644 --- a/target/nextflow/ucsc/bedgraphtobigwig/.config.vsh.yaml +++ b/target/nextflow/ucsc/bedgraphtobigwig/.config.vsh.yaml @@ -42,6 +42,9 @@ resources: - type: "bash_script" path: "script.sh" is_executable: true +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "Convert a bedGraph file to bigWig format" test_resources: - type: "bash_script" @@ -134,6 +137,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -164,8 +169,8 @@ build_info: output: "target/nextflow/ucsc/bedgraphtobigwig" executable: "target/nextflow/ucsc/bedgraphtobigwig/main.nf" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" package_config: name: "rnaseq" version: "main" @@ -186,8 +191,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/nextflow/ucsc/bedgraphtobigwig/main.nf b/target/nextflow/ucsc/bedgraphtobigwig/main.nf index f2eff2a..be1235c 100644 --- a/target/nextflow/ucsc/bedgraphtobigwig/main.nf +++ b/target/nextflow/ucsc/bedgraphtobigwig/main.nf @@ -2860,6 +2860,11 @@ meta = [ "type" : "bash_script", "path" : "script.sh", "is_executable" : true + }, + { + "type" : "file", + "path" : "/src/workflows/utils/labels.config", + "dest" : "nextflow_labels.config" } ], "description" : "Convert a bedGraph file to bigWig format", @@ -2976,7 +2981,10 @@ meta = [ "cpu200" : "cpus = 200", "cpu500" : "cpus = 500", "cpu1000" : "cpus = 1000" - } + }, + "script" : [ + "includeConfig(\\"nextflow_labels.config\\")" + ] }, "debug" : false, "container" : "docker" @@ -3018,8 +3026,8 @@ meta = [ "engine" : "docker|native", "output" : "/workdir/root/repo/target/nextflow/ucsc/bedgraphtobigwig", "viash_version" : "0.9.0", - "git_commit" : "d63250ae704b6bd9a11792c4f979be2309999a2e", - "git_remote" : "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + "git_commit" : "4adb388c7d928eea02bccf890214f3b932b08714", + "git_remote" : "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" }, "package_config" : { "name" : "rnaseq", @@ -3050,7 +3058,7 @@ meta = [ "source" : "/workdir/root/repo/src", "target" : "/workdir/root/repo/target", "config_mods" : [ - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag := '$id'\n", + ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config', dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\\"nextflow_labels.config\\")'\n", ".engines += { type: \\"native\\" }", ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'", ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/nextflow/ucsc/bedgraphtobigwig/nextflow.config b/target/nextflow/ucsc/bedgraphtobigwig/nextflow.config index ddc6f96..502c7a5 100644 --- a/target/nextflow/ucsc/bedgraphtobigwig/nextflow.config +++ b/target/nextflow/ucsc/bedgraphtobigwig/nextflow.config @@ -122,4 +122,4 @@ process{ withLabel: cpu1000 { cpus = 1000 } } - +includeConfig("nextflow_labels.config") diff --git a/target/nextflow/ucsc/bedgraphtobigwig/nextflow_labels.config b/target/nextflow/ucsc/bedgraphtobigwig/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/nextflow/ucsc/bedgraphtobigwig/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/nextflow/workflows/genome_alignment_and_quant/.config.vsh.yaml b/target/nextflow/workflows/genome_alignment_and_quant/.config.vsh.yaml index 3957eb1..28382bb 100644 --- a/target/nextflow/workflows/genome_alignment_and_quant/.config.vsh.yaml +++ b/target/nextflow/workflows/genome_alignment_and_quant/.config.vsh.yaml @@ -448,6 +448,9 @@ resources: path: "main.nf" is_executable: true entrypoint: "run_wf" +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "A viash sub-workflow for genome alignment and quantification stage of\ \ nf-core/rnaseq pipeline.\n" info: null @@ -578,6 +581,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -590,8 +595,8 @@ build_info: output: "target/nextflow/workflows/genome_alignment_and_quant" executable: "target/nextflow/workflows/genome_alignment_and_quant/main.nf" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" dependencies: - "target/dependencies/vsh/vsh/biobox/main/nextflow/star/star_align_reads" - "target/dependencies/vsh/vsh/biobox/main/nextflow/samtools/samtools_sort" @@ -623,8 +628,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/nextflow/workflows/genome_alignment_and_quant/main.nf b/target/nextflow/workflows/genome_alignment_and_quant/main.nf index 3b8f37a..7fa356c 100644 --- a/target/nextflow/workflows/genome_alignment_and_quant/main.nf +++ b/target/nextflow/workflows/genome_alignment_and_quant/main.nf @@ -3325,6 +3325,11 @@ meta = [ "path" : "main.nf", "is_executable" : true, "entrypoint" : "run_wf" + }, + { + "type" : "file", + "path" : "/src/workflows/utils/labels.config", + "dest" : "nextflow_labels.config" } ], "description" : "A viash sub-workflow for genome alignment and quantification stage of nf-core/rnaseq pipeline.\n", @@ -3498,7 +3503,10 @@ meta = [ "cpu200" : "cpus = 200", "cpu500" : "cpus = 500", "cpu1000" : "cpus = 1000" - } + }, + "script" : [ + "includeConfig(\\"nextflow_labels.config\\")" + ] }, "debug" : false, "container" : "docker" @@ -3516,8 +3524,8 @@ meta = [ "engine" : "native", "output" : "/workdir/root/repo/target/nextflow/workflows/genome_alignment_and_quant", "viash_version" : "0.9.0", - "git_commit" : "d63250ae704b6bd9a11792c4f979be2309999a2e", - "git_remote" : "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + "git_commit" : "4adb388c7d928eea02bccf890214f3b932b08714", + "git_remote" : "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" }, "package_config" : { "name" : "rnaseq", @@ -3548,7 +3556,7 @@ meta = [ "source" : "/workdir/root/repo/src", "target" : "/workdir/root/repo/target", "config_mods" : [ - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag := '$id'\n", + ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config', dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\\"nextflow_labels.config\\")'\n", ".engines += { type: \\"native\\" }", ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'", ".engines[.type == 'docker'].target_tag := 'main'" @@ -3585,86 +3593,92 @@ workflow run_wf { [ id, state + [ paired: paired, input: input ] ] } - | star_align_reads.run ( - runIf: { id, state -> state.aligner == 'star_salmon' }, - fromState: [ - "input": "fastq_1", - "input_r2": "fastq_2", - "genome_dir": "star_index", - "sjdb_gtf_file": "gtf", - "out_sam_attr_rg_line": "star_sam_attr_rg_line", - "sjdb_gtf_feature_exon": "star_sjdb_gtf_feature_exon" - ], - toState: [ - "genome_bam": "aligned_reads", - "transcriptome_bam": "reads_aligned_to_transcriptome", - "star_multiqc": "log" - ], - args: [ - quant_mode: "TranscriptomeSAM", - twopass_mode: "Basic", - out_sam_type: "BAM;Unsorted", - run_rng_seed: 0, - out_filter_multimap_nmax: 20, - align_sjdb_overhang_min: 1, - out_sam_attributes: "NH;HI;AS;NM;MD", - quant_transcriptome_sam_output: "BanSingleEnd" - ] + | star_align_reads.run( + runIf: { id, state -> state.aligner == 'star_salmon' }, + fromState: [ + "input": "fastq_1", + "input_r2": "fastq_2", + "genome_dir": "star_index", + "sjdb_gtf_file": "gtf", + "out_sam_attr_rg_line": "star_sam_attr_rg_line", + "sjdb_gtf_feature_exon": "star_sjdb_gtf_feature_exon" + ], + toState: [ + "genome_bam": "aligned_reads", + "transcriptome_bam": "reads_aligned_to_transcriptome", + "star_multiqc": "log" + ], + args: [ + quant_mode: "TranscriptomeSAM", + twopass_mode: "Basic", + out_sam_type: "BAM;Unsorted", + run_rng_seed: 0, + out_filter_multimap_nmax: 20, + align_sjdb_overhang_min: 1, + out_sam_attributes: "NH;HI;AS;NM;MD", + quant_transcriptome_sam_output: "BanSingleEnd" + ], + directives: [ label: [ "highmem", "midcpu" ] ] ) // GENOME BAM - | samtools_sort.run ( - runIf: { id, state -> state.aligner == 'star_salmon' }, - fromState: ["input": "genome_bam"], - toState: ["genome_bam_sorted": "output"], - key: "genome_sorted" + | samtools_sort.run( + runIf: { id, state -> state.aligner == 'star_salmon' }, + fromState: ["input": "genome_bam"], + toState: ["genome_bam_sorted": "output"], + key: "genome_sorted", + directives: [ label: [ "highmem", "midcpu" ] ] ) - | samtools_index.run ( - runIf: { id, state -> state.aligner == 'star_salmon' }, - fromState: [ - "input": "genome_bam_sorted", - "csi": "bam_csi_index" - ], - toState: [ "genome_bam_index": "output" ], - key: "genome_sorted" + | samtools_index.run( + runIf: { id, state -> state.aligner == 'star_salmon' }, + fromState: [ + "input": "genome_bam_sorted", + "csi": "bam_csi_index" + ], + toState: [ "genome_bam_index": "output" ], + key: "genome_sorted", + directives: [ label: [ "highmem", "midcpu" ] ] ) - | samtools_stats.run ( - runIf: { id, state -> state.aligner == 'star_salmon' }, - fromState: [ - "input": "genome_bam_sorted", - "bai": "genome_bam_index", - "fasta": "fasta" - ], - toState: [ "genome_bam_stats": "output" ], - key: "genome_stats" + | samtools_stats.run( + runIf: { id, state -> state.aligner == 'star_salmon' }, + fromState: [ + "input": "genome_bam_sorted", + "bai": "genome_bam_index", + "fasta": "fasta" + ], + toState: [ "genome_bam_stats": "output" ], + key: "genome_stats", + directives: [ label: [ "highmem", "midcpu" ] ] ) - | samtools_flagstat.run ( - runIf: { id, state -> state.aligner == 'star_salmon' }, - fromState: [ - "bam": "genome_bam_sorted", - "bai": "genome_bam_index", - "fasta": "fasta" - ], - toState: [ "genome_bam_flagstat": "output" ], - key: "genome_flagstat" + | samtools_flagstat.run( + runIf: { id, state -> state.aligner == 'star_salmon' }, + fromState: [ + "bam": "genome_bam_sorted", + "bai": "genome_bam_index", + "fasta": "fasta" + ], + toState: [ "genome_bam_flagstat": "output" ], + key: "genome_flagstat", + directives: [ label: [ "highmem", "midcpu" ] ] ) | samtools_idxstats.run( - runIf: { id, state -> state.aligner == 'star_salmon' }, - fromState: [ - "bam": "genome_bam_sorted", - "bai": "genome_bam_index", - "fasta": "fasta" - ], - toState: [ "genome_bam_idxstats": "output" ], - key: "genome_idxstats" + runIf: { id, state -> state.aligner == 'star_salmon' }, + fromState: [ + "bam": "genome_bam_sorted", + "bai": "genome_bam_index", + "fasta": "fasta" + ], + toState: [ "genome_bam_idxstats": "output" ], + key: "genome_idxstats", + directives: [ label: [ "highmem", "midcpu" ] ] ) - // - // Remove duplicate reads from BAM file based on UMIs - // - - // Deduplicate genome BAM file - | umi_tools_dedup.run ( + // + // Remove duplicate reads from BAM file based on UMIs + // + + // Deduplicate genome BAM file + | umi_tools_dedup.run( runIf: { id, state -> state.with_umi && state.aligner == 'star_salmon' }, fromState: { id, state -> def output_stats = state.umi_dedup_stats ? state.id : @@ -3674,18 +3688,20 @@ workflow run_wf { output_stats: output_stats] }, toState: [ "genome_bam_sorted": "output" ], - key: "genome_deduped" - ) - | samtools_index.run ( + key: "genome_deduped", + directives: [ label: [ "highmem", "midcpu" ] ] + ) + | samtools_index.run( runIf: { id, state -> state.with_umi && state.aligner == 'star_salmon' }, fromState: [ "input": "genome_bam_sorted", "csi": "bam_csi_index" ], toState: [ "genome_bam_index": "output" ], - key: "genome_deduped" - ) - | samtools_stats.run ( + key: "genome_deduped", + directives: [ label: [ "highmem", "midcpu" ] ] + ) + | samtools_stats.run( runIf: { id, state -> state.with_umi && state.aligner == 'star_salmon' }, fromState: [ "input": "genome_bam_sorted", @@ -3693,9 +3709,10 @@ workflow run_wf { "fasta": "fasta" ], toState: [ "genome_bam_stats": "output" ], - key: "genome_deduped_stats" - ) - | samtools_flagstat.run ( + key: "genome_deduped_stats", + directives: [ label: [ "highmem", "midcpu" ] ] + ) + | samtools_flagstat.run( runIf: { id, state -> state.with_umi && state.aligner == 'star_salmon' }, fromState: [ "bam": "genome_bam_sorted", @@ -3703,9 +3720,10 @@ workflow run_wf { "fasta": "fasta" ], toState: [ "genome_bam_flagstat": "output" ], - key: "genome_deduped_flagstat" - ) - | samtools_idxstats.run( + key: "genome_deduped_flagstat", + directives: [ label: [ "highmem", "midcpu" ] ] + ) + | samtools_idxstats.run( runIf: { id, state -> state.with_umi && state.aligner == 'star_salmon' }, fromState: [ "bam": "genome_bam_sorted", @@ -3713,55 +3731,61 @@ workflow run_wf { "fasta": "fasta", ], toState: [ "genome_bam_idxstats": "output" ], - key: "genome_deduped_idxstats" - ) + key: "genome_deduped_idxstats", + directives: [ label: [ "highmem", "midcpu" ] ] + ) // Deduplicate transcriptome BAM file - | samtools_sort.run ( + | samtools_sort.run( runIf: { id, state -> state.with_umi && state.aligner == 'star_salmon' }, fromState: [ "input": "transcriptome_bam" ], toState: [ "transcriptome_bam": "output" ], - key: "transcriptome_sorted" - ) - | samtools_index.run ( + key: "transcriptome_sorted", + directives: [ label: [ "highmem", "midcpu" ] ] + ) + | samtools_index.run( runIf: { id, state -> state.with_umi && state.aligner == 'star_salmon' }, fromState: [ "input": "transcriptome_bam", "csi": "bam_csi_index" ], toState: [ "transcriptome_bam_index": "output" ], - key: "transcriptome_sorted" - ) - | samtools_stats.run ( + key: "transcriptome_sorted", + directives: [ label: [ "highmem", "midcpu" ] ] + ) + | samtools_stats.run( runIf: { id, state -> state.with_umi && state.aligner == 'star_salmon' }, fromState: [ "input": "transcriptome_bam", "bai": "transcriptome_bam_index", ], toState: [ "transcriptome_bam_stats": "output" ], - key: "transcriptome_stats" - ) - | samtools_flagstat.run ( + key: "transcriptome_stats", + directives: [ label: [ "highmem", "midcpu" ] ] + ) + | samtools_flagstat.run( runIf: { id, state -> state.with_umi && state.aligner == 'star_salmon' }, fromState: [ "bam": "transcriptome_bam", "bai": "transcriptome_bam_index" ], toState: [ "transcriptome_bam_flagstat": "output" ], - key: "transcriptome_flagstat" - ) - | samtools_idxstats.run( + key: "transcriptome_flagstat", + directives: [ label: [ "highmem", "midcpu" ] ] + ) + | samtools_idxstats.run( runIf: { id, state -> state.with_umi && state.aligner == 'star_salmon' }, fromState: [ "bam": "transcriptome_bam", "bai": "transcriptome_bam_index" ], toState: [ "transcriptome_bam_idxstats": "output" ], - key: "transcriptome_idxstats" - ) - - | umi_tools_dedup.run ( + key: "transcriptome_idxstats", + directives: [ label: [ "highmem", "midcpu" ] ] + ) + + | umi_tools_dedup.run( runIf: { id, state -> state.with_umi && state.aligner == 'star_salmon' }, fromState: { id, state -> def output_stats = state.umi_dedup_stats ? state.id : @@ -3771,57 +3795,64 @@ workflow run_wf { output_stats: output_stats] }, toState: [ "transcriptome_bam_deduped": "output" ], - key: "transcriptome_deduped" - ) - | samtools_sort.run ( + key: "transcriptome_deduped", + directives: [ label: [ "highmem", "midcpu" ] ] + ) + | samtools_sort.run( runIf: { id, state -> state.with_umi && state.aligner == 'star_salmon' }, fromState: [ "input": "transcriptome_bam_deduped" ], toState: [ "transcriptome_bam": "output" ], - key: "transcriptome_deduped_sorted" - ) - | samtools_index.run ( - runIf: { id, state -> state.with_umi && state.aligner == 'star_salmon' }, - fromState: [ - "input": "transcriptome_bam", - "csi": "bam_csi_index" - ], - toState: [ "transcriptome_bam_index": "output" ], - key: "transcriptome_deduped_sorted" - ) - | samtools_stats.run ( + key: "transcriptome_deduped_sorted", + directives: [ label: [ "highmem", "midcpu" ] ] + ) + | samtools_index.run( + runIf: { id, state -> state.with_umi && state.aligner == 'star_salmon' }, + fromState: [ + "input": "transcriptome_bam", + "csi": "bam_csi_index" + ], + toState: [ "transcriptome_bam_index": "output" ], + key: "transcriptome_deduped_sorted", + directives: [ label: [ "highmem", "midcpu" ] ] + ) + | samtools_stats.run( runIf: { id, state -> state.with_umi && state.aligner == 'star_salmon' }, fromState: [ "input": "transcriptome_bam", "bai": "transcriptome_bam_index" ], toState: [ "transcriptome_bam_stats": "output" ], - key: "transcriptome_deduped_stats" - ) - | samtools_flagstat.run ( + key: "transcriptome_deduped_stats", + directives: [ label: [ "highmem", "midcpu" ] ] + ) + | samtools_flagstat.run( runIf: { id, state -> state.with_umi && state.aligner == 'star_salmon' }, fromState: [ "bam": "transcriptome_bam", "bai": "transcriptome_bam_index" ], toState: [ "transcriptome_bam_flagstat": "output" ], - key: "transcriptome_deduped_flagstat" - ) - | samtools_idxstats.run( + key: "transcriptome_deduped_flagstat", + directives: [ label: [ "highmem", "midcpu" ] ] + ) + | samtools_idxstats.run( runIf: { id, state -> state.with_umi && state.aligner == 'star_salmon' }, fromState: [ "bam": "transcriptome_bam", "bai": "transcriptome_bam_index" ], toState: [ "transcriptome_bam_idxstats": "output" ], - key: "transcriptome_deduped_idxstats" - ) + key: "transcriptome_deduped_idxstats", + directives: [ label: [ "highmem", "midcpu" ] ] + ) - // Fix paired-end reads in name sorted BAM file - | umi_tools_prepareforrsem.run ( + // Fix paired-end reads in name sorted BAM file + | umi_tools_prepareforrsem.run( runIf: { id, state -> state.with_umi && state.paired && state.aligner == 'star_salmon' }, fromState: [ "input": "transcriptome_bam" ], - toState: [ "transcriptome_bam": "output" ] - ) + toState: [ "transcriptome_bam": "output" ], + directives: [ label: [ "highmem", "midcpu" ] ] + ) // Infer lib-type for salmon quant | map { id, state -> @@ -3844,26 +3875,27 @@ workflow run_wf { } // Count reads from BAM alignments using Salmon - | salmon_quant.run ( - runIf: { id, state -> state.aligner == 'star_salmon' }, - fromState: [ - "lib_type": "lib_type", - "alignments": "transcriptome_bam", - "targets": "transcript_fasta", - "gene_map": "gtf" - ], - toState: [ - "quant_out_dir": "output", - "quant_results_file": "quant_results" - ] + | salmon_quant.run( + runIf: { id, state -> state.aligner == 'star_salmon' }, + fromState: [ + "lib_type": "lib_type", + "alignments": "transcriptome_bam", + "targets": "transcript_fasta", + "gene_map": "gtf" + ], + toState: [ + "quant_out_dir": "output", + "quant_results_file": "quant_results" + ], + directives: [ label: [ "highmem", "midcpu" ] ] ) - | map { id, state -> - def mod_state = (state.aligner == 'star_salmon') ? state + [salmon_multiqc: state.quant_out_dir] : state - [ id, mod_state ] - } - - | rsem_calculate_expression.run ( + | map { id, state -> + def mod_state = (state.aligner == 'star_salmon') ? state + [salmon_multiqc: state.quant_out_dir] : state + [ id, mod_state ] + } + + | rsem_calculate_expression.run( runIf: { id, state -> state.aligner == 'star_rsem' }, fromState: [ "id": "id", @@ -3894,26 +3926,29 @@ workflow run_wf { "bam_star_rsem": "bam_star", "bam_genome_rsem": "bam_genome", "bam_transcript_rsem": "bam_transcript" - ] - ) - - // RSEM_Star BAM - | samtools_sort.run ( + ], + directives: [ label: [ "highmem", "midcpu" ] ] + ) + + // RSEM_Star BAM + | samtools_sort.run( runIf: { id, state -> state.aligner == 'star_rsem' }, fromState: ["input": "bam_star_rsem"], toState: ["genome_bam_sorted": "output"], - key: "genome_sorted" - ) - | samtools_index.run ( + key: "genome_sorted", + directives: [ label: [ "highmem", "midcpu" ] ] + ) + | samtools_index.run( runIf: { id, state -> state.aligner == 'star_rsem' }, fromState: [ "input": "genome_bam_sorted", "csi": "bam_csi_index" ], toState: [ "genome_bam_index": "output" ], - key: "genome_sorted" - ) - | samtools_stats.run ( + key: "genome_sorted", + directives: [ label: [ "highmem", "midcpu" ] ] + ) + | samtools_stats.run( runIf: { id, state -> state.aligner == 'star_rsem' }, fromState: [ "input": "genome_bam_sorted", @@ -3921,9 +3956,10 @@ workflow run_wf { "fasta": "fasta" ], toState: [ "genome_bam_stats": "output" ], - key: "genome_stats" - ) - | samtools_flagstat.run ( + key: "genome_stats", + directives: [ label: [ "highmem", "midcpu" ] ] + ) + | samtools_flagstat.run( runIf: { id, state -> state.aligner == 'star_rsem' }, fromState: [ "bam": "genome_bam_sorted", @@ -3931,9 +3967,10 @@ workflow run_wf { "fasta": "fasta" ], toState: [ "genome_bam_flagstat": "output" ], - key: "genome_flagstat" - ) - | samtools_idxstats.run( + key: "genome_flagstat", + directives: [ label: [ "highmem", "midcpu" ] ] + ) + | samtools_idxstats.run( runIf: { id, state -> state.aligner == 'star_rsem' }, fromState: [ "bam": "genome_bam_sorted", @@ -3941,9 +3978,9 @@ workflow run_wf { "fasta": "fasta" ], toState: [ "genome_bam_idxstats": "output" ], - key: "genome_idxstats" - ) - + key: "genome_idxstats", + directives: [ label: [ "highmem", "midcpu" ] ] + ) | map { id, state -> def mod_state = state.findAll { key, value -> value instanceof java.nio.file.Path && value.exists() } [ id, mod_state ] @@ -3968,9 +4005,10 @@ workflow run_wf { "rsem_counts_gene": "rsem_counts_gene", "rsem_counts_transcripts": "rsem_counts_transcripts", "bam_genome_rsem": "bam_genome_rsem", - "bam_transcript_rsem": "bam_transcript_rsem" ] + "bam_transcript_rsem": "bam_transcript_rsem" + ] ) - + emit: output_ch } diff --git a/target/nextflow/workflows/genome_alignment_and_quant/nextflow.config b/target/nextflow/workflows/genome_alignment_and_quant/nextflow.config index a904cd9..272d111 100644 --- a/target/nextflow/workflows/genome_alignment_and_quant/nextflow.config +++ b/target/nextflow/workflows/genome_alignment_and_quant/nextflow.config @@ -122,4 +122,4 @@ process{ withLabel: cpu1000 { cpus = 1000 } } - +includeConfig("nextflow_labels.config") diff --git a/target/nextflow/workflows/genome_alignment_and_quant/nextflow_labels.config b/target/nextflow/workflows/genome_alignment_and_quant/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/nextflow/workflows/genome_alignment_and_quant/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/nextflow/workflows/merge_quant_results/.config.vsh.yaml b/target/nextflow/workflows/merge_quant_results/.config.vsh.yaml index 3b37a73..cbe8021 100644 --- a/target/nextflow/workflows/merge_quant_results/.config.vsh.yaml +++ b/target/nextflow/workflows/merge_quant_results/.config.vsh.yaml @@ -177,6 +177,9 @@ resources: path: "main.nf" is_executable: true entrypoint: "run_wf" +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "A sub-workflow to merge the counts obtained from salmon quant across\ \ all samples." info: null @@ -266,6 +269,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -278,8 +283,8 @@ build_info: output: "target/nextflow/workflows/merge_quant_results" executable: "target/nextflow/workflows/merge_quant_results/main.nf" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" dependencies: - "target/nextflow/tx2gene" - "target/nextflow/tximport" @@ -304,8 +309,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/nextflow/workflows/merge_quant_results/main.nf b/target/nextflow/workflows/merge_quant_results/main.nf index 1ea5e5a..cf9d08f 100644 --- a/target/nextflow/workflows/merge_quant_results/main.nf +++ b/target/nextflow/workflows/merge_quant_results/main.nf @@ -3020,6 +3020,11 @@ meta = [ "path" : "main.nf", "is_executable" : true, "entrypoint" : "run_wf" + }, + { + "type" : "file", + "path" : "/src/workflows/utils/labels.config", + "dest" : "nextflow_labels.config" } ], "description" : "A sub-workflow to merge the counts obtained from salmon quant across all samples.", @@ -3131,7 +3136,10 @@ meta = [ "cpu200" : "cpus = 200", "cpu500" : "cpus = 500", "cpu1000" : "cpus = 1000" - } + }, + "script" : [ + "includeConfig(\\"nextflow_labels.config\\")" + ] }, "debug" : false, "container" : "docker" @@ -3149,8 +3157,8 @@ meta = [ "engine" : "native", "output" : "/workdir/root/repo/target/nextflow/workflows/merge_quant_results", "viash_version" : "0.9.0", - "git_commit" : "d63250ae704b6bd9a11792c4f979be2309999a2e", - "git_remote" : "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + "git_commit" : "4adb388c7d928eea02bccf890214f3b932b08714", + "git_remote" : "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" }, "package_config" : { "name" : "rnaseq", @@ -3181,7 +3189,7 @@ meta = [ "source" : "/workdir/root/repo/src", "target" : "/workdir/root/repo/target", "config_mods" : [ - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag := '$id'\n", + ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config', dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\\"nextflow_labels.config\\")'\n", ".engines += { type: \\"native\\" }", ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'", ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/nextflow/workflows/merge_quant_results/nextflow.config b/target/nextflow/workflows/merge_quant_results/nextflow.config index 61bb4a1..566442d 100644 --- a/target/nextflow/workflows/merge_quant_results/nextflow.config +++ b/target/nextflow/workflows/merge_quant_results/nextflow.config @@ -122,4 +122,4 @@ process{ withLabel: cpu1000 { cpus = 1000 } } - +includeConfig("nextflow_labels.config") diff --git a/target/nextflow/workflows/merge_quant_results/nextflow_labels.config b/target/nextflow/workflows/merge_quant_results/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/nextflow/workflows/merge_quant_results/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/nextflow/workflows/post_processing/.config.vsh.yaml b/target/nextflow/workflows/post_processing/.config.vsh.yaml index c952924..a71d81c 100644 --- a/target/nextflow/workflows/post_processing/.config.vsh.yaml +++ b/target/nextflow/workflows/post_processing/.config.vsh.yaml @@ -343,6 +343,9 @@ resources: path: "main.nf" is_executable: true entrypoint: "run_wf" +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "A viash sub-workflow for the post-processing stage of nf-core/rnaseq\ \ pipeline.\n" info: null @@ -465,6 +468,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -477,8 +482,8 @@ build_info: output: "target/nextflow/workflows/post_processing" executable: "target/nextflow/workflows/post_processing/main.nf" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" dependencies: - "target/nextflow/picard_markduplicates" - "target/dependencies/vsh/vsh/biobox/main/nextflow/samtools/samtools_sort" @@ -510,8 +515,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/nextflow/workflows/post_processing/main.nf b/target/nextflow/workflows/post_processing/main.nf index f1cccf0..ef2fbda 100644 --- a/target/nextflow/workflows/post_processing/main.nf +++ b/target/nextflow/workflows/post_processing/main.nf @@ -3204,6 +3204,11 @@ meta = [ "path" : "main.nf", "is_executable" : true, "entrypoint" : "run_wf" + }, + { + "type" : "file", + "path" : "/src/workflows/utils/labels.config", + "dest" : "nextflow_labels.config" } ], "description" : "A viash sub-workflow for the post-processing stage of nf-core/rnaseq pipeline.\n", @@ -3369,7 +3374,10 @@ meta = [ "cpu200" : "cpus = 200", "cpu500" : "cpus = 500", "cpu1000" : "cpus = 1000" - } + }, + "script" : [ + "includeConfig(\\"nextflow_labels.config\\")" + ] }, "debug" : false, "container" : "docker" @@ -3387,8 +3395,8 @@ meta = [ "engine" : "native", "output" : "/workdir/root/repo/target/nextflow/workflows/post_processing", "viash_version" : "0.9.0", - "git_commit" : "d63250ae704b6bd9a11792c4f979be2309999a2e", - "git_remote" : "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + "git_commit" : "4adb388c7d928eea02bccf890214f3b932b08714", + "git_remote" : "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" }, "package_config" : { "name" : "rnaseq", @@ -3419,7 +3427,7 @@ meta = [ "source" : "/workdir/root/repo/src", "target" : "/workdir/root/repo/target", "config_mods" : [ - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag := '$id'\n", + ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config', dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\\"nextflow_labels.config\\")'\n", ".engines += { type: \\"native\\" }", ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'", ".engines[.type == 'docker'].target_tag := 'main'" @@ -3447,180 +3455,194 @@ include { bedgraphtobigwig } from "${meta.resources_dir}/../../../nextflow/ucsc/ // Note: some helper functionality is added at the end of this file workflow run_wf { - take: + take: input_ch - main: - output_ch = input_ch + main: - | picard_markduplicates.run ( - runIf: { id, state -> !state.skip_markduplicates && !state.with_umi }, - fromState: [ - "bam": "genome_bam", - "fasta": "fasta", - "fai": "fai", - "extra_picard_args": "extra_picard_args" - ], - toState: [ - "processed_genome_bam": "output_bam", - "markduplicates_metrics": "metrics" - ] - ) - | samtools_sort.run ( - runIf: { id, state -> !state.skip_markduplicates && !state.with_umi }, - fromState: [ "input": "processed_genome_bam" ], - toState: [ "processed_genome_bam": "output" ], - key: "genome_sorted_MarkDuplicates" - ) - | samtools_index.run ( - runIf: { id, state -> !state.skip_markduplicates && !state.with_umi }, - fromState: [ - "input": "processed_genome_bam", - "csi": "bam_csi_index" - ], - toState: [ "genome_bam_index": "output" ], - key: "genome_sorted_MarkDuplicates", - ) - | samtools_stats.run ( - runIf: { id, state -> !state.skip_markduplicates && !state.with_umi }, - fromState: [ - "input": "processed_genome_bam", - "bai": "genome_bam_index" - ], - toState: [ "genome_bam_stats": "output" ], - key: "MarkDuplicates_stats" - ) - | samtools_flagstat.run ( - runIf: { id, state -> !state.skip_markduplicates && !state.with_umi }, - fromState: [ - "bam": "processed_genome_bam", - "bai": "genome_bam_index" - ], - toState: [ "genome_bam_flagstat": "output" ], - key: "MarkDuplicates_flagstat" - ) - | samtools_idxstats.run( - runIf: { id, state -> !state.skip_markduplicates && !state.with_umi }, - fromState: [ - "bam": "processed_genome_bam", - "bai": "genome_bam_index" - ], - toState: [ "genome_bam_idxstats": "output" ], - key: "MarkDuplicates_idxstats" - ) + output_ch = input_ch - | stringtie.run ( - runIf: { id, state -> !state.skip_stringtie }, - fromState: [ - "strandedness": "strandedness", - "bam": "processed_genome_bam", - "annotation_gtf": "gtf", - "extra_stringtie_args": "extra_stringtie_args" - ], - toState: [ - "stringtie_transcript_gtf": "transcript_gtf", - "stringtie_coverage_gtf": "coverage_gtf", - "stringtie_abundance": "abundance", - "stringtie_ballgown": "ballgown" - ] - ) + | picard_markduplicates.run ( + runIf: { id, state -> !state.skip_markduplicates && !state.with_umi }, + fromState: [ + "bam": "genome_bam", + "fasta": "fasta", + "fai": "fai", + "extra_picard_args": "extra_picard_args" + ], + toState: [ + "processed_genome_bam": "output_bam", + "markduplicates_metrics": "metrics" + ], + directives: [ label: [ "midmem", "midcpu" ] ] + ) + | samtools_sort.run ( + runIf: { id, state -> !state.skip_markduplicates && !state.with_umi }, + fromState: [ "input": "processed_genome_bam" ], + toState: [ "processed_genome_bam": "output" ], + key: "genome_sorted_MarkDuplicates", + directives: [ label: [ "midmem", "midcpu" ] ] + ) + | samtools_index.run ( + runIf: { id, state -> !state.skip_markduplicates && !state.with_umi }, + fromState: [ + "input": "processed_genome_bam", + "csi": "bam_csi_index" + ], + toState: [ "genome_bam_index": "output" ], + key: "genome_sorted_MarkDuplicates", + directives: [ label: [ "midmem", "midcpu" ] ] + ) + | samtools_stats.run ( + runIf: { id, state -> !state.skip_markduplicates && !state.with_umi }, + fromState: [ + "input": "processed_genome_bam", + "bai": "genome_bam_index" + ], + toState: [ "genome_bam_stats": "output" ], + key: "MarkDuplicates_stats", + directives: [ label: [ "midmem", "midcpu" ] ] + ) + | samtools_flagstat.run ( + runIf: { id, state -> !state.skip_markduplicates && !state.with_umi }, + fromState: [ + "bam": "processed_genome_bam", + "bai": "genome_bam_index" + ], + toState: [ "genome_bam_flagstat": "output" ], + key: "MarkDuplicates_flagstat", + directives: [ label: [ "midmem", "midcpu" ] ] + ) + | samtools_idxstats.run( + runIf: { id, state -> !state.skip_markduplicates && !state.with_umi }, + fromState: [ + "bam": "processed_genome_bam", + "bai": "genome_bam_index" + ], + toState: [ "genome_bam_idxstats": "output" ], + key: "MarkDuplicates_idxstats", + directives: [ label: [ "midmem", "midcpu" ] ] + ) - // Genome-wide coverage with BEDTools + | stringtie.run ( + runIf: { id, state -> !state.skip_stringtie }, + fromState: [ + "strandedness": "strandedness", + "bam": "processed_genome_bam", + "annotation_gtf": "gtf", + "extra_stringtie_args": "extra_stringtie_args" + ], + toState: [ + "stringtie_transcript_gtf": "transcript_gtf", + "stringtie_coverage_gtf": "coverage_gtf", + "stringtie_abundance": "abundance", + "stringtie_ballgown": "ballgown" + ], + directives: [ label: [ "midmem", "midcpu" ] ] + ) - | bedtools_genomecov.run ( - runIf: { id, state -> !state.skip_bigwig }, - fromState: [ - "input_bam": "processed_genome_bam", - ], - args: [ - split: true, - du: true, - bed_graph: true, - strand: "+" - ], - toState: [ "bedgraph_forward": "output" ], - key: "bedtools_genomecov_forward" - ) + // Genome-wide coverage with BEDTools - | bedtools_genomecov.run ( - runIf: { id, state -> !state.skip_bigwig }, - fromState: [ - "input_bam": "processed_genome_bam", - ], - args: [ - split: true, - du: true, - bed_graph: true, - strand: "-" - ], - toState: [ "bedgraph_reverse": "output" ], - key: "bedtools_genomecov_reverse" - ) + | bedtools_genomecov.run ( + runIf: { id, state -> !state.skip_bigwig }, + fromState: [ + "input_bam": "processed_genome_bam", + ], + args: [ + split: true, + du: true, + bed_graph: true, + strand: "+" + ], + toState: [ "bedgraph_forward": "output" ], + key: "bedtools_genomecov_forward", + directives: [ label: [ "midmem", "midcpu" ] ] + ) - | bedclip.run ( - runIf: { id, state -> !state.skip_bigwig }, - fromState: [ - "input_bedgraph": "bedgraph_forward", - "sizes": "chrom_sizes" - ], - toState: [ "bedgraph_forward": "output_bedgraph" ], - key: "bedclip_forward" - ) + | bedtools_genomecov.run ( + runIf: { id, state -> !state.skip_bigwig }, + fromState: [ + "input_bam": "processed_genome_bam", + ], + args: [ + split: true, + du: true, + bed_graph: true, + strand: "-" + ], + toState: [ "bedgraph_reverse": "output" ], + key: "bedtools_genomecov_reverse", + directives: [ label: [ "midmem", "midcpu" ] ] + ) - | bedgraphtobigwig.run ( - runIf: { id, state -> !state.skip_bigwig }, - fromState: [ - "bedgraph": "bedgraph_forward", - "sizes": "chrom_sizes" - ], - toState: [ "bigwig_forward": "bigwig" ], - key: "bedgraphtobigwig_forward" - ) + | bedclip.run ( + runIf: { id, state -> !state.skip_bigwig }, + fromState: [ + "input_bedgraph": "bedgraph_forward", + "sizes": "chrom_sizes" + ], + toState: [ "bedgraph_forward": "output_bedgraph" ], + key: "bedclip_forward", + directives: [ label: [ "midmem", "midcpu" ] ] + ) - | bedclip.run ( - runIf: { id, state -> !state.skip_bigwig }, - fromState: [ - "input_bedgraph": "bedgraph_reverse", - "sizes": "chrom_sizes", - ], - toState: [ "bedgraph_reverse": "output_bedgraph" ], - key: "bedclip_reverse" - ) + | bedgraphtobigwig.run ( + runIf: { id, state -> !state.skip_bigwig }, + fromState: [ + "bedgraph": "bedgraph_forward", + "sizes": "chrom_sizes" + ], + toState: [ "bigwig_forward": "bigwig" ], + key: "bedgraphtobigwig_forward", + directives: [ label: [ "midmem", "midcpu" ] ] + ) - | bedgraphtobigwig.run ( - runIf: { id, state -> !state.skip_bigwig }, - fromState: [ - "bedgraph": "bedgraph_reverse", - "sizes": "chrom_sizes" - ], - toState: [ "bigwig_reverse": "bigwig" ], - key: "bedgraphtobigwig_reverse" - ) + | bedclip.run ( + runIf: { id, state -> !state.skip_bigwig }, + fromState: [ + "input_bedgraph": "bedgraph_reverse", + "sizes": "chrom_sizes", + ], + toState: [ "bedgraph_reverse": "output_bedgraph" ], + key: "bedclip_reverse", + directives: [ label: [ "midmem", "midcpu" ] ] + ) - | map { id, state -> - def mod_state = state.findAll { key, value -> value instanceof java.nio.file.Path && value.exists() } - [ id, mod_state ] - } + | bedgraphtobigwig.run ( + runIf: { id, state -> !state.skip_bigwig }, + fromState: [ + "bedgraph": "bedgraph_reverse", + "sizes": "chrom_sizes" + ], + toState: [ "bigwig_reverse": "bigwig" ], + key: "bedgraphtobigwig_reverse", + directives: [ label: [ "midmem", "midcpu" ] ] + ) - | setState ( - "processed_genome_bam": "processed_genome_bam", - "genome_bam_index": "genome_bam_index", - "genome_bam_stats": "genome_bam_stats", - "genome_bam_flagstat": "genome_bam_flagstat", - "genome_bam_idxstats": "genome_bam_idxstats", - "markduplicates_metrics": "markduplicates_metrics", - "stringtie_transcript_gtf": "stringtie_transcript_gtf", - "stringtie_coverage_gtf": "stringtie_coverage_gtf", - "stringtie_abundance": "stringtie_abundance", - "stringtie_ballgown": "stringtie_ballgown", - "bedgraph_forward": "bedgraph_forward", - "bedgraph_reverse": "bedgraph_reverse", - "bigwig_forward": "bigwig_forward", - "bigwig_reverse": "bigwig_reverse" - ) + | map { id, state -> + def mod_state = state.findAll { key, value -> value instanceof java.nio.file.Path && value.exists() } + [ id, mod_state ] + } - emit: - output_ch + | setState ( + "processed_genome_bam": "processed_genome_bam", + "genome_bam_index": "genome_bam_index", + "genome_bam_stats": "genome_bam_stats", + "genome_bam_flagstat": "genome_bam_flagstat", + "genome_bam_idxstats": "genome_bam_idxstats", + "markduplicates_metrics": "markduplicates_metrics", + "stringtie_transcript_gtf": "stringtie_transcript_gtf", + "stringtie_coverage_gtf": "stringtie_coverage_gtf", + "stringtie_abundance": "stringtie_abundance", + "stringtie_ballgown": "stringtie_ballgown", + "bedgraph_forward": "bedgraph_forward", + "bedgraph_reverse": "bedgraph_reverse", + "bigwig_forward": "bigwig_forward", + "bigwig_reverse": "bigwig_reverse" + ) + + emit: + output_ch } // inner workflow hook diff --git a/target/nextflow/workflows/post_processing/nextflow.config b/target/nextflow/workflows/post_processing/nextflow.config index 01d2cbf..00f3c28 100644 --- a/target/nextflow/workflows/post_processing/nextflow.config +++ b/target/nextflow/workflows/post_processing/nextflow.config @@ -122,4 +122,4 @@ process{ withLabel: cpu1000 { cpus = 1000 } } - +includeConfig("nextflow_labels.config") diff --git a/target/nextflow/workflows/post_processing/nextflow_labels.config b/target/nextflow/workflows/post_processing/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/nextflow/workflows/post_processing/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/nextflow/workflows/pre_processing/.config.vsh.yaml b/target/nextflow/workflows/pre_processing/.config.vsh.yaml index 2a31588..8423cdf 100644 --- a/target/nextflow/workflows/pre_processing/.config.vsh.yaml +++ b/target/nextflow/workflows/pre_processing/.config.vsh.yaml @@ -501,6 +501,9 @@ resources: path: "main.nf" is_executable: true entrypoint: "run_wf" +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "A subworkflow for the pre-processing stage of the nf-core/rnaseq pipeline.\n" info: null status: "enabled" @@ -620,6 +623,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -632,8 +637,8 @@ build_info: output: "target/nextflow/workflows/pre_processing" executable: "target/nextflow/workflows/pre_processing/main.nf" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" dependencies: - "target/dependencies/vsh/vsh/biobox/main/nextflow/fastqc" - "target/dependencies/vsh/vsh/biobox/main/nextflow/umi_tools/umi_tools_extract" @@ -663,8 +668,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/nextflow/workflows/pre_processing/main.nf b/target/nextflow/workflows/pre_processing/main.nf index 22a2b0b..80d5da5 100644 --- a/target/nextflow/workflows/pre_processing/main.nf +++ b/target/nextflow/workflows/pre_processing/main.nf @@ -3401,6 +3401,11 @@ meta = [ "path" : "main.nf", "is_executable" : true, "entrypoint" : "run_wf" + }, + { + "type" : "file", + "path" : "/src/workflows/utils/labels.config", + "dest" : "nextflow_labels.config" } ], "description" : "A subworkflow for the pre-processing stage of the nf-core/rnaseq pipeline.\n", @@ -3558,7 +3563,10 @@ meta = [ "cpu200" : "cpus = 200", "cpu500" : "cpus = 500", "cpu1000" : "cpus = 1000" - } + }, + "script" : [ + "includeConfig(\\"nextflow_labels.config\\")" + ] }, "debug" : false, "container" : "docker" @@ -3576,8 +3584,8 @@ meta = [ "engine" : "native", "output" : "/workdir/root/repo/target/nextflow/workflows/pre_processing", "viash_version" : "0.9.0", - "git_commit" : "d63250ae704b6bd9a11792c4f979be2309999a2e", - "git_remote" : "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + "git_commit" : "4adb388c7d928eea02bccf890214f3b932b08714", + "git_remote" : "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" }, "package_config" : { "name" : "rnaseq", @@ -3608,7 +3616,7 @@ meta = [ "source" : "/workdir/root/repo/src", "target" : "/workdir/root/repo/target", "config_mods" : [ - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag := '$id'\n", + ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config', dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\\"nextflow_labels.config\\")'\n", ".engines += { type: \\"native\\" }", ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'", ".engines[.type == 'docker'].target_tag := 'main'" @@ -3658,7 +3666,8 @@ workflow run_wf { def new_state = state + newKeys return new_state }, - args: [html: "*.html", zip: "*.zip"] + args: [html: "*.html", zip: "*.zip"], + directives: [ label: [ "midmem", "highcpu" ] ] ) // Extract UMIs from fastq files and discard read 1 or read 2 if required @@ -3681,7 +3690,8 @@ workflow run_wf { toState: [ "fastq_1": "output", "fastq_2": "read2_out" - ] + ], + directives: [ label: [ "midmem", "midcpu" ] ] ) // Discard read if required @@ -3720,7 +3730,8 @@ workflow run_wf { "trim_zip_2": "trimmed_fastqc_zip_2", "trim_html_1": "trimmed_fastqc_html_1", "trim_html_2": "trimmed_fastqc_html_2" - ] + ], + directives: [ label: [ "midmem", "midcpu" ] ] ) // Trim reads using fastp @@ -3745,7 +3756,8 @@ workflow run_wf { "trim_json": "json", "trim_html": "html", "trim_merged_out": "merged_out" - ] + ], + directives: [ label: [ "midmem", "midcpu" ] ] ) // Perform FASTQC on reads trimmed using fastp @@ -3766,7 +3778,8 @@ workflow run_wf { return new_state }, args: [html: "*.html", zip: "*.zip"], - key: "fastqc_trimming" + key: "fastqc_trimming", + directives: [ label: [ "midmem", "midcpu" ] ] ) // Filter out contaminant RNA @@ -3782,7 +3795,8 @@ workflow run_wf { toState: [ "fastq_1": "fastq_1", "fastq_2": "fastq_2" - ] + ], + directives: [ label: [ "midmem", "midcpu" ] ] ) // Sort reads by rRNA and non-rRNA @@ -3807,7 +3821,8 @@ workflow run_wf { ] def new_state = state + newKeys return new_state - } + }, + directives: [ label: [ "highmem", "midcpu" ] ] ) | map { id, state -> if (state.remove_ribo_rna) { @@ -3833,7 +3848,8 @@ workflow run_wf { toState: [ "subsampled_fastq_1": "output_1", "subsampled_fastq_2": "output_2" - ] + ], + directives: [ label: [ "midmem", "midcpu" ] ] ) // Infer lib-type for salmon quant @@ -3870,39 +3886,40 @@ workflow run_wf { lib_type: state.lib_type ] }, args: [ "skip_quant": true ], - toState: [ "salmon_quant_output": "output" ] + toState: [ "salmon_quant_output": "output" ], + directives: [ label: [ "highmem", "highcpu" ] ] ) - | map { id, state -> - def mod_state = (!state.paired) ? - [trim_log_2: state.remove(state.trim_log_2), trim_zip_2: state.remove(state.trim_zip_2), trim_html_2: state.remove(state.trim_html_2), failed_trim_unpaired2: state.remove(state.failed_trim_unpaired2)] : - [] - [ id, state + mod_state ] - } + | map { id, state -> + def mod_state = (!state.paired) ? + [trim_log_2: state.remove(state.trim_log_2), trim_zip_2: state.remove(state.trim_zip_2), trim_html_2: state.remove(state.trim_html_2), failed_trim_unpaired2: state.remove(state.failed_trim_unpaired2)] : + [] + [ id, state + mod_state ] + } - | map { id, state -> - def mod_state = state.findAll { key, value -> value instanceof java.nio.file.Path && value.exists() } - [ id, mod_state ] - } + | map { id, state -> + def mod_state = state.findAll { key, value -> value instanceof java.nio.file.Path && value.exists() } + [ id, mod_state ] + } | setState ( - "fastqc_html_1": "fastqc_html_1", - "fastqc_html_2": "fastqc_html_2", - "fastqc_zip_1": "fastqc_zip_1", - "fastqc_zip_2": "fastqc_zip_2", - "qc_output1": "fastq_1", - "qc_output2": "fastq_2", - "trim_log_1": "trim_log_1", - "trim_log_2": "trim_log_2", - "trim_zip_1": "trim_zip_1", - "trim_zip_2": "trim_zip_2", - "trim_html_1": "trim_html_1", - "trim_html_2": "trim_html_2", - "sortmerna_log": "sortmerna_log", - "trim_json": "trim_json", - "trim_html": "trim_html", - "trim_merged_out": "trim_merged_out", - "salmon_quant_output": "salmon_quant_output" + "fastqc_html_1": "fastqc_html_1", + "fastqc_html_2": "fastqc_html_2", + "fastqc_zip_1": "fastqc_zip_1", + "fastqc_zip_2": "fastqc_zip_2", + "qc_output1": "fastq_1", + "qc_output2": "fastq_2", + "trim_log_1": "trim_log_1", + "trim_log_2": "trim_log_2", + "trim_zip_1": "trim_zip_1", + "trim_zip_2": "trim_zip_2", + "trim_html_1": "trim_html_1", + "trim_html_2": "trim_html_2", + "sortmerna_log": "sortmerna_log", + "trim_json": "trim_json", + "trim_html": "trim_html", + "trim_merged_out": "trim_merged_out", + "salmon_quant_output": "salmon_quant_output" ) emit: diff --git a/target/nextflow/workflows/pre_processing/nextflow.config b/target/nextflow/workflows/pre_processing/nextflow.config index bd7b615..b6fbea2 100644 --- a/target/nextflow/workflows/pre_processing/nextflow.config +++ b/target/nextflow/workflows/pre_processing/nextflow.config @@ -122,4 +122,4 @@ process{ withLabel: cpu1000 { cpus = 1000 } } - +includeConfig("nextflow_labels.config") diff --git a/target/nextflow/workflows/pre_processing/nextflow_labels.config b/target/nextflow/workflows/pre_processing/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/nextflow/workflows/pre_processing/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/nextflow/workflows/prepare_genome/.config.vsh.yaml b/target/nextflow/workflows/prepare_genome/.config.vsh.yaml index ca6f706..a784837 100644 --- a/target/nextflow/workflows/prepare_genome/.config.vsh.yaml +++ b/target/nextflow/workflows/prepare_genome/.config.vsh.yaml @@ -358,6 +358,9 @@ resources: path: "main.nf" is_executable: true entrypoint: "run_wf" +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "A subworkflow for preparing all the required genome references\n" info: null status: "enabled" @@ -490,6 +493,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -502,8 +507,8 @@ build_info: output: "target/nextflow/workflows/prepare_genome" executable: "target/nextflow/workflows/prepare_genome/main.nf" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" dependencies: - "target/nextflow/gunzip" - "target/dependencies/vsh/vsh/biobox/main/nextflow/gffread" @@ -538,8 +543,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/nextflow/workflows/prepare_genome/main.nf b/target/nextflow/workflows/prepare_genome/main.nf index ce7cce9..8e966fd 100644 --- a/target/nextflow/workflows/prepare_genome/main.nf +++ b/target/nextflow/workflows/prepare_genome/main.nf @@ -3214,6 +3214,11 @@ meta = [ "path" : "main.nf", "is_executable" : true, "entrypoint" : "run_wf" + }, + { + "type" : "file", + "path" : "/src/workflows/utils/labels.config", + "dest" : "nextflow_labels.config" } ], "description" : "A subworkflow for preparing all the required genome references\n", @@ -3399,7 +3404,10 @@ meta = [ "cpu200" : "cpus = 200", "cpu500" : "cpus = 500", "cpu1000" : "cpus = 1000" - } + }, + "script" : [ + "includeConfig(\\"nextflow_labels.config\\")" + ] }, "debug" : false, "container" : "docker" @@ -3417,8 +3425,8 @@ meta = [ "engine" : "native", "output" : "/workdir/root/repo/target/nextflow/workflows/prepare_genome", "viash_version" : "0.9.0", - "git_commit" : "d63250ae704b6bd9a11792c4f979be2309999a2e", - "git_remote" : "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + "git_commit" : "4adb388c7d928eea02bccf890214f3b932b08714", + "git_remote" : "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" }, "package_config" : { "name" : "rnaseq", @@ -3449,7 +3457,7 @@ meta = [ "source" : "/workdir/root/repo/src", "target" : "/workdir/root/repo/target", "config_mods" : [ - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag := '$id'\n", + ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config', dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\\"nextflow_labels.config\\")'\n", ".engines += { type: \\"native\\" }", ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'", ".engines[.type == 'docker'].target_tag := 'main'" @@ -3479,291 +3487,314 @@ include { kallisto_index } from "${meta.root_dir}/dependencies/vsh/vsh/biobox/ma // user-provided Nextflow code workflow run_wf { - take: - input_ch + take: + input_ch - main: - output_ch = input_ch - - // Uncompress fasta - | gunzip.run ( - fromState: [ "input": "fasta" ], - toState: [ "fasta": "output" ], - key: "gunzip_fasta", - args: [ output: "reference_genome.fasta" ] - ) + main: + output_ch = input_ch - // uncompress gtf - | gunzip.run ( - runIf: {id, state -> state.gtf}, - fromState: [ "input": "gtf" ], - toState: [ "gtf": "output" ], - key: "gunzip_gtf", - args: [output: "gene_annotation.gtf"] - ) + // Uncompress fasta + | gunzip.run ( + fromState: [ "input": "fasta" ], + toState: [ "fasta": "output" ], + key: "gunzip_fasta", + args: [ output: "reference_genome.fasta" ], + directives: [ label: [ "lowmem", "midcpu" ] ] + ) - // uncompress gff - | gunzip.run ( - runIf: {id, state -> !state.gtf && state.gff}, - fromState: [ "input": "gff" ], - toState: [ "gff": "output" ], - key: "gunzip_gff", - args: [output: "gene_annotation.gff"] - ) + // uncompress gtf + | gunzip.run ( + runIf: {id, state -> state.gtf}, + fromState: [ "input": "gtf" ], + toState: [ "gtf": "output" ], + key: "gunzip_gtf", + args: [output: "gene_annotation.gtf"], + directives: [ label: [ "lowmem", "midcpu" ] ] + ) - // gff to gtf - | gffread.run ( - runIf: {id, state -> !state.gtf && state.gff}, - fromState: [ - "input": "gff", - "genome": "fasta" - ], - toState: [ "gtf": "outfile" ], - args: [ - outfile: "gene_annotation.gtf", - gtf_output: true, - keep_attrs: true, - keep_exon_attrs: true - ] - ) + // uncompress gff + | gunzip.run ( + runIf: {id, state -> !state.gtf && state.gff}, + fromState: [ "input": "gff" ], + toState: [ "gff": "output" ], + key: "gunzip_gff", + args: [output: "gene_annotation.gff"], + directives: [ label: [ "lowmem", "midcpu" ] ] + ) - | gtf_filter.run( - runIf: {id, state -> state.gtf && state.filter_gtf}, - fromState: [ - "fasta": "fasta", - "gtf": "gtf" - ], - toState: [ "gtf": "filtered_gtf" ], - args: [filtered_gtf: "gene_annotation.gtf"] - ) + // gff to gtf + | gffread.run ( + runIf: {id, state -> !state.gtf && state.gff}, + fromState: [ + "input": "gff", + "genome": "fasta" + ], + toState: [ "gtf": "outfile" ], + args: [ + outfile: "gene_annotation.gtf", + gtf_output: true, + keep_attrs: true, + keep_exon_attrs: true + ], + directives: [ label: [ "lowmem", "midcpu" ] ] + ) - // uncompress additional fasta - | gunzip.run ( - runIf: {id, state -> state.additional_fasta}, - fromState: [ "input": "additional_fasta" ], - toState: [ "additional_fasta": "output" ], - key: "gunzip_additional_fasta", - args: [output: "additional.fasta"] - ) + | gtf_filter.run( + runIf: {id, state -> state.gtf && state.filter_gtf}, + fromState: [ + "fasta": "fasta", + "gtf": "gtf" + ], + toState: [ "gtf": "filtered_gtf" ], + args: [filtered_gtf: "gene_annotation.gtf"], + directives: [ label: [ "lowmem", "midcpu" ] ] + ) - // concatenate additional fasta - | cat_additional_fasta.run ( - runIf: {id, state -> state.additional_fasta}, - fromState: [ - "fasta": "fasta", - "gtf": "gtf", - "additional_fasta": "additional_fasta", - "biotype": "biotype" - ], - toState: [ - "fasta": "fasta_output", - "gtf": "gtf_output" - ], - args: [ - fasta_output: "genome_additional.fasta", - gtf_output: "genome_additional.gtf" - ] - ) + // uncompress additional fasta + | gunzip.run ( + runIf: {id, state -> state.additional_fasta}, + fromState: [ "input": "additional_fasta" ], + toState: [ "additional_fasta": "output" ], + key: "gunzip_additional_fasta", + args: [output: "additional.fasta"], + directives: [ label: [ "lowmem", "midcpu" ] ] + ) - // uncompress bed file - | gunzip.run ( - runIf: {id, state -> state.gene_bed}, - fromState: [ "input": "gene_bed" ], - toState: [ "gene_bed": "output" ], - key: "gunzip_gene_bed", - args: [output: "genome_additional.bed"] - ) + // concatenate additional fasta + | cat_additional_fasta.run ( + runIf: {id, state -> state.additional_fasta}, + fromState: [ + "fasta": "fasta", + "gtf": "gtf", + "additional_fasta": "additional_fasta", + "biotype": "biotype" + ], + toState: [ + "fasta": "fasta_output", + "gtf": "gtf_output" + ], + args: [ + fasta_output: "genome_additional.fasta", + gtf_output: "genome_additional.gtf" + ], + directives: [ label: [ "lowmem", "midcpu" ] ] + ) - // gtf to bed - | gtf2bed.run ( - runIf: { id, state -> !state.gene_bed}, - fromState: [ "gtf": "gtf" ], - toState: [ "gene_bed": "bed_output" ], - args: [bed_output: "genome_additional.bed"] - ) + // uncompress bed file + | gunzip.run ( + runIf: {id, state -> state.gene_bed}, + fromState: [ "input": "gene_bed" ], + toState: [ "gene_bed": "output" ], + key: "gunzip_gene_bed", + args: [output: "genome_additional.bed"], + directives: [ label: [ "lowmem", "midcpu" ] ] + ) - // uncompress transcript fasta - | gunzip.run ( - runIf: {id, state -> state.transcript_fasta}, - fromState: [ "input": "transcript_fasta" ], - toState: [ "transcript_fasta": "output" ], - key: "transcript_fasta", - args: [output: "transcriptome.fasta"] - ) + // gtf to bed + | gtf2bed.run ( + runIf: { id, state -> !state.gene_bed}, + fromState: [ "gtf": "gtf" ], + toState: [ "gene_bed": "bed_output" ], + args: [bed_output: "genome_additional.bed"], + directives: [ label: [ "lowmem", "midcpu" ] ] + ) - // preprocess transcripts fasta if gtf is in gencode format - | preprocess_transcripts_fasta.run ( - runIf: {id, state -> state.transcript_fasta && state.gencode}, - fromState: [ "transcript_fasta": "transcript_fasta" ], - toState: [ "transcript_fasta": "output" ], - args: [output: "transcriptome.fasta"] - ) + // uncompress transcript fasta + | gunzip.run ( + runIf: {id, state -> state.transcript_fasta}, + fromState: [ "input": "transcript_fasta" ], + toState: [ "transcript_fasta": "output" ], + key: "transcript_fasta", + args: [output: "transcriptome.fasta"], + directives: [ label: [ "lowmem", "midcpu" ] ] + ) - // make transcript FASTA if not provided - | rsem_prepare_reference.run ( - runIf: {id, state -> !state.transcript_fasta}, - fromState: [ - "reference_fasta_files": "fasta", - "gtf": "gtf" - ], - toState: [ "make_transcript_fasta_output": "output" ], - key: "make_transcript_fasta", - args: [reference_name: "genome"] - ) - | map { id, state -> - def transcript_fasta = (!state.transcript_fasta) ? - state.make_transcript_fasta_output.listFiles().find{it.name == "genome.transcripts.fa"} : - state.transcript_fasta - [ id, state + [transcript_fasta: transcript_fasta] ] - } + // preprocess transcripts fasta if gtf is in gencode format + | preprocess_transcripts_fasta.run ( + runIf: {id, state -> state.transcript_fasta && state.gencode}, + fromState: [ "transcript_fasta": "transcript_fasta" ], + toState: [ "transcript_fasta": "output" ], + args: [output: "transcriptome.fasta"], + directives: [ label: [ "lowmem", "midcpu" ] ] + ) - // chromosome size and fai index - | getchromsizes.run ( - fromState: [ "fasta": "fasta" ], - toState: [ - "fai": "fai", - "sizes": "sizes" - ], - key: "chromsizes", - args: [ - fai: "genome_additional.fasta.fai", - sizes: "genome_additional.fasta.sizes" - ] - ) - - // untar bbsplit index, if available - | untar.run ( - runIf: {id, state -> state.bbsplit_index}, - fromState: [ "input": "bbsplit_index" ], - toState: [ "bbsplit_index": "output" ], - key: "untar_bbsplit_index", - args: [output: "BBSplit_index"] - ) + // make transcript FASTA if not provided + | rsem_prepare_reference.run ( + runIf: {id, state -> !state.transcript_fasta}, + fromState: [ + "reference_fasta_files": "fasta", + "gtf": "gtf" + ], + toState: [ "make_transcript_fasta_output": "output" ], + key: "make_transcript_fasta", + args: [reference_name: "genome"], + directives: [ label: [ "lowmem", "midcpu" ] ] + ) + | map { id, state -> + def transcript_fasta = (!state.transcript_fasta) ? + state.make_transcript_fasta_output.listFiles().find{it.name == "genome.transcripts.fa"} : + state.transcript_fasta + [ id, state + [transcript_fasta: transcript_fasta] ] + } - | map {id, state -> - def ref = [state.fasta] + state.bbsplit_fasta_list - [id, state + [bbsplit_ref: ref] ] - } + // chromosome size and fai index + | getchromsizes.run ( + fromState: [ "fasta": "fasta" ], + toState: [ + "fai": "fai", + "sizes": "sizes" + ], + key: "chromsizes", + args: [ + fai: "genome_additional.fasta.fai", + sizes: "genome_additional.fasta.sizes" + ], + directives: [ label: [ "lowmem", "midcpu" ] ] + ) - // create bbsplit index, if not already availble - | bbmap_bbsplit.run ( - runIf: {id, state -> !state.skip_bbsplit && !state.bbsplit_index}, - fromState: ["ref": "bbsplit_ref"], - toState: [ "bbsplit_index": "index" ], - args: [ - only_build_index: true, - index: "BBSplit_index" - ], - key: "generate_bbsplit_index" - ) + // untar bbsplit index, if available + | untar.run ( + runIf: {id, state -> state.bbsplit_index}, + fromState: [ "input": "bbsplit_index" ], + toState: [ "bbsplit_index": "output" ], + key: "untar_bbsplit_index", + directives: [ label: [ "lowmem", "midcpu" ] ] + ) - // Uncompress STAR index or generate from scratch if required - | untar.run ( - runIf: {id, state -> state.star_index}, - fromState: [ "input": "star_index" ], - toState: [ "star_index": "output" ], - key: "untar_star_index", - args: [output: "STAR_index"] - ) - - // TODO: Add to viah-hub or adapt star_align_reads to enable the generateGenome runMode - | star_genome_generate.run ( - runIf: {id, state -> !state.star_index && !state.skip_alignment}, - fromState: [ - "genome_fasta_files": "fasta", - "sjdb_gtf_file": "gtf", - "sjdb_gtf_feature_exon": "star_sjdb_gtf_feature_exon" - ], - toState: [ "star_index": "index" ], - key: "generate_star_index", - args: [index: "STAR_index"] - ) + | map { id, state -> + // Check if bbsplit_fasta_list is defined + def ref = (state.bbsplit_fasta_list) ? + [state.fasta] + state.bbsplit_fasta_list : + [state.fasta] + [id, state + [bbsplit_ref: ref] ] + } - // Uncompress RSEM index or generate from scratch if required - | untar.run ( - runIf: {id, state -> state.rsem_index}, - fromState: [ "input": "rsem_index" ], - toState: [ "rsem_index": "output" ], - key: "untar_rsem_index", - args: [output: "RSEM_index"] - ) + // create bbsplit index, if not already available + | bbmap_bbsplit.run ( + runIf: {id, state -> !state.skip_bbsplit && !state.bbsplit_index}, + fromState: ["ref": "bbsplit_ref"], + toState: [ "bbsplit_index": "index" ], + args: [ + only_build_index: true, + index: "BBSplit_index" + ], + key: "generate_bbsplit_index" + ) - | rsem_prepare_reference.run ( - runIf: {id, state -> !state.rsem_index && state.aligner == 'star_rsem'}, - fromState: [ - "reference_fasta_files": "fasta", - "gtf": "gtf" - ], - toState: [ "rsem_index": "output" ], - key: "generate_rsem_index", - args: [reference_name: "genome"] - ) - - // TODO: Uncompress HISAT2 index or generate from scratch if required + // Uncompress STAR index or generate from scratch if required + | untar.run ( + runIf: {id, state -> state.star_index}, + fromState: [ "input": "star_index" ], + toState: [ "star_index": "output" ], + key: "untar_star_index", + args: [output: "STAR_index"], + directives: [ label: [ "lowmem", "midcpu" ] ] + ) - // Uncompress Salmon index or generate from scratch if required - | untar.run ( - runIf: {id, state -> state.salmon_index}, - fromState: [ "input": "salmon_index" ], - toState: [ "salmon_index": "output" ], - key: "untar_salmon_index", - args: [output: "Salmon_index"] - ) + | star_genome_generate.run ( + runIf: {id, state -> !state.star_index && !state.skip_alignment}, + fromState: [ + "genome_fasta_files": "fasta", + "sjdb_gtf_file": "gtf", + "sjdb_gtf_feature_exon": "star_sjdb_gtf_feature_exon" + ], + toState: [ "star_index": "index" ], + key: "generate_star_index", + args: [index: "STAR_index"], + directives: [ label: [ "highmem", "highcpu" ] ] + ) - | salmon_index.run ( - runIf: {id, state -> (state.aligner == 'star_salmon' || state.pseudo_aligner == "salmon") && !state.salmon_index}, - fromState: [ - "genome": "fasta", - "transcripts": "transcript_fasta", - "kmer_len": "pseudo_aligner_kmer_size", - "gencode": "gencode" - ], - toState: [ "salmon_index": "index" ], - key: "generate_salmon_index", - args: [index: "Salmon_index"] - ) + // Uncompress RSEM index or generate from scratch if required + | untar.run ( + runIf: {id, state -> state.rsem_index}, + fromState: [ "input": "rsem_index" ], + toState: [ "rsem_index": "output" ], + key: "untar_rsem_index", + args: [output: "RSEM_index"], + directives: [ label: [ "lowmem", "midcpu" ] ] + ) - // Uncompress Kallisto index or generate from scratch if required - | untar.run ( - runIf: {id, state -> state.kallisto_index}, - fromState: [ "input": "kallisto_index" ], - toState: [ "kallisto_index": "output" ], - key: "untar_kallisto_index", - args: [output: "Kallisto_index"] - ) + | rsem_prepare_reference.run ( + runIf: {id, state -> !state.rsem_index && state.aligner == 'star_rsem'}, + fromState: [ + "reference_fasta_files": "fasta", + "gtf": "gtf" + ], + toState: [ "rsem_index": "output" ], + key: "generate_rsem_index", + args: [reference_name: "genome"], + directives: [ label: [ "lowmem", "midcpu" ] ] + ) + + // TODO: Uncompress HISAT2 index or generate from scratch if required - | kallisto_index.run( - runIf: {id, state -> state.pseudo_aligner == "kallisto" && !state.kallisto_index}, - fromState: [ - "input": "transcript_fasta", - "kmer_size": "pseudo_aligner_kmer_size" - ], - toState: [ "kallisto_index": "index" ], - key: "generate_kallisto_index", - args: [index: "Kallisto_index"] - ) + // Uncompress Salmon index or generate from scratch if required + | untar.run ( + runIf: {id, state -> state.salmon_index}, + fromState: [ "input": "salmon_index" ], + toState: [ "salmon_index": "output" ], + key: "untar_salmon_index", + args: [output: "Salmon_index"], + directives: [ label: [ "lowmem", "midcpu" ] ] + ) - | map { id, state -> - def mod_state = state.findAll { key, value -> value instanceof java.nio.file.Path && value.exists() } - [ id, mod_state ] - } + | salmon_index.run ( + runIf: {id, state -> (state.aligner == 'star_salmon' || state.pseudo_aligner == "salmon") && !state.salmon_index}, + fromState: [ + "genome": "fasta", + "transcripts": "transcript_fasta", + "kmer_len": "pseudo_aligner_kmer_size", + "gencode": "gencode" + ], + toState: [ "salmon_index": "index" ], + key: "generate_salmon_index", + args: [index: "Salmon_index"], + directives: [ label: [ "lowmem", "midcpu" ] ] + ) - | setState ( - "fasta_uncompressed": "fasta", - "gtf_uncompressed": "gtf", - "transcript_fasta_uncompressed": "transcript_fasta", - "gene_bed_uncompressed": "gene_bed", - "star_index_uncompressed": "star_index", - "salmon_index_uncompressed": "salmon_index", - "kallisto_index_uncompressed": "kallisto_index", - "bbsplit_index_uncompressed": "bbsplit_index", - "rsem_index_uncompressed": "rsem_index", - "chrom_sizes": "sizes", - "fai": "fai" - ) + // Uncompress Kallisto index or generate from scratch if required + | untar.run ( + runIf: {id, state -> state.kallisto_index}, + fromState: [ "input": "kallisto_index" ], + toState: [ "kallisto_index": "output" ], + key: "untar_kallisto_index", + args: [output: "Kallisto_index"], + directives: [ label: [ "lowmem", "midcpu" ] ] + ) - emit: - output_ch + | kallisto_index.run( + runIf: {id, state -> state.pseudo_aligner == "kallisto" && !state.kallisto_index}, + fromState: [ + "input": "transcript_fasta", + "kmer_size": "pseudo_aligner_kmer_size" + ], + toState: [ "kallisto_index": "index" ], + key: "generate_kallisto_index", + args: [index: "Kallisto_index"], + directives: [ label: [ "lowmem", "midcpu" ] ] + ) + + | map { id, state -> + def mod_state = state.findAll { key, value -> value instanceof java.nio.file.Path && value.exists() } + [ id, mod_state ] + } + + | setState ( + "fasta_uncompressed": "fasta", + "gtf_uncompressed": "gtf", + "transcript_fasta_uncompressed": "transcript_fasta", + "gene_bed_uncompressed": "gene_bed", + "star_index_uncompressed": "star_index", + "salmon_index_uncompressed": "salmon_index", + "kallisto_index_uncompressed": "kallisto_index", + "bbsplit_index_uncompressed": "bbsplit_index", + "rsem_index_uncompressed": "rsem_index", + "chrom_sizes": "sizes", + "fai": "fai" + ) + + emit: + output_ch } // inner workflow hook diff --git a/target/nextflow/workflows/prepare_genome/nextflow.config b/target/nextflow/workflows/prepare_genome/nextflow.config index feafc06..dafabe4 100644 --- a/target/nextflow/workflows/prepare_genome/nextflow.config +++ b/target/nextflow/workflows/prepare_genome/nextflow.config @@ -122,4 +122,4 @@ process{ withLabel: cpu1000 { cpus = 1000 } } - +includeConfig("nextflow_labels.config") diff --git a/target/nextflow/workflows/prepare_genome/nextflow_labels.config b/target/nextflow/workflows/prepare_genome/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/nextflow/workflows/prepare_genome/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/nextflow/workflows/pseudo_alignment_and_quant/.config.vsh.yaml b/target/nextflow/workflows/pseudo_alignment_and_quant/.config.vsh.yaml index da7fdb9..1efe08f 100644 --- a/target/nextflow/workflows/pseudo_alignment_and_quant/.config.vsh.yaml +++ b/target/nextflow/workflows/pseudo_alignment_and_quant/.config.vsh.yaml @@ -183,6 +183,9 @@ resources: path: "main.nf" is_executable: true entrypoint: "run_wf" +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "A viash sub-workflow for pseudo alignment and quantification stage of\ \ nf-core/rnaseq pipeline.\n" info: null @@ -273,6 +276,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -285,8 +290,8 @@ build_info: output: "target/nextflow/workflows/pseudo_alignment_and_quant" executable: "target/nextflow/workflows/pseudo_alignment_and_quant/main.nf" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" dependencies: - "target/dependencies/vsh/vsh/biobox/main/nextflow/salmon/salmon_quant" - "target/dependencies/vsh/vsh/biobox/main/nextflow/kallisto/kallisto_quant" @@ -310,8 +315,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/nextflow/workflows/pseudo_alignment_and_quant/main.nf b/target/nextflow/workflows/pseudo_alignment_and_quant/main.nf index ba004f4..f94159e 100644 --- a/target/nextflow/workflows/pseudo_alignment_and_quant/main.nf +++ b/target/nextflow/workflows/pseudo_alignment_and_quant/main.nf @@ -3018,6 +3018,11 @@ meta = [ "path" : "main.nf", "is_executable" : true, "entrypoint" : "run_wf" + }, + { + "type" : "file", + "path" : "/src/workflows/utils/labels.config", + "dest" : "nextflow_labels.config" } ], "description" : "A viash sub-workflow for pseudo alignment and quantification stage of nf-core/rnaseq pipeline.\n", @@ -3127,7 +3132,10 @@ meta = [ "cpu200" : "cpus = 200", "cpu500" : "cpus = 500", "cpu1000" : "cpus = 1000" - } + }, + "script" : [ + "includeConfig(\\"nextflow_labels.config\\")" + ] }, "debug" : false, "container" : "docker" @@ -3145,8 +3153,8 @@ meta = [ "engine" : "native", "output" : "/workdir/root/repo/target/nextflow/workflows/pseudo_alignment_and_quant", "viash_version" : "0.9.0", - "git_commit" : "d63250ae704b6bd9a11792c4f979be2309999a2e", - "git_remote" : "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + "git_commit" : "4adb388c7d928eea02bccf890214f3b932b08714", + "git_remote" : "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" }, "package_config" : { "name" : "rnaseq", @@ -3177,7 +3185,7 @@ meta = [ "source" : "/workdir/root/repo/src", "target" : "/workdir/root/repo/target", "config_mods" : [ - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag := '$id'\n", + ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config', dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\\"nextflow_labels.config\\")'\n", ".engines += { type: \\"native\\" }", ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'", ".engines[.type == 'docker'].target_tag := 'main'" @@ -3230,22 +3238,23 @@ workflow run_wf { // Count reads from BAM alignments using Salmon | salmon_quant.run ( - runIf: { id, state -> state.pseudo_aligner == 'salmon' }, - fromState: { id, state -> - def unmated_reads = !state.paired ? state.fastq_1 : null - def mates1 = state.paired ? state.fastq_1 : null - def mates2 = state.paired ? state.fastq_2 : null - [ unmated_reads: unmated_reads, - mates1: mates1, - mates2: mates2, - gene_map: state.gtf, - index: state.salmon_index, - lib_type: state.lib_type ] - }, - toState: [ - "quant_out_dir": "output", - "salmon_quant_results_file": "quant_results" - ] + runIf: { id, state -> state.pseudo_aligner == 'salmon' }, + fromState: { id, state -> + def unmated_reads = !state.paired ? state.fastq_1 : null + def mates1 = state.paired ? state.fastq_1 : null + def mates2 = state.paired ? state.fastq_2 : null + [ unmated_reads: unmated_reads, + mates1: mates1, + mates2: mates2, + gene_map: state.gtf, + index: state.salmon_index, + lib_type: state.lib_type ] + }, + toState: [ + "quant_out_dir": "output", + "salmon_quant_results_file": "quant_results" + ], + directives: [ label: [ "midmem", "highcpu" ] ] ) | map { id, state -> @@ -3253,7 +3262,7 @@ workflow run_wf { [ id, mod_state ] } - | kallisto_quant.run ( + | kallisto_quant.run ( runIf: { id, state -> state.pseudo_aligner == 'kallisto'}, fromState: { id, state -> def fr_stranded = state.strandedness == 'forward' @@ -3277,8 +3286,9 @@ workflow run_wf { ] def new_state = state + newKeys return new_state - } - ) + }, + directives: [ label: [ "midmem", "highcpu" ] ] + ) | map { id, state -> def mod_state = state.findAll { key, value -> value instanceof java.nio.file.Path && value.exists() } @@ -3289,7 +3299,8 @@ workflow run_wf { [ "pseudo_multiqc": "quant_results", "quant_out_dir": "quant_out_dir", "salmon_quant_results_file": "salmon_quant_results_file", - "kallisto_quant_results_file": "kallisto_quant_results_file" ] + "kallisto_quant_results_file": "kallisto_quant_results_file" + ] ) emit: diff --git a/target/nextflow/workflows/pseudo_alignment_and_quant/nextflow.config b/target/nextflow/workflows/pseudo_alignment_and_quant/nextflow.config index b78bfec..ce29fd5 100644 --- a/target/nextflow/workflows/pseudo_alignment_and_quant/nextflow.config +++ b/target/nextflow/workflows/pseudo_alignment_and_quant/nextflow.config @@ -122,4 +122,4 @@ process{ withLabel: cpu1000 { cpus = 1000 } } - +includeConfig("nextflow_labels.config") diff --git a/target/nextflow/workflows/pseudo_alignment_and_quant/nextflow_labels.config b/target/nextflow/workflows/pseudo_alignment_and_quant/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/nextflow/workflows/pseudo_alignment_and_quant/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/nextflow/workflows/quality_control/.config.vsh.yaml b/target/nextflow/workflows/quality_control/.config.vsh.yaml index 3c251f3..dadf349 100644 --- a/target/nextflow/workflows/quality_control/.config.vsh.yaml +++ b/target/nextflow/workflows/quality_control/.config.vsh.yaml @@ -547,6 +547,7 @@ argument_groups: multiple_sep: ";" - type: "file" name: "--multiqc_custom_config" + description: "Custom multiqc configuration file\n" info: null must_exist: true create_parent: true @@ -556,6 +557,7 @@ argument_groups: multiple_sep: ";" - type: "string" name: "--multiqc_title" + description: "Custom multiqc title\n" info: null required: false direction: "input" @@ -1396,6 +1398,9 @@ resources: path: "main.nf" is_executable: true entrypoint: "run_wf" +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "A subworkflow for the final quality control stage of the nf-core/rnaseq\ \ pipeline.\n" info: null @@ -1542,6 +1547,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -1554,8 +1561,8 @@ build_info: output: "target/nextflow/workflows/quality_control" executable: "target/nextflow/workflows/quality_control/main.nf" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" dependencies: - "target/dependencies/vsh/vsh/biobox/main/nextflow/rseqc/rseqc_bamstat" - "target/dependencies/vsh/vsh/biobox/main/nextflow/rseqc/rseqc_inferexperiment" @@ -1595,8 +1602,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/nextflow/workflows/quality_control/main.nf b/target/nextflow/workflows/quality_control/main.nf index 49638ef..d5184fb 100644 --- a/target/nextflow/workflows/quality_control/main.nf +++ b/target/nextflow/workflows/quality_control/main.nf @@ -3414,6 +3414,7 @@ meta = [ { "type" : "file", "name" : "--multiqc_custom_config", + "description" : "Custom multiqc configuration file\n", "must_exist" : true, "create_parent" : true, "required" : false, @@ -3424,6 +3425,7 @@ meta = [ { "type" : "string", "name" : "--multiqc_title", + "description" : "Custom multiqc title\n", "required" : false, "direction" : "input", "multiple" : false, @@ -4395,6 +4397,11 @@ meta = [ "path" : "main.nf", "is_executable" : true, "entrypoint" : "run_wf" + }, + { + "type" : "file", + "path" : "/src/workflows/utils/labels.config", + "dest" : "nextflow_labels.config" } ], "description" : "A subworkflow for the final quality control stage of the nf-core/rnaseq pipeline.\n", @@ -4608,7 +4615,10 @@ meta = [ "cpu200" : "cpus = 200", "cpu500" : "cpus = 500", "cpu1000" : "cpus = 1000" - } + }, + "script" : [ + "includeConfig(\\"nextflow_labels.config\\")" + ] }, "debug" : false, "container" : "docker" @@ -4626,8 +4636,8 @@ meta = [ "engine" : "native", "output" : "/workdir/root/repo/target/nextflow/workflows/quality_control", "viash_version" : "0.9.0", - "git_commit" : "d63250ae704b6bd9a11792c4f979be2309999a2e", - "git_remote" : "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + "git_commit" : "4adb388c7d928eea02bccf890214f3b932b08714", + "git_remote" : "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" }, "package_config" : { "name" : "rnaseq", @@ -4658,7 +4668,7 @@ meta = [ "source" : "/workdir/root/repo/src", "target" : "/workdir/root/repo/target", "config_mods" : [ - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag := '$id'\n", + ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config', dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\\"nextflow_labels.config\\")'\n", ".engines += { type: \\"native\\" }", ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'", ".engines[.type == 'docker'].target_tag := 'main'" @@ -4692,802 +4702,828 @@ include { merge_quant_results } from "${meta.resources_dir}/../../../nextflow/wo // inner workflow // user-provided Nextflow code workflow run_wf { - - take: - input_ch - main: + take: + input_ch - qc_ch = input_ch + main: - // temporary fix to force assignment when alignment in skipped - | map {it} + qc_ch = input_ch - // Feature biotype QC using featureCounts - | map { id, state -> - def biotype_in_gtf = biotypeInGtf(state.gtf, state.biotype) - def attribute_type = state.gencode ? "gene_type" : state.featurecounts_group_type - def strand = (state.strandedness == "forward") ? 1 : ((state.strandedness == "reverse") ? 2 : 0) - [ id, state + [biotype_in_gtf: biotype_in_gtf, attribute_type: attribute_type, strand: strand] ] + // temporary fix to force assignment when alignment is skipped + | map {it} + + // Feature biotype QC using featureCounts + | map { id, state -> + def biotype_in_gtf = biotypeInGtf(state.gtf, state.biotype) + def attribute_type = state.gencode ? "gene_type" : state.featurecounts_group_type + def strand = (state.strandedness == "forward") ? 1 : ((state.strandedness == "reverse") ? 2 : 0) + [ id, state + [biotype_in_gtf: biotype_in_gtf, attribute_type: attribute_type, strand: strand] ] + } + + | featurecounts.run ( + runIf: { id, state -> !state.skip_qc && !state.skip_biotype_qc && state.biotype && state.biotype_in_gtf && !state.skip_align }, + fromState: [ + "paired": "paired", + "strand": "strand", + "annotation": "gtf", + "input": "genome_bam", + "attribute_type": "attribute_type", + "feature_type": "featurecounts_feature_type", + "count_read_pairs": "paired" + ], + toState: [ + "featurecounts": "counts", + "featurecounts_summary": "summary" + ], + args: [ + both_aligned: true, + same_strand: true + ], + directives: [ label: [ "midmem", "midcpu" ] ] + ) + + | multiqc_custom_biotype.run ( + runIf: { id, state -> !state.skip_qc && !state.skip_biotype_qc && state.biotype && state.featurecounts && !state.skip_align }, + fromState: [ + "id": "id", + "biocounts": "featurecounts", + "biotypes_header": "biotypes_header" + ], + toState: [ + "featurecounts_multiqc": "featurecounts_multiqc", + "featurecounts_rrna_multiqc": "featurecounts_rrna_multiqc" + ], + directives: [ label: [ "midmem", "midcpu" ] ] + ) + + | preseq_lcextrap.run ( + runIf: { id, state -> !state.skip_qc && !state.skip_preseq && !state.skip_align }, + fromState: [ + "paired": "paired", + "input": "genome_bam", + "extra_preseq_args": "extra_preseq_args" + ], + toState: [ "preseq_output": "output" ], + directives: [ label: [ "midmem", "midcpu" ] ] + ) + + | rseqc_bamstat.run ( + runIf: { id, state -> !state.skip_qc && !state.skip_rseqc && "bam_stat" in state.rseqc_modules && !state.skip_align }, + fromState: [ + "input_file": "genome_bam", + "mapq": "map_qual" + ], + toState: [ "bamstat_output": "output" ], + directives: [ label: [ "midmem", "midcpu" ] ] + ) + | rseqc_inferexperiment.run( + runIf: { id, state -> !state.skip_qc && !state.skip_rseqc && "infer_experiment" in state.rseqc_modules && !state.skip_align }, + fromState: [ + "input_file": "genome_bam", + "refgene": "gene_bed", + "sample_size": "sample_size", + "mapq": "map_qual" + ], + toState: [ "strandedness_output": "output" ], + directives: [ label: [ "midmem", "midcpu" ] ] + ) + // Get predicted strandedness from the RSeQC infer_experiment.py output + | map { id, state -> + def inferred_strand = getInferexperimentStrandedness(state.strandedness_output, 30) + def passed_strand_check = (state.strandedness != inferred_strand[0]) ? false : true + [ id, state + [ inferred_strand: inferred_strand, passed_strand_check: passed_strand_check ] ] + } + | rseqc_inner_distance.run( + runIf: { id, state -> !state.skip_qc && !state.skip_rseqc && state.paired && "inner_distance" in state.rseqc_modules && !state.skip_align }, + key: "inner_distance", + args: ["output_prefix": "output"], + fromState: [ + "input_file": "genome_bam", + "refgene": "gene_bed", + "sample_size": "sample_size", + "mapq": "map_qual", + "lower_bound": "lower_bound_size", + "upper_bound": "upper_bound_size", + "step": "step_size", + ], + toState: [ + "inner_dist_output_stats": "output_stats", + "inner_dist_output_dist": "output_dist", + "inner_dist_output_freq": "output_freq", + "inner_dist_output_plot": "output_plot", + "inner_dist_output_plot_r": "output_plot_r" + ], + directives: [ label: [ "midmem", "midcpu" ] ] + ) + | rseqc_junctionannotation.run( + runIf: { id, state -> !state.skip_qc && !state.skip_rseqc && "junction_annotation" in state.rseqc_modules && !state.skip_align }, + fromState: [ + "input": "genome_bam", + "refgene": "gene_bed", + "map_qual": "map_qual", + "min_intron": "min_intron" + ], + toState: [ + "junction_annotation_output_log": "output_log", + "junction_annotation_output_plot_r": "output_plot_r", + "junction_annotation_output_junction_bed": "output_junction_bed", + "junction_annotation_output_junction_interact": "output_junction_interact", + "junction_annotation_output_junction_sheet": "output_junction_sheet", + "junction_annotation_output_splice_events_plot": "output_splice_events_plot", + "junction_annotation_output_splice_junctions_plot": "output_splice_junctions_plot" + ], + directives: [ label: [ "midmem", "midcpu" ] ] + ) + | rseqc_junctionsaturation.run( + runIf: { id, state -> !state.skip_qc && !state.skip_rseqc && "junction_saturation" in state.rseqc_modules && !state.skip_align }, + fromState: [ + "input": "genome_bam", + "refgene": "gene_bed", + "sampling_percentile_lower_bound": "sampling_percentile_lower_bound", + "sampling_percentile_upper_bound": "sampling_percentile_upper_bound", + "sampling_percentile_step": "sampling_percentile_step", + "min_intron": "min_intron", + "min_splice_read": "min_splice_read", + "map_qual": "map_qual" + ], + toState: [ + "junction_saturation_output_plot_r": "output_plot_r", + "junction_saturation_output_plot": "output_plot" + ], + directives: [ label: [ "midmem", "midcpu" ] ] + ) + | rseqc_readdistribution.run( + runIf: { id, state -> !state.skip_qc && !state.skip_rseqc && "read_distribution" in state.rseqc_modules && !state.skip_align }, + fromState: [ + "input": "genome_bam", + "refgene": "gene_bed", + ], + toState: [ "read_distribution_output": "output" ], + directives: [ label: [ "midmem", "midcpu" ] ] + ) + | rseqc_readduplication.run( + runIf: { id, state -> !state.skip_qc && !state.skip_rseqc && "read_duplication" in state.rseqc_modules && !state.skip_align }, + fromState: [ + "input": "genome_bam", + "read_count_upper_limit": "read_count_upper_limit", + "map_qual": "map_qual" + ], + toState: [ + "read_duplication_output_duplication_rate_plot_r": "output_duplication_rate_plot_r", + "read_duplication_output_duplication_rate_plot": "output_duplication_rate_plot", + "read_duplication_output_duplication_rate_mapping": "output_duplication_rate_mapping", + "read_duplication_output_duplication_rate_sequence": "output_duplication_rate_sequence" + ], + directives: [ label: [ "midmem", "midcpu" ] ] + ) + | rseqc_tin.run( + runIf: { id, state -> !state.skip_qc && !state.skip_rseqc && "tin" in state.rseqc_modules && !state.skip_align }, + fromState: [ + "bam_input": "genome_bam", + "bai_input": "genome_bam_index", + "refgene": "gene_bed", + "minimum_coverage": "minimum_coverage", + "sample_size": "tin_sample_size", + "subtract_background": "subtract_background" + ], + toState: [ + "tin_output_summary": "output_tin_summary", + "tin_output_metrics": "output_tin" + ], + directives: [ label: [ "midmem", "midcpu" ] ] + ) + + | dupradar.run( + runIf: { id, state -> !state.skip_qc && !state.skip_dupradar && !state.skip_align }, + fromState: [ + "id": "id", + "input": "genome_bam", + "gtf_annotation": "gtf", + "paired": "paired", + "strandedness": "strandedness" + ], + toState: [ + "dupradar_output_dupmatrix": "output_dupmatrix", + "dupradar_output_dup_intercept_mqc": "output_dup_intercept_mqc", + "dupradar_output_duprate_exp_boxplot": "output_duprate_exp_boxplot", + "dupradar_output_duprate_exp_densplot": "output_duprate_exp_densplot", + "dupradar_output_duprate_exp_denscurve_mqc": "output_duprate_exp_denscurve_mqc", + "dupradar_output_expression_histogram": "output_expression_histogram", + "dupradar_output_intercept_slope": "output_intercept_slope" + ], + directives: [ label: [ "midmem", "midcpu" ] ] + ) + + // TODO: Add outdir as an output argument to the qualimap module on biobox. + // Qualimap ouputs a few more raw data files to outdir but since the module is using a temporary directory as output dir these files are lost. + | qualimap_rnaseq.run( + runIf: { id, state -> !state.skip_qc && !state.skip_qualimap && !state.skip_align }, + fromState: [ + "bam": "genome_bam", + "gtf": "gtf", + "num_pr_bases": "pr_bases", + "num_tr_bias": "tr_bias", + "algorithm": "algorithm", + "sequencing_protocol": "sequencing_protocol", + "sorted": "sorted", + "java_memory_size": "java_memory_size", + ], + toState: [ + "qualimap_report": "report", + "qualimap_qc_report": "qc_report", + "qualimap_counts": "counts" + ], + directives: [ label: [ "midmem", "midcpu" ] ] + ) + + merged_ch = qc_ch + | toSortedList + | map { list -> + def ids = list.collect { id, state -> id } + def strandedness = list.collect { id, state -> state.strandedness } + def num_trimmed_reads = list.collect { id, state -> state.num_trimmed_reads } + def passed_trimmed_reads = list.collect { id, state -> state.passed_trimmed_reads } + def passed_mapping = list.collect { id, state -> state.passed_mapping } + def percent_mapped = list.collect { id, state -> state.percent_mapped } + def inferred_strand = list.collect { id, state -> state.inferred_strand } + def passed_strand_check = list.collect { id, state -> state.passed_strand_check } + def gtf = list.collect { id, state -> state.gtf }.unique()[0] + def gtf_extra_attributes = list.collect { id, state -> state.gtf_extra_attributes }.unique()[0] + def gtf_group_features = list.collect { id, state -> state.gtf_group_features }.unique()[0] + def pca_header_multiqc = list.collect { id, state -> state.pca_header_multiqc }.unique()[0] + def clustering_header_multiqc = list.collect { id, state -> state.clustering_header_multiqc }.unique()[0] + def aligner = list.collect { id, state -> state.aligner }.unique()[0] + def pseudo_aligner = list.collect { id, state -> state.pseudo_aligner }.unique()[0] + def deseq2_vst = list.collect { id, state -> state.deseq2_vst }.unique()[0] + def extra_deseq2_args = list.collect { id, state -> state.extra_deseq2_args }.unique()[0] + def extra_deseq2_args2 = list.collect { id, state -> state.extra_deseq2_args2 }.unique()[0] + def skip_deseq2_qc = list.collect { id, state -> state.skip_deseq2_qc }.unique()[0] + def skip_qc = list.collect { id, state -> state.skip_qc }.unique()[0] + def skip_align = list.collect { id, state -> state.skip_align }.unique()[0] + def skip_pseudo_align = list.collect { id, state -> state.skip_pseudo_align }.unique()[0] + def quant_results = list.collect { id, state -> + (state.quant_results_file instanceof java.nio.file.Path && state.quant_results_file.exists()) ? + state.quant_results_file : + null } + def rsem_counts_gene = list.collect { id, state -> + (state.rsem_counts_gene instanceof java.nio.file.Path && state.rsem_counts_gene.exists()) ? + state.rsem_counts_gene : + null } + def rsem_counts_transcripts = list.collect { id, state -> + (state.rsem_counts_transcripts instanceof java.nio.file.Path && state.rsem_counts_transcripts.exists()) ? + state.rsem_counts_transcripts : + null } + def pseudo_quant_out_dir = list.collect { id, state -> + (state.pseudo_quant_out_dir instanceof java.nio.file.Path && state.pseudo_quant_out_dir.exists()) ? + state.pseudo_quant_out_dir : + null } + def pseudo_salmon_quant_results = list.collect { id, state -> + (state.pseudo_salmon_quant_results_file instanceof java.nio.file.Path && state.pseudo_salmon_quant_results_file.exists()) ? + state.pseudo_salmon_quant_results_file : + null } + def pseudo_kallisto_quant_results = list.collect { id, state -> + (state.pseudo_kallisto_quant_results_file instanceof java.nio.file.Path && state.pseudo_kallisto_quant_results_file.exists()) ? + state.pseudo_kallisto_quant_results_file : + null } + def fastqc_zip_1 = list.collect { id, state -> + (state.fastqc_zip_1 instanceof java.nio.file.Path && state.fastqc_zip_1.exists()) ? + state.fastqc_zip_1 : + null } + def fastqc_zip_2 = list.collect { id, state -> + (state.fastqc_zip_2 instanceof java.nio.file.Path && state.fastqc_zip_2.exists()) ? + state.fastqc_zip_2 : + null } + def trim_zip_1 = list.collect { id, state -> + (state.trim_zip_1 instanceof java.nio.file.Path && state.trim_zip_1.exists()) ? + state.trim_zip_1 : + null } + def trim_zip_2 = list.collect { id, state -> + (state.trim_zip_2 instanceof java.nio.file.Path && state.trim_zip_2.exists()) ? + state.trim_zip_2 : + null } + def trim_log_1 = list.collect { id, state -> + (state.trim_log_1 instanceof java.nio.file.Path && state.trim_log_1.exists()) ? + state.trim_log_1 : + null } + def trim_log_2 = list.collect { id, state -> + (state.trim_log_2 instanceof java.nio.file.Path && state.trim_log_2.exists()) ? + state.trim_log_2 : + null } + def sortmerna_multiqc = list.collect { id, state -> + (state.sortmerna_multiqc instanceof java.nio.file.Path && state.sortmerna_multiqc.exists()) ? + state.sortmerna_multiqc : + null } + def star_multiqc = list.collect { id, state -> + (state.star_multiqc instanceof java.nio.file.Path && state.star_multiqc.exists()) ? + state.star_multiqc : + null } + def genome_bam_stats = list.collect { id, state -> + (state.genome_bam_stats instanceof java.nio.file.Path && state.genome_bam_stats.exists()) ? + state.genome_bam_stats : + null } + def genome_bam_flagstat = list.collect { id, state -> + (state.genome_bam_flagstat instanceof java.nio.file.Path && state.genome_bam_flagstat.exists()) ? + state.genome_bam_flagstat : + null } + def genome_bam_idxstats = list.collect { id, state -> + (state.genome_bam_idxstats instanceof java.nio.file.Path && state.genome_bam_idxstats.exists()) ? + state.genome_bam_idxstats : + null } + def markduplicates_multiqc = list.collect { id, state -> + (state.markduplicates_multiqc instanceof java.nio.file.Path && state.markduplicates_multiqc.exists()) ? + state.markduplicates_multiqc : + null } + def salmon_multiqc = list.collect { id, state -> + (state.salmon_multiqc instanceof java.nio.file.Path && state.salmon_multiqc.exists()) ? + state.salmon_multiqc : + null } + def rsem_multiqc = list.collect { id, state -> + (state.rsem_multiqc instanceof java.nio.file.Path && state.rsem_multiqc.exists()) ? + state.rsem_multiqc : + null } + def pseudo_multiqc = list.collect { id, state -> + (state.pseudo_multiqc instanceof java.nio.file.Path && state.pseudo_multiqc.exists()) ? + state.pseudo_multiqc : + null } + def featurecounts_multiqc = list.collect { id, state -> + (state.featurecounts_multiqc instanceof java.nio.file.Path && state.featurecounts_multiqc.exists()) ? + state.featurecounts_multiqc : + null } + def featurecounts_rrna_multiqc = list.collect { id, state -> + (state.featurecounts_rrna_multiqc instanceof java.nio.file.Path && state.featurecounts_rrna_multiqc.exists()) ? + state.featurecounts_rrna_multiqc : + null } + def preseq_output = list.collect { id, state -> + (state.preseq_output instanceof java.nio.file.Path && state.preseq_output.exists()) ? + state.preseq_output : + null } + // def qualimap_output_dir = list.collect { id, state -> + // (state.qualimap_output_dir instanceof java.nio.file.Path && state.qualimap_output_dir.exists()) ? + // state.qualimap_output_dir : + // null } + def dupradar_output_dup_intercept_mqc = list.collect { id, state -> + (state.dupradar_output_dup_intercept_mqc instanceof java.nio.file.Path && state.dupradar_output_dup_intercept_mqc.exists()) ? + state.dupradar_output_dup_intercept_mqc : + null } + def dupradar_output_duprate_exp_denscurve_mqc = list.collect { id, state -> + (state.dupradar_output_duprate_exp_denscurve_mqc instanceof java.nio.file.Path && state.dupradar_output_duprate_exp_denscurve_mqc.exists()) ? + state.dupradar_output_duprate_exp_denscurve_mqc : + null } + def bamstat_output = list.collect { id, state -> + (state.bamstat_output instanceof java.nio.file.Path && state.bamstat_output.exists()) ? + state.bamstat_output : + null } + def inferexperiment_multiqc = list.collect { id, state -> + (state.strandedness_output instanceof java.nio.file.Path && state.strandedness_output.exists()) ? + state.strandedness_output : + null } + def inner_dist_output_freq = list.collect { id, state -> + (state.inner_dist_output_freq instanceof java.nio.file.Path && state.inner_dist_output_freq.exists()) ? + state.inner_dist_output_freq : + null } + def junction_annotation_output_log = list.collect { id, state -> + (state.junction_annotation_output_log instanceof java.nio.file.Path && state.junction_annotation_output_log.exists()) ? + state.junction_annotation_output_log : + null } + def junction_saturation_output_plot_r = list.collect { id, state -> + (state.junction_saturation_output_plot_r instanceof java.nio.file.Path && state.junction_saturation_output_plot_r.exists()) ? + state.junction_saturation_output_plot_r : + null } + def read_distribution_output = list.collect { id, state -> + (state.read_distribution_output instanceof java.nio.file.Path && state.read_distribution_output.exists()) ? + state.read_distribution_output : + null } + def read_duplication_output_duplication_rate_mapping = list.collect { id, state -> + (state.read_duplication_output_duplication_rate_mapping instanceof java.nio.file.Path && state.read_duplication_output_duplication_rate_mapping.exists()) ? + state.read_duplication_output_duplication_rate_mapping : + null } + def tin_output_summary = list.collect { id, state -> + (state.tin_output_summary instanceof java.nio.file.Path && state.tin_output_summary.exists()) ? + state.tin_output_summary : + null } + def multiqc_custom_config = list.collect { id, state -> state.multiqc_custom_config }.unique()[0] + + ["merged", + [ + ids: ids, + strandedness: strandedness, + num_trimmed_reads: num_trimmed_reads, + passed_trimmed_reads: passed_trimmed_reads, + passed_mapping: passed_mapping, + percent_mapped: percent_mapped, + inferred_strand: inferred_strand, + passed_strand_check: passed_strand_check, + skip_align: skip_align, + skip_pseudo_align: skip_pseudo_align, + quant_results: quant_results.findAll { it != null }, + rsem_counts_gene: rsem_counts_gene.findAll { it != null }, + rsem_counts_transcripts: rsem_counts_transcripts.findAll { it != null }, + pseudo_quant_out_dir: pseudo_quant_out_dir.findAll { it != null }, + pseudo_salmon_quant_results: pseudo_salmon_quant_results.findAll { it != null }, + pseudo_kallisto_quant_results: pseudo_kallisto_quant_results.findAll { it != null }, + gtf: gtf, + gtf_extra_attributes: gtf_extra_attributes, + gtf_group_features: gtf_group_features, + pca_header_multiqc: pca_header_multiqc, + clustering_header_multiqc: clustering_header_multiqc, + aligner: aligner, + pseudo_aligner: pseudo_aligner, + deseq2_vst: deseq2_vst, + extra_deseq2_args: extra_deseq2_args, + extra_deseq2_args2: extra_deseq2_args2, + skip_deseq2_qc: skip_deseq2_qc, + fastqc_zip: fastqc_zip_1 + fastqc_zip_2, + trim_zip: trim_zip_1 + trim_zip_2, + trim_log: trim_log_1 + trim_log_2, + sortmerna_multiqc: sortmerna_multiqc, + star_multiqc: star_multiqc, + genome_bam_stats: genome_bam_stats, + genome_bam_flagstat: genome_bam_flagstat, + genome_bam_idxstats: genome_bam_idxstats, + markduplicates_multiqc: markduplicates_multiqc, + salmon_multiqc: salmon_multiqc, + rsem_multiqc: rsem_multiqc, + pseudo_multiqc: pseudo_multiqc, + featurecounts_multiqc: featurecounts_multiqc, + featurecounts_rrna_multiqc: featurecounts_rrna_multiqc, + preseq_output: preseq_output, + // qualimap_output_dir: qualimap_output_dir, + dupradar_output_dup_intercept_mqc: dupradar_output_dup_intercept_mqc, + dupradar_output_duprate_exp_denscurve_mqc: dupradar_output_duprate_exp_denscurve_mqc, + bamstat_output: bamstat_output, + inner_dist_output_freq: inner_dist_output_freq, + inferexperiment_multiqc: inferexperiment_multiqc, + junction_annotation_output_log: junction_annotation_output_log, + junction_saturation_output_plot_r: junction_saturation_output_plot_r, + read_distribution_output: read_distribution_output, + read_duplication_output_duplication_rate_mapping: read_duplication_output_duplication_rate_mapping, + tin_output_summary: tin_output_summary, + multiqc_custom_config: multiqc_custom_config + ] + ] + } + + // Merge quantification results of alignment + | merge_quant_results.run ( + runIf: { id, state -> !state.skip_align && state.aligner == 'star_salmon' }, + fromState: [ + "salmon_quant_results": "quant_results", + "gtf": "gtf", + "gtf_extra_attributes": "gtf_extra_attributes", + "gtf_group_features": "gtf_group_features" + ], + args: [ quant_type: "salmon"], + toState: [ + "tpm_gene": "tpm_gene", + "counts_gene": "counts_gene", + "counts_gene_length_scaled": "counts_gene_length_scaled", + "counts_gene_scaled": "counts_gene_scaled", + "tpm_transcript": "tpm_transcript", + "counts_transcript": "counts_transcript", + "lengths_gene": "lengths_gene", + "lengths_transcript": "lengths_transcript", + "quant_merged_summarizedexperiment": "quant_merged_summarizedexperiment" + ], + key: "merge_quant_results", + directives: [ label: [ "midmem", "midcpu" ] ] + ) + + | rsem_merge_counts.run ( + runIf: { id, state -> state.aligner == 'star_rsem' }, + fromState: [ + "counts_gene": "rsem_counts_gene", + "counts_transcripts": "rsem_counts_transcripts" + ], + toState: [ + "tpm_gene": "merged_gene_tpm", + "counts_gene": "merged_gene_counts", + "tpm_transcript": "merged_transcript_tpm", + "counts_transcript": "merged_transcript_counts" + ], + directives: [ label: [ "midmem", "midcpu" ] ] + ) + + | deseq2_qc.run ( + runIf: { id, state -> !state.skip_qc && !state.skip_deseq2_qc && !state.skip_align }, + fromState: { id, state -> + def counts = (state.aligner == "star_rsem") ? state.counts_gene : state.counts_gene_length_scaled + [ + counts: counts, + vst: state.deseq2_vst, + label: state.aligner + ] + }, + args: [count_col: 3, id_col: 1, outprefix: "deseq2"], + toState: [ + "deseq2_output": "outdir", + "deseq2_pca_multiqc": "pca_multiqc", + "deseq2_dists_multiqc": "dists_multiqc" + ], + key: "deseq2_qc_align_quant", + directives: [ label: [ "midmem", "midcpu" ] ] + ) + + // Merge quantification results of pseudo alignment + | merge_quant_results.run ( + runIf: { id, state -> !state.skip_pseudo_align }, + fromState: [ + "salmon_quant_results": "pseudo_salmon_quant_results", + "kallisto_quant_results": "pseudo_kallisto_quant_results", + "gtf": "gtf", + "gtf_extra_attributes": "gtf_extra_attributes", + "gtf_group_features": "gtf_group_features", + "quant_type": "pseudo_aligner" + ], + toState: [ + "pseudo_tpm_gene": "tpm_gene", + "pseudo_counts_gene": "counts_gene", + "pseudo_counts_gene_length_scaled": "counts_gene_length_scaled", + "pseudo_counts_gene_scaled": "counts_gene_scaled", + "pseudo_tpm_transcript": "tpm_transcript", + "pseudo_counts_transcript": "counts_transcript", + "pseudo_lengths_gene": "lengths_gene", + "pseudo_lengths_transcript": "lengths_transcript", + "pseudo_quant_merged_summarizedexperiment": "quant_merged_summarizedexperiment" + ], + key: "merge_pseudo_quant_results", + directives: [ label: [ "midmem", "midcpu" ] ] + ) + + | deseq2_qc.run ( + runIf: { id, state -> !state.skip_qc && !state.skip_deseq2_qc && !state.skip_pseudo_align }, + fromState: [ + "counts": "pseudo_counts_gene_length_scaled", + "vst": "deseq2_vst", + "label": "pseudo_aligner" + ], + args: [count_col: 3, id_col: 1, outprefix: "deseq2"], + toState: [ + "deseq2_output_pseudo": "outdir", + "deseq2_pca_multiqc_pseudo": "pca_multiqc", + "deseq2_dists_multiqc_pseudo": "dists_multiqc" + ], + key: "deseq2_qc_pseuso_align_quant", + directives: [ label: [ "midmem", "midcpu" ] ] + ) + + // Get list of samples that failed trimming, mapping, and strand check for MultiQC report + | map { id, state -> + def fail_trimming_header = ["Sample", "Reads after trimming"] + def fail_trimming_multiqc = "" + def star_mapping_header = ["Sample", "STAR uniquely mapped reads (%)"] + def fail_mapping_multiqc = "" + def strand_check_header = ["Sample", "Provided strandedness", "Inferred strandedness", "Sense (%)", "Antisense (%)", "Undetermined (%)"] + def fail_strand_multiqc = "" + if (state.ids.size() > 0) { + fail_trimming_multiqc += "${fail_trimming_header.join('\t')}\n" + fail_mapping_multiqc += "${star_mapping_header.join('\t')}\n" + fail_strand_multiqc += "${strand_check_header.join('\t')}\n" + for (i=0; i !state.skip_qc && !state.skip_biotype_qc && state.biotype && state.biotype_in_gtf && !state.skip_align }, - fromState: [ - "paired": "paired", - "strand": "strand", - "annotation": "gtf", - "input": "genome_bam", - "attribute_type": "attribute_type", - "feature_type": "featurecounts_feature_type", - "count_read_pairs": "paired" - ], - toState: [ - "featurecounts": "counts", - "featurecounts_summary": "summary" - ], - args: [ - both_aligned: true, - same_strand: true - ] - ) - - | multiqc_custom_biotype.run ( - runIf: { id, state -> !state.skip_qc && !state.skip_biotype_qc && state.biotype && state.featurecounts && !state.skip_align }, - fromState: [ - "id": "id", - "biocounts": "featurecounts", - "biotypes_header": "biotypes_header" - ], - toState: [ - "featurecounts_multiqc": "featurecounts_multiqc", - "featurecounts_rrna_multiqc": "featurecounts_rrna_multiqc" - ] - ) - - | preseq_lcextrap.run ( - runIf: { id, state -> !state.skip_qc && !state.skip_preseq && !state.skip_align }, - fromState: [ - "paired": "paired", - "input": "genome_bam", - "extra_preseq_args": "extra_preseq_args" - ], - toState: [ "preseq_output": "output" ] - ) - - | rseqc_bamstat.run ( - runIf: { id, state -> !state.skip_qc && !state.skip_rseqc && "bam_stat" in state.rseqc_modules && !state.skip_align }, - fromState: [ - "input_file": "genome_bam", - "mapq": "map_qual" - ], - toState: [ "bamstat_output": "output" ] - ) - | rseqc_inferexperiment.run( - runIf: { id, state -> !state.skip_qc && !state.skip_rseqc && "infer_experiment" in state.rseqc_modules && !state.skip_align }, - fromState: [ - "input_file": "genome_bam", - "refgene": "gene_bed", - "sample_size": "sample_size", - "mapq": "map_qual" - ], - toState: [ "strandedness_output": "output" ] - ) - // Get predicted strandedness from the RSeQC infer_experiment.py output - | map { id, state -> - def inferred_strand = getInferexperimentStrandedness(state.strandedness_output, 30) - def passed_strand_check = (state.strandedness != inferred_strand[0]) ? false : true - [ id, state + [ inferred_strand: inferred_strand, passed_strand_check: passed_strand_check ] ] + if (!state.passed_mapping[i]) { + tsv_data = [state.ids[i], state.percent_mapped[i]].join('\t') + fail_mapping_multiqc += tsv_data.join('\n') + } + if (!state.passed_strand_check[i]) { + tsv_data = ([state.ids[i], state.strandedness[i]] + state.inferred_strand[i]).join('\t') + fail_strand_multiqc += tsv_data.join('\n') + } + } } - | rseqc_inner_distance.run( - runIf: { id, state -> !state.skip_qc && !state.skip_rseqc && state.paired && "inner_distance" in state.rseqc_modules && !state.skip_align }, - key: "inner_distance", - fromState: [ - "input_file": "genome_bam", - "refgene": "gene_bed", - "sample_size": "sample_size", - "mapq": "map_qual", - "lower_bound": "lower_bound_size", - "upper_bound": "upper_bound_size", - "step": "step_size" - ], - toState: [ - "inner_dist_output_stats": "output_stats", - "inner_dist_output_dist": "output_dist", - "inner_dist_output_freq": "output_freq", - "inner_dist_output_plot": "output_plot", - "inner_dist_output_plot_r": "output_plot_r" - ] - ) - | rseqc_junctionannotation.run( - runIf: { id, state -> !state.skip_qc && !state.skip_rseqc && "junction_annotation" in state.rseqc_modules && !state.skip_align }, - fromState: [ - "input": "genome_bam", - "refgene": "gene_bed", - "map_qual": "map_qual", - "min_intron": "min_intron" - ], - toState: [ - "junction_annotation_output_log": "output_log", - "junction_annotation_output_plot_r": "output_plot_r", - "junction_annotation_output_junction_bed": "output_junction_bed", - "junction_annotation_output_junction_interact": "output_junction_interact", - "junction_annotation_output_junction_sheet": "output_junction_sheet", - "junction_annotation_output_splice_events_plot": "output_splice_events_plot", - "junction_annotation_output_splice_junctions_plot": "output_splice_junctions_plot" - ] - ) - | rseqc_junctionsaturation.run( - runIf: { id, state -> !state.skip_qc && !state.skip_rseqc && "junction_saturation" in state.rseqc_modules && !state.skip_align }, - fromState: [ - "input": "genome_bam", - "refgene": "gene_bed", - "sampling_percentile_lower_bound": "sampling_percentile_lower_bound", - "sampling_percentile_upper_bound": "sampling_percentile_upper_bound", - "sampling_percentile_step": "sampling_percentile_step", - "min_intron": "min_intron", - "min_splice_read": "min_splice_read", - "map_qual": "map_qual" - ], - toState: [ - "junction_saturation_output_plot_r": "output_plot_r", - "junction_saturation_output_plot": "output_plot" - ] - ) - | rseqc_readdistribution.run( - runIf: { id, state -> !state.skip_qc && !state.skip_rseqc && "read_distribution" in state.rseqc_modules && !state.skip_align }, - fromState: [ - "input": "genome_bam", - "refgene": "gene_bed", - ], - toState: [ "read_distribution_output": "output" ] - ) - | rseqc_readduplication.run( - runIf: { id, state -> !state.skip_qc && !state.skip_rseqc && "read_duplication" in state.rseqc_modules && !state.skip_align }, - fromState: [ - "input": "genome_bam", - "read_count_upper_limit": "read_count_upper_limit", - "map_qual": "map_qual" - ], - toState: [ - "read_duplication_output_duplication_rate_plot_r": "output_duplication_rate_plot_r", - "read_duplication_output_duplication_rate_plot": "output_duplication_rate_plot", - "read_duplication_output_duplication_rate_mapping": "output_duplication_rate_mapping", - "read_duplication_output_duplication_rate_sequence": "output_duplication_rate_sequence" - ] - ) - | rseqc_tin.run( - runIf: { id, state -> !state.skip_qc && !state.skip_rseqc && "tin" in state.rseqc_modules && !state.skip_align }, - fromState: [ - "bam_input": "genome_bam", - "bai_input": "genome_bam_index", - "refgene": "gene_bed", - "minimum_coverage": "minimum_coverage", - "sample_size": "tin_sample_size", - "subtract_background": "subtract_background" - ], - toState: [ - "tin_output_summary": "output_tin_summary", - "tin_output_metrics": "output_tin" - ] - ) - | dupradar.run( - runIf: { id, state -> !state.skip_qc && !state.skip_dupradar && !state.skip_align }, - fromState: [ - "id": "id", - "input": "genome_bam", - "gtf_annotation": "gtf", - "paired": "paired", - "strandedness": "strandedness" - ], - toState: [ - "dupradar_output_dupmatrix": "output_dupmatrix", - "dupradar_output_dup_intercept_mqc": "output_dup_intercept_mqc", - "dupradar_output_duprate_exp_boxplot": "output_duprate_exp_boxplot", - "dupradar_output_duprate_exp_densplot": "output_duprate_exp_densplot", - "dupradar_output_duprate_exp_denscurve_mqc": "output_duprate_exp_denscurve_mqc", - "dupradar_output_expression_histogram": "output_expression_histogram", - "dupradar_output_intercept_slope": "output_intercept_slope" - ] - ) + [ id, state + [fail_trimming_multiqc: fail_trimming_multiqc, fail_mapping_multiqc: fail_mapping_multiqc, fail_strand_multiqc: fail_strand_multiqc] ] + } - // TODO: Add outdir as an output argument to the qualimap module on biobox. - // Qualimap ouputs a few more raw data files to outdir but since the module is using a temporary directory as output dir these files are lost. - | qualimap_rnaseq.run( - runIf: { id, state -> !state.skip_qc && !state.skip_qualimap && !state.skip_align }, - fromState: [ - "bam": "genome_bam", - "gtf": "gtf", - "num_pr_bases": "pr_bases", - "num_tr_bias": "tr_bias", - "algorithm": "algorithm", - "sequencing_protocol": "sequencing_protocol", - "sorted": "sorted", - "java_memory_size": "java_memory_size", - ], - toState: [ - "qualimap_report": "report", - "qualimap_qc_report": "qc_report", - "qualimap_counts": "counts" - ] - ) + | map { id, state -> + state.each { key, value -> + if (value instanceof ArrayList) { + value.removeAll { it == null } + } + } + mod_state = state.findAll { key, value -> value != null } + [ id, mod_state ] + } - merged_ch = qc_ch - | toSortedList - | map { list -> - def ids = list.collect { id, state -> id } - def strandedness = list.collect { id, state -> state.strandedness } - def num_trimmed_reads = list.collect { id, state -> state.num_trimmed_reads } - def passed_trimmed_reads = list.collect { id, state -> state.passed_trimmed_reads } - def passed_mapping = list.collect { id, state -> state.passed_mapping } - def percent_mapped = list.collect { id, state -> state.percent_mapped } - def inferred_strand = list.collect { id, state -> state.inferred_strand } - def passed_strand_check = list.collect { id, state -> state.passed_strand_check } - def gtf = list.collect { id, state -> state.gtf }.unique()[0] - def gtf_extra_attributes = list.collect { id, state -> state.gtf_extra_attributes }.unique()[0] - def gtf_group_features = list.collect { id, state -> state.gtf_group_features }.unique()[0] - def pca_header_multiqc = list.collect { id, state -> state.pca_header_multiqc }.unique()[0] - def clustering_header_multiqc = list.collect { id, state -> state.clustering_header_multiqc }.unique()[0] - def aligner = list.collect { id, state -> state.aligner }.unique()[0] - def pseudo_aligner = list.collect { id, state -> state.pseudo_aligner }.unique()[0] - def deseq2_vst = list.collect { id, state -> state.deseq2_vst }.unique()[0] - def extra_deseq2_args = list.collect { id, state -> state.extra_deseq2_args }.unique()[0] - def extra_deseq2_args2 = list.collect { id, state -> state.extra_deseq2_args2 }.unique()[0] - def skip_deseq2_qc = list.collect { id, state -> state.skip_deseq2_qc }.unique()[0] - def skip_qc = list.collect { id, state -> state.skip_qc }.unique()[0] - def skip_align = list.collect { id, state -> state.skip_align }.unique()[0] - def skip_pseudo_align = list.collect { id, state -> state.skip_pseudo_align }.unique()[0] - def quant_results = list.collect { id, state -> - (state.quant_results_file instanceof java.nio.file.Path && state.quant_results_file.exists()) ? - state.quant_results_file : - null } - def rsem_counts_gene = list.collect { id, state -> - (state.rsem_counts_gene instanceof java.nio.file.Path && state.rsem_counts_gene.exists()) ? - state.rsem_counts_gene : - null } - def rsem_counts_transcripts = list.collect { id, state -> - (state.rsem_counts_transcripts instanceof java.nio.file.Path && state.rsem_counts_transcripts.exists()) ? - state.rsem_counts_transcripts : - null } - def pseudo_quant_out_dir = list.collect { id, state -> - (state.pseudo_quant_out_dir instanceof java.nio.file.Path && state.pseudo_quant_out_dir.exists()) ? - state.pseudo_quant_out_dir : - null } - def pseudo_salmon_quant_results = list.collect { id, state -> - (state.pseudo_salmon_quant_results_file instanceof java.nio.file.Path && state.pseudo_salmon_quant_results_file.exists()) ? - state.pseudo_salmon_quant_results_file : - null } - def pseudo_kallisto_quant_results = list.collect { id, state -> - (state.pseudo_kallisto_quant_results_file instanceof java.nio.file.Path && state.pseudo_kallisto_quant_results_file.exists()) ? - state.pseudo_kallisto_quant_results_file : - null } - def fastqc_zip_1 = list.collect { id, state -> - (state.fastqc_zip_1 instanceof java.nio.file.Path && state.fastqc_zip_1.exists()) ? - state.fastqc_zip_1 : - null } - def fastqc_zip_2 = list.collect { id, state -> - (state.fastqc_zip_2 instanceof java.nio.file.Path && state.fastqc_zip_2.exists()) ? - state.fastqc_zip_2 : - null } - def trim_zip_1 = list.collect { id, state -> - (state.trim_zip_1 instanceof java.nio.file.Path && state.trim_zip_1.exists()) ? - state.trim_zip_1 : - null } - def trim_zip_2 = list.collect { id, state -> - (state.trim_zip_2 instanceof java.nio.file.Path && state.trim_zip_2.exists()) ? - state.trim_zip_2 : - null } - def trim_log_1 = list.collect { id, state -> - (state.trim_log_1 instanceof java.nio.file.Path && state.trim_log_1.exists()) ? - state.trim_log_1 : - null } - def trim_log_2 = list.collect { id, state -> - (state.trim_log_2 instanceof java.nio.file.Path && state.trim_log_2.exists()) ? - state.trim_log_2 : - null } - def sortmerna_multiqc = list.collect { id, state -> - (state.sortmerna_multiqc instanceof java.nio.file.Path && state.sortmerna_multiqc.exists()) ? - state.sortmerna_multiqc : - null } - def star_multiqc = list.collect { id, state -> - (state.star_multiqc instanceof java.nio.file.Path && state.star_multiqc.exists()) ? - state.star_multiqc : - null } - def genome_bam_stats = list.collect { id, state -> - (state.genome_bam_stats instanceof java.nio.file.Path && state.genome_bam_stats.exists()) ? - state.genome_bam_stats : - null } - def genome_bam_flagstat = list.collect { id, state -> - (state.genome_bam_flagstat instanceof java.nio.file.Path && state.genome_bam_flagstat.exists()) ? - state.genome_bam_flagstat : - null } - def genome_bam_idxstats = list.collect { id, state -> - (state.genome_bam_idxstats instanceof java.nio.file.Path && state.genome_bam_idxstats.exists()) ? - state.genome_bam_idxstats : - null } - def markduplicates_multiqc = list.collect { id, state -> - (state.markduplicates_multiqc instanceof java.nio.file.Path && state.markduplicates_multiqc.exists()) ? - state.markduplicates_multiqc : - null } - def salmon_multiqc = list.collect { id, state -> - (state.salmon_multiqc instanceof java.nio.file.Path && state.salmon_multiqc.exists()) ? - state.salmon_multiqc : - null } - def rsem_multiqc = list.collect { id, state -> - (state.rsem_multiqc instanceof java.nio.file.Path && state.rsem_multiqc.exists()) ? - state.rsem_multiqc : - null } - def pseudo_multiqc = list.collect { id, state -> - (state.pseudo_multiqc instanceof java.nio.file.Path && state.pseudo_multiqc.exists()) ? - state.pseudo_multiqc : - null } - def featurecounts_multiqc = list.collect { id, state -> - (state.featurecounts_multiqc instanceof java.nio.file.Path && state.featurecounts_multiqc.exists()) ? - state.featurecounts_multiqc : - null } - def featurecounts_rrna_multiqc = list.collect { id, state -> - (state.featurecounts_rrna_multiqc instanceof java.nio.file.Path && state.featurecounts_rrna_multiqc.exists()) ? - state.featurecounts_rrna_multiqc : - null } - def preseq_output = list.collect { id, state -> - (state.preseq_output instanceof java.nio.file.Path && state.preseq_output.exists()) ? - state.preseq_output : - null } - // def qualimap_output_dir = list.collect { id, state -> - // (state.qualimap_output_dir instanceof java.nio.file.Path && state.qualimap_output_dir.exists()) ? - // state.qualimap_output_dir : - // null } - def dupradar_output_dup_intercept_mqc = list.collect { id, state -> - (state.dupradar_output_dup_intercept_mqc instanceof java.nio.file.Path && state.dupradar_output_dup_intercept_mqc.exists()) ? - state.dupradar_output_dup_intercept_mqc : - null } - def dupradar_output_duprate_exp_denscurve_mqc = list.collect { id, state -> - (state.dupradar_output_duprate_exp_denscurve_mqc instanceof java.nio.file.Path && state.dupradar_output_duprate_exp_denscurve_mqc.exists()) ? - state.dupradar_output_duprate_exp_denscurve_mqc : - null } - def bamstat_output = list.collect { id, state -> - (state.bamstat_output instanceof java.nio.file.Path && state.bamstat_output.exists()) ? - state.bamstat_output : - null } - def inferexperiment_multiqc = list.collect { id, state -> - (state.strandedness_output instanceof java.nio.file.Path && state.strandedness_output.exists()) ? - state.strandedness_output : - null } - def inner_dist_output_freq = list.collect { id, state -> - (state.inner_dist_output_freq instanceof java.nio.file.Path && state.inner_dist_output_freq.exists()) ? - state.inner_dist_output_freq : - null } - def junction_annotation_output_log = list.collect { id, state -> - (state.junction_annotation_output_log instanceof java.nio.file.Path && state.junction_annotation_output_log.exists()) ? - state.junction_annotation_output_log : - null } - def junction_saturation_output_plot_r = list.collect { id, state -> - (state.junction_saturation_output_plot_r instanceof java.nio.file.Path && state.junction_saturation_output_plot_r.exists()) ? - state.junction_saturation_output_plot_r : - null } - def read_distribution_output = list.collect { id, state -> - (state.read_distribution_output instanceof java.nio.file.Path && state.read_distribution_output.exists()) ? - state.read_distribution_output : - null } - def read_duplication_output_duplication_rate_mapping = list.collect { id, state -> - (state.read_duplication_output_duplication_rate_mapping instanceof java.nio.file.Path && state.read_duplication_output_duplication_rate_mapping.exists()) ? - state.read_duplication_output_duplication_rate_mapping : - null } - def tin_output_summary = list.collect { id, state -> - (state.tin_output_summary instanceof java.nio.file.Path && state.tin_output_summary.exists()) ? - state.tin_output_summary : - null } - def multiqc_custom_config = list.collect { id, state -> state.multiqc_custom_config }.unique()[0] - ["merged", [ - ids: ids, - strandedness: strandedness, - num_trimmed_reads: num_trimmed_reads, - passed_trimmed_reads: passed_trimmed_reads, - passed_mapping: passed_mapping, - percent_mapped: percent_mapped, - inferred_strand: inferred_strand, - passed_strand_check: passed_strand_check, - skip_align: skip_align, - skip_pseudo_align: skip_pseudo_align, - quant_results: quant_results.findAll { it != null }, - rsem_counts_gene: rsem_counts_gene.findAll { it != null }, - rsem_counts_transcripts: rsem_counts_transcripts.findAll { it != null }, - pseudo_quant_out_dir: pseudo_quant_out_dir.findAll { it != null }, - pseudo_salmon_quant_results: pseudo_salmon_quant_results.findAll { it != null }, - pseudo_kallisto_quant_results: pseudo_kallisto_quant_results.findAll { it != null }, - gtf: gtf, - gtf_extra_attributes: gtf_extra_attributes, - gtf_group_features: gtf_group_features, - pca_header_multiqc: pca_header_multiqc, - clustering_header_multiqc: clustering_header_multiqc, - aligner: aligner, - pseudo_aligner: pseudo_aligner, - deseq2_vst: deseq2_vst, - extra_deseq2_args: extra_deseq2_args, - extra_deseq2_args2: extra_deseq2_args2, - skip_deseq2_qc: skip_deseq2_qc, - fastqc_zip: fastqc_zip_1 + fastqc_zip_2, - trim_zip: trim_zip_1 + trim_zip_2, - trim_log: trim_log_1 + trim_log_2, - sortmerna_multiqc: sortmerna_multiqc, - star_multiqc: star_multiqc, - genome_bam_stats: genome_bam_stats, - genome_bam_flagstat: genome_bam_flagstat, - genome_bam_idxstats: genome_bam_idxstats, - markduplicates_multiqc: markduplicates_multiqc, - salmon_multiqc: salmon_multiqc, - rsem_multiqc: rsem_multiqc, - pseudo_multiqc: pseudo_multiqc, - featurecounts_multiqc: featurecounts_multiqc, - featurecounts_rrna_multiqc: featurecounts_rrna_multiqc, - preseq_output: preseq_output, - // qualimap_output_dir: qualimap_output_dir, - dupradar_output_dup_intercept_mqc: dupradar_output_dup_intercept_mqc, - dupradar_output_duprate_exp_denscurve_mqc: dupradar_output_duprate_exp_denscurve_mqc, - bamstat_output: bamstat_output, - inner_dist_output_freq: inner_dist_output_freq, - inferexperiment_multiqc: inferexperiment_multiqc, - junction_annotation_output_log: junction_annotation_output_log, - junction_saturation_output_plot_r: junction_saturation_output_plot_r, - read_distribution_output: read_distribution_output, - read_duplication_output_duplication_rate_mapping: read_duplication_output_duplication_rate_mapping, - tin_output_summary: tin_output_summary, - multiqc_custom_config: multiqc_custom_config - ] ] - } + | prepare_multiqc_input.run( + runIf: { id, state -> !state.skip_qc && !state.skip_multiqc }, + fromState: [ + "fail_trimming_multiqc": "fail_trimming_multiqc", + "fail_mapping_multiqc": "fail_mapping_multiqc", + "fail_strand_multiqc": "fail_strand_multiqc", + "fastqc_raw_multiqc": "fastqc_zip", + "fastqc_trim_multiqc": "trim_zip", + "trim_log_multiqc": "trim_log", + "sortmerna_multiqc": "sortmerna_multiqc", + "star_multiqc": "star_multiqc", + "salmon_multiqc": "salmon_multiqc", + "rsem_multiqc": "rsem_multiqc", + "pseudo_multiqc": "pseudo_multiqc", + "samtools_stats": "genome_bam_stats", + "samtools_flagstat": "genome_bam_flagstat", + "samtools_idxstats": "genome_bam_idxstats", + "markduplicates_multiqc": "markduplicates_multiqc", + "featurecounts_multiqc": "featurecounts_multiqc", + "featurecounts_rrna_multiqc": "featurecounts_rrna_multiqc", + "aligner_pca_multiqc": "deseq2_pca_multiqc", + "aligner_clustering_multiqc": "deseq2_dists_multiqc", + "pseudo_aligner_pca_multiqc": "deseq2_pca_multiqc_pseudo", + "pseudo_aligner_clustering_multiqc": "deseq2_dists_multiqc_pseudo", + "preseq_multiqc": "preseq_output", + // "qualimap_multiqc": "qualimap_output_dir", + "dupradar_output_dup_intercept_mqc": "dupradar_output_dup_intercept_mqc", + "dupradar_output_duprate_exp_denscurve_mqc": "dupradar_output_duprate_exp_denscurve_mqc", + "bamstat_multiqc": "bamstat_output", + "inferexperiment_multiqc": "inferexperiment_multiqc", + "innerdistance_multiqc": "inner_dist_output_freq", + "junctionannotation_multiqc": "junction_annotation_output_log", + "junctionsaturation_multiqc": "junction_saturation_output_plot_r", + "readdistribution_multiqc": "read_distribution_output", + "readduplication_multiqc": "read_duplication_output_duplication_rate_mapping", + "tin_multiqc": "tin_output_summary", + "multiqc_config": "multiqc_custom_config" + ], + toState: [ "multiqc_input": "output" ], + directives: [ label: [ "midmem", "midcpu" ] ] + ) - // Merge quantification results of alignment - | merge_quant_results.run ( - runIf: { id, state -> !state.skip_align && state.aligner == 'star_salmon' }, - fromState: [ - "salmon_quant_results": "quant_results", - "gtf": "gtf", - "gtf_extra_attributes": "gtf_extra_attributes", - "gtf_group_features": "gtf_group_features" - ], - args: [ quant_type: "salmon"], - toState: [ - "tpm_gene": "tpm_gene", - "counts_gene": "counts_gene", - "counts_gene_length_scaled": "counts_gene_length_scaled", - "counts_gene_scaled": "counts_gene_scaled", - "tpm_transcript": "tpm_transcript", - "counts_transcript": "counts_transcript", - "lengths_gene": "lengths_gene", - "lengths_transcript": "lengths_transcript", - "quant_merged_summarizedexperiment": "quant_merged_summarizedexperiment" - ], - key: "merge_quant_results" - ) + | multiqc.run ( + runIf: { id, state -> !state.skip_qc && !state.skip_multiqc }, + fromState: [ + "title": "multiqc_title", + "input": "multiqc_input", + ], + args: [exclude_modules: "general_stats"], + toState: [ + "multiqc_report": "output_report", + "multiqc_data": "output_data", + "multiqc_plots": "output_plots" + ], + directives: [ label: [ "highmem", "highcpu" ] ] + ) - | rsem_merge_counts.run ( - runIf: { id, state -> state.aligner == 'star_rsem' }, - fromState: [ - "counts_gene": "rsem_counts_gene", - "counts_transcripts": "rsem_counts_transcripts" - ], - toState: [ - "tpm_gene": "merged_gene_tpm", - "counts_gene": "merged_gene_counts", - "tpm_transcript": "merged_transcript_tpm", - "counts_transcript": "merged_transcript_counts" - ] - ) + | map { id, state -> + [ + id, [ + tpm_gene: state.tpm_gene, + counts_gene: state.counts_gene, + counts_gene_length_scaled: state.counts_gene_length_scaled, + counts_gene_scaled: state.counts_gene_scaled, + tpm_transcript: state.tpm_transcript, + counts_transcript: state.counts_transcript, + quant_merged_summarizedexperiment: state.quant_merged_summarizedexperiment, + deseq2_output: state.deseq2_output, + pseudo_tpm_gene: state.pseudo_tpm_gene, + pseudo_counts_gene: state.pseudo_counts_gene, + pseudo_counts_gene_length_scaled: state.pseudo_counts_gene_length_scaled, + pseudo_counts_gene_scaled: state.pseudo_counts_gene_scaled, + pseudo_tpm_transcript: state.pseudo_tpm_transcript, + pseudo_counts_transcript: state.pseudo_counts_transcript, + pseudo_quant_merged_summarizedexperiment: state.pseudo_quant_merged_summarizedexperiment, + deseq2_output_pseudo: state.deseq2_output_pseudo, + multiqc_report: state.multiqc_report, + multiqc_data: state.multiqc_data, + multiqc_plots: state.multiqc_plots + ] + ] + } - | deseq2_qc.run ( - runIf: { id, state -> !state.skip_qc && !state.skip_deseq2_qc && !state.skip_align }, - fromState: { id, state -> - def counts = (state.aligner == "star_rsem") ? state.counts_gene : state.counts_gene_length_scaled - [ - counts: counts, - vst: state.deseq2_vst, - label: state.aligner - ] - }, - args: [count_col: 3, id_col: 1, outprefix: "deseq2"], - toState: [ - "deseq2_output": "outdir", - "deseq2_pca_multiqc": "pca_multiqc", - "deseq2_dists_multiqc": "dists_multiqc" - ], - key: "deseq2_qc_align_quant" - ) + | map { list -> list[1]} - // Merge quantification results of pseudo alignment - | merge_quant_results.run ( - runIf: { id, state -> !state.skip_pseudo_align }, - fromState: [ - "salmon_quant_results": "pseudo_salmon_quant_results", - "kallisto_quant_results": "pseudo_kallisto_quant_results", - "gtf": "gtf", - "gtf_extra_attributes": "gtf_extra_attributes", - "gtf_group_features": "gtf_group_features", - "quant_type": "pseudo_aligner" - ], - toState: [ - "pseudo_tpm_gene": "tpm_gene", - "pseudo_counts_gene": "counts_gene", - "pseudo_counts_gene_length_scaled": "counts_gene_length_scaled", - "pseudo_counts_gene_scaled": "counts_gene_scaled", - "pseudo_tpm_transcript": "tpm_transcript", - "pseudo_counts_transcript": "counts_transcript", - "pseudo_lengths_gene": "lengths_gene", - "pseudo_lengths_transcript": "lengths_transcript", - "pseudo_quant_merged_summarizedexperiment": "quant_merged_summarizedexperiment" - ], - key: "merge_pseudo_quant_results" - ) + output_ch = qc_ch - | deseq2_qc.run ( - runIf: { id, state -> !state.skip_qc && !state.skip_deseq2_qc && !state.skip_pseudo_align }, - fromState: [ - "counts": "pseudo_counts_gene_length_scaled", - "vst": "deseq2_vst", - "label": "pseudo_aligner" - ], - args: [count_col: 3, id_col: 1, outprefix: "deseq2"], - toState: [ - "deseq2_output_pseudo": "outdir", - "deseq2_pca_multiqc_pseudo": "pca_multiqc", - "deseq2_dists_multiqc_pseudo": "dists_multiqc" - ], - key: "deseq2_qc_pseuso_align_quant" - ) - - // Get list of samples that failed trimming, mapping, and strand check for MultiQC report - | map { id, state -> - def fail_trimming_header = ["Sample", "Reads after trimming"] - def fail_trimming_multiqc = "" - def star_mapping_header = ["Sample", "STAR uniquely mapped reads (%)"] - def fail_mapping_multiqc = "" - def strand_check_header = ["Sample", "Provided strandedness", "Inferred strandedness", "Sense (%)", "Antisense (%)", "Undetermined (%)"] - def fail_strand_multiqc = "" - if (state.ids.size() > 0) { - fail_trimming_multiqc += "${fail_trimming_header.join('\t')}\n" - fail_mapping_multiqc += "${star_mapping_header.join('\t')}\n" - fail_strand_multiqc += "${strand_check_header.join('\t')}\n" - for (i=0; i - state.each { key, value -> - if (value instanceof ArrayList) { - value.removeAll { it == null } - } - } - mod_state = state.findAll { key, value -> value != null } - [ id, mod_state ] - } + | map { list -> [list[0], list[1] + list[2]] } - | prepare_multiqc_input.run( - runIf: { id, state -> !state.skip_qc && !state.skip_multiqc }, - fromState: [ - "fail_trimming_multiqc": "fail_trimming_multiqc", - "fail_mapping_multiqc": "fail_mapping_multiqc", - "fail_strand_multiqc": "fail_strand_multiqc", - "fastqc_raw_multiqc": "fastqc_zip", - "fastqc_trim_multiqc": "trim_zip", - "trim_log_multiqc": "trim_log", - "sortmerna_multiqc": "sortmerna_multiqc", - "star_multiqc": "star_multiqc", - "salmon_multiqc": "salmon_multiqc", - "rsem_multiqc": "rsem_multiqc", - "pseudo_multiqc": "pseudo_multiqc", - "samtools_stats": "genome_bam_stats", - "samtools_flagstat": "genome_bam_flagstat", - "samtools_idxstats": "genome_bam_idxstats", - "markduplicates_multiqc": "markduplicates_multiqc", - "featurecounts_multiqc": "featurecounts_multiqc", - "featurecounts_rrna_multiqc": "featurecounts_rrna_multiqc", - "aligner_pca_multiqc": "deseq2_pca_multiqc", - "aligner_clustering_multiqc": "deseq2_dists_multiqc", - "pseudo_aligner_pca_multiqc": "deseq2_pca_multiqc_pseudo", - "pseudo_aligner_clustering_multiqc": "deseq2_dists_multiqc_pseudo", - "preseq_multiqc": "preseq_output", - // "qualimap_multiqc": "qualimap_output_dir", - "dupradar_output_dup_intercept_mqc": "dupradar_output_dup_intercept_mqc", - "dupradar_output_duprate_exp_denscurve_mqc": "dupradar_output_duprate_exp_denscurve_mqc", - "bamstat_multiqc": "bamstat_output", - "inferexperiment_multiqc": "inferexperiment_multiqc", - "innerdistance_multiqc": "inner_dist_output_freq", - "junctionannotation_multiqc": "junction_annotation_output_log", - "junctionsaturation_multiqc": "junction_saturation_output_plot_r", - "readdistribution_multiqc": "read_distribution_output", - "readduplication_multiqc": "read_duplication_output_duplication_rate_mapping", - "tin_multiqc": "tin_output_summary", - "multiqc_config": "multiqc_custom_config" - ], - toState: [ "multiqc_input": "output" ] - ) + | map { id, state -> + def mod_state = state.findAll { key, value -> value instanceof java.nio.file.Path && value.exists() } + [ id, mod_state ] + } - | multiqc.run ( - runIf: { id, state -> !state.skip_qc && !state.skip_multiqc }, - fromState: [ - "title": "multiqc_title", - "input": "multiqc_input", - ], - args: [exclude_modules: "general_stats"], - toState: [ - "multiqc_report": "output_report", - "multiqc_data": "output_data", - "multiqc_plots": "output_plots" - ] - ) + | setState ( + [ + "preseq_output": "preseq_output", + "bamstat_output": "bamstat_output", + "strandedness_output": "strandedness_output", + "inner_dist_output_stats": "inner_dist_output_stats", + "inner_dist_output_dist": "inner_dist_output_dist", + "inner_dist_output_freq": "inner_dist_output_freq", + "inner_dist_output_plot": "inner_dist_output_plot", + "inner_dist_output_plot_r": "inner_dist_output_plot_r", + "junction_annotation_output_log": "junction_annotation_output_log", + "junction_annotation_output_plot_r": "junction_annotation_output_plot_r", + "junction_annotation_output_junction_bed": "junction_annotation_output_junction_bed", + "junction_annotation_output_junction_interact": "junction_annotation_output_junction_interact", + "junction_annotation_output_junction_sheet": "junction_annotation_output_junction_sheet", + "junction_annotation_output_splice_events_plot": "junction_annotation_output_splice_events_plot", + "junction_annotation_output_splice_junctions_plot": "junction_annotation_output_splice_junctions_plot", + "junction_saturation_output_plot_r": "junction_saturation_output_plot_r", + "junction_saturation_output_plot": "junction_saturation_output_plot", + "read_distribution_output": "read_distribution_output", + "read_duplication_output_duplication_rate_plot_r": "read_duplication_output_duplication_rate_plot_r", + "read_duplication_output_duplication_rate_plot": "read_duplication_output_duplication_rate_plot", + "read_duplication_output_duplication_rate_mapping": "read_duplication_output_duplication_rate_mapping", + "read_duplication_output_duplication_rate_sequence": "read_duplication_output_duplication_rate_sequence", + "tin_output_summary": "tin_output_summary", + "tin_output_metrics": "tin_output_metrics", + "dupradar_output_dupmatrix": "dupradar_output_dupmatrix", + "dupradar_output_dup_intercept_mqc": "dupradar_output_dup_intercept_mqc", + "dupradar_output_duprate_exp_boxplot": "dupradar_output_duprate_exp_boxplot", + "dupradar_output_duprate_exp_densplot": "dupradar_output_duprate_exp_densplot", + "dupradar_output_duprate_exp_denscurve_mqc": "dupradar_output_duprate_exp_denscurve_mqc", + "dupradar_output_expression_histogram": "dupradar_output_expression_histogram", + "dupradar_output_intercept_slope": "dupradar_output_intercept_slope", + "qualimap_report": "qualimap_report", + "qualimap_qc_report": "qualimap_qc_report", + "qualimap_counts": "qualimap_counts", + "featurecounts": "featurecounts", + "featurecounts_summary": "featurecounts_summary", + "featurecounts_multiqc": "featurecounts_multiqc", + "featurecounts_rrna_multiqc": "featurecounts_rrna_multiqc", + "tpm_gene": "tpm_gene", + "counts_gene": "counts_gene", + "counts_gene_length_scaled": "counts_gene_length_scaled", + "counts_gene_scaled": "counts_gene_scaled", + "tpm_transcript": "tpm_transcript", + "counts_transcript": "counts_transcript", + "lengths_gene": "lengths_gene", + "lengths_transcript": "lengths_transcript", + "quant_merged_summarizedexperiment": "quant_merged_summarizedexperiment", + "deseq2_output": "deseq2_output", + "pseudo_tpm_gene": "pseudo_tpm_gene", + "pseudo_counts_gene": "pseudo_counts_gene", + "pseudo_counts_gene_length_scaled": "pseudo_counts_gene_length_scaled", + "pseudo_counts_gene_scaled": "pseudo_counts_gene_scaled", + "pseudo_tpm_transcript": "pseudo_tpm_transcript", + "pseudo_counts_transcript": "pseudo_counts_transcript", + "pseudo_lengths_gene": "pseudo_lengths_gene", + "pseudo_lengths_transcript": "pseudo_lengths_transcript", + "pseudo_quant_merged_summarizedexperiment": "pseudo_quant_merged_summarizedexperiment", + "deseq2_output_pseudo": "deseq2_output_pseudo", + "multiqc_report": "multiqc_report", + "multiqc_data": "multiqc_data", + "multiqc_plots": "multiqc_plots" + ] + ) - | map { id, state -> - [ id, [ - tpm_gene: state.tpm_gene, - counts_gene: state.counts_gene, - counts_gene_length_scaled: state.counts_gene_length_scaled, - counts_gene_scaled: state.counts_gene_scaled, - tpm_transcript: state.tpm_transcript, - counts_transcript: state.counts_transcript, - quant_merged_summarizedexperiment: state.quant_merged_summarizedexperiment, - deseq2_output: state.deseq2_output, - pseudo_tpm_gene: state.pseudo_tpm_gene, - pseudo_counts_gene: state.pseudo_counts_gene, - pseudo_counts_gene_length_scaled: state.pseudo_counts_gene_length_scaled, - pseudo_counts_gene_scaled: state.pseudo_counts_gene_scaled, - pseudo_tpm_transcript: state.pseudo_tpm_transcript, - pseudo_counts_transcript: state.pseudo_counts_transcript, - pseudo_quant_merged_summarizedexperiment: state.pseudo_quant_merged_summarizedexperiment, - deseq2_output_pseudo: state.deseq2_output_pseudo, - multiqc_report: state.multiqc_report, - multiqc_data: state.multiqc_data, - multiqc_plots: state.multiqc_plots - ] ] - } - - | map { list -> list[1]} - - output_ch = qc_ch - - | combine(merged_ch) - - | map { list -> [list[0], list[1] + list[2]] } - - | map { id, state -> - def mod_state = state.findAll { key, value -> value instanceof java.nio.file.Path && value.exists() } - [ id, mod_state ] - } - - | setState ( - [ - "preseq_output": "preseq_output", - "bamstat_output": "bamstat_output", - "strandedness_output": "strandedness_output", - "inner_dist_output_stats": "inner_dist_output_stats", - "inner_dist_output_dist": "inner_dist_output_dist", - "inner_dist_output_freq": "inner_dist_output_freq", - "inner_dist_output_plot": "inner_dist_output_plot", - "inner_dist_output_plot_r": "inner_dist_output_plot_r", - "junction_annotation_output_log": "junction_annotation_output_log", - "junction_annotation_output_plot_r": "junction_annotation_output_plot_r", - "junction_annotation_output_junction_bed": "junction_annotation_output_junction_bed", - "junction_annotation_output_junction_interact": "junction_annotation_output_junction_interact", - "junction_annotation_output_junction_sheet": "junction_annotation_output_junction_sheet", - "junction_annotation_output_splice_events_plot": "junction_annotation_output_splice_events_plot", - "junction_annotation_output_splice_junctions_plot": "junction_annotation_output_splice_junctions_plot", - "junction_saturation_output_plot_r": "junction_saturation_output_plot_r", - "junction_saturation_output_plot": "junction_saturation_output_plot", - "read_distribution_output": "read_distribution_output", - "read_duplication_output_duplication_rate_plot_r": "read_duplication_output_duplication_rate_plot_r", - "read_duplication_output_duplication_rate_plot": "read_duplication_output_duplication_rate_plot", - "read_duplication_output_duplication_rate_mapping": "read_duplication_output_duplication_rate_mapping", - "read_duplication_output_duplication_rate_sequence": "read_duplication_output_duplication_rate_sequence", - "tin_output_summary": "tin_output_summary", - "tin_output_metrics": "tin_output_metrics", - "dupradar_output_dupmatrix": "dupradar_output_dupmatrix", - "dupradar_output_dup_intercept_mqc": "dupradar_output_dup_intercept_mqc", - "dupradar_output_duprate_exp_boxplot": "dupradar_output_duprate_exp_boxplot", - "dupradar_output_duprate_exp_densplot": "dupradar_output_duprate_exp_densplot", - "dupradar_output_duprate_exp_denscurve_mqc": "dupradar_output_duprate_exp_denscurve_mqc", - "dupradar_output_expression_histogram": "dupradar_output_expression_histogram", - "dupradar_output_intercept_slope": "dupradar_output_intercept_slope", - "qualimap_report": "qualimap_report", - "qualimap_qc_report": "qualimap_qc_report", - "qualimap_counts": "qualimap_counts", - "featurecounts": "featurecounts", - "featurecounts_summary": "featurecounts_summary", - "featurecounts_multiqc": "featurecounts_multiqc", - "featurecounts_rrna_multiqc": "featurecounts_rrna_multiqc", - "tpm_gene": "tpm_gene", - "counts_gene": "counts_gene", - "counts_gene_length_scaled": "counts_gene_length_scaled", - "counts_gene_scaled": "counts_gene_scaled", - "tpm_transcript": "tpm_transcript", - "counts_transcript": "counts_transcript", - "lengths_gene": "lengths_gene", - "lengths_transcript": "lengths_transcript", - "quant_merged_summarizedexperiment": "quant_merged_summarizedexperiment", - "deseq2_output": "deseq2_output", - "pseudo_tpm_gene": "pseudo_tpm_gene", - "pseudo_counts_gene": "pseudo_counts_gene", - "pseudo_counts_gene_length_scaled": "pseudo_counts_gene_length_scaled", - "pseudo_counts_gene_scaled": "pseudo_counts_gene_scaled", - "pseudo_tpm_transcript": "pseudo_tpm_transcript", - "pseudo_counts_transcript": "pseudo_counts_transcript", - "pseudo_lengths_gene": "pseudo_lengths_gene", - "pseudo_lengths_transcript": "pseudo_lengths_transcript", - "pseudo_quant_merged_summarizedexperiment": "pseudo_quant_merged_summarizedexperiment", - "deseq2_output_pseudo": "deseq2_output_pseudo", - "multiqc_report": "multiqc_report", - "multiqc_data": "multiqc_data", - "multiqc_plots": "multiqc_plots" - ] - ) - - emit: - output_ch + emit: + output_ch } // // Function to check whether biotype field exists in GTF file // def biotypeInGtf(gtf_file, biotype) { - def hits = 0 - gtf_file.eachLine { line -> - def attributes = line.split('\t')[-1].split() - if (attributes.contains(biotype)) { - hits += 1 - } - } - if (hits) { - return true - } else { - log.warn "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" + - " Biotype attribute '${biotype}' not found in the last column of the GTF file!\n\n" + - " Biotype QC will be skipped to circumvent the issue below:\n" + - " https://github.com/nf-core/rnaseq/issues/460\n\n" + - " Amend '--featurecounts_group_type' to change this behaviour.\n" + - "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" - return false + def hits = 0 + gtf_file.eachLine { line -> + def attributes = line.split('\t')[-1].split() + if (attributes.contains(biotype)) { + hits += 1 } + } + if (hits) { + return true + } else { + log.warn "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n" + + " Biotype attribute '${biotype}' not found in the last column of the GTF file!\n\n" + + " Biotype QC will be skipped to circumvent the issue below:\n" + + " https://github.com/nf-core/rnaseq/issues/460\n\n" + + " Amend '--featurecounts_group_type' to change this behaviour.\n" + + "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" + return false + } } // // Function that parses and returns the predicted strandedness from the RSeQC infer_experiment.py output // def getInferexperimentStrandedness(inferexperiment_file, cutoff=30) { - def sense = 0 - def antisense = 0 - def undetermined = 0 - inferexperiment_file.eachLine { line -> - def undetermined_matcher = line =~ /Fraction of reads failed to determine:\s([\d\.]+)/ - def se_sense_matcher = line =~ /Fraction of reads explained by "\++,--":\s([\d\.]+)/ - def se_antisense_matcher = line =~ /Fraction of reads explained by "\+-,-\+":\s([\d\.]+)/ - def pe_sense_matcher = line =~ /Fraction of reads explained by "1\++,1--,2\+-,2-\+":\s([\d\.]+)/ - def pe_antisense_matcher = line =~ /Fraction of reads explained by "1\+-,1-\+,2\+\+,2--":\s([\d\.]+)/ - if (undetermined_matcher) undetermined = undetermined_matcher[0][1].toFloat() * 100 - if (se_sense_matcher) sense = se_sense_matcher[0][1].toFloat() * 100 - if (se_antisense_matcher) antisense = se_antisense_matcher[0][1].toFloat() * 100 - if (pe_sense_matcher) sense = pe_sense_matcher[0][1].toFloat() * 100 - if (pe_antisense_matcher) antisense = pe_antisense_matcher[0][1].toFloat() * 100 - } - def strandedness = 'unstranded' - if (sense >= 100-cutoff) { - strandedness = 'forward' - } else if (antisense >= 100-cutoff) { - strandedness = 'reverse' - } - return [ strandedness, sense, antisense, undetermined ] + def sense = 0 + def antisense = 0 + def undetermined = 0 + inferexperiment_file.eachLine { line -> + def undetermined_matcher = line =~ /Fraction of reads failed to determine:\s([\d\.]+)/ + def se_sense_matcher = line =~ /Fraction of reads explained by "\++,--":\s([\d\.]+)/ + def se_antisense_matcher = line =~ /Fraction of reads explained by "\+-,-\+":\s([\d\.]+)/ + def pe_sense_matcher = line =~ /Fraction of reads explained by "1\++,1--,2\+-,2-\+":\s([\d\.]+)/ + def pe_antisense_matcher = line =~ /Fraction of reads explained by "1\+-,1-\+,2\+\+,2--":\s([\d\.]+)/ + if (undetermined_matcher) undetermined = undetermined_matcher[0][1].toFloat() * 100 + if (se_sense_matcher) sense = se_sense_matcher[0][1].toFloat() * 100 + if (se_antisense_matcher) antisense = se_antisense_matcher[0][1].toFloat() * 100 + if (pe_sense_matcher) sense = pe_sense_matcher[0][1].toFloat() * 100 + if (pe_antisense_matcher) antisense = pe_antisense_matcher[0][1].toFloat() * 100 + } + def strandedness = 'unstranded' + if (sense >= 100-cutoff) { + strandedness = 'forward' + } else if (antisense >= 100-cutoff) { + strandedness = 'reverse' + } + return [ strandedness, sense, antisense, undetermined ] } // inner workflow hook diff --git a/target/nextflow/workflows/quality_control/nextflow.config b/target/nextflow/workflows/quality_control/nextflow.config index 228ad7f..24cfbbd 100644 --- a/target/nextflow/workflows/quality_control/nextflow.config +++ b/target/nextflow/workflows/quality_control/nextflow.config @@ -122,4 +122,4 @@ process{ withLabel: cpu1000 { cpus = 1000 } } - +includeConfig("nextflow_labels.config") diff --git a/target/nextflow/workflows/quality_control/nextflow_labels.config b/target/nextflow/workflows/quality_control/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/nextflow/workflows/quality_control/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/nextflow/workflows/quality_control/nextflow_schema.json b/target/nextflow/workflows/quality_control/nextflow_schema.json index 833fc51..b5e5c6a 100644 --- a/target/nextflow/workflows/quality_control/nextflow_schema.json +++ b/target/nextflow/workflows/quality_control/nextflow_schema.json @@ -616,8 +616,8 @@ "multiqc_custom_config": { "type": "string", - "description": "Type: `file`. ", - "help_text": "Type: `file`. " + "description": "Type: `file`. Custom multiqc configuration file\n", + "help_text": "Type: `file`. Custom multiqc configuration file\n" } @@ -626,8 +626,8 @@ "multiqc_title": { "type": "string", - "description": "Type: `string`. ", - "help_text": "Type: `string`. " + "description": "Type: `string`. Custom multiqc title\n", + "help_text": "Type: `string`. Custom multiqc title\n" } diff --git a/target/nextflow/workflows/rnaseq/.config.vsh.yaml b/target/nextflow/workflows/rnaseq/.config.vsh.yaml index 01d9cb8..208a797 100644 --- a/target/nextflow/workflows/rnaseq/.config.vsh.yaml +++ b/target/nextflow/workflows/rnaseq/.config.vsh.yaml @@ -521,11 +521,6 @@ argument_groups: direction: "input" multiple: false multiple_sep: ";" - - type: "boolean_true" - name: "--skip_bbsplit" - description: "Skip BBSplit for removal of non-reference genome reads." - info: null - direction: "input" - type: "boolean" name: "--skip_umi_extract" description: "Skip umi_tools extract step." @@ -566,11 +561,6 @@ argument_groups: description: "Skip Preseq." info: null direction: "input" - - type: "boolean_true" - name: "--skip_deseq2_qc" - description: "Skip DESeq2 PCA and heatmap plotting." - info: null - direction: "input" - type: "boolean_true" name: "--skip_dupradar" description: "Skip dupRadar." @@ -649,9 +639,8 @@ argument_groups: arguments: - type: "file" name: "--multiqc_custom_config" + description: "Custom multiqc configuration file\n" info: null - default: - - "src/assets/multiqc_config.yml" must_exist: true create_parent: true required: false @@ -660,6 +649,7 @@ argument_groups: multiple_sep: ";" - type: "string" name: "--multiqc_title" + description: "Custom multiqc title\n" info: null required: false direction: "input" @@ -668,8 +658,6 @@ argument_groups: - type: "file" name: "--multiqc_methods_description" info: null - default: - - "src/assets/methods_description_template.yml" must_exist: true create_parent: true required: false @@ -1949,7 +1937,15 @@ resources: path: "main.nf" is_executable: true entrypoint: "run_wf" +- type: "file" + path: "nextflow_labels.config" + dest: "nextflow_labels.config" description: "A viash workflow for the nf-core/rnaseq pipeline.\n" +test_resources: +- type: "nextflow_script" + path: "test.nf" + is_executable: true + entrypoint: "test_wf" info: null status: "enabled" requirements: @@ -2049,6 +2045,8 @@ runners: cpu200: "cpus = 200" cpu500: "cpus = 500" cpu1000: "cpus = 1000" + script: + - "includeConfig(\"nextflow_labels.config\")" debug: false container: "docker" engines: @@ -2061,8 +2059,8 @@ build_info: output: "target/nextflow/workflows/rnaseq" executable: "target/nextflow/workflows/rnaseq/main.nf" viash_version: "0.9.0" - git_commit: "d63250ae704b6bd9a11792c4f979be2309999a2e" - git_remote: "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + git_commit: "4adb388c7d928eea02bccf890214f3b932b08714" + git_remote: "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" dependencies: - "target/nextflow/workflows/prepare_genome" - "target/nextflow/cat_fastq" @@ -2091,8 +2089,10 @@ package_config: source: "src" target: "target" config_mods: - - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag\ - \ := '$id'\n" + - ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config',\ + \ dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag\ + \ := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\"nextflow_labels.config\"\ + )'\n" - ".engines += { type: \"native\" }" - ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'" - ".engines[.type == 'docker'].target_tag := 'main'" diff --git a/target/nextflow/workflows/rnaseq/main.nf b/target/nextflow/workflows/rnaseq/main.nf index 55ec510..e65bcdd 100644 --- a/target/nextflow/workflows/rnaseq/main.nf +++ b/target/nextflow/workflows/rnaseq/main.nf @@ -3397,12 +3397,6 @@ meta = [ "multiple" : false, "multiple_sep" : ";" }, - { - "type" : "boolean_true", - "name" : "--skip_bbsplit", - "description" : "Skip BBSplit for removal of non-reference genome reads.", - "direction" : "input" - }, { "type" : "boolean", "name" : "--skip_umi_extract", @@ -3451,12 +3445,6 @@ meta = [ "description" : "Skip Preseq.", "direction" : "input" }, - { - "type" : "boolean_true", - "name" : "--skip_deseq2_qc", - "description" : "Skip DESeq2 PCA and heatmap plotting.", - "direction" : "input" - }, { "type" : "boolean_true", "name" : "--skip_dupradar", @@ -3552,9 +3540,7 @@ meta = [ { "type" : "file", "name" : "--multiqc_custom_config", - "default" : [ - "src/assets/multiqc_config.yml" - ], + "description" : "Custom multiqc configuration file\n", "must_exist" : true, "create_parent" : true, "required" : false, @@ -3565,6 +3551,7 @@ meta = [ { "type" : "string", "name" : "--multiqc_title", + "description" : "Custom multiqc title\n", "required" : false, "direction" : "input", "multiple" : false, @@ -3573,9 +3560,6 @@ meta = [ { "type" : "file", "name" : "--multiqc_methods_description", - "default" : [ - "src/assets/methods_description_template.yml" - ], "must_exist" : true, "create_parent" : true, "required" : false, @@ -4902,7 +4886,7 @@ meta = [ { "type" : "file", "name" : "--deseq2_output", - ''' + ''' "default" : [ + "default" : [ "deseq2_qc" ], "must_exist" : true, @@ -4919,7 +4903,7 @@ meta = [ "deseq2_qc_pseudo" ], "must_exist" : true, - "create_parent" : true, + "create_parent" : ''' + '''true, "required" : false, "direction" : "output", "multiple" : false, @@ -5074,9 +5058,22 @@ meta = [ "path" : "main.nf", "is_executable" : true, "entrypoint" : "run_wf" + }, + { + "type" : "file", + "path" : "/src/workflows/utils/labels.config", + "dest" : "nextflow_labels.config" } ], "description" : "A viash workflow for the nf-core/rnaseq pipeline.\n", + "test_resources" : [ + { + "type" : "nextflow_script", + "path" : "test.nf", + "is_executable" : true, + "entrypoint" : "test_wf" + } + ], "status" : "enabled", "requirements" : { "commands" : [ @@ -5209,7 +5206,10 @@ meta = [ "cpu200" : "cpus = 200", "cpu500" : "cpus = 500", "cpu1000" : "cpus = 1000" - } + }, + "script" : [ + "includeConfig(\\"nextflow_labels.config\\")" + ] }, "debug" : false, "container" : "docker" @@ -5227,8 +5227,8 @@ meta = [ "engine" : "native", "output" : "/workdir/root/repo/target/nextflow/workflows/rnaseq", "viash_version" : "0.9.0", - "git_commit" : "d63250ae704b6bd9a11792c4f979be2309999a2e", - "git_remote" : "https://x-access-token:ghs_ri9q8QB7jMaviilgc8bYrtSqMrabrg3q8JZY@github.com/viash-hub/rnaseq" + "git_commit" : "4adb388c7d928eea02bccf890214f3b932b08714", + "git_remote" : "https://x-access-token:ghs_MW7eJel8BXirGBmM5nVBbQvzqvrjaH0zDh8H@github.com/viash-hub/rnaseq" }, "package_config" : { "name" : "rnaseq", @@ -5259,7 +5259,7 @@ meta = [ "source" : "/workdir/root/repo/src", "target" : "/workdir/root/repo/target", "config_mods" : [ - ".requirements.commands := ['ps']\n.runners[.type == 'nextflow'].directives.tag := '$id'\n", + ".requirements.commands := ['ps']\n.resources += {path: '/src/workflows/utils/labels.config', dest: 'nextflow_labels.config'}\n.runners[.type == 'nextflow'].directives.tag := '$id'\n.runners[.type == 'nextflow'].config.script := 'includeConfig(\\"nextflow_labels.config\\")'\n", ".engines += { type: \\"native\\" }", ".engines[.type == 'docker'].target_registry := 'images.viash-hub.com'", ".engines[.type == 'docker'].target_tag := 'main'" @@ -5286,6 +5286,7 @@ workflow run_wf { input_ch main: + reference_ch = input_ch | map { id, state -> @@ -5304,8 +5305,8 @@ workflow run_wf { | toSortedList | map { list -> - [ "ref", - [ fasta: list.collect { id, state -> state.fasta }.unique()[0], + [ "ref", [ + fasta: list.collect { id, state -> state.fasta }.unique()[0], gtf: list.collect { id, state -> state.gtf }.unique()[0], gff: list.collect { id, state -> state.gff }.unique()[0], additional_fasta: list.collect { id, state -> state.additional_fasta }.unique()[0], @@ -5321,7 +5322,8 @@ workflow run_wf { // splicesites: list.collect { id, state -> state.splicesites }.unique()[0], // hisat2_index: list.collect { id, state -> state.hisat2_index }.unique()[0], bbsplit_index: list.collect { id, state -> state.bbsplit_index }.unique()[0], - skip_bbsplit: list.collect { id, state -> state.skip_bbsplit }.unique()[0], + // See: + skip_bbsplit: true, // list.collect { id, state -> state.skip_bbsplit }.unique()[0], skip_alignment: list.collect { id, state -> state.skip_alignment }.unique()[0], gencode: list.collect { id, state -> state.gencode }.unique()[0], biotype: list.collect { id, state -> state.biotype }.unique()[0], @@ -5333,43 +5335,43 @@ workflow run_wf { // prepare all the necessary files for reference genome | prepare_genome.run ( - fromState: [ - "fasta": "fasta", - "gtf": "gtf", - "gff": "gff", - "additional_fasta": "additional_fasta", - "transcript_fasta": "transcript_fasta", - "gene_bed": "gene_bed", - "bbsplit_fasta_list": "bbsplit_fasta_list", - "star_index": "star_index", - "rsem_index": "rsem_index", - "salmon_index": "salmon_index", - "kallisto_index": "kallisto_index", - "pseudo_aligner_kmer_size": "pseudo_aligner_kmer_size", - // "splicesites": "splicesites", - // "hisat2_index": "hisat2_index", - "bbsplit_index": "bbsplit_index", - "skip_bbsplit": "skip_bbsplit", - "gencode": "gencode", - "biotype": "biotype", - "filter_gtf": "filter_gtf", - "aligner": "aligner", - "pseudo_aligner": "pseudo_aligner", - "skip_alignment": "skip_alignment", - "star_sjdb_gtf_feature_exon": "star_sjdb_gtf_feature_exon" - ], - toState: [ - "fasta": "uncompressed_fasta", - "gtf": "gtf_uncompressed", - "transcript_fasta": "transcript_fasta_uncompressed", - "fai": "fai", - "chrom_sizes": "chrom_sizes", - "bbsplit_index": "bbsplit_index_uncompressed", - "star_index": "star_index_uncompressed", - "salmon_index": "salmon_index_uncompressed", - "kallisto_index": "kallisto_index_uncompressed", - "gene_bed": "gene_bed_uncompressed" - ] + fromState: [ + "fasta": "fasta", + "gtf": "gtf", + "gff": "gff", + "additional_fasta": "additional_fasta", + "transcript_fasta": "transcript_fasta", + "gene_bed": "gene_bed", + "bbsplit_fasta_list": "bbsplit_fasta_list", + "star_index": "star_index", + "rsem_index": "rsem_index", + "salmon_index": "salmon_index", + "kallisto_index": "kallisto_index", + "pseudo_aligner_kmer_size": "pseudo_aligner_kmer_size", + // "splicesites": "splicesites", + // "hisat2_index": "hisat2_index", + "bbsplit_index": "bbsplit_index", + "skip_bbsplit": "skip_bbsplit", + "gencode": "gencode", + "biotype": "biotype", + "filter_gtf": "filter_gtf", + "aligner": "aligner", + "pseudo_aligner": "pseudo_aligner", + "skip_alignment": "skip_alignment", + "star_sjdb_gtf_feature_exon": "star_sjdb_gtf_feature_exon" + ], + toState: [ + "fasta": "uncompressed_fasta", + "gtf": "gtf_uncompressed", + "transcript_fasta": "transcript_fasta_uncompressed", + "fai": "fai", + "chrom_sizes": "chrom_sizes", + "bbsplit_index": "bbsplit_index_uncompressed", + "star_index": "star_index_uncompressed", + "salmon_index": "salmon_index_uncompressed", + "kallisto_index": "kallisto_index_uncompressed", + "gene_bed": "gene_bed_uncompressed" + ] ) // Check if contigs in genome fasta file > 512 Mbp @@ -5377,6 +5379,7 @@ workflow run_wf { (isBelowMaxContigSize(state.fai)) ? [id, state] : [id, state + [bam_csi_index: true]] } + // Pick out the state | map { list -> list[1]} analysis_ch = input_ch @@ -5387,73 +5390,74 @@ workflow run_wf { // Concatenate FastQ files from same sample if required | cat_fastq.run ( - fromState: [ - "read_1": "fastq_1", - "read_2": "fastq_2" - ], - toState: [ - "fastq_1": "fastq_1", - "fastq_2": "fastq_2" - ] + fromState: [ + "read_1": "fastq_1", + "read_2": "fastq_2" + ], + toState: [ + "fastq_1": "fastq_1", + "fastq_2": "fastq_2" + ], + directives: [ label: [ "lowmem", "midcpu" ] ] ) // Pre-process fastq files | pre_processing.run ( - fromState: [ - "id": "id", - "fastq_1": "fastq_1", - "fastq_2": "fastq_2", - "umitools_bc_pattern": "umitools_bc_pattern", - "umitools_bc_pattern2": "umitools_bc_pattern2", - "strandedness": "strandedness", - "transcript_fasta": "transcript_fasta", - "gtf": "gtf", - "with_umi": "with_umi", - "bbsplit_index": "bbsplit_index", - "bbsplit_fasta_list": "bbsplit_fasta_list", - "bc_pattern": "bc_pattern", - "ribo_database_manifest": "ribo_database_manifest", - "salmon_index": "salmon_index", - "skip_qc": "skip_qc", - "skip_fastqc": "skip_fastqc", - "skip_skip_umi_extract": "skip_umi_extract", - "umi_discard_read": "umi_discard_read", - "skip_trimming": "skip_trimming", - "trimmer": "trimmer", - "skip_bbsplit": "skip_bbsplit", - "remove_ribo_rna": "remove_ribo_rna" - ], - toState: [ - "fastqc_html_1": "fastqc_html_1", - "fastqc_html_2": "fastqc_html_2", - "fastqc_zip_1": "fastqc_zip_1", - "fastqc_zip_2": "fastqc_zip_2", - "fastq_1": "qc_output1", - "fastq_2": "qc_output2", - "trim_log_1": "trim_log_1", - "trim_log_2": "trim_log_2", - "trim_zip_1": "trim_zip_1", - "trim_zip_2": "trim_zip_2", - "trim_html_1": "trim_html_1", - "trim_html_2": "trim_html_2", - "passed_trimmed_reads": "passed_trimmed_reads", - "num_trimmed_reads": "num_trimmed_reads", - "sortmerna_log": "sortmerna_log", - "salmon_quant_output": "salmon_quant_output", - "fastp_failed_trim": "failed_trim", - "fastp_failed_trim_unpaired1": "failed_trim_unpaired1", - "fastp_failed_trim_unpaired2": "failed_trim_unpaired2", - "fastp_trim_json": "trim_json", - "fastp_trim_html": "trim_html", - "fastp_trim_merged_out": "trim_merged_out" - ] + fromState: [ + "id": "id", + "fastq_1": "fastq_1", + "fastq_2": "fastq_2", + "umitools_bc_pattern": "umitools_bc_pattern", + "umitools_bc_pattern2": "umitools_bc_pattern2", + "strandedness": "strandedness", + "transcript_fasta": "transcript_fasta", + "gtf": "gtf", + "with_umi": "with_umi", + "bbsplit_index": "bbsplit_index", + "bbsplit_fasta_list": "bbsplit_fasta_list", + "bc_pattern": "bc_pattern", + "ribo_database_manifest": "ribo_database_manifest", + "salmon_index": "salmon_index", + "skip_qc": "skip_qc", + "skip_fastqc": "skip_fastqc", + "skip_skip_umi_extract": "skip_umi_extract", + "umi_discard_read": "umi_discard_read", + "skip_trimming": "skip_trimming", + "trimmer": "trimmer", + "skip_bbsplit": "skip_bbsplit", + "remove_ribo_rna": "remove_ribo_rna" + ], + toState: [ + "fastqc_html_1": "fastqc_html_1", + "fastqc_html_2": "fastqc_html_2", + "fastqc_zip_1": "fastqc_zip_1", + "fastqc_zip_2": "fastqc_zip_2", + "fastq_1": "qc_output1", + "fastq_2": "qc_output2", + "trim_log_1": "trim_log_1", + "trim_log_2": "trim_log_2", + "trim_zip_1": "trim_zip_1", + "trim_zip_2": "trim_zip_2", + "trim_html_1": "trim_html_1", + "trim_html_2": "trim_html_2", + "passed_trimmed_reads": "passed_trimmed_reads", + "num_trimmed_reads": "num_trimmed_reads", + "sortmerna_log": "sortmerna_log", + "salmon_quant_output": "salmon_quant_output", + "fastp_failed_trim": "failed_trim", + "fastp_failed_trim_unpaired1": "failed_trim_unpaired1", + "fastp_failed_trim_unpaired2": "failed_trim_unpaired2", + "fastp_trim_json": "trim_json", + "fastp_trim_html": "trim_html", + "fastp_trim_merged_out": "trim_merged_out" + ] ) // Infer strandedness from Salmon pseudo-alignment results | map { id, state -> - (state.strandedness == 'auto') ? - [ id, state + [strandedness: getSalmonInferredStrandedness(state.salmon_quant_output)] ] : - [id, state] + (state.strandedness == 'auto') ? + [ id, state + [strandedness: getSalmonInferredStrandedness(state.salmon_quant_output)] ] : + [id, state] } // Filter FastQ files based on minimum trimmed read count after adapter trimming @@ -5479,49 +5483,49 @@ workflow run_wf { // Genome alignment and quantification | genome_alignment_and_quant.run ( - runIf: { id, state -> !state.skip_alignment && state.passed_trimmed_reads }, - fromState: [ - "id": "id", - "fastq_1": "fastq_1", - "fastq_2": "fastq_2", - "strandedness": "strandedness", - "gtf": "gtf", - "transcript_fasta": "transcript_fasta", - "bam_csi_index": "bam_csi_index", - "aligner": "aligner", - "rsem_index": "rsem_index", - "star_index": "star_index", - "star_sjdb_gtf_feature_exon": "star_sjdb_gtf_feature_exon", - "star_ignore_sjdbgtf": "star_ignore_sjdbgtf", - "with_umi": "with_umi", - "umi_dedup_stats": "umi_dedup_stats", - "gtf_group_features": "gtf_group_features", - "gtf_extra_attributes": "gtf_extra_attributes", - "salmon_quant_libtype": "salmon_quant_libtype", - "salmon_index": "salmon_index", - "extra_rsem_calculate_expression_args": "extra_rsem_calculate_expression_args" - ], - toState: [ - "star_multiqc": "star_multiqc", - "rsem_multiqc": "rsem_multiqc", - "salmon_multiqc": "salmon_multiqc", - "genome_bam_sorted": "genome_bam_sorted", - "genome_bam_index": "genome_bam_index", - "genome_bam_stats": "genome_bam_stats", - "genome_bam_flagstat": "genome_bam_flagstat", - "genome_bam_idxstats": "genome_bam_idxstats", - "transcriptome_bam": "transcriptome_bam", - "transcriptome_bam_index": "transcriptome_bam_index", - "transcriptome_bam_stats": "transcriptome_bam_stats", - "transcriptome_bam_flagstat": "transcriptome_bam_flagstat", - "transcriptome_bam_idxstats": "transcriptome_bam_idxstats", - "quant_out_dir": "quant_out_dir", - "quant_results_file": "quant_results_file", - "rsem_counts_gene": "rsem_counts_gene", - "rsem_counts_transcripts": "rsem_counts_transcripts", - "bam_genome_rsem": "bam_genome_rsem", - "bam_transcript_rsem": "bam_transcript_rsem" - ] + runIf: { id, state -> !state.skip_alignment && state.passed_trimmed_reads }, + fromState: [ + "id": "id", + "fastq_1": "fastq_1", + "fastq_2": "fastq_2", + "strandedness": "strandedness", + "gtf": "gtf", + "transcript_fasta": "transcript_fasta", + "bam_csi_index": "bam_csi_index", + "aligner": "aligner", + "rsem_index": "rsem_index", + "star_index": "star_index", + "star_sjdb_gtf_feature_exon": "star_sjdb_gtf_feature_exon", + "star_ignore_sjdbgtf": "star_ignore_sjdbgtf", + "with_umi": "with_umi", + "umi_dedup_stats": "umi_dedup_stats", + "gtf_group_features": "gtf_group_features", + "gtf_extra_attributes": "gtf_extra_attributes", + "salmon_quant_libtype": "salmon_quant_libtype", + "salmon_index": "salmon_index", + "extra_rsem_calculate_expression_args": "extra_rsem_calculate_expression_args" + ], + toState: [ + "star_multiqc": "star_multiqc", + "rsem_multiqc": "rsem_multiqc", + "salmon_multiqc": "salmon_multiqc", + "genome_bam_sorted": "genome_bam_sorted", + "genome_bam_index": "genome_bam_index", + "genome_bam_stats": "genome_bam_stats", + "genome_bam_flagstat": "genome_bam_flagstat", + "genome_bam_idxstats": "genome_bam_idxstats", + "transcriptome_bam": "transcriptome_bam", + "transcriptome_bam_index": "transcriptome_bam_index", + "transcriptome_bam_stats": "transcriptome_bam_stats", + "transcriptome_bam_flagstat": "transcriptome_bam_flagstat", + "transcriptome_bam_idxstats": "transcriptome_bam_idxstats", + "quant_out_dir": "quant_out_dir", + "quant_results_file": "quant_results_file", + "rsem_counts_gene": "rsem_counts_gene", + "rsem_counts_transcripts": "rsem_counts_transcripts", + "bam_genome_rsem": "bam_genome_rsem", + "bam_transcript_rsem": "bam_transcript_rsem" + ] ) // Filter channels to get samples that passed STAR minimum mapping percentage @@ -5533,35 +5537,35 @@ workflow run_wf { // Pseudo-alignment and quantification | pseudo_alignment_and_quant.run ( - runIf: { id, state -> !state.skip_pseudo_alignment && state.passed_trimmed_reads }, - fromState: [ - "id": "id", - "fastq_1": "fastq_1", - "fastq_2": "fastq_2", - "strandedness": "strandedness", - "gtf": "gtf", - "transcript_fasta": "transcript_fasta", - "pseudo_aligner": "pseudo_aligner", - "salmon_index": "salmon_index", - "kallisto_index": "kallisto_index", - "extra_star_align_args": "extra_star_align_args", - "star_ignore_sjdbgtf": "star_ignore_sjdbgtf", - "seq_platform": "seq_platform", - "seq_center": "seq_center", - "with_umi": "with_umi", - "umi_dedup_stats": "umi_dedup_stats", - "gtf_group_features": "gtf_group_features", - "gtf_extra_attributes": "gtf_extra_attributes", - "lib_type": "salmon_quant_libtype", - "kallisto_quant_fragment_length": "kallisto_quant_fragment_length", - "kallisto_quant_fragment_length_sd": "kallisto_quant_fragment_length_sd" - ], - toState: [ - "pseudo_quant_out_dir": "quant_out_dir", - "pseudo_salmon_quant_results_file": "salmon_quant_results_file", - "pseudo_kallisto_quant_results_file": "kallisto_quant_results_file", - "pseudo_multiqc": "pseudo_multiqc" - ] + runIf: { id, state -> !state.skip_pseudo_alignment && state.passed_trimmed_reads }, + fromState: [ + "id": "id", + "fastq_1": "fastq_1", + "fastq_2": "fastq_2", + "strandedness": "strandedness", + "gtf": "gtf", + "transcript_fasta": "transcript_fasta", + "pseudo_aligner": "pseudo_aligner", + "salmon_index": "salmon_index", + "kallisto_index": "kallisto_index", + "extra_star_align_args": "extra_star_align_args", + "star_ignore_sjdbgtf": "star_ignore_sjdbgtf", + "seq_platform": "seq_platform", + "seq_center": "seq_center", + "with_umi": "with_umi", + "umi_dedup_stats": "umi_dedup_stats", + "gtf_group_features": "gtf_group_features", + "gtf_extra_attributes": "gtf_extra_attributes", + "lib_type": "salmon_quant_libtype", + "kallisto_quant_fragment_length": "kallisto_quant_fragment_length", + "kallisto_quant_fragment_length_sd": "kallisto_quant_fragment_length_sd" + ], + toState: [ + "pseudo_quant_out_dir": "quant_out_dir", + "pseudo_salmon_quant_results_file": "salmon_quant_results_file", + "pseudo_kallisto_quant_results_file": "kallisto_quant_results_file", + "pseudo_multiqc": "pseudo_multiqc" + ] ) | map { id, state -> @@ -5572,165 +5576,170 @@ workflow run_wf { // Post-processing | post_processing.run ( - runIf: { id, state -> !state.skip_alignment && state.passed_trimmed_reads && state.passed_mapping }, - fromState: [ - "id": "id", - "paired": "paired", - "strandedness": "strandedness", - "fasta": "fasta", - "fai": "fai", - "gtf": "gtf", - "genome_bam": "genome_bam_sorted", - "chrom_sizes": "chrom_sizes", - "star_multiqc": "star_multiqc", - "extra_picard_args": "extra_picard_args", - "extra_stringtie_args": "extra_stringtie_args", - "stringtie_ignore_gtf": "stringtie_ignore_gtf", - "extra_bedtools_args": "extra_bedtools_args", - "bam_csi_index": "bam_csi_index", - "min_mapped_reads": "min_mapped_reads", - "with_umi": "with_umi", - "skip_qc": "skip_qc", - "skip_markduplicates": "skip_markduplicates", - "skip_stringtie": "skip_stringtie", - "skip_bigwig":"gencode" - ], - toState: [ - "genome_bam_sorted": "processed_genome_bam", - "genome_bam_index": "genome_bam_index", - "genome_bam_stats": "genome_bam_stats", - "genome_bam_flagstat": "genome_bam_flagstat", - "genome_bam_idxstats": "genome_bam_idxstats", - "markduplicates_metrics": "markduplicates_metrics", - "stringtie_transcript_gtf": "stringtie_transcript_gtf", - "stringtie_coverage_gtf": "stringtie_coverage_gtf", - "stringtie_abundance": "stringtie_abundance", - "stringtie_ballgown": "stringtie_ballgown", - "bedgraph_forward": "bedgraph_forward", - "bedgraph_reverse": "bedgraph_reverse", - "bigwig_forward": "bigwig_forward", - "bigwig_reverse": "bigwig_reverse" - ] + runIf: { id, state -> !state.skip_alignment && state.passed_trimmed_reads && state.passed_mapping }, + fromState: [ + "id": "id", + "paired": "paired", + "strandedness": "strandedness", + "fasta": "fasta", + "fai": "fai", + "gtf": "gtf", + "genome_bam": "genome_bam_sorted", + "chrom_sizes": "chrom_sizes", + "star_multiqc": "star_multiqc", + "extra_picard_args": "extra_picard_args", + "extra_stringtie_args": "extra_stringtie_args", + "stringtie_ignore_gtf": "stringtie_ignore_gtf", + "extra_bedtools_args": "extra_bedtools_args", + "bam_csi_index": "bam_csi_index", + "min_mapped_reads": "min_mapped_reads", + "with_umi": "with_umi", + "skip_qc": "skip_qc", + "skip_markduplicates": "skip_markduplicates", + "skip_stringtie": "skip_stringtie", + "skip_bigwig":"gencode" + ], + toState: [ + "genome_bam_sorted": "processed_genome_bam", + "genome_bam_index": "genome_bam_index", + "genome_bam_stats": "genome_bam_stats", + "genome_bam_flagstat": "genome_bam_flagstat", + "genome_bam_idxstats": "genome_bam_idxstats", + "markduplicates_metrics": "markduplicates_metrics", + "stringtie_transcript_gtf": "stringtie_transcript_gtf", + "stringtie_coverage_gtf": "stringtie_coverage_gtf", + "stringtie_abundance": "stringtie_abundance", + "stringtie_ballgown": "stringtie_ballgown", + "bedgraph_forward": "bedgraph_forward", + "bedgraph_reverse": "bedgraph_reverse", + "bigwig_forward": "bigwig_forward", + "bigwig_reverse": "bigwig_reverse" + ] ) // Final QC + + // Temporarily skip DESeq2 QC for now + // https://github.com/viash-hub/rnaseq/issues/31 + | map{ id, state -> [ id, state + [ skip_deseq2_qc: true ] ] } + | quality_control.run ( - fromState: [ - "id": "id", - "paired": "paired", - "strandedness": "strandedness", - "skip_align": "skip_alignment", - "skip_pseudo_align": "skip_pseudo_alignment", - "skip_dupradar": "skip_dupradar", - "skip_qualimap": "skip_qualimap", - "skip_rseqc": "skip_rseqc", - "skip_multiqc": "skip_multiqc", - "skip_preseq": "skip_preseq", - "gtf": "gtf", - "num_trimmed_reads": "num_trimmed_reads", - "passed_trimmed_reads": "passed_trimmed_reads", - "passed_mapping": "passed_mapping", - "percent_mapped": "percent_mapped", - "genome_bam": "genome_bam_sorted", - "genome_bam_index": "genome_bam_index", - "salmon_multiqc": "salmon_multiqc", - "quant_results_file": "quant_results_file", - "rsem_multiqc": "rsem_multiqc", - "rsem_counts_gene": "rsem_counts_gene", - "rsem_counts_transcripts": "rsem_counts_transcripts", - "pseudo_multiqc": "pseudo_multiqc", - "pseudo_quant_out_dir": "pseudo_quant_out_dir", - "pseudo_salmon_quant_results_file": "pseudo_salmon_quant_results_file", - "pseudo_kallisto_quant_results_file": "pseudo_kallisto_quant_results_file", - "aligner": "aligner", - "pseudo_aligner": "pseudo_aligner", - "gene_bed": "gene_bed", - "extra_preseq_args": "extra_preseq_args", - "biotype": "biotype", - "skip_biotype_qc": "skip_biotype_qc", - "featurecounts_group_type": "featurecounts_group_type", - "featurecounts_feature_type": "featurecounts_feature_type", - "gencode": "gencode", - "skip_deseq2_qc": "skip_deseq2_qc", - "deseq2_vst": "deseq2_vst", - "multiqc_custom_config": "multiqc_custom_config", - "multiqc_title": "multiqc_title", - "multiqc_methods_description": "multiqc_methods_description", - "fastqc_zip_1": "fastqc_zip_1", - "fastqc_zip_2": "fastqc_zip_2", - "trim_log_1": "trim_log_1", - "trim_log_2": "trim_log_2", - "trim_zip_1": "trim_zip_1", - "trim_zip_2": "trim_zip_2", - "sortmerna_multiqc": "sortmerna_log", - "star_multiqc": "star_multiqc", - "genome_bam_stats": "genome_bam_stats", - "genome_bam_flagstat": "genome_bam_flagstat", - "genome_bam_idxstats": "genome_bam_idxstats", - "markduplicates_multiqc": "markduplicates_metrics", - "rseqc_modules": "rseqc_modules" - ], - toState: [ - "preseq_output": "preseq_output", - "bamstat_output": "bamstat_output", - "strandedness_output": "strandedness_output", - "inner_dist_output_stats": "inner_dist_output_stats", - "inner_dist_output_dist": "inner_dist_output_dist", - "inner_dist_output_freq": "inner_dist_output_freq", - "inner_dist_output_plot": "inner_dist_output_plot", - "inner_dist_output_plot_r": "inner_dist_output_plot_r", - "junction_annotation_output_log": "junction_annotation_output_log", - "junction_annotation_output_plot_r": "junction_annotation_output_plot_r", - "junction_annotation_output_junction_bed": "junction_annotation_output_junction_bed", - "junction_annotation_output_junction_interact": "junction_annotation_output_junction_interact", - "junction_annotation_output_junction_sheet": "junction_annotation_output_junction_sheet", - "junction_annotation_output_splice_events_plot": "junction_annotation_output_splice_events_plot", - "junction_annotation_output_splice_junctions_plot": "junction_annotation_output_splice_junctions_plot", - "junction_saturation_output_plot_r": "junction_saturation_output_plot_r", - "junction_saturation_output_plot": "junction_saturation_output_plot", - "read_distribution_output": "read_distribution_output", - "read_duplication_output_duplication_rate_plot_r": "read_duplication_output_duplication_rate_plot_r", - "read_duplication_output_duplication_rate_plot": "read_duplication_output_duplication_rate_plot", - "read_duplication_output_duplication_rate_mapping": "read_duplication_output_duplication_rate_mapping", - "read_duplication_output_duplication_rate_sequence": "read_duplication_output_duplication_rate_sequence", - "tin_output_summary": "tin_output_summary", - "tin_output_metrics": "tin_output_metrics", - "dupradar_output_dupmatrix": "dupradar_output_dupmatrix", - "dupradar_output_dup_intercept_mqc": "dupradar_output_dup_intercept_mqc", - "dupradar_output_duprate_exp_boxplot": "dupradar_output_duprate_exp_boxplot", - "dupradar_output_duprate_exp_densplot": "dupradar_output_duprate_exp_densplot", - "dupradar_output_duprate_exp_denscurve_mqc": "dupradar_output_duprate_exp_denscurve_mqc", - "dupradar_output_expression_histogram": "dupradar_output_expression_histogram", - "dupradar_output_intercept_slope": "dupradar_output_intercept_slope", - "qualimap_report": "qualimap_report", - "qualimap_qc_report": "qualimap_qc_report", - "qualimap_counts": "qualimap_counts", - "featurecounts": "featurecounts", - "featurecounts_summary": "featurecounts_summary", - "featurecounts_multiqc": "featurecounts_multiqc", - "featurecounts_rrna_multiqc": "featurecounts_rrna_multiqc", - "tpm_gene": "tpm_gene", - "counts_gene": "counts_gene", - "counts_gene_length_scaled": "counts_gene_length_scaled", - "counts_gene_scaled": "counts_gene_scaled", - "tpm_transcript": "tpm_transcript", - "counts_transcript": "counts_transcript", - "qunat_merged_summarizedexperiment": "quant_merged_summarizedexperiment", - "deseq2_output": "deseq2_output", - "pseudo_tpm_gene": "pseudo_tpm_gene", - "pseudo_counts_gene": "pseudo_counts_gene", - "pseudo_counts_gene_length_scaled": "pseudo_counts_gene_length_scaled", - "pseudo_counts_gene_scaled": "pseudo_counts_gene_scaled", - "pseudo_tpm_transcript": "pseudo_tpm_transcript", - "pseudo_counts_transcript": "pseudo_counts_transcript", - "pseudo_lengths_gene": "pseudo_lengths_gene", - "pseudo_lengths_transcript": "pseudo_lengths_transcript", - "pseudo_quant_merged_summarizedexperiment": "pseudo_quant_merged_summarizedexperiment", - "deseq2_output_pseudo": "deseq2_output_pseudo", - "multiqc_report": "multiqc_report", - "multiqc_data": "multiqc_data", - "multiqc_plots": "multiqc_plots" - ] + fromState: [ + "id": "id", + "paired": "paired", + "strandedness": "strandedness", + "skip_align": "skip_alignment", + "skip_pseudo_align": "skip_pseudo_alignment", + "skip_dupradar": "skip_dupradar", + "skip_qualimap": "skip_qualimap", + "skip_rseqc": "skip_rseqc", + "skip_multiqc": "skip_multiqc", + "skip_preseq": "skip_preseq", + "gtf": "gtf", + "num_trimmed_reads": "num_trimmed_reads", + "passed_trimmed_reads": "passed_trimmed_reads", + "passed_mapping": "passed_mapping", + "percent_mapped": "percent_mapped", + "genome_bam": "genome_bam_sorted", + "genome_bam_index": "genome_bam_index", + "salmon_multiqc": "salmon_multiqc", + "quant_results_file": "quant_results_file", + "rsem_multiqc": "rsem_multiqc", + "rsem_counts_gene": "rsem_counts_gene", + "rsem_counts_transcripts": "rsem_counts_transcripts", + "pseudo_multiqc": "pseudo_multiqc", + "pseudo_quant_out_dir": "pseudo_quant_out_dir", + "pseudo_salmon_quant_results_file": "pseudo_salmon_quant_results_file", + "pseudo_kallisto_quant_results_file": "pseudo_kallisto_quant_results_file", + "aligner": "aligner", + "pseudo_aligner": "pseudo_aligner", + "gene_bed": "gene_bed", + "extra_preseq_args": "extra_preseq_args", + "biotype": "biotype", + "skip_biotype_qc": "skip_biotype_qc", + "featurecounts_group_type": "featurecounts_group_type", + "featurecounts_feature_type": "featurecounts_feature_type", + "gencode": "gencode", + "skip_deseq2_qc": "skip_deseq2_qc", + "deseq2_vst": "deseq2_vst", + "multiqc_custom_config": "multiqc_custom_config", + "multiqc_title": "multiqc_title", + "multiqc_methods_description": "multiqc_methods_description", + "fastqc_zip_1": "fastqc_zip_1", + "fastqc_zip_2": "fastqc_zip_2", + "trim_log_1": "trim_log_1", + "trim_log_2": "trim_log_2", + "trim_zip_1": "trim_zip_1", + "trim_zip_2": "trim_zip_2", + "sortmerna_multiqc": "sortmerna_log", + "star_multiqc": "star_multiqc", + "genome_bam_stats": "genome_bam_stats", + "genome_bam_flagstat": "genome_bam_flagstat", + "genome_bam_idxstats": "genome_bam_idxstats", + "markduplicates_multiqc": "markduplicates_metrics", + "rseqc_modules": "rseqc_modules" + ], + toState: [ + "preseq_output": "preseq_output", + "bamstat_output": "bamstat_output", + "strandedness_output": "strandedness_output", + "inner_dist_output_stats": "inner_dist_output_stats", + "inner_dist_output_dist": "inner_dist_output_dist", + "inner_dist_output_freq": "inner_dist_output_freq", + "inner_dist_output_plot": "inner_dist_output_plot", + "inner_dist_output_plot_r": "inner_dist_output_plot_r", + "junction_annotation_output_log": "junction_annotation_output_log", + "junction_annotation_output_plot_r": "junction_annotation_output_plot_r", + "junction_annotation_output_junction_bed": "junction_annotation_output_junction_bed", + "junction_annotation_output_junction_interact": "junction_annotation_output_junction_interact", + "junction_annotation_output_junction_sheet": "junction_annotation_output_junction_sheet", + "junction_annotation_output_splice_events_plot": "junction_annotation_output_splice_events_plot", + "junction_annotation_output_splice_junctions_plot": "junction_annotation_output_splice_junctions_plot", + "junction_saturation_output_plot_r": "junction_saturation_output_plot_r", + "junction_saturation_output_plot": "junction_saturation_output_plot", + "read_distribution_output": "read_distribution_output", + "read_duplication_output_duplication_rate_plot_r": "read_duplication_output_duplication_rate_plot_r", + "read_duplication_output_duplication_rate_plot": "read_duplication_output_duplication_rate_plot", + "read_duplication_output_duplication_rate_mapping": "read_duplication_output_duplication_rate_mapping", + "read_duplication_output_duplication_rate_sequence": "read_duplication_output_duplication_rate_sequence", + "tin_output_summary": "tin_output_summary", + "tin_output_metrics": "tin_output_metrics", + "dupradar_output_dupmatrix": "dupradar_output_dupmatrix", + "dupradar_output_dup_intercept_mqc": "dupradar_output_dup_intercept_mqc", + "dupradar_output_duprate_exp_boxplot": "dupradar_output_duprate_exp_boxplot", + "dupradar_output_duprate_exp_densplot": "dupradar_output_duprate_exp_densplot", + "dupradar_output_duprate_exp_denscurve_mqc": "dupradar_output_duprate_exp_denscurve_mqc", + "dupradar_output_expression_histogram": "dupradar_output_expression_histogram", + "dupradar_output_intercept_slope": "dupradar_output_intercept_slope", + "qualimap_report": "qualimap_report", + "qualimap_qc_report": "qualimap_qc_report", + "qualimap_counts": "qualimap_counts", + "featurecounts": "featurecounts", + "featurecounts_summary": "featurecounts_summary", + "featurecounts_multiqc": "featurecounts_multiqc", + "featurecounts_rrna_multiqc": "featurecounts_rrna_multiqc", + "tpm_gene": "tpm_gene", + "counts_gene": "counts_gene", + "counts_gene_length_scaled": "counts_gene_length_scaled", + "counts_gene_scaled": "counts_gene_scaled", + "tpm_transcript": "tpm_transcript", + "counts_transcript": "counts_transcript", + "quant_merged_summarizedexperiment": "quant_merged_summarizedexperiment", + "deseq2_output": "deseq2_output", + "pseudo_tpm_gene": "pseudo_tpm_gene", + "pseudo_counts_gene": "pseudo_counts_gene", + "pseudo_counts_gene_length_scaled": "pseudo_counts_gene_length_scaled", + "pseudo_counts_gene_scaled": "pseudo_counts_gene_scaled", + "pseudo_tpm_transcript": "pseudo_tpm_transcript", + "pseudo_counts_transcript": "pseudo_counts_transcript", + "pseudo_lengths_gene": "pseudo_lengths_gene", + "pseudo_lengths_transcript": "pseudo_lengths_transcript", + "pseudo_quant_merged_summarizedexperiment": "pseudo_quant_merged_summarizedexperiment", + "deseq2_output_pseudo": "deseq2_output_pseudo", + "multiqc_report": "multiqc_report", + "multiqc_data": "multiqc_data", + "multiqc_plots": "multiqc_plots" + ] ) | map { id, state -> @@ -5922,8 +5931,8 @@ def getTrimGaloreReadsAfterFiltering(log_file) { // Function that parses fastp json output file to get total number of reads after trimming // def getFastpReadsAfterFiltering(json_file) { - def Map json = (Map) new JsonSlurper().parseText(json_file.text).get('summary') - return json['after_filtering']['total_reads'].toLong() + def Map json = (Map) new JsonSlurper().parseText(json_file.text).get('summary') + return json['after_filtering']['total_reads'].toLong() } // diff --git a/target/nextflow/workflows/rnaseq/nextflow.config b/target/nextflow/workflows/rnaseq/nextflow.config index 06c9fa4..6232f37 100644 --- a/target/nextflow/workflows/rnaseq/nextflow.config +++ b/target/nextflow/workflows/rnaseq/nextflow.config @@ -122,4 +122,4 @@ process{ withLabel: cpu1000 { cpus = 1000 } } - +includeConfig("nextflow_labels.config") diff --git a/target/nextflow/workflows/rnaseq/nextflow_labels.config b/target/nextflow/workflows/rnaseq/nextflow_labels.config new file mode 100644 index 0000000..b18e545 --- /dev/null +++ b/target/nextflow/workflows/rnaseq/nextflow_labels.config @@ -0,0 +1,44 @@ +process { + // Default resources for components that hardly do any processing + memory = { 2.GB * task.attempt } + cpus = 1 + + // Retry for exit codes that have something to do with memory issues + errorStrategy = { task.exitStatus in 137..140 ? 'retry' : 'terminate' } + maxRetries = 3 + maxMemory = null + + // Resource labels + withLabel: singlecpu { cpus = 1 } + withLabel: lowcpu { cpus = 2 } + withLabel: midcpu { cpus = 4 } + withLabel: highcpu { cpus = 8 } + withLabel: veryhighcpu { cpus = 16 } + + withLabel: lowmem { memory = { get_memory( 4.GB * task.attempt ) } } + withLabel: midmem { memory = { get_memory( 16.GB * task.attempt ) } } + withLabel: highmem { memory = { get_memory( 24.GB * task.attempt ) } } + withLabel: veryhighmem { memory = { get_memory( 48.GB * task.attempt ) } } +} + +def get_memory(to_compare) { + if (!process.containsKey("maxMemory") || !process.maxMemory) { + return to_compare + } + + try { + if (process.containsKey("maxRetries") && process.maxRetries && task.attempt == (process.maxRetries as int)) { + return process.maxMemory + } + else if (to_compare.compareTo(process.maxMemory as nextflow.util.MemoryUnit) == 1) { + return max_memory as nextflow.util.MemoryUnit + } + else { + return to_compare + } + } catch (all) { + println "Error processing memory resources. Please check that process.maxMemory '${process.maxMemory}' and process.maxRetries '${process.maxRetries}' are valid!" + System.exit(1) + } +} + diff --git a/target/nextflow/workflows/rnaseq/nextflow_schema.json b/target/nextflow/workflows/rnaseq/nextflow_schema.json index 35f6782..f0c8300 100644 --- a/target/nextflow/workflows/rnaseq/nextflow_schema.json +++ b/target/nextflow/workflows/rnaseq/nextflow_schema.json @@ -626,17 +626,6 @@ } - , - "skip_bbsplit": { - "type": - "boolean", - "description": "Type: `boolean_true`, default: `false`. Skip BBSplit for removal of non-reference genome reads", - "help_text": "Type: `boolean_true`, default: `false`. Skip BBSplit for removal of non-reference genome reads." - , - "default":false - } - - , "skip_umi_extract": { "type": @@ -714,17 +703,6 @@ } - , - "skip_deseq2_qc": { - "type": - "boolean", - "description": "Type: `boolean_true`, default: `false`. Skip DESeq2 PCA and heatmap plotting", - "help_text": "Type: `boolean_true`, default: `false`. Skip DESeq2 PCA and heatmap plotting." - , - "default":false - } - - , "skip_dupradar": { "type": @@ -837,10 +815,9 @@ "multiqc_custom_config": { "type": "string", - "description": "Type: `file`, default: `src/assets/multiqc_config.yml`. ", - "help_text": "Type: `file`, default: `src/assets/multiqc_config.yml`. " - , - "default":"src/assets/multiqc_config.yml" + "description": "Type: `file`. Custom multiqc configuration file\n", + "help_text": "Type: `file`. Custom multiqc configuration file\n" + } @@ -848,8 +825,8 @@ "multiqc_title": { "type": "string", - "description": "Type: `string`. ", - "help_text": "Type: `string`. " + "description": "Type: `string`. Custom multiqc title\n", + "help_text": "Type: `string`. Custom multiqc title\n" } @@ -858,10 +835,9 @@ "multiqc_methods_description": { "type": "string", - "description": "Type: `file`, default: `src/assets/methods_description_template.yml`. ", - "help_text": "Type: `file`, default: `src/assets/methods_description_template.yml`. " - , - "default":"src/assets/methods_description_template.yml" + "description": "Type: `file`. ", + "help_text": "Type: `file`. " + }