Skip to content

Commit

Permalink
several improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
ctuni committed Oct 29, 2024
1 parent d8c31ec commit 7e41b19
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 23 deletions.
9 changes: 9 additions & 0 deletions conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ process {
ext.args = '--quiet'
}

withName: UNTAR {
publishDir = [
path: { "${params.outdir}/kraken2_db" },
mode: params.publish_dir_mode,
saveAs: { filename -> filename.equals('versions.yml') ? null : filename },
enabled: params.save_uncompressed_k2db
]
}

withName: 'MULTIQC_GLOBAL' {
ext.args = { params.multiqc_title ? "--title \"$params.multiqc_title\"" : '' }
publishDir = [
Expand Down
38 changes: 28 additions & 10 deletions modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,44 @@
"fastqc": {
"branch": "master",
"git_sha": "666652151335353eef2fcd58880bcef5bc2928e1",
"installed_by": ["modules"]
"installed_by": [
"modules"
]
},
"kraken2/kraken2": {
"branch": "master",
"git_sha": "666652151335353eef2fcd58880bcef5bc2928e1",
"installed_by": ["modules"]
"installed_by": [
"modules"
]
},
"krona/ktimporttaxonomy": {
"branch": "master",
"git_sha": "666652151335353eef2fcd58880bcef5bc2928e1",
"installed_by": ["modules"]
"installed_by": [
"modules"
]
},
"krona/ktupdatetaxonomy": {
"branch": "master",
"git_sha": "666652151335353eef2fcd58880bcef5bc2928e1",
"installed_by": ["modules"]
"installed_by": [
"modules"
]
},
"multiqc": {
"branch": "master",
"git_sha": "cf17ca47590cc578dfb47db1c2a44ef86f89976d",
"installed_by": ["modules"]
"installed_by": [
"modules"
]
},
"untar": {
"branch": "master",
"git_sha": "666652151335353eef2fcd58880bcef5bc2928e1",
"installed_by": ["modules"]
"installed_by": [
"modules"
]
}
}
},
Expand All @@ -42,20 +54,26 @@
"utils_nextflow_pipeline": {
"branch": "master",
"git_sha": "3aa0aec1d52d492fe241919f0c6100ebf0074082",
"installed_by": ["subworkflows"]
"installed_by": [
"subworkflows"
]
},
"utils_nfcore_pipeline": {
"branch": "master",
"git_sha": "1b6b9a3338d011367137808b49b923515080e3ba",
"installed_by": ["subworkflows"]
"installed_by": [
"subworkflows"
]
},
"utils_nfschema_plugin": {
"branch": "master",
"git_sha": "2fd2cd6d0e7b273747f32e465fdc6bcc3ae0814e",
"installed_by": ["subworkflows"]
"installed_by": [
"subworkflows"
]
}
}
}
}
}
}
}
1 change: 1 addition & 0 deletions nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ params {
kraken2_db = 'https://github.com/nf-core/test-datasets/raw/taxprofiler/data/database/kraken2/testdb-kraken2.tar.gz'
kraken2_save_reads = false
kraken2_save_readclassifications = false
save_uncompressed_k2db = false

// MultiQC options
multiqc_config = null
Expand Down
7 changes: 6 additions & 1 deletion nextflow_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -255,5 +255,10 @@
{
"$ref": "#/$defs/generic_options"
}
]
],
"properties": {
"save_uncompressed_k2db": {
"type": "boolean"
}
}
}
16 changes: 7 additions & 9 deletions subworkflows/local/phylogenetic_qc.nf
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ workflow PHYLOGENETIC_QC{
reads

main:
ch_reads = reads
ch_multiqc_files = Channel.empty()
ch_versions = Channel.empty()
ch_reads = reads
ch_versions = Channel.empty()
//
// MODULE: Untar kraken2_db or read it as it is if not compressed
//
if (params.kraken2_db.endsWith('.gz')) {
UNTAR_KRAKEN2_DB ( [ [:], params.kraken2_db ])
ch_kraken2_db = UNTAR_KRAKEN2_DB.out.untar.map { it[1] }
ch_versions = ch_versions.mix(UNTAR_KRAKEN2_DB.out.versions)
ch_versions = ch_versions.mix(UNTAR_KRAKEN2_DB.out.versions.first())
} else {
ch_kraken2_db = Channel.value([[:], file(params.kraken2_db, checkIfExists: true)])
ch_kraken2_db = Channel.fromPath(params.kraken2_db, checkIfExists: true)
ch_kraken2_db = ch_kraken2_db.collect()
}

//
Expand All @@ -35,9 +35,7 @@ workflow PHYLOGENETIC_QC{
params.kraken2_save_reads,
params.kraken2_save_readclassifications
)
ch_multiqc_files = ch_multiqc_files.mix( KRAKEN2_KRAKEN2.out.report )
ch_versions = ch_versions.mix( KRAKEN2_KRAKEN2.out.versions.first() )
//KRAKEN2_KRAKEN2.out.report.map { meta, report -> [ report ] }.collect()
ch_versions = ch_versions.mix( KRAKEN2_KRAKEN2.out.versions.first())

//
// MODULE: krona plot the kraken2 reports
Expand All @@ -50,6 +48,6 @@ workflow PHYLOGENETIC_QC{

emit:
versions = ch_versions
mqc = ch_multiqc_files
mqc = KRAKEN2_KRAKEN2.out.report
krona_plots = KRONA_KTIMPORTTAXONOMY.out.html.collect()
}
8 changes: 5 additions & 3 deletions workflows/seqinspector.nf
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,16 @@ workflow SEQINSPECTOR {
PHYLOGENETIC_QC (
ch_samplesheet
)
//ch_multiqc_files = ch_multiqc_files.mix(PHYLOGENETIC_QC.out.mqc.collect{it[1]}.ifEmpty([]))
ch_versions = ch_versions.mix(PHYLOGENETIC_QC.out.versions)
// TODO: Uncomment this line for add the kraken2 report to the MultiQC (channel creation might need some further tweaking)
//ch_multiqc_files = ch_multiqc_files.mix(PHYLOGENETIC_QC.out)
ch_versions = ch_versions.mix(PHYLOGENETIC_QC.out.versions.flatten())


//
// Collate and save software versions
//
softwareVersionsToYAML(ch_versions)
.collectFile(
.collectFile(
storeDir: "${params.outdir}/pipeline_info",
name: 'nf_core_' + 'pipeline_software_' + 'mqc_' + 'versions.yml',
sort: true,
Expand Down Expand Up @@ -92,6 +93,7 @@ workflow SEQINSPECTOR {
)
)

// .map { meta, file -> file }
MULTIQC_GLOBAL (
ch_multiqc_files
.map { meta, file -> file }
Expand Down

0 comments on commit 7e41b19

Please sign in to comment.