mirror of
https://github.com/MillironX/taxprofiler.git
synced 2024-11-22 08:19:54 +00:00
Add final adapterremoval options to match fastp functionality
This commit is contained in:
parent
c4c93bd59d
commit
dcda815bfb
4 changed files with 71 additions and 34 deletions
|
@ -62,18 +62,15 @@ process {
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
withName: FASTP {
|
withName: FASTP_SINGLE {
|
||||||
ext.prefix = { "${meta.id}_${meta.run_accession}" }
|
|
||||||
ext.args = [
|
ext.args = [
|
||||||
// collapsing options - option to retain singletons
|
|
||||||
params.shortread_clipmerge_excludeunmerged ? '' : "--include_unmerged",
|
|
||||||
// trimming options
|
// trimming options
|
||||||
params.shortread_clipmerge_skipadaptertrim ? "--disable_adapter_trimming" : "",
|
params.shortread_clipmerge_skipadaptertrim ? "--disable_adapter_trimming" : "",
|
||||||
params.shortread_clipmerge_adapter1 ? "--adapter_sequence ${params.shortread_clipmerge_adapter1}" : "",
|
params.shortread_clipmerge_adapter1 ? "--adapter_sequence ${params.shortread_clipmerge_adapter1}" : "",
|
||||||
!{ ${meta.single_end} } && params.shortread_clipmerge_adapter2 ? "--adapter_sequence_r2 ${params.shortread_clipmerge_adapter2}" : !{ ${meta.single_end} } ? "--detect_adapter_for_pe" : "",
|
|
||||||
// filtering options
|
// filtering options
|
||||||
"--length_required ${params.shortread_clipmerge_minlength}"
|
"--length_required ${params.shortread_clipmerge_minlength}"
|
||||||
].join(' ').trim()
|
].join(' ').trim()
|
||||||
|
ext.prefix = { "${meta.id}_${meta.run_accession}" }
|
||||||
publishDir = [
|
publishDir = [
|
||||||
path: { "${params.outdir}/fastp" },
|
path: { "${params.outdir}/fastp" },
|
||||||
mode: 'copy',
|
mode: 'copy',
|
||||||
|
@ -81,6 +78,61 @@ process {
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
withName: FASTP_PAIRED {
|
||||||
|
ext.args = [
|
||||||
|
// collapsing options - option to retain singletons
|
||||||
|
params.shortread_clipmerge_excludeunmerged ? '' : "--include_unmerged",
|
||||||
|
// trimming options
|
||||||
|
params.shortread_clipmerge_skipadaptertrim ? "--disable_adapter_trimming" : "",
|
||||||
|
params.shortread_clipmerge_adapter1 ? "--adapter_sequence ${params.shortread_clipmerge_adapter1}" : "",
|
||||||
|
params.shortread_clipmerge_adapter2 ? "--adapter_sequence_r2 ${params.shortread_clipmerge_adapter2}" : "--detect_adapter_for_pe",
|
||||||
|
// filtering options
|
||||||
|
"--length_required ${params.shortread_clipmerge_minlength}"
|
||||||
|
].join(' ').trim()
|
||||||
|
ext.prefix = { "${meta.id}_${meta.run_accession}" }
|
||||||
|
publishDir = [
|
||||||
|
path: { "${params.outdir}/fastp" },
|
||||||
|
mode: 'copy',
|
||||||
|
pattern: '*.fastq.gz'
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
withName: ADAPTERREMOVAL_SINGLE {
|
||||||
|
ext.args = [
|
||||||
|
// trimming options
|
||||||
|
params.shortread_clipmerge_skipadaptertrim ? "--adapter1 '' --adapter2 ''" : "",
|
||||||
|
params.shortread_clipmerge_adapter1 ? "--adapter1 ${params.shortread_clipmerge_adapter1}" : "",
|
||||||
|
// filtering options
|
||||||
|
"--minlength ${params.shortread_clipmerge_minlength}"
|
||||||
|
].join(' ').trim()
|
||||||
|
ext.prefix = { "${meta.id}_${meta.run_accession}" }
|
||||||
|
publishDir = [
|
||||||
|
path: { "${params.outdir}/adapterremoval" },
|
||||||
|
mode: 'copy',
|
||||||
|
pattern: '*.fastq.gz'
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
withName: ADAPTERREMOVAL_PAIRED {
|
||||||
|
ext.args = [
|
||||||
|
// collapsing options
|
||||||
|
params.shortread_clipmerge_mergepairs ? "--collapse" : "",
|
||||||
|
// trimming options
|
||||||
|
params.shortread_clipmerge_skipadaptertrim ? "--adapter1 '' --adapter2 ''" : "",
|
||||||
|
params.shortread_clipmerge_adapter1 ? "--adapter1 ${params.shortread_clipmerge_adapter1}" : "",
|
||||||
|
params.shortread_clipmerge_adapter2 ? "--adapter2 ${params.shortread_clipmerge_adapter2}" : "",
|
||||||
|
// filtering options
|
||||||
|
"--minlength ${params.shortread_clipmerge_minlength}"
|
||||||
|
].join(' ').trim()
|
||||||
|
ext.prefix = { "${meta.id}_${meta.run_accession}" }
|
||||||
|
publishDir = [
|
||||||
|
path: { "${params.outdir}/adapterremoval" },
|
||||||
|
mode: 'copy',
|
||||||
|
pattern: '*.fastq.gz'
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
withName: PORECHOP {
|
withName: PORECHOP {
|
||||||
ext.prefix = { "${meta.id}_${meta.run_accession}" }
|
ext.prefix = { "${meta.id}_${meta.run_accession}" }
|
||||||
publishDir = [
|
publishDir = [
|
||||||
|
@ -99,23 +151,23 @@ process {
|
||||||
}
|
}
|
||||||
|
|
||||||
withName: MALT_RUN {
|
withName: MALT_RUN {
|
||||||
|
ext.args = { "${meta.db_params}" }
|
||||||
|
ext.prefix = { "${meta.id}-${meta.run_accession}-${meta.db_name}" }
|
||||||
publishDir = [
|
publishDir = [
|
||||||
path: { "${params.outdir}/malt/${meta.db_name}" },
|
path: { "${params.outdir}/malt/${meta.db_name}" },
|
||||||
mode: 'copy',
|
mode: 'copy',
|
||||||
pattern: '*.{rma6,tab,text,sam,log}'
|
pattern: '*.{rma6,tab,text,sam,log}'
|
||||||
]
|
]
|
||||||
ext.args = { "${meta.db_params}" }
|
|
||||||
ext.prefix = { "${meta.id}-${meta.run_accession}-${meta.db_name}" }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
withName: KRAKEN2_KRAKEN2 {
|
withName: KRAKEN2_KRAKEN2 {
|
||||||
|
ext.args = { "${meta.db_params}" }
|
||||||
|
ext.prefix = { "${meta.id}-${meta.run_accession}-${meta.db_name}" }
|
||||||
publishDir = [
|
publishDir = [
|
||||||
path: { "${params.outdir}/kraken2/${meta.db_name}" },
|
path: { "${params.outdir}/kraken2/${meta.db_name}" },
|
||||||
mode: 'copy',
|
mode: 'copy',
|
||||||
pattern: '*.{fastq.gz,txt}'
|
pattern: '*.{fastq.gz,txt}'
|
||||||
]
|
]
|
||||||
ext.args = { "${meta.db_params}" }
|
|
||||||
ext.prefix = { "${meta.id}-${meta.run_accession}-${meta.db_name}" }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
withName: CUSTOM_DUMPSOFTWAREVERSIONS {
|
withName: CUSTOM_DUMPSOFTWAREVERSIONS {
|
||||||
|
|
|
@ -59,7 +59,7 @@ params {
|
||||||
shortread_clipmerge_tool = 'fastp'
|
shortread_clipmerge_tool = 'fastp'
|
||||||
shortread_clipmerge_skipadaptertrim = false
|
shortread_clipmerge_skipadaptertrim = false
|
||||||
shortread_clipmerge_mergepairs = false
|
shortread_clipmerge_mergepairs = false
|
||||||
shortread_clipmerge_excludeunmerged = true
|
shortread_clipmerge_excludeunmerged = false
|
||||||
shortread_clipmerge_adapter1 = null
|
shortread_clipmerge_adapter1 = null
|
||||||
shortread_clipmerge_adapter2 = null
|
shortread_clipmerge_adapter2 = null
|
||||||
shortread_clipmerge_minlength = 15
|
shortread_clipmerge_minlength = 15
|
||||||
|
|
|
@ -10,10 +10,7 @@
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"fa_icon": "fas fa-terminal",
|
"fa_icon": "fas fa-terminal",
|
||||||
"description": "Define where the pipeline should find input data and save output data.",
|
"description": "Define where the pipeline should find input data and save output data.",
|
||||||
"required": [
|
"required": ["input", "outdir"],
|
||||||
"input",
|
|
||||||
"outdir"
|
|
||||||
],
|
|
||||||
"properties": {
|
"properties": {
|
||||||
"input": {
|
"input": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
|
@ -176,14 +173,7 @@
|
||||||
"description": "Method used to save pipeline results to output directory.",
|
"description": "Method used to save pipeline results to output directory.",
|
||||||
"help_text": "The Nextflow `publishDir` option specifies which intermediate files should be saved to the output directory. This option tells the pipeline what method should be used to move these files. See [Nextflow docs](https://www.nextflow.io/docs/latest/process.html#publishdir) for details.",
|
"help_text": "The Nextflow `publishDir` option specifies which intermediate files should be saved to the output directory. This option tells the pipeline what method should be used to move these files. See [Nextflow docs](https://www.nextflow.io/docs/latest/process.html#publishdir) for details.",
|
||||||
"fa_icon": "fas fa-copy",
|
"fa_icon": "fas fa-copy",
|
||||||
"enum": [
|
"enum": ["symlink", "rellink", "link", "copy", "copyNoFollow", "move"],
|
||||||
"symlink",
|
|
||||||
"rellink",
|
|
||||||
"link",
|
|
||||||
"copy",
|
|
||||||
"copyNoFollow",
|
|
||||||
"move"
|
|
||||||
],
|
|
||||||
"hidden": true
|
"hidden": true
|
||||||
},
|
},
|
||||||
"email_on_fail": {
|
"email_on_fail": {
|
||||||
|
@ -277,7 +267,7 @@
|
||||||
},
|
},
|
||||||
"shortread_clipmerge_excludeunmerged": {
|
"shortread_clipmerge_excludeunmerged": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": true
|
"default": false
|
||||||
},
|
},
|
||||||
"longread_clip": {
|
"longread_clip": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
|
@ -295,10 +285,7 @@
|
||||||
"shortread_clipmerge_tool": {
|
"shortread_clipmerge_tool": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"default": "fastp",
|
"default": "fastp",
|
||||||
"enum": [
|
"enum": ["fastp", "adapterremoval"]
|
||||||
"fastp",
|
|
||||||
"adapterremoval"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"shortread_clipmerge_skipadaptertrim": {
|
"shortread_clipmerge_skipadaptertrim": {
|
||||||
"type": "boolean"
|
"type": "boolean"
|
||||||
|
|
|
@ -16,7 +16,6 @@ workflow SHORTREAD_ADAPTERREMOVAL {
|
||||||
ch_multiqc_files = Channel.empty()
|
ch_multiqc_files = Channel.empty()
|
||||||
|
|
||||||
ch_input_for_adapterremoval = reads
|
ch_input_for_adapterremoval = reads
|
||||||
.dump(tag: "pre_adapterremoval_branch")
|
|
||||||
.branch{
|
.branch{
|
||||||
single: it[0]['single_end'] == true
|
single: it[0]['single_end'] == true
|
||||||
paired: it[0]['single_end'] == false
|
paired: it[0]['single_end'] == false
|
||||||
|
@ -36,11 +35,13 @@ workflow SHORTREAD_ADAPTERREMOVAL {
|
||||||
.map {
|
.map {
|
||||||
meta, reads ->
|
meta, reads ->
|
||||||
def meta_new = meta.clone()
|
def meta_new = meta.clone()
|
||||||
meta_new['single_end'] = 1
|
meta_new['single_end'] = true
|
||||||
|
|
||||||
[ meta_new, reads ]
|
[ meta_new, reads ]
|
||||||
}
|
}
|
||||||
.groupTuple(by: 0)
|
.groupTuple(by: 0)
|
||||||
|
|
||||||
|
|
||||||
ch_adapterremoval_reads_prepped_pe = CAT_FASTQ ( ch_adapterremoval_for_cat ).reads
|
ch_adapterremoval_reads_prepped_pe = CAT_FASTQ ( ch_adapterremoval_for_cat ).reads
|
||||||
|
|
||||||
ch_adapterremoval_reads_prepped = ch_adapterremoval_reads_prepped_pe.mix( ADAPTERREMOVAL_SINGLE.out.singles_truncated )
|
ch_adapterremoval_reads_prepped = ch_adapterremoval_reads_prepped_pe.mix( ADAPTERREMOVAL_SINGLE.out.singles_truncated )
|
||||||
|
@ -51,7 +52,7 @@ workflow SHORTREAD_ADAPTERREMOVAL {
|
||||||
.map {
|
.map {
|
||||||
meta, reads ->
|
meta, reads ->
|
||||||
def meta_new = meta.clone()
|
def meta_new = meta.clone()
|
||||||
meta_new['single_end'] = 1
|
meta_new['single_end'] = true
|
||||||
|
|
||||||
[ meta_new, reads ]
|
[ meta_new, reads ]
|
||||||
}
|
}
|
||||||
|
@ -65,13 +66,10 @@ workflow SHORTREAD_ADAPTERREMOVAL {
|
||||||
|
|
||||||
ch_adapterremoval_reads_prepped_pe = ADAPTERREMOVAL_PAIRED.out.pair1_truncated
|
ch_adapterremoval_reads_prepped_pe = ADAPTERREMOVAL_PAIRED.out.pair1_truncated
|
||||||
.join( ADAPTERREMOVAL_PAIRED.out.pair2_truncated )
|
.join( ADAPTERREMOVAL_PAIRED.out.pair2_truncated )
|
||||||
.dump(tag: "pre-group")
|
|
||||||
.groupTuple(by: 0)
|
.groupTuple(by: 0)
|
||||||
.dump(tag: "post-group")
|
|
||||||
.map { meta, pair1, pair2 ->
|
.map { meta, pair1, pair2 ->
|
||||||
[ meta, [ pair1, pair2 ].flatten() ]
|
[ meta, [ pair1, pair2 ].flatten() ]
|
||||||
}
|
}
|
||||||
.dump(tag: "post-map")
|
|
||||||
|
|
||||||
|
|
||||||
ch_adapterremoval_reads_prepped = ch_adapterremoval_reads_prepped_pe
|
ch_adapterremoval_reads_prepped = ch_adapterremoval_reads_prepped_pe
|
||||||
|
|
Loading…
Reference in a new issue