1
0
Fork 0
mirror of https://github.com/MillironX/taxprofiler.git synced 2024-11-10 21:53:09 +00:00

Start adding conditions in modules.conf - non-cat not working

This commit is contained in:
James Fellows Yates 2023-03-22 15:39:45 +01:00
parent 74bc6b7dd3
commit 3b90064ba4
3 changed files with 111 additions and 49 deletions

View file

@ -71,6 +71,12 @@ process {
path: { "${params.outdir}/fastp" }, path: { "${params.outdir}/fastp" },
mode: params.publish_dir_mode, mode: params.publish_dir_mode,
pattern: '*.{log,html,json}' pattern: '*.{log,html,json}'
],
[
path: { "${params.outdir}/analysis_ready_reads" },
mode: params.publish_dir_mode,
pattern: '*.fastq.gz',
enabled: !params.perform_runmerging && !params.perform_shortread_hostremoval && !params.shortread_complexityfilter_tool && !params.perform_shortread_qc && params.save_analysis_ready_reads
] ]
] ]
} }
@ -99,6 +105,12 @@ process {
path: { "${params.outdir}/fastp" }, path: { "${params.outdir}/fastp" },
mode: params.publish_dir_mode, mode: params.publish_dir_mode,
pattern: '*.{log,html,json}' pattern: '*.{log,html,json}'
],
[
path: { "${params.outdir}/analysis_ready_reads" },
mode: params.publish_dir_mode,
pattern: '*.fastq.gz',
enabled: !params.perform_runmerging && !params.perform_shortread_hostremoval && !params.shortread_complexityfilter_tool && !params.perform_shortread_qc && params.save_analysis_ready_reads
] ]
] ]
} }
@ -122,6 +134,12 @@ process {
path: { "${params.outdir}/adapterremoval" }, path: { "${params.outdir}/adapterremoval" },
mode: params.publish_dir_mode, mode: params.publish_dir_mode,
pattern: '*.settings' pattern: '*.settings'
],
[
path: { "${params.outdir}/analysis_ready_reads" },
mode: params.publish_dir_mode,
pattern: '*.fastq.gz',
enabled: !params.perform_runmerging && !params.perform_shortread_hostremoval && !params.shortread_complexityfilter_tool && !params.perform_shortread_qc && params.save_analysis_ready_reads
] ]
] ]
} }
@ -148,6 +166,12 @@ process {
path: { "${params.outdir}/adapterremoval" }, path: { "${params.outdir}/adapterremoval" },
mode: params.publish_dir_mode, mode: params.publish_dir_mode,
pattern: '*.settings' pattern: '*.settings'
],
[
path: { "${params.outdir}/analysis_ready_reads" },
mode: params.publish_dir_mode,
pattern: '*.fastq.gz',
enabled: !params.perform_runmerging && !params.perform_shortread_hostremoval && !params.shortread_complexityfilter_tool && !params.perform_shortread_qc && params.save_analysis_ready_reads
] ]
] ]
} }
@ -166,6 +190,7 @@ process {
mode: params.publish_dir_mode, mode: params.publish_dir_mode,
pattern: '*.log' pattern: '*.log'
] ]
// TODO ANALYSIS READY
] ]
} }
@ -190,14 +215,78 @@ process {
pattern: '*.log' pattern: '*.log'
] ]
] ]
// TODO ANALYSIS READY
}
withName: BBMAP_BBDUK {
ext.args = [
"entropy=${params.shortread_complexityfilter_entropy}",
"entropywindow=${params.shortread_complexityfilter_bbduk_windowsize}",
params.shortread_complexityfilter_bbduk_mask ? "entropymask=t" : "entropymask=f"
].join(' ').trim()
ext.prefix = { "${meta.id}_${meta.run_accession}" }
publishDir = [
[
path: { "${params.outdir}/bbduk/" },
mode: params.publish_dir_mode,
pattern: '*.{fastq.gz,log}',
enabled: params.save_complexityfiltered_reads
],
[
path: { "${params.outdir}/bbduk/" },
mode: params.publish_dir_mode,
pattern: '*.log'
],
[
path: { "${params.outdir}/analysis_ready_reads" },
mode: params.publish_dir_mode,
pattern: '*.fastq.gz',
enabled: !params.perform_runmerging && !params.perform_shortread_hostremoval && params.shortread_complexityfilter_tool && params.save_analysis_ready_reads
]
]
}
withName: PRINSEQPLUSPLUS {
ext.args = [
params.shortread_complexityfilter_prinseqplusplus_mode == 'dust' ? "-lc_dust=${params.shortread_complexityfilter_prinseqplusplus_dustscore}" : "-lc_entropy=${params.shortread_complexityfilter_entropy}",
"-trim_qual_left=0 -trim_qual_left=0 -trim_qual_window=0 -trim_qual_step=0",
].join(' ').trim()
ext.prefix = { "${meta.id}_${meta.run_accession}" }
publishDir = [
[
path: { "${params.outdir}/prinseqplusplus/" },
mode: params.publish_dir_mode,
pattern: '*{_good_out.fastq.gz,_good_out_R1.fastq.gz,_good_out_R2.fastq.gz}',
enabled: params.save_complexityfiltered_reads
],
[
path: { "${params.outdir}/prinseqplusplus/" },
mode: params.publish_dir_mode,
pattern: '*.log'
],
[
path: { "${params.outdir}/analysis_ready_reads" },
mode: params.publish_dir_mode,
pattern: '*.fastq.gz',
enabled: !params.perform_runmerging && !params.perform_shortread_hostremoval && params.shortread_complexityfilter_tool && params.save_analysis_ready_reads
]
]
} }
withName: BOWTIE2_BUILD { withName: BOWTIE2_BUILD {
publishDir = [ publishDir = [
[
path: { "${params.outdir}/bowtie2/build" }, path: { "${params.outdir}/bowtie2/build" },
mode: params.publish_dir_mode, mode: params.publish_dir_mode,
pattern: 'bowtie2', pattern: 'bowtie2',
enabled: params.save_hostremoval_index enabled: params.save_hostremoval_index
],
[
path: { "${params.outdir}/analysis_ready_reads" },
mode: params.publish_dir_mode,
pattern: '*.fastq.gz',
enabled: !params.perform_runmerging && !params.perform_shortread_hostremoval && !params.shortread_complexityfilter_tool && !params.perform_shortread_qc && params.save_analysis_ready_reads
]
] ]
} }
@ -221,6 +310,12 @@ process {
mode: params.publish_dir_mode, mode: params.publish_dir_mode,
pattern: '*.fastq.gz', pattern: '*.fastq.gz',
enabled: params.save_hostremoval_unmapped enabled: params.save_hostremoval_unmapped
],
[
path: { "${params.outdir}/analysis_ready_reads" },
mode: params.publish_dir_mode,
pattern: '*.fastq.gz',
saveAs: { (( !params.perform_runmerging | params.perform_runmerging && !${meta.is_multirun} ) && params.perform_shortread_hostremoval && params.save_analysis_ready_reads ) ? it : null }
] ]
] ]
} }
@ -243,6 +338,7 @@ process {
pattern: '*.bam', pattern: '*.bam',
enabled: params.save_hostremoval_bam enabled: params.save_hostremoval_bam
] ]
// TODO ANALYSIS READY READS
} }
withName: SAMTOOLS_VIEW { withName: SAMTOOLS_VIEW {
@ -269,56 +365,21 @@ process {
] ]
} }
withName: BBMAP_BBDUK {
ext.args = [
"entropy=${params.shortread_complexityfilter_entropy}",
"entropywindow=${params.shortread_complexityfilter_bbduk_windowsize}",
params.shortread_complexityfilter_bbduk_mask ? "entropymask=t" : "entropymask=f"
].join(' ').trim()
ext.prefix = { "${meta.id}_${meta.run_accession}" }
publishDir = [
[
path: { "${params.outdir}/bbduk/" },
mode: params.publish_dir_mode,
pattern: '*.{fastq.gz,log}',
enabled: params.save_complexityfiltered_reads
],
[
path: { "${params.outdir}/bbduk/" },
mode: params.publish_dir_mode,
pattern: '*.log'
]
]
}
withName: PRINSEQPLUSPLUS {
ext.args = [
params.shortread_complexityfilter_prinseqplusplus_mode == 'dust' ? "-lc_dust=${params.shortread_complexityfilter_prinseqplusplus_dustscore}" : "-lc_entropy=${params.shortread_complexityfilter_entropy}",
"-trim_qual_left=0 -trim_qual_left=0 -trim_qual_window=0 -trim_qual_step=0",
].join(' ').trim()
ext.prefix = { "${meta.id}_${meta.run_accession}" }
publishDir = [
[
path: { "${params.outdir}/prinseqplusplus/" },
mode: params.publish_dir_mode,
pattern: '*{_good_out.fastq.gz,_good_out_R1.fastq.gz,_good_out_R2.fastq.gz}',
enabled: params.save_complexityfiltered_reads
],
[
path: { "${params.outdir}/prinseqplusplus/" },
mode: params.publish_dir_mode,
pattern: '*.log'
]
]
}
withName: CAT_FASTQ { withName: CAT_FASTQ {
ext.prefix = { "${meta.id}" } ext.prefix = { "${meta.id}" }
publishDir = [ publishDir = [
[
path: { "${params.outdir}/run_merging/" }, path: { "${params.outdir}/run_merging/" },
mode: params.publish_dir_mode, mode: params.publish_dir_mode,
pattern: '*.fastq.gz', pattern: '*.fastq.gz',
enabled: params.save_runmerged_reads enabled: params.save_runmerged_reads
],
[
path: { "${params.outdir}/analysis_ready_reads" },
mode: params.publish_dir_mode,
pattern: '*.fastq.gz',
enabled: params.perform_runmerging && params.save_analysis_ready_reads
]
] ]
} }

View file

@ -105,6 +105,8 @@ params {
save_hostremoval_bam = false save_hostremoval_bam = false
save_hostremoval_unmapped = false save_hostremoval_unmapped = false
// Publishing final reads going into profiling
save_analysis_ready_reads = false
// MALT // MALT
run_malt = false run_malt = false

View file

@ -43,7 +43,6 @@ workflow INPUT_CHECK {
// Channel generation // Channel generation
ch_fastq = ch_parsed_samplesheet.fastq ch_fastq = ch_parsed_samplesheet.fastq
.map { create_fastq_channel(it) } .map { create_fastq_channel(it) }
.dump(tag: "boop")
ch_nanopore = ch_parsed_samplesheet.nanopore ch_nanopore = ch_parsed_samplesheet.nanopore
.map { create_fastq_channel(it) } .map { create_fastq_channel(it) }