Skip to content

Commit

Permalink
Make it possible to use chopper as filtering tool as well
Browse files Browse the repository at this point in the history
  • Loading branch information
muabnezor committed Oct 15, 2024
1 parent 7102af4 commit 9bc8156
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 25 deletions.
4 changes: 3 additions & 1 deletion conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,9 @@ process {

withName: CHOPPER {
ext.args2 = [
"--contam ${params.lambda_reference}"
!params.keep_lambda ? "--contam ${params.lambda_reference}": "",
params.longreads_min_quality ? "--quality ${params.longreads_min_quality}": "",
params.longreads_min_length ? "--minlength ${params.longreads_min_length}": "",
].join(' ').trim()
publishDir = [
[
Expand Down
1 change: 0 additions & 1 deletion nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ params {
keep_phix = false
// long read preprocessing options
longread_adaptertrimming_tool = "porechop_abi"
longread_phageremoval_tool = "chopper"
longread_filtering_tool = "filtlong"
// phix_reference = "ftp://ftp.ncbi.nlm.nih.gov/genomes/genbank/viral/Enterobacteria_phage_phiX174_sensu_lato/all_assembly_versions/GCA_002596845.1_ASM259684v1/GCA_002596845.1_ASM259684v1_genomic.fna.gz"
phix_reference = "${baseDir}/assets/data/GCA_002596845.1_ASM259684v1_genomic.fna.gz"
Expand Down
8 changes: 1 addition & 7 deletions nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -497,16 +497,10 @@
"enum": ["porechop", "porechop_abi"],
"default": "porechop_abi"
},
"longread_phageremoval_tool": {
"type": "string",
"description": "Specify which long read phage removal tool to use.",
"enum": ["nanolyse", "chopper"],
"default": "chopper"
},
"longread_filtering_tool": {
"type": "string",
"description": "Specify which long read filtering tool to use.",
"enum": ["filtlong", "nanoq"],
"enum": ["filtlong", "nanoq", "chopper"],
"default": "filtlong"
}
}
Expand Down
29 changes: 13 additions & 16 deletions subworkflows/local/longread_preprocessing.nf
Original file line number Diff line number Diff line change
Expand Up @@ -53,22 +53,13 @@ workflow LONGREAD_PREPROCESSING {
}
}

if (!params.keep_lambda) {
if (params.longread_phageremoval_tool == 'chopper') {
CHOPPER (
ch_long_reads
)
ch_long_reads = CHOPPER.out.fastq
ch_versions = ch_versions.mix(CHOPPER.out.versions.first())
} else if (params.longread_phageremoval_tool == 'nanolyse') {
NANOLYSE (
ch_long_reads,
ch_nanolyse_db
)
ch_long_reads = NANOLYSE.out.fastq
ch_versions = ch_versions.mix(NANOLYSE.out.versions.first())
}

if (!params.keep_lambda && params.longread_filtering_tool != 'chopper') {
NANOLYSE (
ch_long_reads,
ch_nanolyse_db
)
ch_long_reads = NANOLYSE.out.fastq
ch_versions = ch_versions.mix(NANOLYSE.out.versions.first())
}

if (params.longread_filtering_tool == 'filtlong') {
Expand All @@ -95,6 +86,12 @@ workflow LONGREAD_PREPROCESSING {
ch_long_reads = NANOQ.out.reads
ch_versions = ch_versions.mix(NANOQ.out.versions.first())
ch_multiqc_files = ch_multiqc_files.mix(NANOQ.out.stats)
} else if (params.longread_filtering_tool == 'chopper') {
CHOPPER (
ch_long_reads
)
ch_long_reads = CHOPPER.out.fastq
ch_versions = ch_versions.mix(CHOPPER.out.versions.first())
}

NANOPLOT_FILTERED (
Expand Down

0 comments on commit 9bc8156

Please sign in to comment.