Refactor splitting up parts for cleaner code
Joon-Klaps opened this issue · comments
Joon Klaps commented
Description of feature
Do like this:
ch_input_for_kaiju2krona = ch_input_classifications.kaiju
.map{ meta, profiles -> [[meta['tool'], meta['db_name']], meta, profiles] }
.combine( databases.map{ meta, db -> [[meta['tool'], meta['db_name']], db] }, by: 0 )
.multiMap{
it ->
profiles: [it[1], it[2]]
db: it[3]
}
Not this:
// run stats on all variants not only those that pass the filter
vcf_fasta = ch_vcf.join(meta_fasta, by: [0])
vcf = vcf_fasta.map{ meta, vcf, fasta -> [ meta, vcf ] }
fasta = vcf_fasta.map{ meta, vcf, fasta -> [ meta, fasta ] }