mirror of
https://github.com/MillironX/taxprofiler.git
synced 2024-11-22 09:19:54 +00:00
Add some debugging notes
This commit is contained in:
parent
622fafedc8
commit
e6e8ed7cc9
2 changed files with 34 additions and 30 deletions
|
@ -105,7 +105,7 @@ process {
|
||||||
pattern: '*.{rma6,tab,text,sam,log}'
|
pattern: '*.{rma6,tab,text,sam,log}'
|
||||||
]
|
]
|
||||||
ext.args = { "${meta.db_params}" }
|
ext.args = { "${meta.db_params}" }
|
||||||
ext.prefix = { "${meta.id}-${meta.db_name}" }
|
ext.prefix = { "${meta.id}-${meta.run_accession}-${meta.db_name}" }
|
||||||
}
|
}
|
||||||
|
|
||||||
withName: KRAKEN2_KRAKEN2 {
|
withName: KRAKEN2_KRAKEN2 {
|
||||||
|
@ -115,7 +115,7 @@ process {
|
||||||
pattern: '*.{fastq.gz,txt}'
|
pattern: '*.{fastq.gz,txt}'
|
||||||
]
|
]
|
||||||
ext.args = { "${meta.db_params}" }
|
ext.args = { "${meta.db_params}" }
|
||||||
ext.prefix = { "${meta.id}-${meta.db_name}" }
|
ext.prefix = { "${meta.id}-${meta.run_accession}-${meta.db_name}" }
|
||||||
}
|
}
|
||||||
|
|
||||||
withName: CUSTOM_DUMPSOFTWAREVERSIONS {
|
withName: CUSTOM_DUMPSOFTWAREVERSIONS {
|
||||||
|
|
|
@ -74,9 +74,9 @@ workflow TAXPROFILER {
|
||||||
|
|
||||||
ch_versions = Channel.empty()
|
ch_versions = Channel.empty()
|
||||||
|
|
||||||
//
|
/*
|
||||||
// SUBWORKFLOW: Read in samplesheet, validate and stage input files
|
SUBWORKFLOW: Read in samplesheet, validate and stage input files
|
||||||
//
|
*/
|
||||||
INPUT_CHECK (
|
INPUT_CHECK (
|
||||||
ch_input
|
ch_input
|
||||||
)
|
)
|
||||||
|
@ -86,9 +86,9 @@ workflow TAXPROFILER {
|
||||||
ch_databases
|
ch_databases
|
||||||
)
|
)
|
||||||
|
|
||||||
//
|
/*
|
||||||
// MODULE: Run FastQC
|
MODULE: Run FastQC
|
||||||
//
|
*/
|
||||||
ch_input_for_fastqc = INPUT_CHECK.out.fastq.mix( INPUT_CHECK.out.nanopore ).dump(tag: "input_to_fastq")
|
ch_input_for_fastqc = INPUT_CHECK.out.fastq.mix( INPUT_CHECK.out.nanopore ).dump(tag: "input_to_fastq")
|
||||||
FASTQC (
|
FASTQC (
|
||||||
ch_input_for_fastqc
|
ch_input_for_fastqc
|
||||||
|
@ -99,9 +99,9 @@ workflow TAXPROFILER {
|
||||||
ch_versions.unique().collectFile(name: 'collated_versions.yml')
|
ch_versions.unique().collectFile(name: 'collated_versions.yml')
|
||||||
)
|
)
|
||||||
|
|
||||||
//
|
/*
|
||||||
// PERFORM PREPROCESSING
|
SUBWORKFLOW: PERFORM PREPROCESSING
|
||||||
//
|
*/
|
||||||
if ( params.shortread_clipmerge ) {
|
if ( params.shortread_clipmerge ) {
|
||||||
ch_shortreads_preprocessed = SHORTREAD_PREPROCESSING ( INPUT_CHECK.out.fastq ).reads
|
ch_shortreads_preprocessed = SHORTREAD_PREPROCESSING ( INPUT_CHECK.out.fastq ).reads
|
||||||
} else {
|
} else {
|
||||||
|
@ -116,16 +116,19 @@ workflow TAXPROFILER {
|
||||||
ch_longreads_preprocessed = INPUT_CHECK.out.nanopore
|
ch_longreads_preprocessed = INPUT_CHECK.out.nanopore
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
/*
|
||||||
// PERFORM SHORT READ RUN MERGING
|
MODULE: PERFORM SHORT READ RUN MERGING
|
||||||
|
*/
|
||||||
|
|
||||||
// TODO: Check not necessary for long reads too?
|
// TODO: Check not necessary for long reads too?
|
||||||
//
|
// TODO: source of clash - combined should only occur when
|
||||||
|
// files ARE to be combined. SE/unmerged (see not below)
|
||||||
ch_processed_for_combine = ch_shortreads_preprocessed
|
ch_processed_for_combine = ch_shortreads_preprocessed
|
||||||
.dump(tag: "prep_for_combine_grouping")
|
.dump(tag: "prep_for_combine_grouping")
|
||||||
.map {
|
.map {
|
||||||
meta, reads ->
|
meta, reads ->
|
||||||
def meta_new = meta.clone()
|
def meta_new = meta.clone()
|
||||||
meta_new['run_accession'] = 'combined'
|
//meta_new['run_accession'] = 'combined'
|
||||||
[ meta_new, reads ]
|
[ meta_new, reads ]
|
||||||
}
|
}
|
||||||
.groupTuple ( by: 0 )
|
.groupTuple ( by: 0 )
|
||||||
|
@ -134,17 +137,18 @@ workflow TAXPROFILER {
|
||||||
skip: it[1].size() < 2
|
skip: it[1].size() < 2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NOTE: this does not allow CATing of SE & PE runs of same sample
|
||||||
|
// when --shortread_clipmerge_mergepairs is false
|
||||||
CAT_FASTQ ( ch_processed_for_combine.combine )
|
CAT_FASTQ ( ch_processed_for_combine.combine )
|
||||||
|
|
||||||
// TODO May need to flatten reads?
|
|
||||||
ch_reads_for_profiling = ch_processed_for_combine.skip
|
ch_reads_for_profiling = ch_processed_for_combine.skip
|
||||||
.dump(tag: "skip_combine")
|
.dump(tag: "skip_combine")
|
||||||
.mix( CAT_FASTQ.out.reads )
|
.mix( CAT_FASTQ.out.reads )
|
||||||
.dump(tag: "files_for_profiling")
|
.dump(tag: "files_for_profiling")
|
||||||
|
|
||||||
//
|
/*
|
||||||
// COMBINE READS WITH POSSIBLE DATABASES
|
COMBINE READS WITH POSSIBLE DATABASES
|
||||||
//
|
*/
|
||||||
|
|
||||||
// e.g. output [DUMP: reads_plus_db] [['id':'2612', 'run_accession':'combined', 'instrument_platform':'ILLUMINA', 'single_end':1], <reads_path>/2612.merged.fastq.gz, ['tool':'malt', 'db_name':'mal95', 'db_params':'"-id 90"'], <db_path>/malt90]
|
// e.g. output [DUMP: reads_plus_db] [['id':'2612', 'run_accession':'combined', 'instrument_platform':'ILLUMINA', 'single_end':1], <reads_path>/2612.merged.fastq.gz, ['tool':'malt', 'db_name':'mal95', 'db_params':'"-id 90"'], <db_path>/malt90]
|
||||||
ch_input_for_profiling = ch_reads_for_profiling
|
ch_input_for_profiling = ch_reads_for_profiling
|
||||||
|
@ -157,9 +161,9 @@ workflow TAXPROFILER {
|
||||||
unknown: true
|
unknown: true
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
/*
|
||||||
// PREPARE PROFILER INPUT CHANNELS
|
PREPARE PROFILER INPUT CHANNELS
|
||||||
//
|
*/
|
||||||
|
|
||||||
// We groupTuple to have all samples in one channel for MALT as database
|
// We groupTuple to have all samples in one channel for MALT as database
|
||||||
// loading takes a long time, so we only want to run it once per database
|
// loading takes a long time, so we only want to run it once per database
|
||||||
|
@ -171,7 +175,7 @@ workflow TAXPROFILER {
|
||||||
[ temp_meta, it[1], db ]
|
[ temp_meta, it[1], db ]
|
||||||
}
|
}
|
||||||
.groupTuple(by: [0,2])
|
.groupTuple(by: [0,2])
|
||||||
.dump(tag: "input_for_malt")
|
.dump(tag: "input_to_malt")
|
||||||
.multiMap {
|
.multiMap {
|
||||||
it ->
|
it ->
|
||||||
reads: [ it[0], it[1].flatten() ]
|
reads: [ it[0], it[1].flatten() ]
|
||||||
|
@ -180,16 +184,16 @@ workflow TAXPROFILER {
|
||||||
|
|
||||||
// We can run Kraken2 one-by-one sample-wise
|
// We can run Kraken2 one-by-one sample-wise
|
||||||
ch_input_for_kraken2 = ch_input_for_profiling.kraken2
|
ch_input_for_kraken2 = ch_input_for_profiling.kraken2
|
||||||
.dump(tag: "input_for_kraken")
|
.dump(tag: "input_to_kraken")
|
||||||
.multiMap {
|
.multiMap {
|
||||||
it ->
|
it ->
|
||||||
reads: [ it[0] + it[2], it[1].flatten() ]
|
reads: [ it[0] + it[2], it[1].flatten() ]
|
||||||
db: it[3]
|
db: it[3]
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
/*
|
||||||
// RUN PROFILING
|
MODULE: RUN PROFILING
|
||||||
//
|
*/
|
||||||
if ( params.run_malt ) {
|
if ( params.run_malt ) {
|
||||||
MALT_RUN ( ch_input_for_malt.reads, params.malt_mode, ch_input_for_malt.db )
|
MALT_RUN ( ch_input_for_malt.reads, params.malt_mode, ch_input_for_malt.db )
|
||||||
}
|
}
|
||||||
|
@ -198,9 +202,9 @@ workflow TAXPROFILER {
|
||||||
KRAKEN2_KRAKEN2 ( ch_input_for_kraken2.reads, ch_input_for_kraken2.db )
|
KRAKEN2_KRAKEN2 ( ch_input_for_kraken2.reads, ch_input_for_kraken2.db )
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
/*
|
||||||
// MODULE: MultiQC
|
MODULE: MultiQC
|
||||||
//
|
*/
|
||||||
workflow_summary = WorkflowTaxprofiler.paramsSummaryMultiqc(workflow, summary_params)
|
workflow_summary = WorkflowTaxprofiler.paramsSummaryMultiqc(workflow, summary_params)
|
||||||
ch_workflow_summary = Channel.value(workflow_summary)
|
ch_workflow_summary = Channel.value(workflow_summary)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue