Skip to content

Commit cb316ff

Browse files
author
Zachary Foster
committed
make sure version information is collected from all proceses
1 parent d3e5607 commit cb316ff

17 files changed

Lines changed: 49 additions & 12 deletions

File tree

assets/main_report/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/.quarto/

assets/main_report/index.qmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Pathogen Surveillance Report
33
params:
4-
inputs: ""
4+
inputs: "~/downloads/_no_group_defined__inputs"
55
execute:
66
echo: false
77
bibliography: references.bib

conf/modules.config

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ process {
203203
ext.args = { secrets.NCBI_API_KEY ? "--api-key ${secrets.NCBI_API_KEY}" : "" }
204204

205205
// Settings to avoid API rate limits and not put too much stress on servers
206-
maxForks = 1 // NCBI seems to be not allowing concurrent downloads with this command, althogh I cannot find any documentation about this
206+
maxForks = 1 // NCBI seems to be not allowing concurrent downloads with this command, although I cannot find any documentation about this
207207
errorStrategy = { task.attempt >= 3 ? 'ignore' : 'retry' }
208208
beforeScript = { task.attempt == 1 ? 'sleep "0.$(($RANDOM % 100))"' : "sleep ${Math.pow(5, task.attempt)}" }
209209
}
@@ -212,6 +212,7 @@ process {
212212
publishDir = [
213213
enabled: false
214214
]
215+
ext.args = { "--dosage 1000000 --full-annot -n --align-off" }
215216
}
216217

