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

dsl2: metagenomics uncollapsed paired end #1098

Open
wants to merge 18 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 12 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
5 changes: 4 additions & 1 deletion conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ process {
ext.args = [
params.metagenomics_input == 'all' ? '' : '-F 4',
].join(' ').trim()
ext.prefix = { "${meta.sample_id}_${meta.library_id}_${meta.reference}_mapped" }
ext.prefix = { params.metagenomics_input == 'all' ? "${meta.sample_id}_${meta.library_id}_${meta.reference}_all" : "${meta.sample_id}_${meta.library_id}_${meta.reference}_mapped" }
publishDir = [
path: { "${params.outdir}/bam_filtering/" },
mode: params.publish_dir_mode,
Expand Down Expand Up @@ -980,6 +980,7 @@ process {
}

withName: KRAKEN2_KRAKEN2 {
tag = { "${meta.sample_id}|single_end_mode_${meta.single_end}" }
ext.args = [
params.metagenomics_kraken2_saveminimizers ? "--report-minimizer-data" : ""
].join(' ').trim()
Expand All @@ -992,11 +993,13 @@ process {
}

withName: KRAKENUNIQ_PRELOADEDKRAKENUNIQ {
tag = { ${meta.single_end} ? "single_end" : "paried_end" }
publishDir = [
path: { "${params.outdir}/metagenomics/profiling/krakenuniq/" },
mode: params.publish_dir_mode,
pattern: '*.{txt,fastq.gz}'
]
ext.prefix = { "${meta.single_end}" }
}

withName: METAPHLAN_METAPHLAN {
Expand Down
18 changes: 18 additions & 0 deletions docs/development/metagenomics_paired_end.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## investigation notes for updating code to allow for PE inputs into metagenomics profiling (eg for kraken, malt)

see
https://github.com/nf-core/eager/issues/945

current issue is that the reads that go into mapping are not by default extracted as singletons and non-singletons, so we lose that information
Then downstream the inputs into the krakenuniq module (even if split correctly with meta vars) don't have the correct headers to parse the PE nature of the reads (since they have all been concatenated anyways, and just were ORIGINALLY PE)

So: needs to be fixed up higher (eg in bamfiltering.nf, likely with a new adjustment to the SAMTOOLS_FASTQ_UNMAPPED, SAMTOOLS_FASTQ_MAPPED, and SAMTOOLS_VIEW_BAM_FILTERING modules )

ISSUE FOUND: while the outputting of PE reads is OK in bamfiltering.nf (fastq_mapped & fastq_unmapped) when overlap merging is not done cat_fastq weirdly merges singletons to one PE file and other to the other PE file, so then everything gets fucked up
Copy link
Member

Choose a reason for hiding this comment

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

That sounds like a hackathon-thing to do

"""
cat input1/JK2782_JK2782_TGGCCGATCAACGA_Mammoth_MT_Krause_unmapped_other.fastq.gz input3/JK2782_JK2782_TGGCCGATCAACGA_Mammoth_MT_Krause_unmapped_1.fastq.gz > JK2782_JK2782_TGGCCGATCAACGA_Mammoth_MT_Krause_1.merged.fastq.gz
cat input2/JK2782_JK2782_TGGCCGATCAACGA_Mammoth_MT_Krause_unmapped_singleton.fastq.gz input4/JK2782_JK2782_TGGCCGATCAACGA_Mammoth_MT_Krause_unmapped_2.fastq.gz > JK2782_JK2782_TGGCCGATCAACGA_Mammoth_MT_Krause_2.merged.fastq.gz
"""

Decision is needed on what behavior is wanted for unmapped singletons, other. and then likely remove the call to cat_fastq for PE reads
Possibly just split to also have the singletons parsed separately?
2 changes: 1 addition & 1 deletion modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
},
"krakenuniq/preloadedkrakenuniq": {
"branch": "master",
"git_sha": "a6eb17f65b3ee5761c25c075a6166c9f76733cee",
"git_sha": "666652151335353eef2fcd58880bcef5bc2928e1",
"installed_by": ["modules"]
},
"malt/run": {
Expand Down

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

112 changes: 64 additions & 48 deletions modules/nf-core/krakenuniq/preloadedkrakenuniq/main.nf

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

Loading