1
0
Fork 0
mirror of https://github.com/MillironX/taxprofiler.git synced 2024-11-22 08:09:54 +00:00

add more comments and slight style changes

This commit is contained in:
Moritz E. Beber 2023-03-07 14:57:53 +01:00
parent 5380bc18ec
commit 7c1133efb8
4 changed files with 30 additions and 27 deletions

View file

@ -45,6 +45,8 @@ workflow LONGREAD_HOSTREMOVAL {
SAMTOOLS_INDEX ( MINIMAP2_ALIGN.out.bam ) SAMTOOLS_INDEX ( MINIMAP2_ALIGN.out.bam )
ch_versions = ch_versions.mix( SAMTOOLS_INDEX.out.versions.first() ) ch_versions = ch_versions.mix( SAMTOOLS_INDEX.out.versions.first() )
// FIXME: This join is performed using entire maps as keys.
// Please replace with joining on specific keys instead.
bam_bai = MINIMAP2_ALIGN.out.bam bam_bai = MINIMAP2_ALIGN.out.bam
.join(SAMTOOLS_INDEX.out.bai) .join(SAMTOOLS_INDEX.out.bai)

View file

@ -35,10 +35,7 @@ workflow PROFILING {
ch_input_for_profiling = reads ch_input_for_profiling = reads
.map { .map {
meta, reads -> meta, reads ->
def meta_new = meta.clone() [meta + [id: "${meta.id}${meta.single_end ? '_se' : '_pe'}"], reads]
pairtype = meta_new['single_end'] ? '_se' : '_pe'
meta_new['id'] = meta_new['id'] + pairtype
[meta_new, reads]
} }
.combine(databases) .combine(databases)
.branch { .branch {
@ -90,11 +87,12 @@ workflow PROFILING {
[ new_meta, reads, db ] [ new_meta, reads, db ]
} }
// FIXME: Groups elements in the channel using the meta map as key. Replace with grouping on specific keys.
.groupTuple(by: [0,2]) .groupTuple(by: [0,2])
.multiMap { .multiMap {
it -> meta, reads, db ->
reads: [ it[0], it[1].flatten() ] reads: [ meta, reads.flatten() ]
db: it[2] db: db
} }
MALT_RUN ( ch_input_for_malt.reads, ch_input_for_malt.db ) MALT_RUN ( ch_input_for_malt.reads, ch_input_for_malt.db )
@ -323,6 +321,7 @@ workflow PROFILING {
meta, reads, db_meta, db -> meta, reads, db_meta, db ->
[[id: db_meta.db_name, single_end: meta.single_end], reads, db_meta, db] [[id: db_meta.db_name, single_end: meta.single_end], reads, db_meta, db]
} }
// FIXME: Groups elements in the channel using the meta map as key. Replace with grouping on specific keys.
.groupTuple(by: [0,2,3]) .groupTuple(by: [0,2,3])
.multiMap { .multiMap {
single_meta, reads, db_meta, db -> single_meta, reads, db_meta, db ->

View file

@ -30,6 +30,7 @@ workflow STANDARDISATION_PROFILES {
meta_new.tool = meta.tool == 'metaphlan3' ? 'metaphlan' : meta.tool == 'malt' ? 'megan6' : meta.tool meta_new.tool = meta.tool == 'metaphlan3' ? 'metaphlan' : meta.tool == 'malt' ? 'megan6' : meta.tool
[meta_new, profile] [meta_new, profile]
} }
// FIXME: Groups elements in the channel using the meta map as key. Replace with grouping on specific keys.
.groupTuple () .groupTuple ()
.map { [ it[0], it[1].flatten() ] } .map { [ it[0], it[1].flatten() ] }

View file

@ -197,6 +197,7 @@ workflow TAXPROFILER {
meta_new.remove('run_accession') meta_new.remove('run_accession')
[ meta_new, reads ] [ meta_new, reads ]
} }
// FIXME: Groups elements in the channel using the meta map as key. Replace with grouping on specific keys.
.groupTuple() .groupTuple()
.map { .map {
meta, reads -> meta, reads ->