diff --git a/.github/workflows/github_actions.config b/.github/workflows/github_actions.config index d79f3021..d5ec9499 100644 --- a/.github/workflows/github_actions.config +++ b/.github/workflows/github_actions.config @@ -1,4 +1,4 @@ -includeConfig '/home/runner/work/Cecret/Cecret/configs/cecret_config_template.config' +params.vadr = false process { withName:ivar_consensus{ diff --git a/.github/workflows/test_primers.yml b/.github/workflows/test_primers.yml index c913614b..d601785f 100644 --- a/.github/workflows/test_primers.yml +++ b/.github/workflows/test_primers.yml @@ -19,8 +19,7 @@ jobs: 'ncov_V4', 'ncov_V4.1', 'ncov_V5.3.2', - 'mpx_primalseq', - 'mpx_idt' + 'mpx_primalseq' ] steps: diff --git a/.github/workflows/test_profile.yml b/.github/workflows/test_profile.yml index 19e2e8bc..13628f11 100644 --- a/.github/workflows/test_profile.yml +++ b/.github/workflows/test_profile.yml @@ -24,7 +24,7 @@ jobs: - name: Run Cecret run: | - nextflow run . -profile docker,test -c .github/workflows/github_actions.config --maxcpus 2 --medcpus 2 --cleaner 'fastp' --aligner 'minimap2' --mpileup_depth 200 --vadr false + nextflow run . -profile docker,test -c .github/workflows/github_actions.config --maxcpus 2 --medcpus 2 --cleaner 'fastp' --aligner 'minimap2' --mpileup_depth 200 --vadr false --aci false --freyja false ls cecret* diff --git a/.github/workflows/test_profile1.yml b/.github/workflows/test_profile1.yml index fcee51b1..2f57d30d 100644 --- a/.github/workflows/test_profile1.yml +++ b/.github/workflows/test_profile1.yml @@ -24,7 +24,7 @@ jobs: - name: Run Cecret run: | - nextflow run . -profile docker,test1 -c .github/workflows/github_actions.config --maxcpus 2 --medcpus 2 --cleaner 'fastp' --aligner 'minimap2' --mpileup_depth 200 --vadr false + nextflow run . -profile docker,test1 -c .github/workflows/github_actions.config --maxcpus 2 --medcpus 2 --cleaner 'fastp' --aligner 'minimap2' --mpileup_depth 200 --vadr false --aci false --freyja false ls cecret* diff --git a/.github/workflows/test_profile2.yml b/.github/workflows/test_profile2.yml index b541c60f..7c035359 100644 --- a/.github/workflows/test_profile2.yml +++ b/.github/workflows/test_profile2.yml @@ -24,7 +24,7 @@ jobs: - name: Run Cecret run: | - nextflow run . -profile docker,test2 -c .github/workflows/github_actions.config --maxcpus 2 --medcpus 2 --cleaner 'fastp' --aligner 'minimap2' --mpileup_depth 200 --vadr false + nextflow run . -profile docker,test2 -c .github/workflows/github_actions.config --maxcpus 2 --medcpus 2 --cleaner 'fastp' --aligner 'minimap2' --mpileup_depth 200 --vadr false --aci false --freyja false ls cecret* diff --git a/bin/.tests.notower.sh b/bin/.tests.notower.sh deleted file mode 100755 index 8482b4cf..00000000 --- a/bin/.tests.notower.sh +++ /dev/null @@ -1,99 +0,0 @@ -#/bin/bash -#nextflow ~/sandbox/Cecret/Cecret.nf -profile singularity --reads /home/eriny/sandbox/test_files/cecret/reads --outdir tests -with-tower -resume - -test=$1 - -if [ -z "$test" ]; then test="small" ; fi - -if [ "$test" == "small" ] -then - options=("reads" "single_reads" "fastas") - - for option in ${options[@]} - do - # defaults - nextflow ~/sandbox/Cecret/Cecret.nf \ - -profile singularity,artic_V3 \ - --$option /home/eriny/sandbox/test_files/cecret/$option \ - --outdir singularity_defaults_$option - - # removed test for bamsnap and rename because of lack of interest - # attempted bcftools and filter - nextflow ~/sandbox/Cecret/Cecret.nf \ - -profile singularity,artic_V3 \ - --$option /home/eriny/sandbox/test_files/cecret/$option \ - --outdir all_on_$option \ - --bcftools_variants true \ - --filter true \ - -resume - - # removing primer trimming - nextflow ~/sandbox/Cecret/Cecret.nf \ - -profile singularity,artic_V3 \ - --$option /home/eriny/sandbox/test_files/cecret/$option \ - --outdir nontrimmed_$option \ - --trimmer 'none' \ - -resume - - # changing the cleaner, aligner, and trimmer - nextflow ~/sandbox/Cecret/Cecret.nf \ - -profile singularity,artic_V3 \ - --$option /home/eriny/sandbox/test_files/cecret/$option \ - --outdir toggled_$option \ - --cleaner 'fastp' \ - --trimmer 'samtools' \ - --aligner 'minimap2' \ - -resume - - # with UPHL's config - nextflow ~/sandbox/Cecret/Cecret.nf \ - -profile uphl,artic_V3 \ - --$option /home/eriny/sandbox/test_files/cecret/$option \ - --outdir uphl_$option \ - -resume - done - - # multifasta - nextflow ~/sandbox/Cecret/Cecret.nf \ - -profile singularity,artic_V3 \ - --reads /home/eriny/sandbox/test_files/cecret/reads \ - --single-reads /home/eriny/sandbox/test_files/cecret/single-reads \ - --fastas /home/eriny/sandbox/test_files/cecret/fastas \ - --multifastas /home/eriny/sandbox/test_files/cecret/multifasta \ - --outdir kitchen_sink - - # empty - nextflow ~/sandbox/Cecret/Cecret.nf \ - -profile singularity,artic_V3 \ - --reads doesntexit \ - --single-reads willnotexist \ - --fastas shouldntexit \ - --outdir empty - -else - # CDC's test data with relatedness - nextflow ~/sandbox/Cecret/Cecret.nf \ - -profile singularity,artic_V3 \ - --reads /home/eriny/sandbox/sars-cov-2-datasets/reads \ - --outdir default_datasets \ - --relatedness true - - nextflow ~/sandbox/Cecret/Cecret.nf \ - -profile uphl,artic_V3 \ - --reads /home/eriny/sandbox/sars-cov-2-datasets/reads \ - --outdir uphl_datasets \ - -resume \ - --relatedness true - - # CDC's test data with relatedness using nextalign - nextflow ~/sandbox/Cecret/Cecret.nf \ - -profile singularity,artic_V3 \ - --reads /home/eriny/sandbox/sars-cov-2-datasets/reads \ - --outdir toggled_datasets \ - --cleaner 'fastp' \ - --trimmer 'samtools' \ - --aligner 'minimap2' \ - --relatedness true \ - --msa 'nextalign' \ - -resume -fi diff --git a/bin/.tests.sh b/bin/.tests.sh index a3091390..5019c1ef 100755 --- a/bin/.tests.sh +++ b/bin/.tests.sh @@ -3,6 +3,8 @@ # nextflow run ~/sandbox/Cecret -profile singularity,mpx --reads /home/eriny/sandbox/test_files/cecret/mpx --outdir tests --cleaner 'fastp' -with-tower -resume # nextflow run ~/sandbox/Cecret -profile singularity --nanopore /home/eriny/sandbox/test_files/cecret/nanopore --outdir tests -with-tower -resume +echo "usage : bash .test.sh {small,primers,else}" + test=$1 if [ -z "$test" ]; then test="small" ; fi @@ -36,6 +38,7 @@ then -profile singularity,artic_V3 \ --$option /home/eriny/sandbox/test_files/cecret/$option \ --outdir singularity_defaults_$option \ + -resume \ -with-tower # removed test for bamsnap and rename because of lack of interest @@ -96,6 +99,83 @@ then --outdir empty \ -with-tower +elif [ "$test" == "primers" ] +then + + nanopore_primers=("midnight_idt_V1" "midnight_ont_V1" "midnight_ont_V2" "midnight_ont_V3") + for primer in ${nanopore_primers[@]} + do + nextflow run ~/sandbox/Cecret \ + -profile singularity \ + --nanopore /home/eriny/sandbox/test_files/cecret/nanopore \ + --outdir primer_${primer}_artic \ + --primer_set $primer \ + --bcftools_variants false \ + --fastqc false \ + --ivar_variants false \ + --samtools_stats false \ + --samtools_coverage false \ + --samtools_depth false \ + --nextclade false \ + --pangolin false \ + --freyja false \ + --vadr false \ + -resume \ + -with-tower + done + + trimmers=("samtools" "ivar") + for trimmer in ${trimmers[@]} + do + illumina_primers=("ncov_V3" "ncov_V4" "ncov_V4.1" "ncov_V5.3.2") + for primer in ${illumina_primers[@]} + do + nextflow run ~/sandbox/Cecret \ + -profile singularity \ + --reads /home/eriny/sandbox/test_files/cecret/reads \ + --outdir primer_${primer}_${trimmer} \ + --trimmer $trimmer \ + --cleaner 'fastp' \ + --primer_set $primer \ + --bcftools_variants false \ + --fastqc false \ + --ivar_variants false \ + --samtools_stats false \ + --samtools_coverage false \ + --samtools_depth false \ + --nextclade false \ + --pangolin false \ + --freyja false \ + --vadr false \ + -resume \ + -with-tower + done + + mpx_primers=("mpx_primalseq" "mpx_idt") + for primer in ${mpx_primers[@]} + do + nextflow run ~/sandbox/Cecret \ + -profile singularity \ + --reads /home/eriny/sandbox/test_files/cecret/mpx_idt \ + --outdir primer_${primer}_${trimmer} \ + --trimmer $trimmer \ + --cleaner 'fastp' \ + --primer_set $primer \ + --bcftools_variants false \ + --fastqc false \ + --ivar_variants false \ + --samtools_stats false \ + --samtools_coverage false \ + --samtools_depth false \ + --nextclade false \ + --pangolin false \ + --freyja false \ + --vadr false \ + -with-tower \ + -resume + done + done + else # CDC's test data with relatedness nextflow run ~/sandbox/Cecret \ diff --git a/bin/params.sh b/bin/params.sh new file mode 100755 index 00000000..e20c674a --- /dev/null +++ b/bin/params.sh @@ -0,0 +1,82 @@ +#!/bin/bash + +##### ##### ##### ##### ##### ##### ##### ##### ##### +# It's like nf-core's version, but jankier ##### +##### ##### ##### ##### ##### ##### ##### ##### ##### + +# this +# 1. finds all the params +# 2. checks that they are in nextflow_schema.json +# 3. checks that their default value is in nextflow_schema.json +# 4. checks that every param and its default value is in the config file +# 5. checks that every process with its default values are in the config file + +##### ##### ##### ##### ##### ##### ##### ##### ##### +# finding all the params ##### +##### ##### ##### ##### ##### ##### ##### ##### ##### + +params=$(grep param main.nf | awk '{ ( $1=$1 ) ; print $0 }' | grep ^param | awk '{print $1}' | sort | uniq | cut -f 2 -d '.') + +for param in ${params[@]} +do + echo "evaluating params.$param" + + # default value + default="$(grep -w params.$param main.nf | grep "=" | head -n 1 | sed 's/.*=//g' | awk '{ ( $1=$1 ) ; print $0 }' ) " + echo -e "default:\t$default" + + # 2. checks that they are in nextflow_schema.json + schema_check=$(grep "\"$param\":" nextflow_schema.json | head -n 1) + if [ -n "$schema_check" ] + then + # 3. checks that their default value is in nextflow_schema.json + schema_default="$(grep "\"$param\":" -A 10 nextflow_schema.json | grep "}" -B 10 -m 1 | grep "default" | head -n 1 | sed 's/.*://g' | awk '{ ( $1=$1 ) ; print $0 }' )" + echo -e "schema:\t\t$schema_default" + + else + echo "$param was not included in nextflow_schema.json file!!!" + fi + + config_check=$(grep "params.$param =" configs/cecret_config_template.config | head -n 1) + if [ -n "$config_check" ] + then + # 4. checks that every param and its default value is in the config file + config_default="$(grep -w params.$param configs/cecret_config_template.config | grep -v "#" | head -n 1 | sed 's/.*=//g' | awk '{ ( $1=$1 ) ; print $0 }' )" + echo -e "config:\t\t$config_default" + + else + echo "$param was not included in configs/cecret_config_template.config file!!!" + fi + + echo "" + +done + +echo "##### ##### ##### ##### #####" +echo "# Now for the processes #####" +echo "##### ##### ##### ##### #####" + + +processes=$(grep ^process -h modules/*nf | awk '{print $2}' | sort | uniq ) +echo ${processes[@]} + +for process in ${processes[@]} +do + #echo "getting information for $process" + #grep "process $process {" -h modules/*nf -A 200 | grep -e "when:" -e "input:" -B 200 -m 1 | grep -v "#UPHLICA" | grep -v "when:" | grep -v "input:" | grep -v "tag" + + echo -e "//\twithName:$process{" + while read line + do + key=$(echo $line | awk '{print $1}' | grep -v process ) + if [ -n "$key" ] + then + value=$(echo $line | sed "s|$key||g" | awk '{ ( $1=$1 ) ; print $0 }' | sed 's/\"${params.outdir}\"/cecret/g') + echo -e "//\t\t$key = \"$value\"" + fi + done < <(grep "process $process {" -h modules/*nf -A 200 | grep -e "when:" -e "input:" -B 200 -m 1 | grep -v "#UPHLICA" | grep -v "when:" | grep -v "input:" | grep -v "tag") + echo -e "//\t}" + + #echo "" + #grep "// withName:$process{" -A 20 configs/cecret_config_template.config | grep -m 1 "}" -B 20 +done \ No newline at end of file diff --git a/configs/cecret_config_template.config b/configs/cecret_config_template.config index d7c45b31..845cf80b 100644 --- a/configs/cecret_config_template.config +++ b/configs/cecret_config_template.config @@ -1,3 +1,16 @@ +//# Instructions -------------------------------------------- +//# We think it's great that you want to adjust some paramaters. +//# This is very useful when running this on the cloud. +//# This is especially useful for the following processes: +//# - params.kraken2_db to specify where the kraken2 database is on your system +//# - params.artic_options to specify what flow cell was used to generate nanopore reads +//# - the organism-specific files for non-COVID/MPX isolates +//# Right now, most everything is commented out with '//'. +//# To adjust a parameter, remove the '//' from in front of a param and replace the value +//# with the one that suits your needs. +//# Don't hesitate to ask for assistance at https://github.com/UPHL-BioNGS/Cecret/issues +//# if something doesn't work (also, please include a copy of your config file). + //# Docker Params ------------------------------------------- //# see https://www.nextflow.io/docs/latest/config.html#scope-docker for a complete list //docker.enabled = true @@ -50,7 +63,11 @@ //params.reads = 'reads' //params.single_reads = 'single_reads' //params.fastas = 'fastas' +//params.multifastas = 'multifastas' +//params.nanopore = 'nanopore' +//params.sample_sheet = "sample_sheet.csv" //params.outdir = 'cecret' +//params.sra_accessions = [] //# Basic CPU usage grouping //params.maxcpus = 8 @@ -59,11 +76,14 @@ //# Specifying the 'sarscov2', 'mpx', or 'other' //params.species = 'sarscov2' +//# using the included primer sets +//params.primer_set = "ncov_V4" + //# Reference files for SARS-CoV-2 (part of the github repository) -//params.reference_genome = "Cecret/configs/MN908947.3.fasta" -//params.gff_file = "Cecret/configs/MN908947.3.gff" -//params.primer_bed = "Cecret/configs/artic_V3_nCoV-2019.bed" -//params.amplicon_bed = "Cecret/configs/nCoV-2019.insert.bed" +//params.reference_genome = "< path/to/file >" +//params.gff = "< path/to/file >" +//params.primer_bed = "< path/to/file >" +//params.amplicon_bed = "< path/to/file >" //# Tool toggles //# trimmer options are 'ivar' and 'samtools' or 'none' for no primer trimming @@ -127,7 +147,7 @@ //params.minimum_depth = 100 //# params.mpileup_depth is shared with ivar_consensus and bcftools_variants //params.mpileup_depth = 8000 -//params.ivar_variants_options = '-q 20 -t 0.6 ' +//params.ivar_variants_options = '-q 20 -t 0.6' //# For process ivar_consensus //# params.minimum_depth is shared with ivar_variants, summary, and samtools_depth @@ -139,8 +159,16 @@ //# For process fasta_prep //# No editable parameters +//# For process aci +//params.aci = true + +//# For processes artic and artic_read_filtering +//params.artic_options = "--normalise 200 --skip-nanopolish --medaka --medaka-model r941_min_high_g360" +//params.artic_read_filtering_options = "--min-length 400 --max-length 700" + //# For process bcftools_variants //params.bcftools_variants = true +//params.bcftools_variants_options = "" //# params.mpileup_depth is shared with ivar_variants and ivar_consensus //params.mpileup_depth = 8000 @@ -164,13 +192,8 @@ //# For process kraken2 //params.kraken2_options = '' -//params.kraken2 = true -//params.kraken2_db = '' -//params.kraken2_organism = "Severe acute respiratory syndrome-related coronavirus" - -//# For process bedtools_multicov -//params.bedtools_multicov = true -//params.bedtools_options = '-f .1' +//params.kraken2 = false +//params.kraken2_db = false //# For process samtools_ampliconstats and samtools_plot_ampliconstats //params.samtools_ampliconstats_options = '' @@ -183,19 +206,20 @@ //params.pangolin = true //# For process freyja and freyja_aggregate -//params.freya = true +//params.freyja = true //params.freyja_aggregate = true -//params.freyja_variants_options='' -//params.freyja_demix_options='' -//params.freyja_boot_options='--nb 1000' -//params.freyja_aggregate_options='' -//params.freyja_plot_options='' -//params.freyja_plot_filetype='png' +//params.freyja_variants_options = '' +//params.freyja_demix_options = '--depthcutoff 100' +//params.freyja_boot_options = '--nb 1000 --depthcutoff 100' +//params.freyja_aggregate_options = '' +//params.freyja_plot_options = '--mincov 100' +//params.freyja_plot_filetype = 'png' //# For process nextclade //params.nextclade_dataset = 'sars-cov-2' //params.nextclade_options = '' //params.nextclade = true +//params.download_nextclade_dataset = false //# For process vadr //params.vadr_options = '--split --glsearch -s -r --nomisc --lowsim5seq 6 --lowsim3seq 6 --alt_fail lowscore,insertnn,deletinn' @@ -232,120 +256,212 @@ //params.multiqc = true //params.multiqc_options = '' -//# ------------------------------------------------------------------------ -//# Examples of how to change containers or process directive values ------- -//# This is likely not current and should not be used as-is ---------------- -//# You've been warned <3 -------------------------------------------------- - -//# Docker Images ------------------------------------------- -//# static containers (may become out of date) -//bcftools_container = 'staphb/bcftools:1.16' -//bedtools_container = 'staphb/bedtools:2.30.0' -//bwa_container = 'staphb/bwa:0.7.17' -//fastp_container = 'staphb/fastp:0.23.2' -//fastqc_container = 'staphb/fastqc:0.11.9' -//freyja_container = 'staphb/freyja:1.3.11' -//iqtree2_container = 'staphb/iqtree2:2.1.2' -//ivar_container = 'staphb/ivar:1.3.1' -//kraken2_container = 'staphb/kraken2:2.1.2-no-db' -//mafft_container = 'staphb/mafft:7.475' -//minimap2_container = 'staphb/minimap2:2.24' -//multiqc_container = 'quay.io/biocontainers/multiqc:1.14--pyhdfd78af_0' -//pandas_container = 'quay.io/biocontainers/pandas:1.1.5' -//samtools_container = 'staphb/samtools:1.16' -//seqyclean_container = 'staphb/seqyclean:1.10.09' -//snp_dists_container = 'staphb/snp-dists:0.8.2' -//vadr_container = 'staphb/vadr:1.5' - -//# latest tags (more likely to break workflow, but they update "too frequently") -//nextalign_container = 'nextstrain/nextalign:latest' -//nextclade_container = 'nextstrain/nextclade:latest' -//pangolin_container = 'staphb/pangolin:latest' - - -//# Changing the directives for processes -//# The processes can be found in Grandeur/modules and their names are -//bcftools_variants -//bedtools_multicov -//bwa -//fasta_prep -//summary -//combine_results -//download -//fastp -//fastqc -//freyja -//freyja_aggregate -//iqtree2 -//ivar_consensus -//ivar_variants -//ivar_trim -//kraken2 -//mafft -//minimap2 -//multiqc_combine -//nextalign -//nextclade -//pangolin -//samtools_stats -//samtools_coverage -//samtools_flagstat -//samtools_depth -//samtools_ampliconstats -//samtools_plot_ampliconstats -//samtools_sort -//samtools_filter -//samtools_ampliconclip -//samtools_markdup -//seqyclean -//snpdists -//vadr - //# Adjusting the directives for a process -//# seehttps://www.nextflow.io/docs/latest/config.html#scope-process +//# see https://www.nextflow.io/docs/latest/config.html#scope-process +//# WARNING : THIS WAS PUT TOGETHER IN A HURRY AND LIKELY HAS TYPOS!!! //process { -// publishDir = [ path: params.outdir, mode: 'copy' ] -// -// errorStrategy = 'retry' -// maxRetries = 1 // -// withLabel: maxcpus { +// withLabel:maxcpus{ // cpus = params.maxcpus // } -// withLabel: medcpus { +// withLabel:medcpus{ // cpus = params.medcpus // } // -// withName:download { -// container = pandas_container -// } -// -// withName:fastqc{ -// container = fastqc_container -// } -// -// withName:bwa{ -// container = bwa_container -// publishDir = [ path: "${params.outdir}", mode: 'copy', pattern: 'logs/*/*log' ] -// } -// -// withName:minimap2{ -// container = minimap2_container -// publishDir = [ path: "${params.outdir}", mode: 'copy', pattern: 'logs/*/*log' ] -// } -// -// withName:'ivar_.*'{ -// container = ivar_container -// } -// -// withName:vadr{ -// container = vadr_container -// errorStrategy = 'ignore' -// } -// -// withName:mafft{ -// container = mafft_container -// errorStrategy = 'retry' -// maxRetries = 2 -// } +// withName:aci{ +// label = "process_high" +// publishDir = "cecret, mode: 'copy'" +// container = "quay.io/erinyoung/aci:0.1.20230815" +// } +// withName:artic{ +// label = "process_high" +// publishDir = "cecret, mode: 'copy'" +// container = "quay.io/uphl/artic:1.2.4-1.9.4-1" +// } +// withName:artic_read_filtering{ +// publishDir = "cecret, mode: 'copy'" +// container = "quay.io/uphl/artic:1.2.4-1.9.4-1" +// label = "process_single" +// } +// withName:bcftools_variants{ +// publishDir = "cecret, mode: 'copy'" +// errorStrategy = "{ task.attempt < 2 ? 'retry' : 'ignore'}" +// container = "staphb/bcftools:1.18" +// label = "process_single" +// } +// withName:bwa{ +// label = "process_high" +// publishDir = "path: cecret, mode: 'copy', pattern: 'logs/*/*log'" +// container = "staphb/bwa:0.7.17" +// } +// withName:download{ +// publishDir = "cecret, mode: 'copy'" +// container = "quay.io/uphl/seaborn:0.12.2" +// label = "process_single" +// } +// withName:fasta_prep{ +// container = "quay.io/uphl/seaborn:0.12.2" +// label = "process_single" +// } +// withName:fastp{ +// label = "process_single" +// publishDir = "cecret, mode: 'copy'" +// container = "staphb/fastp:0.23.4" +// } +// withName:fastqc{ +// label = "process_single" +// publishDir = "cecret, mode: 'copy'" +// container = "staphb/fastqc:0.12.1" +// } +// withName:freyja{ +// label = "process_medium" +// errorStrategy = "{ task.attempt < 2 ? 'retry' : 'ignore'}" +// publishDir = "cecret, mode: 'copy'" +// container = "quay.io/uphl/freyja:1.4.7-2023-09-26" +// } +// withName:freyja_aggregate{ +// label = "process_single" +// publishDir = "cecret, mode: 'copy'" +// container = "quay.io/uphl/freyja:1.4.7-2023-09-26" +// } +// withName:iqtree2{ +// label = "process_high" +// publishDir = "cecret, mode: 'copy'" +// container = "staphb/iqtree2:2.2.2.6" +// } +// withName:ivar_consensus{ +// label = "process_medium" +// memory = "{ 2.GB * task.attempt }" +// errorStrategy = "{ task.attempt < 2 ? 'retry' : 'ignore'}" +// publishDir = "params.outdir, mode: 'copy'" +// container = "staphb/ivar:1.4.2" +// } +// withName:ivar_trim{ +// label = "process_medium" +// publishDir = "cecret, mode: 'copy'" +// container = "staphb/ivar:1.4.2" +// } +// withName:ivar_variants{ +// label = "process_medium" +// memory = "{ 2.GB * task.attempt }" +// errorStrategy = "{ task.attempt < 3 ? 'retry' : 'ignore'}" +// publishDir = "cecret, mode: 'copy'" +// container = "staphb/ivar:1.4.2" +// } +// withName:kraken2{ +// label = "process_high" +// publishDir = "cecret, mode: 'copy'" +// container = "staphb/kraken2:2.1.3" +// } +// withName:mafft{ +// label = "process_high" +// errorStrategy = "{ task.attempt < 2 ? 'retry' : 'ignore'}" +// publishDir = "cecret, mode: 'copy'" +// container = "staphb/mafft:7.505" +// } +// withName:minimap2{ +// label = "process_high" +// publishDir = "[ path: cecret, mode: 'copy', pattern: 'logs/*/*log' ]" +// container = "staphb/minimap2:2.25" +// } +// withName:multiqc_combine{ +// label = "process_single" +// publishDir = "cecret, mode: 'copy'" +// container = "quay.io/bios/multiqc:1.14--pyhdfd78af_0" +// } +// withName:nextalign{ +// label = "process_high" +// publishDir = "cecret, mode: 'copy'" +// container = "nextstrain/nextalign:2.14.0" +// } +// withName:nextclade{ +// label = "process_medium" +// publishDir = "cecret, mode: 'copy'" +// container = "nextstrain/nextclade:2.14.0" +// } +// withName:nextclade_dataset{ +// label = "process_medium" +// publishDir = "cecret, mode: 'copy'" +// container = "nextstrain/nextclade:2.14.0" +// } +// withName:pangolin{ +// label = "process_medium" +// publishDir = "cecret, mode: 'copy'" +// container = "staphb/pangolin:4.3.1-pdata-1.22" +// } +// withName:samtools_ampliconclip{ +// label = "process_single" +// publishDir = "cecret, mode: 'copy'" +// container = "staphb/samtools:1.17" +// } +// withName:samtools_ampliconstats{ +// label = "process_single" +// publishDir = "cecret, mode: 'copy'" +// container = "staphb/samtools:1.17" +// } +// withName:samtools_coverage{ +// label = "process_single" +// publishDir = "cecret, mode: 'copy'" +// container = "staphb/samtools:1.17" +// } +// withName:samtools_depth{ +// label = "process_single" +// publishDir = "cecret, mode: 'copy'" +// container = "staphb/samtools:1.17" +// } +// withName:samtools_filter{ +// label = "process_single" +// publishDir = "cecret, mode: 'copy'" +// container = "staphb/samtools:1.17" +// } +// withName:samtools_flagstat{ +// label = "process_single" +// publishDir = "cecret, mode: 'copy'" +// container = "staphb/samtools:1.17" +// } +// withName:samtools_markdup{ +// label = "process_single" +// publishDir = "cecret, mode: 'copy'" +// container = "staphb/samtools:1.17" +// } +// withName:samtools_plot_ampliconstats{ +// label = "process_single" +// errorStrategy = "{ task.attempt < 2 ? 'retry' : 'ignore'}" +// publishDir = "cecret, mode: 'copy'" +// container = "staphb/samtools:1.17" +// } +// withName:samtools_sort{ +// label = "process_high" +// publishDir = "cecret, mode: 'copy'" +// container = "staphb/samtools:1.17" +// } +// withName:samtools_stats{ +// label = "process_single" +// publishDir = "cecret, mode: 'copy'" +// container = "staphb/samtools:1.17" +// } +// withName:seqyclean{ +// label = "process_single" +// publishDir = "cecret, mode: 'copy'" +// container = "staphb/seqyclean:1.10.09" +// } +// withName:snpdists{ +// label = "process_single" +// publishDir = "cecret, mode: 'copy'" +// container = "staphb/snp-dists:0.8.2" +// } +// withName:summary{ +// label = "process_single" +// publishDir = "cecret, mode: 'copy'" +// container = "quay.io/uphl/seaborn:0.12.2" +// } +// withName:unzip{ +// label = "process_single" +// container = "quay.io/uphl/seaborn:0.12.2" +// } +// withName:vadr{ +// label = "process_medium" +// publishDir = "cecret, mode: 'copy'" +// container = "staphb/vadr:1.5.1" +// } //} diff --git a/main.nf b/main.nf index 126fa9fa..7d87c733 100644 --- a/main.nf +++ b/main.nf @@ -10,7 +10,7 @@ println(' \\____|_____\\____|_| \\_\\_____| |_|') println('Version: ' + workflow.manifest.version) println('') -println('Currently using the Cecret workflow for use with amplicon Illumina library prep on MiSeq with a corresponding reference genome.\n') +println('Currently using the Cecret workflow for use with corresponding reference genome.\n') println('Author: Erin Young') println('email: eriny@utah.gov') println('') @@ -178,10 +178,10 @@ params.vadr_mdir = '/opt/vadr/vadr-models' params.nextclade_options = '' params.nextalign_options = '--include-reference' params.freyja_variants_options = '' -params.freyja_demix_options = '' -params.freyja_boot_options = '--nb 1000' +params.freyja_demix_options = "--depthcutoff ${params.minimum_depth}" +params.freyja_boot_options = "--nb 1000 --depthcutoff ${params.minimum_depth}" params.freyja_aggregate_options = '' -params.freyja_plot_options = '' +params.freyja_plot_options = "--mincov ${params.minimum_depth}" params.freyja_plot_filetype = 'png' //# Specifying some species-specific params diff --git a/modules/aci.nf b/modules/aci.nf index 5b1ebdc7..67721833 100644 --- a/modules/aci.nf +++ b/modules/aci.nf @@ -3,9 +3,9 @@ process aci { label "process_high" publishDir "${params.outdir}", mode: 'copy' container 'quay.io/erinyoung/aci:0.1.20230815' + errorStrategy { task.attempt < 2 ? 'retry' : 'ignore'} //#UPHLICA maxForks 10 - //#UPHLICA errorStrategy { task.attempt < 2 ? 'retry' : 'ignore'} //#UPHLICA pod annotation: 'scheduler.illumina.com/presetSize', value: 'standard-xlarge' //#UPHLICA memory 60.GB //#UPHLICA cpus 14 diff --git a/modules/artic.nf b/modules/artic.nf index dd47eb94..1734eb8e 100644 --- a/modules/artic.nf +++ b/modules/artic.nf @@ -15,8 +15,8 @@ process artic { tuple val(sample), file(fastq), file(reference), file(bed) output: - tuple val(sample), file("artic/${sample}.primertrim.sorted.bam"), file("artic/${sample}.primertrim.sorted.bam.bai"), emit: bam - path "consensus/${sample}.consensus.fa", emit: consensus + tuple val(sample), file("artic/${sample}.primertrim.sorted.bam"), file("artic/${sample}.primertrim.sorted.bam.bai"), emit: bam, optional: true + path "consensus/${sample}.consensus.fa", emit: consensus, optional: true tuple val("artic"), env(artic_version), emit: artic_version path "artic/${sample}*" path "logs/${task.process}/${sample}.${workflow.sessionId}.log" diff --git a/modules/bwa.nf b/modules/bwa.nf index cc8e8b20..0bf68ebc 100644 --- a/modules/bwa.nf +++ b/modules/bwa.nf @@ -1,8 +1,8 @@ process bwa { - tag "${sample}" - label "process_high" - publishDir = [ path: "${params.outdir}", mode: 'copy', pattern: 'logs/*/*log' ] - container 'staphb/bwa:0.7.17' + tag "${sample}" + label "process_high" + publishDir path: "${params.outdir}", mode: 'copy', pattern: 'logs/*/*log' + container 'staphb/bwa:0.7.17' //#UPHLICA maxForks 10 //#UPHLICA errorStrategy { task.attempt < 2 ? 'retry' : 'ignore'} diff --git a/modules/freyja.nf b/modules/freyja.nf index 796cc5d7..1f165733 100644 --- a/modules/freyja.nf +++ b/modules/freyja.nf @@ -3,7 +3,7 @@ process freyja { label "process_medium" errorStrategy { task.attempt < 2 ? 'retry' : 'ignore'} publishDir "${params.outdir}", mode: 'copy' - container 'quay.io/uphl/freyja:1.4.7-20230915' + container 'quay.io/uphl/freyja:1.4.7-2023-09-26' //#UPHLICA maxForks 10 //#UPHLICA pod annotation: 'scheduler.illumina.com/presetSize', value: 'standard-xlarge' @@ -44,7 +44,7 @@ process freyja { --output freyja/!{sample}_demix.tsv \ | tee -a $log - freyja boot \ + freyja boot !{params.freyja_boot_options} \ freyja/!{sample}_variants.tsv \ freyja/!{sample}_depths.tsv \ --nt !{task.cpus} \ @@ -57,7 +57,7 @@ process freyja_aggregate { tag "Aggregating results from freyja" label "process_single" publishDir "${params.outdir}", mode: 'copy' - container 'quay.io/uphl/freyja:1.4.7-20230915' + container 'quay.io/uphl/freyja:1.4.7-2023-09-26' //#UPHLICA maxForks 10 //#UPHLICA errorStrategy { task.attempt < 2 ? 'retry' : 'ignore'} diff --git a/modules/minimap2.nf b/modules/minimap2.nf index 4842401f..5319c3c9 100644 --- a/modules/minimap2.nf +++ b/modules/minimap2.nf @@ -1,8 +1,8 @@ process minimap2 { - tag "${sample}" - label "process_high" - publishDir = [ path: "${params.outdir}", mode: 'copy', pattern: 'logs/*/*log' ] - container 'staphb/minimap2:2.25' + tag "${sample}" + label "process_high" + publishDir path: "${params.outdir}", mode: 'copy', pattern: 'logs/*/*log' + container 'staphb/minimap2:2.25' //#UPHLICA maxForks 10 //#UPHLICA errorStrategy { task.attempt < 2 ? 'retry' : 'ignore'} diff --git a/nextflow.config b/nextflow.config index aa5c2f96..a4f9262a 100644 --- a/nextflow.config +++ b/nextflow.config @@ -5,7 +5,7 @@ manifest { name = 'Cecret' author = 'Erin Young' homePage = 'https://github.com/UPHL-BioNGS/Cecret' - version = 'v3.8.20230915' + version = 'v3.8.20230926' defaultBranch = 'master' recurseSubmodules = false description = 'Reference-based consensus creation' diff --git a/nextflow_schema.json b/nextflow_schema.json index fb1c60bb..b734f3f5 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -30,7 +30,7 @@ "type": "string", "description": "Options for process", "hidden": true, - "default": "--normalise 200 --skip-nanopolish" + "default": "--normalise 200 --skip-nanopolish --medaka --medaka-model r941_min_high_g360" }, "artic_read_filtering_options": { "type": "string", @@ -62,13 +62,14 @@ "config_file": { "type": "boolean", "hidden": true, + "default": false, "description" : "Specifies if a config file is copied for the end user. Ends script." }, "download_nextclade_dataset": { "type": "boolean", "hidden": false, "description" : "Specifies if nextclade should download its dataset. Set to false to use included dataset.", - "default" : true + "default" : false }, "fastas": { "type": "string", @@ -121,17 +122,19 @@ "freyja_boot_options": { "type": "string", "hidden": true, - "default": "--nb 1000", + "default": "--nb 1000 --depthcutoff 100", "description": "Options for process" }, "freyja_demix_options": { "type": "string", "hidden": true, + "default": "--depthcutoff 100", "description": "Options for process" }, "freyja_plot_filetype": { "type": "string", "hidden": true, + "default": "png", "description": "Specifies filetype for freyja plot", "enum": [ ".pdf", @@ -141,7 +144,7 @@ "freyja_plot_options": { "type": "string", "hidden": true, - "default": "png", + "default": "--mincov 100", "description": "Options for process" }, "freyja_variants_options": { @@ -169,6 +172,7 @@ "iqtree2_outgroup": { "type": "string", "hidden": true, + "default": "MN908947", "description": "outgroup for multiple sequence alignment" }, "ivar_consensus_options": { @@ -200,7 +204,8 @@ "description": "Specifies if process should be used" }, "kraken2_db": { - "type": "string", + "type": "string", + "default": "false", "description": "directory to kraken2 database" }, "kraken2_options": { @@ -295,6 +300,7 @@ "nextclade_dataset": { "type": "string", "hidden": true, + "default": "sars-cov-2", "description": "Specifies nextclade dataset" }, "nextclade_options": { @@ -303,7 +309,8 @@ "description": "Options for process" }, "outdir": { - "type": "string", + "type": "string", + "default": "cecret", "description": "Specifies where results are saved" }, "pangolin": { @@ -408,6 +415,12 @@ "hidden": true, "description": "Options for process" }, + "samtools_flagstat": { + "type": "boolean", + "hidden": true, + "default": true, + "description": "Specifies if process should be used" + }, "samtools_flagstat_options": { "type": "string", "hidden": true, @@ -439,7 +452,6 @@ "samtools_stats_options": { "type": "string", "hidden": true, - "default": true, "description": "Options for process" }, "seqyclean_contaminant_file": { @@ -500,6 +512,7 @@ "vadr": { "type": "boolean", "hidden": true, + "default": true, "description": "Specifies if process should be used" }, "vadr_mdir": { @@ -511,15 +524,18 @@ "vadr_options": { "type": "string", "hidden": true, + "default": "--split --glsearch -s -r --nomisc --lowsim5seq 6 --lowsim3seq 6 --alt_fail lowscore,insertnn,deletinn", "description": "Options for process" }, "vadr_reference": { "type": "string", "hidden": true, + "default": "sarscov2", "description": "Specifies reference for vadr in container" }, "vadr_trim_options": { "type": "string", + "default": "--minlen 50 --maxlen 30000", "hidden": true, "description": "Options for process" } diff --git a/schema/midnight_ont_V2_SARS-CoV-2.insert.bed b/schema/midnight_ont_V2_SARS-CoV-2.insert.bed index 2a32c97d..4fa3b0e4 100644 --- a/schema/midnight_ont_V2_SARS-CoV-2.insert.bed +++ b/schema/midnight_ont_V2_SARS-CoV-2.insert.bed @@ -27,4 +27,3 @@ MN908947.3 25712 26835 nCoV-2019_26_INSERT 26 + MN908947.3 26766 27872 nCoV-2019_27_INSERT 27 + MN908947.3 27808 28985 nCoV-2019_28_INSERT 28 + MN908947.3 28699 29768 nCoV-2019_29_INSERT 29 + - 1 + diff --git a/schema/midnight_ont_V2_SARS-CoV-2.primer.bed~ b/schema/midnight_ont_V2_SARS-CoV-2.primer.bed~ deleted file mode 100644 index 91846059..00000000 --- a/schema/midnight_ont_V2_SARS-CoV-2.primer.bed~ +++ /dev/null @@ -1,59 +0,0 @@ -MN908947.3 30 54 nCoV-2019_1_LEFT 1 -MN908947.3 1183 1205 nCoV-2019_1_RIGHT 1 -MN908947.3 1100 1128 nCoV-2019_2_LEFT 2 -MN908947.3 2244 2266 nCoV-2019_2_RIGHT 2 -MN908947.3 2153 2179 nCoV-2019_3_LEFT 1 -MN908947.3 3235 3257 nCoV-2019_3_RIGHT 1 -MN908947.3 3144 3166 nCoV-2019_4_LEFT 2 -MN908947.3 4240 4262 nCoV-2019_4_RIGHT 2 -MN908947.3 4167 4189 nCoV-2019_5_LEFT 1 -MN908947.3 5337 5359 nCoV-2019_5_RIGHT 1 -MN908947.3 5257 5286 nCoV-2019_6_LEFT 2 -MN908947.3 6358 6380 nCoV-2019_6_RIGHT 2 -MN908947.3 6283 6307 nCoV-2019_7_LEFT 1 -MN908947.3 7379 7401 nCoV-2019_7_RIGHT 1 -MN908947.3 7298 7328 nCoV-2019_8_LEFT 2 -MN908947.3 8363 8385 nCoV-2019_8_RIGHT 2 -MN908947.3 8253 8282 nCoV-2019_9_LEFT 1 -MN908947.3 9378 9400 nCoV-2019_9_RIGHT 1 -MN908947.3 9303 9327 nCoV-2019_10_LEFT 2 -MN908947.3 10429 10451 nCoV-2019_10_RIGHT 2 -MN908947.3 10343 10370 nCoV-2019_11_LEFT 1 -MN908947.3 11447 11469 nCoV-2019_11_RIGHT 1 -MN908947.3 11372 11394 nCoV-2019_12_LEFT 2 -MN908947.3 12538 12560 nCoV-2019_12_RIGHT 2 -MN908947.3 12450 12473 nCoV-2019_13_LEFT 1 -MN908947.3 13599 13621 nCoV-2019_13_RIGHT 1 -MN908947.3 13509 13532 nCoV-2019_14_LEFT 2 -MN908947.3 14619 14641 nCoV-2019_14_RIGHT 2 -MN908947.3 14540 14568 nCoV-2019_15_LEFT 1 -MN908947.3 15713 15735 nCoV-2019_15_RIGHT 1 -MN908947.3 15608 15634 nCoV-2019_16_LEFT 2 -MN908947.3 16698 16720 nCoV-2019_16_RIGHT 2 -MN908947.3 16624 16647 nCoV-2019_17_LEFT 1 -MN908947.3 17732 17754 nCoV-2019_17_RIGHT 1 -MN908947.3 17622 17649 nCoV-2019_18_LEFT 2 -MN908947.3 18684 18706 nCoV-2019_18_RIGHT 2 -MN908947.3 18596 18618 nCoV-2019_19_LEFT 1 -MN908947.3 19655 19678 nCoV-2019_19_RIGHT 1 -MN908947.3 19574 19604 nCoV-2019_20_LEFT 2 -MN908947.3 20676 20698 nCoV-2019_20_RIGHT 2 -MN908947.3 20553 20581 nCoV-2019_21_LEFT 1 -MN908947.3 21620 21642 nCoV-2019_21_RIGHT 1 -MN908947.3 21532 21562 nCoV-2019_22_LEFT 2 -MN908947.3 22590 22612 nCoV-2019_22_RIGHT 2 -MN908947.3 22511 22537 nCoV-2019_23_LEFT 1 -MN908947.3 23609 23631 nCoV-2019_23_RIGHT 1 -MN908947.3 23518 23544 nCoV-2019_24_LEFT 2 -MN908947.3 24714 24736 nCoV-2019_24_RIGHT 2 -MN908947.3 24633 24658 nCoV-2019_25_LEFT 1 -MN908947.3 25768 25790 nCoV-2019_25_RIGHT 1 -MN908947.3 25690 25712 nCoV-2019_26_LEFT 2 -MN908947.3 26835 26857 nCoV-2019_26_RIGHT 2 -MN908947.3 26744 26766 nCoV-2019_27_LEFT 1 -MN908947.3 27872 27894 nCoV-2019_27_RIGHT 1 -MN908947.3 27784 27808 nCoV-2019_28_LEFT 2 -MN908947.3 28985 29007 nCoV-2019_28_RIGHT 2 -MN908947.3 28677 28699 nCoV-2019_29_LEFT 1 -MN908947.3 29768 29790 nCoV-2019_29_RIGHT 1 -