diff --git a/.github/workflows/nextflow-test.yml b/.github/workflows/nextflow-test.yml index b420e25..fa518c0 100644 --- a/.github/workflows/nextflow-test.yml +++ b/.github/workflows/nextflow-test.yml @@ -8,4 +8,19 @@ jobs: steps: - uses: actions/checkout@v1 - name: Help_test - run: curl -s https://get.nextflow.io | bash && ./nextflow run phage.nf --help \ No newline at end of file + run: curl -s https://get.nextflow.io | bash && ./nextflow run phage.nf --help + - name: fasta dry run whole wf + run: | + ./nextflow run phage.nf --fasta ./test-data/stub_genome.fasta -stub -profile stub --cores 2 --max_cores 2 + - name: fasta dry run identify only + run: | + ./nextflow run phage.nf --fasta ./test-data/stub_genome.fasta -stub -profile stub --cores 2 --max_cores 2 --identify + - name: fasta dry run annotate only + run: | + ./nextflow run phage.nf --fasta ./test-data/stub_genome.fasta -stub -profile stub --cores 2 --max_cores 2 --annotate + - name: fasta dry run remove some tools 1 + run: | + ./nextflow run phage.nf --fasta ./test-data/stub_genome.fasta -stub -profile stub --cores 2 --max_cores 2 --dv --mp --pp --sm --vb + - name: fasta dry run remove some tools 2 + run: | + ./nextflow run phage.nf --fasta ./test-data/stub_genome.fasta -stub -profile stub --cores 2 --max_cores 2 --vf --vn --vs --ph --vs2 --sk \ No newline at end of file diff --git a/bin/heatmap_mqt.R b/bin/heatmap_mqt.R index d1144c0..9773b5a 100644 --- a/bin/heatmap_mqt.R +++ b/bin/heatmap_mqt.R @@ -1,4 +1,4 @@ -#docker run --rm -it -v $PWD:/input rocker/tidyverse:4.1.1 R +#docker run --rm -it -v $PWD:/input multifractal/ggplots:v4.1.1 library(purrr) library(readr) install.packages("readr") diff --git a/modules/checkV.nf b/modules/checkV.nf index 82de25e..7eb6f0e 100644 --- a/modules/checkV.nf +++ b/modules/checkV.nf @@ -15,4 +15,10 @@ process checkV { checkv quality_summary ${fasta} results #2> /dev/null cp results/quality_summary.tsv ${name}_quality_summary.tsv #2> /dev/null """ + stub: + """ + mkdir negative_result_${name}.txt + echo "contig_id contig_length genome_copies gene_count viral_genes host_genes checkv_quality miuvig_quality completeness completeness_method contamination provirus termini warnings" > ${name}_quality_summary.tsv + echo "pos_phage_0 146647 1.0 243 141 1 High-quality High-quality 97.03 AAI-based 0.0 No" >> ${name}_quality_summary.tsv + """ } \ No newline at end of file diff --git a/modules/chromomap.nf b/modules/chromomap.nf index 325dedc..060a99b 100644 --- a/modules/chromomap.nf +++ b/modules/chromomap.nf @@ -83,4 +83,11 @@ process chromomap { """ echo "nothing found" > sample_overview_${type}.html """ + stub: + """ + touch sample_overview_${type}.html + """ } + + + diff --git a/modules/databases/download_checkV_DB.nf b/modules/databases/download_checkV_DB.nf index ebf1ab5..88fe0a9 100644 --- a/modules/databases/download_checkV_DB.nf +++ b/modules/databases/download_checkV_DB.nf @@ -11,4 +11,8 @@ process download_checkV_DB { tar -zxvf checkv-db-v0.6.tar.gz rm checkv-db-v0.6.tar.gz """ + stub: + """ + mkdir -p checkv-db-v0.6 + """ } \ No newline at end of file diff --git a/modules/databases/download_pvog_DB.nf b/modules/databases/download_pvog_DB.nf index 662a3fa..5d3ce32 100644 --- a/modules/databases/download_pvog_DB.nf +++ b/modules/databases/download_pvog_DB.nf @@ -9,6 +9,10 @@ process pvog_DB { wget -nH ftp://ftp.ebi.ac.uk/pub/databases/metagenomics/viral-pipeline/hmmer_databases/pvogs.tar.gz && tar -zxvf pvogs.tar.gz rm pvogs.tar.gz """ + stub: + """ + mkdir -p pvogs + """ } process vogtable_DB { @@ -21,6 +25,10 @@ process vogtable_DB { """ wget -nH http://dmk-brain.ecn.uiowa.edu/pVOGs/downloads/VOGTable.txt """ + stub: + """ + touch VOGTable.txt + """ } /* diff --git a/modules/databases/download_references.nf b/modules/databases/download_references.nf index 8dc2f0a..daa6d1a 100644 --- a/modules/databases/download_references.nf +++ b/modules/databases/download_references.nf @@ -9,4 +9,8 @@ process download_references { git clone -b WtP-v0.9 https://github.com/mult1fractal/WtP_phage_reference_db-WtP_v0.9.0.git cat WtP_phage_reference_db-WtP_v0.9.0/fasta-files/*.fa > phage_references.fa """ + stub: + """ + touch phage_references.fa + """ } \ No newline at end of file diff --git a/modules/databases/phage_references_blastDB.nf b/modules/databases/phage_references_blastDB.nf index ab52ecf..2fdfefe 100644 --- a/modules/databases/phage_references_blastDB.nf +++ b/modules/databases/phage_references_blastDB.nf @@ -14,6 +14,11 @@ process phage_references_blastDB { mkdir phage_blast_DB && mv phage_db.* phage_blast_DB tar czf blast_database.tar.gz phage_blast_DB/ """ + stub: + """ + mkdir phage_blast_DB + tar czf blast_database.tar.gz phage_blast_DB/ + """ } //phage_blast_DB/phage_db.* \ No newline at end of file diff --git a/modules/databases/ppr_download_dependencies.nf b/modules/databases/ppr_download_dependencies.nf index e22aa07..b9dbd2b 100644 --- a/modules/databases/ppr_download_dependencies.nf +++ b/modules/databases/ppr_download_dependencies.nf @@ -8,4 +8,8 @@ process ppr_download_dependencies { """ git clone https://github.com/Stormrider935/PPR-Meta.git """ + stub: + """ + mkdir -p PPR-Meta + """ } \ No newline at end of file diff --git a/modules/databases/sourmash_download_DB.nf b/modules/databases/sourmash_download_DB.nf index 90b915a..14b99af 100644 --- a/modules/databases/sourmash_download_DB.nf +++ b/modules/databases/sourmash_download_DB.nf @@ -3,12 +3,16 @@ process sourmash_download_DB { else { storeDir "${params.databases}/sourmash/" } label 'sourmash' input: - file(references) + path(references) output: - file("phages.sbt.zip") + path("phages.sbt.zip") script: """ sourmash compute --scaled 100 -k 21 --singleton --seed 42 -p 8 -o phages.sig ${references} sourmash index phages.sbt.zip phages.sig """ + stub: + """ + touch phages.sbt.zip + """ } diff --git a/modules/databases/vibrant_download_DB.nf b/modules/databases/vibrant_download_DB.nf index 2d1b407..47bede4 100644 --- a/modules/databases/vibrant_download_DB.nf +++ b/modules/databases/vibrant_download_DB.nf @@ -15,6 +15,11 @@ process vibrant_download_DB { cp /opt/conda/share/vibrant-1.0.1/files/VIBRANT*.{tsv,sav} database tar -czf database.tar.gz database/ """ + stub: + """ + mkdir database + tar -czf database.tar.gz database/ + """ } diff --git a/modules/databases/virsorter2_download_DB.nf b/modules/databases/virsorter2_download_DB.nf index 765a940..60d6696 100644 --- a/modules/databases/virsorter2_download_DB.nf +++ b/modules/databases/virsorter2_download_DB.nf @@ -11,5 +11,9 @@ process virsorter2_download_DB { chmod -R a+rX db rm db.tgz """ + stub: + """ + mkdir -p db + """ } diff --git a/modules/databases/virsorter_download_DB.nf b/modules/databases/virsorter_download_DB.nf index a6efd27..8c6aeb2 100644 --- a/modules/databases/virsorter_download_DB.nf +++ b/modules/databases/virsorter_download_DB.nf @@ -10,6 +10,10 @@ process virsorter_download_DB { tar -xvzf virsorter-data-v2.tar.gz rm virsorter-data-v2.tar.gz """ + stub: + """ + mkdir -p virsorter-data + """ } diff --git a/modules/hmmscan.nf b/modules/hmmscan.nf index 64123f3..24e8106 100644 --- a/modules/hmmscan.nf +++ b/modules/hmmscan.nf @@ -10,6 +10,10 @@ process hmmscan { """ hmmscan --cpu ${task.cpus} ${params.hmm_params} --noali --domtblout ${name}_${pvog_db}_hmmscan.tbl ${pvog_db}/${pvog_db}.hmm ${faa} """ + stub: + """ + touch ${name}_${pvog_db}_hmmscan.tbl + """ } diff --git a/modules/hue_heatmap.nf b/modules/hue_heatmap.nf index a05f984..9abdafc 100644 --- a/modules/hue_heatmap.nf +++ b/modules/hue_heatmap.nf @@ -10,4 +10,8 @@ process hue_heatmap { """ hue_heatmap_plot.py --input *.tsv --output ${name}_phage-distribution.pdf """ + stub: + """ + touch ${name}_phage-distribution.pdf + """ } \ No newline at end of file diff --git a/modules/input_suffix_check.nf b/modules/input_suffix_check.nf index e462e89..0b75064 100644 --- a/modules/input_suffix_check.nf +++ b/modules/input_suffix_check.nf @@ -1,9 +1,9 @@ process input_suffix_check { label 'ubuntu' input: - tuple val(name), file(file) + tuple val(name), path(file) output: - tuple val(name), file("${name}.fa") + tuple val(name), path("${name}.fa") script: """ case "${file}" in @@ -32,6 +32,10 @@ process input_suffix_check { # remove empty lines sed '/^\$/d' -i ${name}.fa """ + stub: + """ + touch ${name}.fa + """ } diff --git a/modules/normalize_contig_size.nf b/modules/normalize_contig_size.nf index 2b5f27c..22c935b 100644 --- a/modules/normalize_contig_size.nf +++ b/modules/normalize_contig_size.nf @@ -8,5 +8,9 @@ process normalize_contig_size { """ cut.py --size 3000 --genome ${fasta} --outfile ${name}_fragments.fasta """ + stub: + """ + touch ${name}_fragments.fasta + """ } diff --git a/modules/parser/chromomap_parser.nf b/modules/parser/chromomap_parser.nf index 7082c80..e15eb37 100644 --- a/modules/parser/chromomap_parser.nf +++ b/modules/parser/chromomap_parser.nf @@ -24,4 +24,15 @@ process chromomap_parser { grep --no-messages -w "\$f1" annotationfile.tbl 1>> small/annotationfile.tbl || true done < small/chromosomefile.tbl """ + stub: + """ + mkdir small + mkdir large + + touch small/chromosomefile.tbl + touch small/annotationfile.tbl + + touch large/chromosomefile.tbl + touch large/annotationfile.tbl + """ } \ No newline at end of file diff --git a/modules/parser/filter_virnet.nf b/modules/parser/filter_virnet.nf index 028d32f..529bf3e 100644 --- a/modules/parser/filter_virnet.nf +++ b/modules/parser/filter_virnet.nf @@ -13,4 +13,8 @@ process filter_virnet { # extract correct positive contigs parse_virnet.py --input all_virnet_results.txt --output virnet_\${PWD##*/}.tsv """ + stub: + """ + mkdir touch virnet_\${PWD##*/}.tsv + """ } diff --git a/modules/prodigal.nf b/modules/prodigal.nf index 3774e2f..3ec3ba6 100644 --- a/modules/prodigal.nf +++ b/modules/prodigal.nf @@ -9,4 +9,8 @@ process prodigal { """ prodigal -p "meta" -a ${name}_prodigal.faa -i ${positive_contigs} """ + stub: + """ + touch ${name}_prodigal.faa + """ } diff --git a/modules/raw_data_collection/deepvirfinder_collect_data.nf b/modules/raw_data_collection/deepvirfinder_collect_data.nf index 193e81b..7a67e53 100644 --- a/modules/raw_data_collection/deepvirfinder_collect_data.nf +++ b/modules/raw_data_collection/deepvirfinder_collect_data.nf @@ -12,4 +12,9 @@ process deepvirfinder_collect_data { tail -q -n+2 ${output_lists} >> deepvirfinder/${name}_overview.txt tar -czf deepvirfinder_results_${name}.tar.gz deepvirfinder """ + stub: + """ + mkdir deepvirfinder + tar -czf deepvirfinder_results_${name}.tar.gz deepvirfinder + """ } diff --git a/modules/raw_data_collection/metaphinder_collect_data.nf b/modules/raw_data_collection/metaphinder_collect_data.nf index ad05f8f..49b6c27 100644 --- a/modules/raw_data_collection/metaphinder_collect_data.nf +++ b/modules/raw_data_collection/metaphinder_collect_data.nf @@ -2,9 +2,9 @@ process metaphinder_collect_data { publishDir "${params.output}/${name}/raw_data", mode: 'copy', pattern: "metaphinder_results_${name}.tar.gz" label 'ubuntu' input: - tuple val(name), file(output_lists), file(output_blasts) + tuple val(name), path(output_lists), path(output_blasts) output: - tuple val(name), file("metaphinder_results_${name}.tar.gz") + tuple val(name), path("metaphinder_results_${name}.tar.gz") script: """ mkdir -p metaphinder/blast_results @@ -13,15 +13,20 @@ process metaphinder_collect_data { cp ${output_blasts} metaphinder/blast_results tar -czf metaphinder_results_${name}.tar.gz metaphinder """ + stub: + """ + mkdir metaphinder + tar -czf metaphinder_results_${name}.tar.gz metaphinder + """ } process metaphinder_collect_data_ownDB { publishDir "${params.output}/${name}/raw_data", mode: 'copy', pattern: "metaphinder_ownDB_results_${name}.tar.gz" label 'ubuntu' input: - tuple val(name), file(output_lists), file(output_blasts) + tuple val(name), path(output_lists), path(output_blasts) output: - tuple val(name), file("metaphinder_ownDB_results_${name}.tar.gz") + tuple val(name), path("metaphinder_ownDB_results_${name}.tar.gz") script: """ mkdir -p metaphinder_ownDB/blast_results @@ -30,4 +35,9 @@ process metaphinder_collect_data_ownDB { cp ${output_blasts} metaphinder_ownDB/blast_results tar -czf metaphinder_ownDB_results_${name}.tar.gz metaphinder_ownDB """ + stub: + """ + mkdir metaphinder_ownDB + tar -czf metaphinder_ownDB_results_${name}.tar.gz metaphinder_ownDB + """ } \ No newline at end of file diff --git a/modules/raw_data_collection/phigaro_collect_data.nf b/modules/raw_data_collection/phigaro_collect_data.nf index bfb5ba4..595f923 100644 --- a/modules/raw_data_collection/phigaro_collect_data.nf +++ b/modules/raw_data_collection/phigaro_collect_data.nf @@ -11,4 +11,9 @@ process phigaro_collect_data { cp -r ${rawdir}/* phigaro tar -czf phigaro_results_${name}.tar.gz phigaro """ + stub: + """ + mkdir phigaro + tar -czf phigaro_results_${name}.tar.gz phigaro + """ } diff --git a/modules/raw_data_collection/pprmeta_collect_data.nf b/modules/raw_data_collection/pprmeta_collect_data.nf index ea0a566..bb09be9 100644 --- a/modules/raw_data_collection/pprmeta_collect_data.nf +++ b/modules/raw_data_collection/pprmeta_collect_data.nf @@ -2,9 +2,9 @@ process pprmeta_collect_data { publishDir "${params.output}/${name}/raw_data", mode: 'copy', pattern: "pprmeta_results_${name}.tar.gz" label 'ubuntu' input: - tuple val(name), file(output_lists) + tuple val(name), path(output_lists) output: - tuple val(name), file("pprmeta_results_${name}.tar.gz") + tuple val(name), path("pprmeta_results_${name}.tar.gz") script: """ cat ${output_lists} | head -1 > ${name}_overview.txt diff --git a/modules/raw_data_collection/sourmash_collect_data.nf b/modules/raw_data_collection/sourmash_collect_data.nf index 90a2e97..876147a 100644 --- a/modules/raw_data_collection/sourmash_collect_data.nf +++ b/modules/raw_data_collection/sourmash_collect_data.nf @@ -2,13 +2,18 @@ process sourmash_collect_data { publishDir "${params.output}/${name}/raw_data", mode: 'copy', pattern: "sourmash_results_${name}.tar.gz" label 'ubuntu' input: - tuple val(name), file(output_lists) + tuple val(name), path(output_lists) output: - tuple val(name), file("sourmash_results_${name}.tar.gz") + tuple val(name), path("sourmash_results_${name}.tar.gz") script: """ echo "similarity,name,filename,md5" > ${name}_overview.txt tail -q -n +2 ${output_lists} >> ${name}_overview.txt tar -czf sourmash_results_${name}.tar.gz ${name}_overview.txt """ + stub: + """ + touch ${name}_overview.txt + tar -czf sourmash_results_${name}.tar.gz ${name}_overview.txt + """ } \ No newline at end of file diff --git a/modules/raw_data_collection/vibrant_collect_data.nf b/modules/raw_data_collection/vibrant_collect_data.nf index 72436f9..3c9085f 100644 --- a/modules/raw_data_collection/vibrant_collect_data.nf +++ b/modules/raw_data_collection/vibrant_collect_data.nf @@ -2,9 +2,9 @@ process vibrant_collect_data { publishDir "${params.output}/${name}/raw_data", mode: 'copy', pattern: "vibrant_results_${name}.tar.gz" label 'ubuntu' input: - tuple val(name), file(output_lists), file(dirs) + tuple val(name), path(output_lists), path(dirs) output: - tuple val(name), file("vibrant_results_${name}.tar.gz") + tuple val(name), path("vibrant_results_${name}.tar.gz") script: """ mkdir -p vibrant/results @@ -13,6 +13,11 @@ process vibrant_collect_data { tail -q -n +2 ${output_lists} >> vibrant/${name}_overview.txt tar -czf vibrant_results_${name}.tar.gz vibrant """ + stub: + """ + mkdir vibrant + tar -czf vibrant_results_${name}.tar.gz vibrant + """ } @@ -20,9 +25,9 @@ process vibrant_virome_collect_data { publishDir "${params.output}/${name}/raw_data", mode: 'copy', pattern: "vibrant_virome_results_${name}.tar.gz" label 'ubuntu' input: - tuple val(name), file(output_lists), file(dirs) + tuple val(name), path(output_lists), path(dirs) output: - tuple val(name), file("vibrant_virome_results_${name}.tar.gz") + tuple val(name), path("vibrant_virome_results_${name}.tar.gz") script: """ mkdir -p vibrant/results @@ -31,4 +36,9 @@ process vibrant_virome_collect_data { tail -q -n +2 ${output_lists} >> vibrant/${name}_overview.txt tar -czf vibrant_virome_results_${name}.tar.gz vibrant """ + stub: + """ + mkdir vibrant + tar -czf vibrant_virome_results_${name}.tar.gz vibrant + """ } \ No newline at end of file diff --git a/modules/raw_data_collection/virfinder_collect_data.nf b/modules/raw_data_collection/virfinder_collect_data.nf index 5ffc7e4..860680d 100644 --- a/modules/raw_data_collection/virfinder_collect_data.nf +++ b/modules/raw_data_collection/virfinder_collect_data.nf @@ -11,4 +11,9 @@ process virfinder_collect_data { cp ${output_lists} virfinder tar -czf virfinder_results_${name}.tar.gz virfinder """ + stub: + """ + mkdir virfinder + tar -czf virfinder_results_${name}.tar.gz virfinder + """ } diff --git a/modules/raw_data_collection/virnet_collect_data.nf b/modules/raw_data_collection/virnet_collect_data.nf index 16d6a7e..0bc1cdc 100644 --- a/modules/raw_data_collection/virnet_collect_data.nf +++ b/modules/raw_data_collection/virnet_collect_data.nf @@ -11,4 +11,9 @@ process virnet_collect_data { tail -q -n+2 ${output_lists} >> ${name}_overview.txt tar -czf virnet_results_${name}.tar.gz ${name}_overview.txt """ + stub: + """ + touch ${name}_overview.txt + tar -czf virnet_results_${name}.tar.gz ${name}_overview.txt + """ } diff --git a/modules/raw_data_collection/virsorter2_collect_data.nf b/modules/raw_data_collection/virsorter2_collect_data.nf index a012b0a..0c5ec7a 100644 --- a/modules/raw_data_collection/virsorter2_collect_data.nf +++ b/modules/raw_data_collection/virsorter2_collect_data.nf @@ -11,4 +11,9 @@ process virsorter2_collect_data { cp -r ${rawdir}/* virsorter2 tar -czf virsorter2_results_${name}.tar.gz virsorter2 """ + stub: + """ + mkdir virsorter2 + tar -czf virsorter2_results_${name}.tar.gz virsorter2 + """ } diff --git a/modules/raw_data_collection/virsorter_collect_data.nf b/modules/raw_data_collection/virsorter_collect_data.nf index 60d3aad..f07baec 100644 --- a/modules/raw_data_collection/virsorter_collect_data.nf +++ b/modules/raw_data_collection/virsorter_collect_data.nf @@ -11,6 +11,11 @@ process virsorter_collect_data { cp ${tar_files} virsorter tar -czf virsorter_results_${name}.tar.gz virsorter """ + stub: + """ + mkdir virsorter + tar -czf virsorter_results_${name}.tar.gz virsorter + """ } process virsorter_virome_collect_data { @@ -26,4 +31,9 @@ process virsorter_virome_collect_data { cp ${tar_files} virsorter tar -czf virsorter_virome_results_${name}.tar.gz virsorter """ + stub: + """ + mkdir virsorter + tar -czf virsorter_virome_results_${name}.tar.gz virsorter + """ } \ No newline at end of file diff --git a/modules/samtools.nf b/modules/samtools.nf index a01c09e..a582429 100644 --- a/modules/samtools.nf +++ b/modules/samtools.nf @@ -22,6 +22,10 @@ process samtools { # old command # xargs samtools faidx all.fasta < tmp_allctgs.txt > ${name}_positive_contigs.fa """ + stub: + """ + touch ${name}_positive_contigs.fa + """ } process samtools_fastq { @@ -48,4 +52,8 @@ process samtools_fastq { # old command # xargs samtools faidx all.fasta < tmp_allctgs.txt > ${name}_positive_contigs.fa """ + stub: + """ + touch ${name}_positive_contigs.fa + """ } \ No newline at end of file diff --git a/modules/score_based_chunking.nf b/modules/score_based_chunking.nf index 6c6db25..d2cd311 100644 --- a/modules/score_based_chunking.nf +++ b/modules/score_based_chunking.nf @@ -16,6 +16,19 @@ process score_based_chunking { """ score_chunking.sh ${fasta} ${task.cpus} "0.9" "0.6" "0.3" """ + stub: + """ + mkdir contigs + touch contigs/highly_likely_contigs.fasta + touch contigs/likely_contigs.fasta + touch contigs/unlikely_contigs.fasta + touch contigs/not_likely_contigs.fasta + + ## phages-highly_likely=\$('1') + ## phages-likely=\$('2') + ## phages-unlikely=\$('3') + ## phages-not_likely=\$('4') + """ } /* diff --git a/modules/seqkit.nf b/modules/seqkit.nf index e8e8391..207ec7c 100644 --- a/modules/seqkit.nf +++ b/modules/seqkit.nf @@ -8,4 +8,8 @@ process seqkit { """ seqkit seq -m ${params.filter} ${fasta} > ${name}_filtered.fa """ + stub: + """ + touch ${name}_filtered.fa + """ } \ No newline at end of file diff --git a/modules/setup_container.nf b/modules/setup_container.nf index ba24b0c..bf0201c 100644 --- a/modules/setup_container.nf +++ b/modules/setup_container.nf @@ -23,6 +23,10 @@ process setup_container { download_singularity.sh ${config_file} ${workflow.launchDir}/${params.cachedir} fi + touch everything_done.txt + """ + stub: + """ touch everything_done.txt """ } diff --git a/modules/shuffle_reads_nts.nf b/modules/shuffle_reads_nts.nf index 78d677f..530e169 100644 --- a/modules/shuffle_reads_nts.nf +++ b/modules/shuffle_reads_nts.nf @@ -32,5 +32,9 @@ process shuffle_reads_nts { shuffled.close fastq.close """ +stub: + """ + touch ${name}_shuffled.fastq + """ } diff --git a/modules/sourmash_for_tax.nf b/modules/sourmash_for_tax.nf index 9102875..3bb67b4 100644 --- a/modules/sourmash_for_tax.nf +++ b/modules/sourmash_for_tax.nf @@ -3,10 +3,10 @@ process sourmash_for_tax { label 'sourmash' // errorStrategy 'ignore' input: - tuple val(name), val(category), file(fasta_dir) + tuple val(name), val(category), path(fasta_dir) file(database) output: - tuple val(name), val(category), file("${name}_tax-class.tsv") + tuple val(name), val(category), path("${name}_tax-class.tsv") shell: """ for fastafile in ${fasta_dir}/*.fa; do @@ -49,6 +49,10 @@ process sourmash_for_tax { done sed -i 1i"contig\tprediction_value\tpredicted_organism_name" ${name}_tax-class.tsv """ + stub: + """ + touch ${name}_tax-class.tsv + """ } /* diff --git a/modules/split_multi_fasta.nf b/modules/split_multi_fasta.nf index cb0c786..5710cec 100644 --- a/modules/split_multi_fasta.nf +++ b/modules/split_multi_fasta.nf @@ -19,6 +19,10 @@ process split_multi_fasta { fi done < ${fasta} """ + stub: + """ + mkdir ${name}_contigs/ + """ } process split_multi_fasta_2 { @@ -42,4 +46,8 @@ process split_multi_fasta_2 { fi done < ${fasta} """ + stub: + """ + mkdir ${name}_contigs/ + """ } \ No newline at end of file diff --git a/modules/tools/deepvirfinder.nf b/modules/tools/deepvirfinder.nf index 0ba12ae..8e4797a 100644 --- a/modules/tools/deepvirfinder.nf +++ b/modules/tools/deepvirfinder.nf @@ -10,4 +10,9 @@ process deepvirfinder { dvf.py -c ${task.cpus} -i ${fasta} -o ${name} cp ${name}/*.txt ${name}_\${PWD##*/}.list """ + stub: + """ + echo "name len score pvalue" > ${name}_\${PWD##*/}.list + echo "pos_phage_6 43851 0.9999517202377319 0.0011518996903089357" >> ${name}_\${PWD##*/}.list + """ } \ No newline at end of file diff --git a/modules/tools/metaphinder.nf b/modules/tools/metaphinder.nf index 5016a12..1d4c582 100644 --- a/modules/tools/metaphinder.nf +++ b/modules/tools/metaphinder.nf @@ -14,6 +14,12 @@ process metaphinder { mv ${name}/output.txt ${name}_\${PWD##*/}.list mv ${name}/blast.out ${name}_\${PWD##*/}_blast.out """ + stub: + """ + echo "#contigID classification ANI [%] merged coverage [%] number of hits size[bp]" > ${name}_\${PWD##*/}.list + echo "pos_phage_0 phage 80.754 96.97 172 146647" >> ${name}_\${PWD##*/}.list + touch ${name}_\${PWD##*/}_blast.out + """ } @@ -36,4 +42,10 @@ process metaphinder_own_DB { mv ${name}/output.txt ${name}_\${PWD##*/}.list mv ${name}/blast.out ${name}_\${PWD##*/}_blast.out """ + stub: + """ + echo "#contigID classification ANI [%] merged coverage [%] number of hits size[bp]" > ${name}_\${PWD##*/}.list + echo "pos_phage_0 phage 80.754 96.97 172 146647" >> ${name}_\${PWD##*/}.list + touch ${name}_\${PWD##*/}_blast.out + """ } diff --git a/modules/tools/phigaro.nf b/modules/tools/phigaro.nf index 324693f..805dc3d 100644 --- a/modules/tools/phigaro.nf +++ b/modules/tools/phigaro.nf @@ -12,7 +12,15 @@ process phigaro { cat output/phigaro.txt | awk -v score="1" -F"," 'BEGIN { OFS = "\\t" } {\$2=score; print}' > output/phigaro_\${PWD##*/}.tsv echo "" >> output/phigaro_\${PWD##*/}.tsv sed '\${/^\$/d}' output/phigaro_\${PWD##*/}.tsv - """ + """ + stub: + """ + mkdir output + touch output/phigaro_\${PWD##*/}.tsv + echo "#contigID classification ANI [%] merged coverage [%] number of hits size[bp]" > ${name}_\${PWD##*/}.list + echo "pos_phage_0 phage 80.754 96.97 172 146647" >> ${name}_\${PWD##*/}.list + touch ${name}_\${PWD##*/}_blast.out + """ } // echo "" will attach the new line to the last line diff --git a/modules/tools/pprmeta.nf b/modules/tools/pprmeta.nf index 5e5967f..07c82f0 100644 --- a/modules/tools/pprmeta.nf +++ b/modules/tools/pprmeta.nf @@ -2,15 +2,20 @@ process pprmeta { label 'pprmeta' errorStrategy 'ignore' input: - tuple val(name), file(fasta) + tuple val(name), path(fasta) file(depts) output: - tuple val(name), file("${name}_*.csv") + tuple val(name), path("${name}_*.csv") script: """ cp ${depts}/* . ./PPR_Meta ${fasta} ${name}_\${PWD##*/}.csv """ + stub: + """ + echo "Header,Length,phage_score,chromosome_score,plasmid_score,Possible_source" > ${name}_\${PWD##*/}.csv + echo "pos_phage_0,146647,0.896779561895599,0.0204569467278726,0.0827634909322214,phage" >> ${name}_\${PWD##*/}.csv + """ } // .fasta is not working here. has to be .fa diff --git a/modules/tools/seeker.nf b/modules/tools/seeker.nf index e909853..a3c4da8 100644 --- a/modules/tools/seeker.nf +++ b/modules/tools/seeker.nf @@ -10,4 +10,9 @@ process seeker { predict-metagenome ${fasta} > ${name}.tsv cp ${name}.tsv ${name}_\${PWD##*/}.list """ + stub: + """ + echo "name prediction score" > ${name}_\${PWD##*/}.list + echo "pos_phage_0 Phage 0.82" >> ${name}_\${PWD##*/}.list + """ } diff --git a/modules/tools/sourmash.nf b/modules/tools/sourmash.nf index 76fa9a5..c466e0f 100644 --- a/modules/tools/sourmash.nf +++ b/modules/tools/sourmash.nf @@ -28,6 +28,11 @@ process sourmash { fi done """ + stub: + """ + echo "similarity,name,filename,md5" > ${name}_\${PWD##*/}.list + echo "pos_phage_1,1.0" >> ${name}_\${PWD##*/}.list + """ } /* diff --git a/modules/tools/vibrant.nf b/modules/tools/vibrant.nf index 387c22f..c8bc101 100644 --- a/modules/tools/vibrant.nf +++ b/modules/tools/vibrant.nf @@ -2,12 +2,12 @@ process vibrant { label 'vibrant' errorStrategy 'ignore' input: - tuple val(name), file(fasta) + tuple val(name), path(fasta) path(db) output: - tuple val(name), file("vibrant_*.tsv") + tuple val(name), path("vibrant_*.tsv") // output collection stream - tuple val(name), file("vibrant_*.tsv"), file("VIBRANT_results_*.tar.gz") + tuple val(name), path("vibrant_*.tsv"), path("VIBRANT_results_*.tar.gz") script: """ @@ -30,8 +30,17 @@ process vibrant { tar cf VIBRANT_results_\${PWD##*/}.tar.gz VIBRANT_* """ + stub: + """ + echo "scaffold prediction" > vibrant_\${PWD##*/}.tsv + echo "pos_phage_1 virus" >> vibrant_\${PWD##*/}.tsv + mkdir VIBRANT_results_\${PWD##*/}.tar.gz + """ + } + + process vibrant_virome { label 'vibrant' errorStrategy 'ignore' @@ -65,6 +74,12 @@ process vibrant_virome { tar cf VIBRANT_results_\${PWD##*/}.tar.gz VIBRANT_* """ + stub: + """ + echo "scaffold prediction" > vibrant_\${PWD##*/}.tsv + echo "pos_phage_1 virus" >> vibrant_\${PWD##*/}.tsv + mkdir VIBRANT_results_\${PWD##*/}.tar.gz + """ } /* diff --git a/modules/tools/virfinder.nf b/modules/tools/virfinder.nf index e6d52f3..751b84a 100644 --- a/modules/tools/virfinder.nf +++ b/modules/tools/virfinder.nf @@ -2,12 +2,17 @@ process virfinder { label 'virfinder' errorStrategy 'ignore' input: - tuple val(name), file(fasta) + tuple val(name), path(fasta) output: - tuple val(name), file("${name}_*.list") + tuple val(name), path("${name}_*.list") script: """ virfinder_execute.R ${fasta} cp results.txt ${name}_\${PWD##*/}.list """ + stub: + """ + echo " name length score pvalue" > ${name}_\${PWD##*/}.list + echo "6 pos_phage_5 43293 0.9926088 0.001940335" >> ${name}_\${PWD##*/}.list + """ } \ No newline at end of file diff --git a/modules/tools/virnet.nf b/modules/tools/virnet.nf index ed13a0f..aff89d4 100644 --- a/modules/tools/virnet.nf +++ b/modules/tools/virnet.nf @@ -2,11 +2,16 @@ process virnet { errorStrategy 'ignore' label 'virnet' input: - tuple val(name), file(fasta) + tuple val(name), path(fasta) output: - tuple val(name), file("${name}_*.csv") + tuple val(name), path("${name}_*.csv") script: """ python3 /virnet/predict.py --model_dir /virnet/data/saved_model --input_dim=3000 --input=${fasta} --output=${name}_\${PWD##*/}.csv """ -} \ No newline at end of file + stub: + """ + echo ",ID,DESC,score,result" > ${name}_\${PWD##*/}.csv + echo "0,"pos_phage_0,5e17de4f-ad9e-4fbd-a34d-32e2330ee0cc","pos_phage_0,5e17de4f-ad9e-4fbd-a34d-32e2330ee0cc",0.1751683,0" >> ${name}_\${PWD##*/}.csv + """ +} diff --git a/modules/tools/virsorter.nf b/modules/tools/virsorter.nf index 9d0bea4..73ca102 100644 --- a/modules/tools/virsorter.nf +++ b/modules/tools/virsorter.nf @@ -12,7 +12,13 @@ process virsorter { """ wrapper_phage_contigs_sorter_iPlant.pl -f ${fasta} -db 2 --wdir virsorter --ncpu \$(( ${task.cpus} * 2 )) --data-dir ${database} cat virsorter/Predicted_viral_sequences/VIRSorter*.fasta | grep ">" > virsorter_categorized_contigs_\${PWD##*/}.list - + tar cf virsorter_results_\${PWD##*/}.tar virsorter + """ + stub: + """ + echo ">VIRSorter_pos_phage_7-cat_1" > virsorter_categorized_contigs_\${PWD##*/}.list + echo "VIRSorter_pos_phage_7-cat_1" >> virsorter_categorized_contigs_\${PWD##*/}.list + mkdir virsorter tar cf virsorter_results_\${PWD##*/}.tar virsorter """ } @@ -31,7 +37,13 @@ process virsorter_virome { """ wrapper_phage_contigs_sorter_iPlant.pl -f ${fasta} -db 2 --virome --wdir virsorter --ncpu \$(( ${task.cpus} * 2 )) --data-dir ${database} cat virsorter/Predicted_viral_sequences/VIRSorter*.fasta | grep ">" > virsorter_categorized_contigs_\${PWD##*/}.list - + tar cf virsorter_results_\${PWD##*/}.tar virsorter + """ + stub: + """ + echo ">VIRSorter_pos_phage_7-cat_1" > virsorter_categorized_contigs_\${PWD##*/}.list + echo "VIRSorter_pos_phage_7-cat_1" >> virsorter_categorized_contigs_\${PWD##*/}.list + mkdir virsorter tar cf virsorter_results_\${PWD##*/}.tar virsorter """ } \ No newline at end of file diff --git a/modules/tools/virsorter2.nf b/modules/tools/virsorter2.nf index e891f21..d241f49 100644 --- a/modules/tools/virsorter2.nf +++ b/modules/tools/virsorter2.nf @@ -14,9 +14,16 @@ process virsorter2 { -i ${fasta} \ -j ${task.cpus} """ + stub: + """ + mkdir virsorter2_\${PWD##*/}.out + echo "seqname dsDNAphage NCLDV RNA ssDNA lavidaviridae" > virsorter2_\${PWD##*/}.out/final-viral-score.tsv + echo "pos_phage_0 1 0.133 0.005 0.14 0.04" >> virsorter2_\${PWD##*/}.out/final-viral-score.tsv + """ } + // tar cf virsorter2_results_\${PWD##*/}.out.tar virsorter2_\${PWD##*/}.out // diff --git a/modules/upsetr.nf b/modules/upsetr.nf index dc64575..0bede7a 100644 --- a/modules/upsetr.nf +++ b/modules/upsetr.nf @@ -38,4 +38,8 @@ process upsetr_plot { dev.off() """ + stub: + """ + touch upsetr.svg + """ } \ No newline at end of file diff --git a/nextflow.config b/nextflow.config index 93c4ad9..27520c7 100644 --- a/nextflow.config +++ b/nextflow.config @@ -84,6 +84,12 @@ profiles { fasta = true } } + + stub { + + params.cores = 2 + + } //executer local { diff --git a/phage.nf b/phage.nf index d28fb21..93f4692 100755 --- a/phage.nf +++ b/phage.nf @@ -72,6 +72,7 @@ if ( workflow.profile == 'standard' ) { exit 1, "NO VALID EXECUTION PROFILE SELE if ( workflow.profile.contains('singularity') || workflow.profile.contains('ukj_cloud') || + workflow.profile.contains('stub') || workflow.profile.contains('docker') ) { "engine selected" } else { exit 1, "No engine selected: -profile EXECUTER,ENGINE" } @@ -84,6 +85,7 @@ if ( workflow.profile.contains('slurm') || workflow.profile.contains('lsf') || workflow.profile.contains('ukj_cloud') || + workflow.profile.contains('stub') || workflow.profile.contains('git_action') ) { "executer selected" } else { exit 1, "No executer selected: -profile EXECUTER,ENGINE" } @@ -148,7 +150,6 @@ if (!params.setup && !workflow.profile.contains('test') && !workflow.profile.con include { filter_vibrant; filter_vibrant_virome } from './modules/parser/filter_vibrant' include { filter_virfinder } from './modules/parser/filter_virfinder' include { filter_virnet } from './modules/parser/filter_virnet' - include { filter_virsorter2 } from './modules/parser/filter_virsorter2' include { filter_virsorter; filter_virsorter_virome } from './modules/parser/filter_virsorter' include { hmmscan } from './modules/hmmscan' include { input_suffix_check } from './modules/input_suffix_check' diff --git a/test-data/stub_genome.fasta b/test-data/stub_genome.fasta new file mode 100644 index 0000000..9039bea --- /dev/null +++ b/test-data/stub_genome.fasta @@ -0,0 +1,2 @@ +>stubbi +ACTGCCCCTT \ No newline at end of file