diff --git a/README.md b/README.md index cdb1bb3c..8d4f6dfd 100644 --- a/README.md +++ b/README.md @@ -107,6 +107,7 @@ Three test profile with example data are provided and can be run like so: ## Enhancements - Swap Seqtk with Rasusa for down sampling +- Integrate nf-validate ## Citations diff --git a/conf/modules.config b/conf/modules.config index 5bec3354..a8fae735 100644 --- a/conf/modules.config +++ b/conf/modules.config @@ -643,8 +643,9 @@ process { ext.args = "" stageInMode = params.stage_in_mode // scratch = false - //container = params.pilon_iterative.container ext.containers = params.pilon_iterative + maxRetries = 3 + errorStrategy = { task.attempt <= task.maxRetries ? sleep(Math.pow(2, task.attempt) * 200 as long) && 'retry' : 'ignore' } publishDir = [ [ path: { "${params.outdir}/${params.spades.outdir}/${params.racon.outdir}/${params.pilon_iterative.outdir}/fasta" }, diff --git a/docs/troubleshooting/FAQ.md b/docs/troubleshooting/FAQ.md index 25ab5641..f2a71cfc 100644 --- a/docs/troubleshooting/FAQ.md +++ b/docs/troubleshooting/FAQ.md @@ -28,6 +28,10 @@ The way a variable type is determined from the command line can be found in the Common errors and potential fixes for modules will be detailed here. +### Permission denied on a python script (`bin/some_script.py`) + +There may be an issue on certain installs where the python scripts included alongside mikrokondo do not work due to lack of permissions. The easiest way to solve this issue is to execute `chmod +x bin/*.py` in the mikrokondo installation directory. This will add execution permissions to all of the scripts, if this solution does not work then please submit an issue. + ### Random issues containing on resume `org.iq80.leveldb.impl.Version.retain()` Sometimes the resume features of Nextflow don't always work completely. The above error string typically implies that some output could not be gathered from a process and on subsequent resumes you will get an error. You can find out what process (and its work directory location) caused the error in the `nextflow.log` (normally it will be at the top of some long traceback in the log), and a work directory will be specified listing the directory causing the error. Delete this directory and resume the pipeline. **If you hate logs and you don't care about resuming** other processes you can simply delete the work directory entirely. diff --git a/modules/local/bakta_annotate.nf b/modules/local/bakta_annotate.nf index e8997c62..e44ae55c 100644 --- a/modules/local/bakta_annotate.nf +++ b/modules/local/bakta_annotate.nf @@ -54,4 +54,20 @@ process BAKTA_ANNOTATE { bakta: \$(echo \$(bakta --version) 2>&1 | cut -f '2' -d ' ') END_VERSIONS """ + + stub: + prefix = "stub" + """ + touch stub.${params.bakta.embl_ext} + touch stub.${params.bakta.faa_ext} + touch stub.${params.bakta.ffn_ext} + touch stub.${params.bakta.fna_ext} + touch stub.${params.bakta.gbff_ext} + touch stub.${params.bakta.gff_ext} + touch stub.${params.bakta.hypotheticals_tsv_ext} + touch stub.${params.bakta.hypotheticals_faa_ext} + touch stub.${params.bakta.tsv_ext} + touch stub.${params.bakta.txt_ext} + touch versions.yml + """ } diff --git a/modules/local/bin_kraken2.nf b/modules/local/bin_kraken2.nf index fcc15eb8..2ac7725d 100644 --- a/modules/local/bin_kraken2.nf +++ b/modules/local/bin_kraken2.nf @@ -31,4 +31,12 @@ process BIN_KRAKEN2{ python: \$(python --version | sed 's/Python //g') END_VERSIONS """ + + stub: + prefix = "stub" + """ + touch stub_Escherichia${params.kraken_bin.fasta_ext} + touch stub_Salmonella${params.kraken_bin.fasta_ext} + touch versions.yml + """ } diff --git a/modules/local/check_ont.nf b/modules/local/check_ont.nf index 311c77ce..b730d273 100644 --- a/modules/local/check_ont.nf +++ b/modules/local/check_ont.nf @@ -27,9 +27,9 @@ process CHECK_ONT{ """ stub: - output_name = "test.unique_headers.fastq.gz" + output_name = "stub.unique_headers.fastq.gz" """ - touch ${output_name} + touch stub.unique_headers.fastq.gz touch versions.yml """ diff --git a/modules/local/checkm_lineagewf.nf b/modules/local/checkm_lineagewf.nf index 8f46a1db..6dba1c81 100644 --- a/modules/local/checkm_lineagewf.nf +++ b/modules/local/checkm_lineagewf.nf @@ -43,14 +43,16 @@ process CHECKM_LINEAGEWF { """ stub: + prefix = "stub" """ - mkdir test/bins/ - touch test/bins/genes.faa - touch test/bins/genes.gff - touch test/bins/hmmer.analyze.txt - touch test/bins/hmmer.tree.txt - touch test/test-results.txt - touch test/lineage.ms + mkdir -p stub/bins/ + touch stub/bins/genes.faa + touch stub/bins/genes.gff + touch stub/bins/hmmer.analyze.txt + touch stub/bins/hmmer.tree.txt + touch stub/stub-results.txt + touch stub/${params.checkm.results_ext} + touch stub/${params.checkm.lineage_ms} touch versions.yml """ diff --git a/modules/local/ectyper.nf b/modules/local/ectyper.nf index d46971de..1b64313d 100644 --- a/modules/local/ectyper.nf +++ b/modules/local/ectyper.nf @@ -35,4 +35,13 @@ process ECTYPER{ END_VERSIONS """ + stub: + prefix = "stub" + """ + touch stub/stub${params.ectyper.log_ext} + touch stub/stub${params.ectyper.tsv_ext} + touch stub/stub${params.ectyper.txt_ext} + touch versions.yml + """ + } diff --git a/modules/local/fastp_trim.nf b/modules/local/fastp_trim.nf index 3252730c..730657c4 100644 --- a/modules/local/fastp_trim.nf +++ b/modules/local/fastp_trim.nf @@ -45,5 +45,13 @@ process FASTP_TRIM{ END_VERSIONS """ + stub: + """ + touch stub${params.fastp.fastq_ext} + touch stub${params.fastp.json_ext} + touch stub${params.fastp.html_ext} + touch versions.yml + """ + } diff --git a/modules/local/flye_assemble.nf b/modules/local/flye_assemble.nf index ea66322d..9d2c4ca4 100644 --- a/modules/local/flye_assemble.nf +++ b/modules/local/flye_assemble.nf @@ -46,4 +46,15 @@ process FLYE_ASSEMBLE{ END_VERSIONS """ + stub: + """ + touch stub${params.flye.fasta_ext} + touch stub${params.flye.gfa_ext} + touch stub${params.flye.gv_ext} + touch stub${params.flye.txt_ext} + touch stub${params.flye.log_ext} + touch stub${params.flye.json_ext} + touch versions.yml + """ + } diff --git a/modules/local/kleborate.nf b/modules/local/kleborate.nf index 70fefaff..efd939e9 100644 --- a/modules/local/kleborate.nf +++ b/modules/local/kleborate.nf @@ -29,4 +29,10 @@ process KLEBORATE { kleborate: \$( echo \$(kleborate --version | sed 's/Kleborate v//;')) END_VERSIONS """ + + stub: + """ + touch stub.txt + touch versions.yml + """ } diff --git a/modules/local/kraken.nf b/modules/local/kraken.nf index 8f815eb3..f6a8a8cc 100644 --- a/modules/local/kraken.nf +++ b/modules/local/kraken.nf @@ -21,12 +21,20 @@ process KRAKEN { def args = task.ext.args ?: "" def prefix = task.ext.prefix ?: "${meta.id}" """ - kraken2 --db $db --memory-mapping --threads $task.cpus --output ${meta.id}.${params.kraken.output_suffix}.txt --report ${prefix}.kraken2.${params.kraken.report_suffix}.txt --classified-out ${meta.id}.${params.kraken.classified_suffix}.fasta --unclassified-out ${meta.id}.${params.kraken.unclassified_suffix}.fasta $args --gzip-compressed $contigs + kraken2 --db $db --memory-mapping --threads $task.cpus --output ${prefix}.${params.kraken.output_suffix}.txt --report ${prefix}.kraken2.${params.kraken.report_suffix}.txt --classified-out ${meta.id}.${params.kraken.classified_suffix}.fasta --unclassified-out ${meta.id}.${params.kraken.unclassified_suffix}.fasta $args --gzip-compressed $contigs cat <<-END_VERSIONS > versions.yml "${task.process}": kraken2: \$(echo \$(kraken2 --version 2>&1) | sed 's/^.*Kraken version //; s/ .*\$//') END_VERSIONS """ + stub: + """ + touch stub.${params.kraken.classified_suffix}.fasta + touch stub.${params.kraken.unclassified_suffix}.fasta + touch stub.${params.kraken.output_suffix}.txt + touch stub.${params.kraken.report_suffix}.txt + touch versions.yml + """ } diff --git a/modules/local/lissero.nf b/modules/local/lissero.nf index 3c20cdc4..f5a8d540 100644 --- a/modules/local/lissero.nf +++ b/modules/local/lissero.nf @@ -31,4 +31,10 @@ process LISSERO { lissero: \$( echo \$(lissero --version 2>&1) | sed 's/^.*LisSero //' ) END_VERSIONS """ + + stub: + """ + touch stub${params.lissero.tsv_ext} + touch versions.yml + """ } diff --git a/modules/local/mash_estimate.nf b/modules/local/mash_estimate.nf index 1191ce0b..66f0e0ef 100644 --- a/modules/local/mash_estimate.nf +++ b/modules/local/mash_estimate.nf @@ -30,4 +30,13 @@ process MASH_ESTIMATE{ mash: \$( mash --version ) END_VERSIONS """ + + stub: + prefix = "stub" + """ + touch stub${params.mash.sketch_ext} + touch genome_size.txt + echo "100000" > genome_size.txt + touch versions.yml + """ } diff --git a/modules/local/mash_screen.nf b/modules/local/mash_screen.nf index dc03fc41..c28c70c5 100644 --- a/modules/local/mash_screen.nf +++ b/modules/local/mash_screen.nf @@ -33,4 +33,12 @@ process MASH_SCREEN { mash: \$( mash --version ) END_VERSIONS """ + + stub: + prefix = "stub" + prefix_post = task.process.toString().contains("QC_READS") ? prefix + params.mash.output_reads_ext : prefix + params.mash.output_taxa_ext + """ + touch stub${prefix_post} + touch versions.yml + """ } diff --git a/modules/local/medaka_polish.nf b/modules/local/medaka_polish.nf index 3a6a70b0..15644d46 100644 --- a/modules/local/medaka_polish.nf +++ b/modules/local/medaka_polish.nf @@ -32,4 +32,11 @@ process MEDAKA_POLISH{ medaka: \$( medaka --version 2>&1 | sed 's/medaka //g' ) END_VERSIONS """ + + stub: + """ + touch stub${params.medaka.fasta_ext} + touch versions.yml + """ + } diff --git a/modules/local/minimap2_index.nf b/modules/local/minimap2_index.nf index 553744c2..ac77fc67 100644 --- a/modules/local/minimap2_index.nf +++ b/modules/local/minimap2_index.nf @@ -9,10 +9,11 @@ process MINIMAP2_INDEX{ tuple val(meta), path(contigs) output: - tuple val(meta), path("${meta.id}${params.minimap2.index_ext}"), emit: index + tuple val(meta), path("${prefix}${params.minimap2.index_ext}"), emit: index path "versions.yml", emit: versions script: + prefix = meta.id """ minimap2 -d ${meta.id}${params.minimap2.index_ext} $contigs cat <<-END_VERSIONS > versions.yml @@ -21,4 +22,10 @@ process MINIMAP2_INDEX{ END_VERSIONS """ + stub: + prefix = "stub" + """ + touch stub${params.minimap2.index_ext} + touch versions.yml + """ } diff --git a/modules/local/minimap2_map.nf b/modules/local/minimap2_map.nf index 4627086c..b6af76bc 100644 --- a/modules/local/minimap2_map.nf +++ b/modules/local/minimap2_map.nf @@ -47,4 +47,10 @@ process MINIMAP2_MAP { END_VERSIONS """ + stub: + def mapped_ext = paf_out ? ".paf" : ".sam" + """ + touch stub${mapped_ext} + touch versions.yml + """ } diff --git a/modules/local/mlst.nf b/modules/local/mlst.nf index d0491622..a394b5b0 100644 --- a/modules/local/mlst.nf +++ b/modules/local/mlst.nf @@ -23,4 +23,10 @@ process MLST { mlst: \$( echo \$(mlst --version 2>&1) | sed 's/mlst //' ) END_VERSIONS """ + + stub: + """ + touch stub${params.mlst.json_ext} + touch versions.yml + """ } diff --git a/modules/local/mob_recon.nf b/modules/local/mob_recon.nf index 4a94ea0f..06967836 100644 --- a/modules/local/mob_recon.nf +++ b/modules/local/mob_recon.nf @@ -33,4 +33,15 @@ process MOBSUITE_RECON { mobsuite: \$(echo \$(mob_recon --version 2>&1) | sed 's/^.*mob_recon //; s/ .*\$//') END_VERSIONS """ + + stub: + prefix = "stub" + """ + mkdir stub + touch stub/chromosome${params.mobsuite_recon.fasta_ext} + touch stub/${params.mobsuite_recon.contig_report} + touch stub/plasmid_stub${params.mobsuite_recon.fasta_ext} + touch stub/${params.mobsuite_recon.mob_results_file} + touch versions.yml + """ } diff --git a/modules/local/parse_fastp.nf b/modules/local/parse_fastp.nf index bb6e5a4f..b05880e7 100644 --- a/modules/local/parse_fastp.nf +++ b/modules/local/parse_fastp.nf @@ -13,38 +13,45 @@ process PARSE_FASTP{ tuple val(meta), val(total_bases), emit: base_count exec: - // ! TODO add warning of fastp versions in the future - /* - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - The outputs of the json are tied to Fastp's output json structure, if - Fastp's fields ever change in an updated container this may be the - issue with future fastp versions. - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - */ - def jsonSlurper = new JsonSlurper(); - def data = file(json) - String data_json = data.text - def json_data = jsonSlurper.parseText(data_json) - total_reads_post = json_data.summary.after_filtering.total_reads.toLong() - total_bases = json_data.summary.after_filtering.total_bases.toLong() - /* - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Stating the variables to be filterd below as when testing running the pipeline - on nextflow 23.04.1 unless some side effect occured with the variables nothing happened. - - E.g. when logging the variables they were set as outputs, but when I did nothing else - besides set them (with our without a def) an error occured saying there was no output. - Merely stating the variables below seems to have solved the issue however. I am guessing this - has to do with Groovy or Nextflow interning variable but I do not know for sure currently. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - */ - total_reads_post - total_bases - // if this data is not logged the process does not work??? - //log.info "Sample: ${meta.id}" - //log.info " Total Reads After Filtering: ${total_reads_post}" - //log.info " Total Bases After Filtering: ${total_bases}" + if (workflow.stubRun){ + total_reads_post = 100000 + total_bases = 10000000 + total_reads_post + total_bases + }else{ + // ! TODO add warning of fastp versions in the future + /* + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + The outputs of the json are tied to Fastp's output json structure, if + Fastp's fields ever change in an updated container this may be the + issue with future fastp versions. + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + */ + def jsonSlurper = new JsonSlurper(); + def data = file(json) + String data_json = data.text + def json_data = jsonSlurper.parseText(data_json) + total_reads_post = json_data.summary.after_filtering.total_reads.toLong() + total_bases = json_data.summary.after_filtering.total_bases.toLong() + /* + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Stating the variables to be filterd below as when testing running the pipeline + on nextflow 23.04.1 unless some side effect occured with the variables nothing happened. + + E.g. when logging the variables they were set as outputs, but when I did nothing else + besides set them (with our without a def) an error occured saying there was no output. + Merely stating the variables below seems to have solved the issue however. I am guessing this + has to do with Groovy or Nextflow interning variable but I do not know for sure currently. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + */ + total_reads_post + total_bases + // if this data is not logged the process does not work??? + //log.info "Sample: ${meta.id}" + //log.info " Total Reads After Filtering: ${total_reads_post}" + //log.info " Total Bases After Filtering: ${total_bases}" + } } diff --git a/modules/local/parse_kraken.nf b/modules/local/parse_kraken.nf index 32950af6..d6934dfe 100644 --- a/modules/local/parse_kraken.nf +++ b/modules/local/parse_kraken.nf @@ -26,4 +26,10 @@ process PARSE_KRAKEN { END_VERSIONS """ + stub: + """ + echo "stub" + touch versions.yml + """ + } diff --git a/modules/local/parse_mash.nf b/modules/local/parse_mash.nf index 77ee2437..13010615 100644 --- a/modules/local/parse_mash.nf +++ b/modules/local/parse_mash.nf @@ -31,4 +31,10 @@ process PARSE_MASH{ END_VERSIONS """ + stub: + """ + echo "stub" + touch versions.yml + """ + } diff --git a/modules/local/pilon_polisher.nf b/modules/local/pilon_polisher.nf index 27c0f021..0fe0e11e 100644 --- a/modules/local/pilon_polisher.nf +++ b/modules/local/pilon_polisher.nf @@ -5,14 +5,11 @@ process PILON_ITER { label 'process_medium' memory {task.memory * task.attempt} container "${workflow.containerEngine == 'singularity' || workflow.containerEngine == 'apptainer' ? task.ext.containers.get('singularity') : task.ext.containers.get('docker')}" - errorStrategy 'retry' - maxRetries 3 // zero retries allowed while testing input: tuple val(meta), path(reads), path(contigs) output: - // TODO multiple outputs produced so need to make sure the last one/ or optimal one in the future is taken tuple val(meta), path("*${params.pilon_iterative.fasta_ext}"), path(reads), emit: pilon_fasta tuple val(meta), path("*${params.pilon_iterative.vcf_ext}"), emit: pilon_vcf tuple val(meta), path("*${params.pilon_iterative.changes_ext}"), emit: pilon_changes @@ -47,6 +44,7 @@ process PILON_ITER { // numbered the files are named as {prefix}_{iteration}.blah // below is a convaluted shell string to get the last output sample + // tail -n +2 removes the first line of the listed output (output starts at line 2) // TODO can set output to be related to max_polisihing runs """ gzip -d -c $contigs > $unzipped_contigs @@ -65,4 +63,13 @@ process PILON_ITER { pilonpolisher: No version statement listed END_VERSIONS """ + + stub: + """ + touch stub_polished_${params.pilon_iterative.fasta_ext} + touch stub_polished_${params.pilon_iterative.vcf_ext} + touch stub_polished_${params.pilon_iterative.changes_ext} + touch stub_polished_${params.pilon_iterative.bam_ext} + touch versions.yml + """ } diff --git a/modules/local/quast_assembly.nf b/modules/local/quast_assembly.nf index 3cc055d6..a7fb024b 100644 --- a/modules/local/quast_assembly.nf +++ b/modules/local/quast_assembly.nf @@ -11,14 +11,15 @@ process QUAST { tuple val(meta), path(contigs), path(trimmed_reads) output: - tuple val(meta), path("${meta.id}/*"), path(contigs), emit: quast_data - tuple val(meta), path("${meta.id}/${params.quast.report_prefix}${meta.id}${params.quast.report_ext}"), path(contigs), emit: quast_table + tuple val(meta), path("${prefix}/*"), path(contigs), emit: quast_data + tuple val(meta), path("${prefix}/${params.quast.report_prefix}${prefix}${params.quast.report_ext}"), path(contigs), emit: quast_table path "versions.yml", emit: versions script: // TODO clean up this messy control flow logic that was written on the fly to decide read parameters def args = params.quast.args ?: "" def reads = null + prefix = meta.id def long_read_string = "--single" if (params.platform == params.opt_platforms.ont){ @@ -41,10 +42,10 @@ process QUAST { export OPENBLAS_NUM_THREADS=1 export OMP_NUM_THREADS=1 export GOTO_NUM_THREADS=1 - quast $args --threads $task.cpus --output-dir ${meta.id} ${contigs.join(' ')} - for i in ${meta.id}/*${params.quast.report_base}.* + quast $args --threads $task.cpus --output-dir ${prefix} ${contigs.join(' ')} + for i in ${prefix}/*${params.quast.report_base}.* do - mv \$i \${i/$params.quast.report_base/$meta.id} + mv \$i \${i/$params.quast.report_base/$prefix} done cat <<-END_VERSIONS > versions.yml "${task.process}": @@ -52,4 +53,13 @@ process QUAST { END_VERSIONS """ + stub: + prefix = "stub" + """ + mkdir stub + touch stub/stuff.stuff + echo -e "${params.quast_filter.n50_field}\t${params.quast_filter.nr_contigs_field}\n1000000\t500" > stub/${params.quast.report_prefix}${prefix}${params.quast.report_ext} + touch versions.yml + """ + } diff --git a/modules/local/racon_polish.nf b/modules/local/racon_polish.nf index d22be890..ddc80943 100644 --- a/modules/local/racon_polish.nf +++ b/modules/local/racon_polish.nf @@ -30,4 +30,10 @@ process RACON_POLISH { END_VERSIONS """ + stub: + """ + touch stub${params.racon.consensus_ext} + touch versions.yml + """ + } diff --git a/modules/local/read_summary.nf b/modules/local/read_summary.nf index 1600b0ef..3ed60398 100644 --- a/modules/local/read_summary.nf +++ b/modules/local/read_summary.nf @@ -37,5 +37,11 @@ process READ_SCAN{ END_VERSIONS """ + stub: + prefix = "stub" + """ + touch stub.json + touch versions.yml + """ } diff --git a/modules/local/remove_contaminants.nf b/modules/local/remove_contaminants.nf index cb6f53b9..c0f84451 100644 --- a/modules/local/remove_contaminants.nf +++ b/modules/local/remove_contaminants.nf @@ -72,4 +72,10 @@ process REMOVE_CONTAMINANTS { samtools: \$(echo \$(samtools --version 2>&1) | sed 's/^.*samtools //; s/Using.*\$//') END_VERSIONS """ + + stub: + """ + touch stub.${params.r_contaminants.samtools_output_suffix}${params.r_contaminants.output_ext} + touch versions.yml + """ } diff --git a/modules/local/report.nf b/modules/local/report.nf index 2a51e71f..78c93e9d 100644 --- a/modules/local/report.nf +++ b/modules/local/report.nf @@ -21,8 +21,18 @@ process REPORT{ path("final_report.json"), emit: final_report exec: + if (workflow.stubRun){ + // may need to add in a return here + def report_name = "final_report.json" + def output_file_path = Paths.get("$task.workDir", report_name) + output_file = file(output_file_path).newWriter() + output_file.write("") + output_file.close() + return + } + def sample_data = [:] // Where to aggergate and create json data - def data_stride = 3 // report values added in groups of three + def data_stride = 3 // report values added in groups of three, e.g sample meta info, parameters, output file of interest def headers_list = 'headers' // ! TODO this string exists twice, need to fix that // TODO Check if there is a better way to get array size diff --git a/modules/local/report_to_tsv.nf b/modules/local/report_to_tsv.nf index f9034e55..38379f74 100644 --- a/modules/local/report_to_tsv.nf +++ b/modules/local/report_to_tsv.nf @@ -11,6 +11,7 @@ process REPORT_TO_TSV{ output: path("final_report.tsv"), emit: final_report + path "versions.yml", emit: versions script: """ @@ -20,4 +21,10 @@ process REPORT_TO_TSV{ python: \$(python --version | sed 's/Python //g') END_VERSIONS """ + + stub: + """ + touch final_report.tsv + touch versions.yml + """ } diff --git a/modules/local/sam_to_bam.nf b/modules/local/sam_to_bam.nf index 5127a33d..4fcee61f 100644 --- a/modules/local/sam_to_bam.nf +++ b/modules/local/sam_to_bam.nf @@ -29,4 +29,11 @@ process SAM_TO_BAM{ END_VERSIONS """ + stub: + """ + touch stub${params.samtools.bam_ext} + touch stub${params.samtools.bai_ext} + touch versions.yml + """ + } diff --git a/modules/local/select_pointfinder.nf b/modules/local/select_pointfinder.nf index 5d3b8661..bcb564cf 100644 --- a/modules/local/select_pointfinder.nf +++ b/modules/local/select_pointfinder.nf @@ -11,6 +11,11 @@ process IDENTIFY_POINTDB { tuple val(meta), val(point_finder_val), emit: pointfinder_db exec: + if(workflow.stubRun){ + // may need to add in a return statment here + point_finder_val = "stub" + return + } def species_data = species.split('_|\s') // tokenize string species_data = species_data*.toLowerCase() diff --git a/modules/local/seqtk_sample.nf b/modules/local/seqtk_sample.nf index cb67d876..5c3e811c 100644 --- a/modules/local/seqtk_sample.nf +++ b/modules/local/seqtk_sample.nf @@ -31,4 +31,11 @@ process SEQTK_SAMPLE{ $cmd cat <<-END_VERSIONS > versions.yml\n"${task.process}":\n seqtk: \$(echo \$(seqtk 2>&1) | sed 's/^.*Version: //; s/ .*\$//')\nEND_VERSIONS """ + + stub: + sample_fraction = 0.5 + """ + touch stub${params.seqtk.reads_ext} + touch versions.yml + """ } diff --git a/modules/local/shigeifinder.nf b/modules/local/shigeifinder.nf index 8f88bd1d..282e3ef8 100644 --- a/modules/local/shigeifinder.nf +++ b/modules/local/shigeifinder.nf @@ -27,4 +27,10 @@ process SHIGEIFINDER { shigeifinder: $VERSION END_VERSIONS """ + + stub: + """ + touch stub${params.shigeifinder.tsv_ext} + touch versions.yml + """ } diff --git a/modules/local/sistr.nf b/modules/local/sistr.nf index a21c0b46..c9d74f10 100644 --- a/modules/local/sistr.nf +++ b/modules/local/sistr.nf @@ -16,9 +16,6 @@ process SISTR { tuple val(meta), path("*${params.sistr.cgmlst_ext}") , emit: cgmlst_csv path "versions.yml" , emit: versions - when: - task.ext.when == null || task.ext.when - script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" @@ -45,4 +42,13 @@ process SISTR { sistr: \$(echo \$(sistr --version 2>&1) | sed 's/^.*sistr_cmd //; s/ .*\$//' ) END_VERSIONS """ + + stub: + """ + touch stub${params.sistr.tsv_ext} + touch stub${params.sistr.allele_fasta_ext} + touch stub${params.sistr.allele_json_ext} + touch stub${params.sistr.cgmlst_ext} + touch versions.yml + """ } diff --git a/modules/local/spades_assemble.nf b/modules/local/spades_assemble.nf index ad6d58ce..83efed54 100644 --- a/modules/local/spades_assemble.nf +++ b/modules/local/spades_assemble.nf @@ -65,5 +65,16 @@ implemented and requires paired end reads. Therefore typical De-Novo assembly wi END_VERSIONS """ + stub: + """ + touch stub${params.spades.scaffolds_ext} + touch stub${params.spades.contigs_ext} + touch stub${params.spades.transcripts_ext} + touch stub${params.spades.gene_clusters_ext} + touch stub${params.spades.assembly_graphs_ext} + touch stub${params.spades.log_ext} + touch versions.yml + """ + } diff --git a/modules/local/spatyper.nf b/modules/local/spatyper.nf index 15f3253f..8d6e1a51 100644 --- a/modules/local/spatyper.nf +++ b/modules/local/spatyper.nf @@ -34,4 +34,10 @@ process SPATYPER { spatyper: \$( echo \$(spaTyper --version 2>&1) | sed 's/^.*spaTyper //' ) END_VERSIONS """ + + stub: + """ + touch stub${params.spatyper.tsv_ext} + touch versions.yml + """ } diff --git a/modules/local/staramr.nf b/modules/local/staramr.nf index 87750b54..e7f3553c 100644 --- a/modules/local/staramr.nf +++ b/modules/local/staramr.nf @@ -55,6 +55,20 @@ process STARAMR { END_VERSIONS """ + stub: + prefix = "stub" + """ + mkdir stub + touch stub/summary${params.staramr.tsv_ext} + touch stub/detailed_summary${params.staramr.tsv_ext} + touch stub/resfinder${params.staramr.tsv_ext} + touch stub/pointfinder${params.staramr.tsv_ext} + touch stub/plasmidfinder${params.staramr.tsv_ext} + touch stub/mlst${params.staramr.tsv_ext} + touch stub/settings${params.staramr.txt_ext} + touch stub/results${params.staramr.xlsx_ext} + touch versions.yml + """ diff --git a/modules/local/staramr_version.nf b/modules/local/staramr_version.nf index cc78970d..3b1b0fd1 100644 --- a/modules/local/staramr_version.nf +++ b/modules/local/staramr_version.nf @@ -28,4 +28,10 @@ process STARAMR_DUMP_DB_VERSIONS { END_VERSIONS """ + stub: + """ + touch StarAMRDBVersions.txt + touch versions.yml + """ + } diff --git a/modules/local/unicycler_assemble.nf b/modules/local/unicycler_assemble.nf index 163eb7fc..1aa5c7e6 100644 --- a/modules/local/unicycler_assemble.nf +++ b/modules/local/unicycler_assemble.nf @@ -41,4 +41,12 @@ process UNICYCLER_ASSEMBLE { END_VERSIONS """ + stub: + """ + touch stub${params.unicycler.scaffolds_ext} + touch stub${params.unicycler.assembly_ext} + touch stub${params.unicycler.log_ext} + touch versions.yml + """ + }