Skip to content

Commit 13d21dc

Browse files
committed
add chopper, porechop, and savont
1 parent 53d81c5 commit 13d21dc

19 files changed

Lines changed: 941 additions & 67 deletions

File tree

conf/modules.config

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,20 @@ process {
4141
]
4242
}
4343

44+
withName: PORECHOP_ABI {
45+
ext.prefix = { "${meta.id}.porechop_abi" }
46+
publishDir = [
47+
path: { "${params.outdir}/porechop_abi" },
48+
mode: params.publish_dir_mode,
49+
pattern: "*.log"
50+
]
51+
}
52+
53+
withName: CHOPPER {
54+
ext.args2 = "-q 16"
55+
ext.prefix = { "${meta.id}.chopper" }
56+
}
57+
4458
withName: CUTADAPT_BASIC {
4559
ext.args = { [
4660
"--minimum-length 1",
@@ -93,6 +107,31 @@ process {
93107
]
94108
}
95109

110+
withName: SAVONT_ASV {
111+
ext.args = { "$params.savont_options" }
112+
publishDir = [
113+
[
114+
path: { params.sample_inference == "pooled" ? "${params.outdir}/savont" : "${params.outdir}/savont/per-sample" },
115+
mode: params.publish_dir_mode,
116+
pattern: "*{_feature-table.tsv,_final_asvs.fasta,_savont.log}"
117+
],
118+
[
119+
path: { "${params.outdir}/savont/intermediate/${meta.id}" },
120+
mode: params.publish_dir_mode,
121+
enabled: params.save_intermediates
122+
]
123+
]
124+
}
125+
126+
withName: SAVONT_EXPORT {
127+
publishDir =
128+
[
129+
path: { "${params.outdir}/savont" },
130+
mode: params.publish_dir_mode,
131+
pattern: "*{_feature-table.tsv,_final_asvs.fasta,_savont.log}"
132+
]
133+
}
134+
96135
withName: CUTADAPT_TAXONOMY {
97136
ext.args = { "--discard-untrimmed --minimum-length 1 -g ${meta.fw_primer}...${meta.rv_primer_revcomp}" }
98137
ext.outformat = "fasta"

conf/test_savont.config

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/*
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
Nextflow config file for running minimal tests
4+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5+
Defines input files and everything required to run a fast and simple pipeline test.
6+
7+
Use as follows:
8+
nextflow run nf-core/ampliseq -profile test_savont,<docker/singularity> --outdir <OUTDIR>
9+
10+
----------------------------------------------------------------------------------------
11+
*/
12+
13+
process {
14+
resourceLimits = [
15+
cpus: 4,
16+
memory: '15.GB',
17+
time: '1.h'
18+
]
19+
}
20+
21+
params {
22+
config_profile_name = 'Test profile'
23+
config_profile_description = 'Minimal test dataset to check pipeline function with Savont'
24+
25+
// Input data
26+
input = "samplesheet_nanopore.tsv" //input = params.pipelines_testdata_base_path + "ampliseq/samplesheets/samplesheet_nanopore.tsv" // TODO
27+
metadata = "metadata_nanopore.tsv" //metadata = params.pipelines_testdata_base_path + "ampliseq/samplesheets/metadata_nanopore.tsv" // TODO
28+
nanopore = true
29+
skip_cutadapt = true
30+
sample_inference = "pooled"
31+
32+
// ASV postprocessing
33+
filter_ssu = "bac"
34+
min_len_asv = 1000
35+
36+
// Clean up - not needed
37+
min_samples = 2
38+
39+
// taxonomic classification
40+
dada_ref_taxonomy = "gtdb=R07-RS207"
41+
42+
// reduce runtime
43+
skip_alpha_rarefaction = true
44+
skip_diversity_indices = true
45+
46+
// Compare to expected
47+
expected_sequences = "expected_sequences_abundances/D6305-D6311_ZymoBIOMICS.STD.refseq.v2.ssrRNAs.unique.fasta"
48+
expected_sequences_mismatches = 10
49+
expected_abundances = "expected_sequences_abundances/D6305-D6311_ZymoBIOMICS.STD.refseq.v2.ssrRNAs.unique.abundance.tsv"
50+
51+
// restrict ANCOM analysis to higher taxonomic levels
52+
tax_agglom_max = 3
53+
54+
// Test ANCOMBC2
55+
ancombc2 = true
56+
}

modules.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
"https://github.com/nf-core/modules.git": {
66
"modules": {
77
"nf-core": {
8+
"chopper": {
9+
"branch": "master",
10+
"git_sha": "6d46786420b4d7bc88eba026eb389c0c5535d120",
11+
"installed_by": ["modules"]
12+
},
813
"clustalo/align": {
914
"branch": "master",
1015
"git_sha": "ad65d06c959cff1da9e94c4a972deaf7430931fa",
@@ -99,6 +104,11 @@
99104
"git_sha": "145b0a6fb5e6b56bccd9a030a1baf75b207ac250",
100105
"installed_by": ["modules"]
101106
},
107+
"porechop/abi": {
108+
"branch": "master",
109+
"git_sha": "6d46786420b4d7bc88eba026eb389c0c5535d120",
110+
"installed_by": ["modules"]
111+
},
102112
"seqtk/subseq": {
103113
"branch": "master",
104114
"git_sha": "a46713779030a5f508117080cbf4b693dd4c6e33",

modules/local/savont_asv.nf

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
process SAVONT_ASV {
2+
tag "$meta.id"
3+
label 'process_medium'
4+
label 'process_long'
5+
6+
conda "bioconda::savont=0.6.1c"
7+
container "${ workflow.containerEngine in ['singularity', 'apptainer'] && !task.ext.singularity_pull_docker_container ?
8+
'https://depot.galaxyproject.org/singularity/savont:0.6.1c--hec9b1f2_0' :
9+
'biocontainers/savont:0.6.1c--hec9b1f2_0' }"
10+
11+
input:
12+
tuple val(meta), path(reads), val(sample_string)
13+
14+
output:
15+
path("*_feature-table.tsv") , emit: asv
16+
path("*_final_asvs.fasta") , emit: fasta
17+
path("*_final_clusters.tsv"), emit: clusters
18+
path("savont_asv_*/temp/*") , emit: temp
19+
tuple val(meta), path("savont_asv_*"), emit: output_folder
20+
path("*_savont.log") , emit: log
21+
tuple val("${task.process}"), val('savont'), eval("savont --version 2>&1 | cut -d ' ' -f 2"), topic: versions, emit: versions_savont
22+
23+
script:
24+
def prefix = task.ext.prefix ?: "$meta.id"
25+
def args = task.ext.args ?: ''
26+
def reads_cmd = reads instanceof List ? "--pooled-samples ${reads.join(' ')}" : "${reads}"
27+
"""
28+
savont asv \\
29+
-t $task.cpus \\
30+
$args \\
31+
-o savont_asv_${prefix} \\
32+
$reads_cmd
33+
34+
# adjust the naming of the samples:
35+
sed '1s/.*/${sample_string}/' savont_asv_${prefix}/feature-table.tsv > ${prefix}_feature-table.tsv
36+
37+
# copy other files to include the prefix
38+
cp savont_asv_${prefix}/final_asvs.fasta ${prefix}_final_asvs.fasta
39+
cp savont_asv_${prefix}/final_clusters.tsv ${prefix}_final_clusters.tsv
40+
cp savont_asv_${prefix}/savont_*.log ${prefix}_savont.log
41+
"""
42+
}

modules/local/savont_export.nf

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
process SAVONT_EXPORT {
2+
tag "$prefix"
3+
label 'process_low'
4+
5+
conda "bioconda::savont=0.6.1c"
6+
container "${ workflow.containerEngine in ['singularity', 'apptainer'] && !task.ext.singularity_pull_docker_container ?
7+
'https://depot.galaxyproject.org/singularity/savont:0.6.1c--hec9b1f2_0' :
8+
'biocontainers/savont:0.6.1c--hec9b1f2_0' }"
9+
10+
input:
11+
tuple val(prefix), path(output_folders), val(sample_string)
12+
13+
output:
14+
path("*_feature-table.tsv") , emit: asv
15+
path("*_final_asvs.fasta") , emit: fasta
16+
path("*_savont.log") , emit: log
17+
tuple val("${task.process}"), val('savont'), eval("savont --version 2>&1 | cut -d ' ' -f 2"), topic: versions, emit: versions_savont
18+
19+
script:
20+
def args = task.ext.args ?: ''
21+
def folders = "${output_folders.join(' ')}"
22+
"""
23+
savont export \\
24+
-i $folders \\
25+
-o savont_export \\
26+
--relabel $sample_string
27+
28+
# copy other files to include the prefix
29+
cp savont_export/merged_feature_table.tsv ${prefix}_feature-table.tsv
30+
cp savont_export/merged_rep_seqs.fasta ${prefix}_final_asvs.fasta
31+
cp savont_export/savont_*.log ${prefix}_savont.log
32+
"""
33+
}

modules/nf-core/chopper/environment.yml

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

modules/nf-core/chopper/main.nf

Lines changed: 46 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

modules/nf-core/chopper/meta.yml

Lines changed: 84 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)