Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add chopper and nanoq options for longread preprocessing #692

Draft
wants to merge 5 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 46 additions & 1 deletion conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,8 @@ process {
"--min_length ${params.longreads_min_length}",
"--keep_percent ${params.longreads_keep_percent}",
"--trim",
"--length_weight ${params.longreads_length_weight}"
"--length_weight ${params.longreads_length_weight}",
params.longreads_min_quality ? "--min_mean_q ${params.longreads_min_quality}" : '',
].join(' ').trim()
publishDir = [
path: { "${params.outdir}/QC_longreads/Filtlong" },
Expand All @@ -194,11 +195,55 @@ process {
ext.prefix = { "${meta.id}_run${meta.run}_filtlong" }
}

withName: NANOQ {
ext.args = [
"--min-len ${params.longreads_min_length}",
params.longreads_min_quality ? "--min-qual ${params.longreads_min_quality}": '',
"-vv"
].join(' ').trim()
publishDir = [
[
path: { "${params.outdir}/QC_longreads/Nanoq" },
mode: params.publish_dir_mode,
pattern: "*_nanoq_filtered.fastq.gz",
enabled: params.save_filtered_reads
],
[
path: { "${params.outdir}/QC_longreads/Nanoq" },
mode: params.publish_dir_mode,
pattern: "*_nanoq_filtered.stats"
]
]
ext.prefix = { "${meta.id}_run${meta.run}_nanoq_filtered" }
}

withName: NANOLYSE {
publishDir = [[path: { "${params.outdir}/QC_longreads/NanoLyse" }, mode: params.publish_dir_mode, pattern: "*.log"], [path: { "${params.outdir}/QC_longreads/NanoLyse" }, mode: params.publish_dir_mode, pattern: "*_nanolyse.fastq.gz", enabled: params.save_lambdaremoved_reads]]
ext.prefix = { "${meta.id}_run${meta.run}_lambdafiltered" }
}

withName: CHOPPER {
ext.args2 = [
!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()
Comment on lines +225 to +230
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added the option to use chopper for filtering. Since the conditions in the subworkflow got a bit messy, i decided to put the logic in the modules.config. In this way if params.keep_phage is true, and params.longread_filtering_tool is chopper will run both phage removal and filtering. what do you think of this @jfy133?

publishDir = [
[
path: { "${params.outdir}/QC_longreads/Chopper" },
mode: params.publish_dir_mode,
pattern: "*.log"
],
[
path: { "${params.outdir}/QC_longreads/Chopper" },
mode: params.publish_dir_mode,
pattern: "*_chopper.fastq.gz",
enabled: params.save_lambdaremoved_reads
]
]
ext.prefix = { "${meta.id}_run${meta.run}_chopper" }
}

withName: NANOPLOT_RAW {
ext.prefix = 'raw'
ext.args = {
Expand Down
10 changes: 10 additions & 0 deletions modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@
"git_sha": "911696ea0b62df80e900ef244d7867d177971f73",
"installed_by": ["modules"]
},
"chopper": {
"branch": "master",
"git_sha": "666652151335353eef2fcd58880bcef5bc2928e1",
"installed_by": ["modules"]
},
"concoct/concoct": {
"branch": "master",
"git_sha": "baa30accc6c50ea8a98662417d4f42ed18966353",
Expand Down Expand Up @@ -212,6 +217,11 @@
"git_sha": "3135090b46f308a260fc9d5991d7d2f9c0785309",
"installed_by": ["modules"]
},
"nanoq": {
"branch": "master",
"git_sha": "666652151335353eef2fcd58880bcef5bc2928e1",
"installed_by": ["modules"]
},
"porechop/abi": {
"branch": "master",
"git_sha": "06c8865e36741e05ad32ef70ab3fac127486af48",
Expand Down
5 changes: 5 additions & 0 deletions modules/nf-core/chopper/environment.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 42 additions & 0 deletions modules/nf-core/chopper/main.nf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

60 changes: 60 additions & 0 deletions modules/nf-core/chopper/meta.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 45 additions & 0 deletions modules/nf-core/chopper/tests/main.nf.test

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions modules/nf-core/chopper/tests/main.nf.test.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions modules/nf-core/chopper/tests/tags.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions modules/nf-core/nanoq/environment.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

49 changes: 49 additions & 0 deletions modules/nf-core/nanoq/main.nf

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

63 changes: 63 additions & 0 deletions modules/nf-core/nanoq/meta.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading