1
0
Fork 0
mirror of https://github.com/MillironX/taxprofiler.git synced 2024-11-21 23:56:04 +00:00

Get this working

This commit is contained in:
James Fellows Yates 2022-04-08 13:09:23 +02:00
parent 4d726a87e9
commit d130a72d74
4 changed files with 22 additions and 7 deletions

View file

@ -40,6 +40,7 @@ jobs:
- "--shortread_complexityfilter_tool bbduk"
- "--shortread_complexityfilter_tool prinseq"
- "--run_merging"
- "--run_merging --shortread_clipmerge_mergepairs"
steps:
- name: Check out pipeline code

View file

@ -163,7 +163,7 @@ process {
withName: MALT_RUN {
ext.args = { "${meta.db_params}" }
ext.prefix = { "${meta.id}-${meta.run_accession}-${meta.db_name}" }
ext.prefix = if params.run_merging : { "${meta.id}-${meta.db_name}" } : { "${meta.id}-${meta.run_accession}-${meta.db_name}" }
publishDir = [
path: { "${params.outdir}/malt/${meta.db_name}" },
mode: params.publish_dir_mode,
@ -173,7 +173,7 @@ process {
withName: KRAKEN2_KRAKEN2 {
ext.args = { "${meta.db_params}" }
ext.prefix = { "${meta.id}-${meta.run_accession}-${meta.db_name}" }
ext.prefix = if params.run_merging : { "${meta.id}-${meta.db_name}" } : { "${meta.id}-${meta.run_accession}-${meta.db_name}" }
publishDir = [
path: { "${params.outdir}/kraken2/${meta.db_name}" },
mode: params.publish_dir_mode,
@ -183,7 +183,7 @@ process {
withName: METAPHLAN3 {
publishDir = [
path: { "${params.outdir}/metaphlan3/${meta.db_name}" },
ext.prefix = if params.run_merging : { "${meta.id}-${meta.db_name}" } : { "${meta.id}-${meta.run_accession}-${meta.db_name}" }
mode: params.publish_dir_mode,
pattern: '*.{biom,txt}'
]

View file

@ -28,8 +28,8 @@ workflow SHORTREAD_FASTP {
.map {
meta, reads ->
def meta_new = meta.clone()
meta_new['single_end'] = 1
[ meta_new, reads ]
meta_new['single_end'] = true
[ meta_new, reads.flatten() ]
}
ch_fastp_reads_prepped = ch_fastp_reads_prepped_pe.mix( FASTP_SINGLE.out.reads )

View file

@ -130,7 +130,8 @@ workflow TAXPROFILER {
*/
if ( params.run_merging ) {
ch_reads_for_cat = ch_shortreads_filtered
ch_reads_for_cat_branch = ch_shortreads_filtered
.mix( ch_longreads_preprocessed )
.map {
meta, reads ->
@ -139,8 +140,21 @@ workflow TAXPROFILER {
[ meta_new, reads ]
}
.groupTuple()
.map {
meta, reads ->
[ meta, reads.flatten() ]
}
.branch {
// we can't concate files if there is not a second run, we branch
// here to separate them out, and mix after
cat: ( it[0]['single_end'] && it[1].size() > 1 ) || ( !it[0]['single_end'] && it[1].size() > 2 )
skip: true
}
ch_reads_for_cat_branch.cat.dump(tag: "for_catting")
ch_reads_runmerged = CAT_FASTQ ( ch_reads_for_cat_branch.cat ).reads.mix( ch_reads_for_cat_branch.skip )
ch_reads_runmerged = CAT_FASTQ ( ch_reads_for_cat ).reads
} else {
ch_reads_runmerged = ch_shortreads_filtered
.mix( ch_longreads_preprocessed )