Skip to content

Commit

Permalink
fix: correct file name for combined kraken2 reports
Browse files Browse the repository at this point in the history
  • Loading branch information
Midnighter committed Apr 6, 2024
1 parent 2c430aa commit 46e6637
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 deletions.
2 changes: 1 addition & 1 deletion conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ process {
}

withName: KRAKENTOOLS_COMBINEKREPORTS_KRAKEN {
ext.prefix = { "kraken2_${meta.db_name}_combined_reports" }
ext.prefix = { "kraken2_${meta.id}_combined_reports" }
publishDir = [
path: { "${params.outdir}/kraken2/" },
mode: params.publish_dir_mode,
Expand Down
20 changes: 6 additions & 14 deletions subworkflows/local/standardisation_profiles.nf
Original file line number Diff line number Diff line change
Expand Up @@ -170,22 +170,14 @@ workflow STANDARDISATION_PROFILES {
// Have to sort by size to ensure first file actually has hits otherwise
// the script fails
ch_profiles_for_kraken2 = groupProfiles(
ch_input_profiles.kraken2.map { meta, profile ->
def new_meta = [
// Replace the tool name to get the right output-format description.
tool: meta.tool == 'kraken2-bracken' ? 'kraken2' : meta.tool,
// Append so as to disambiguate when we have same databases
// for kraken2 step of bracken, with normal bracken.
id: meta.tool,
// Append so as to disambiguate when we have same databases
// for kraken2 step of bracken, with normal bracken.
db_name: meta.tool == 'kraken2-bracken' ? "${meta.db_name}-bracken" : "${meta.db_name}"

]
return [meta + new_meta, profile]
ch_input_profiles.kraken2.dump(tag: 'k2-profiles', pretty: true)
.map { meta, profile ->
// Replace database name, to get the right output description.
def db_name = meta.tool == 'kraken2-bracken' ? "${meta.db_name}-bracken" : "${meta.db_name}"
return [meta + [db_name: db_name], profile]
},
[sort: { -it.size() }]
)
).dump(tag: 'k2-grouped', pretty: true)

KRAKENTOOLS_COMBINEKREPORTS_KRAKEN ( ch_profiles_for_kraken2 )
ch_multiqc_files = ch_multiqc_files.mix( KRAKENTOOLS_COMBINEKREPORTS_KRAKEN.out.txt )
Expand Down

0 comments on commit 46e6637

Please sign in to comment.