217218
withName: FASTP {
@@ -229,7 +230,10 @@ process {
229230
cpus = { 2 * task.attempt }
230231
memory = { 8.GB * task.attempt }
231232
time = { 12.h * task.attempt }
232-
ext.args = { params.temp_dir ? "--dir ${params.temp_dir} --quiet" : "--quiet" }
233+
ext.args = { [
234+
params.temp_dir ? "--dir ${params.temp_dir}" : "",
235+
"--quiet"
236+
].minus("").join(" ") }
233237
}
234238

235239
withName: FILTER_ASSEMBLY {
@@ -251,7 +255,10 @@ process {
251255
memory = { 1.GB * task.attempt }
252256
time = { 12.h * task.attempt }
253257
storeDir = { params.data_dir == "false" ? null : "${params.data_dir}/assembly_metadata" }
254-
ext.args = { secrets.NCBI_API_KEY ? "--as-json-lines --api-key ${secrets.NCBI_API_KEY}" : "--as-json-lines" }
258+
ext.args = { [
259+
secrets.NCBI_API_KEY ? "--api-key ${secrets.NCBI_API_KEY}": "",
260+
"--as-json-lines"
261+
].minus("").join(" ") }
255262
maxRetries = 2
256263

257264
// Settings to avoid API rate limits and not put too much stress on servers

docs/usage.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,12 @@ The reference metadata TSV or the sample metadata TSV can have the following col
9999
The typical command for running the pipeline is as follows:
100100

101101
```bash
102-
nextflow run nf-core/pathogensurveillance -profile <REPLACE WITH RUN TOOL> -resume --input <REPLACE WITH TSV/CSV> --outdir <REPLACE WITH OUTPUT PATH>
102+
nextflow run nf-core/pathogensurveillance -profile <REPLACE WITH PACKAGE MANAGER> -resume --input <REPLACE WITH TSV/CSV> --outdir <REPLACE WITH OUTPUT PATH>
103103
```
104104

105105
Where:
106106

107-
- `<REPLACE WITH RUN TOOL>` is one of docker, singularity, podman, shifter, charliecloud, or conda
107+
- `<REPLACE WITH PACKAGE MANAGER>` is one of docker, singularity, podman, shifter, charliecloud, or conda
108108
- `<REPLACE WITH TSV/CSV>` is the path to the input samplesheet
109109
- `<REPLACE WITH OUTPUT PATH>` is the path to where to save the output
110110

modules/local/download_assemblies/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Dockerfile to create container with Cell Ranger v8.0.0 and bcl2fastq v2.20.0
1+
# Dockerfile to create container with ncbi-datasets-cli=16.0.0 and unzip and bioconda::samtools=1.18
22
# Push to nfcore/ncbi-datasets-cli:<VER>
33

44
FROM condaforge/mambaforge:23.1.0-4

modules/local/extract_feature_sequences/main.nf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ process EXTRACT_FEATURE_SEQUENCES {
1818
task.ext.when == null || task.ext.when
1919

2020
script:
21+
def args = task.ext.args ?: ''
2122
prefix = task.ext.prefix ?: "${ref_meta.id}"
2223
"""
23-
# Set dosage ultra high to include all high copy sequences per strain, just get everything
24-
align_feature_sequences_mod.pl --dosage 1000000 --full-annot -i PIRATE.gene_families.ordered.tsv -g modified_gffs/ -o ${prefix}_feature_sequences/ -p ${task.cpus} -n --align-off
24+
align_feature_sequences_mod.pl ${args} -i PIRATE.gene_families.ordered.tsv -g modified_gffs/ -o ${prefix}_feature_sequences/ -p ${task.cpus}
2525
2626
cat <<-END_VERSIONS > versions.yml
2727
"${task.process}":

modules/local/filter_assembly/main.nf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ process FILTER_ASSEMBLY {
2525
$args \\
2626
${prefix}_unzipped.fasta > ${prefix}_filtered.fasta
2727
28+
rm ${prefix}_unzipped.fasta
29+
2830
cat <<-END_VERSIONS > versions.yml
2931
"${task.process}":
3032
biopython: \$(python -c "import Bio; print(Bio.__version__)")

modules/local/graphtyper/genotype/main.nf

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,15 @@ process GRAPHTYPER_GENOTYPE {
5555
5656
# Move result files into working directory for output
5757
find results -maxdepth 2 -name '*.vcf*' > output_paths.txt
58-
sed 's_results/__g' output_paths.txt | sed 's|/|-|g' > output_names.txt
58+
sed -e 's|results/||g' -e sed 's|/|-|g' > output_names.txt
5959
paste -d ' ' output_paths.txt output_names.txt | xargs -I {} echo "mv {}" > mv_commands.sh
6060
source mv_commands.sh
6161
62+
# Clean up
63+
if [[ $ref =~ \\.gz\$ ]]; then
64+
rm __my__reference__.fasta
65+
fi
66+
6267
# Save version information for graphtyper
6368
cat <<-END_VERSIONS > versions.yml
6469
"${task.process}":

modules/local/main_report/main.nf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ process MAIN_REPORT {
3737
3838
# Rename outputs
3939
mv main_report/${prefix}_report/index.html ${prefix}_pathsurveil_report.html
40-
#mv main_report/${prefix}_report/index.pdf ${prefix}_pathsurveil_report.pdf
40+
41+
# Clean up
42+
rm -r main_report
4143
4244
# Save version of quarto used
4345
cat <<-END_VERSIONS > versions.yml

modules/local/make_gff_with_fasta/main.nf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ process MAKE_GFF_WITH_FASTA {
1212

1313
output:
1414
tuple val(meta), path("${prefix}.gff"), emit: gff
15+
path "versions.yml" , emit: versions
1516

1617
when:
1718
task.ext.when == null || task.ext.when
@@ -39,5 +40,10 @@ process MAKE_GFF_WITH_FASTA {
3940
# Rename output file to be just the sample ID and make sure input file does not have same name
4041
mv ${gff} input_${gff}
4142
mv ${prefix}_with_ref.gff ${prefix}.gff
43+
44+
cat <<-END_VERSIONS > versions.yml
45+
"${task.process}":
46+
sed: \$(sed --version | head -n 1 | sed 's/sed (GNU sed) //')
47+
END_VERSIONS
4248
"""
4349
}

0 commit comments

Comments
 (0)