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

Add comments about MALT id replacement and refactor for simplicity

This commit is contained in:
James A. Fellows Yates 2022-06-10 11:27:51 +02:00 committed by GitHub
parent 800c0dd2aa
commit 621b6a3d09
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -66,13 +66,20 @@ workflow PROFILING {
.filter { it[0]['instrument_platform'] == 'ILLUMINA' }
.map {
meta, reads, db_meta, db ->
def sam_format = params.malt_save_reads ? ' --alignments ./ -za false' : ""
def temp_meta = [ id: meta['db_name'] ]
def new_meta = meta.clone()
def new_db_meta = db_meta.clone()
// Add the saving of alignments in SAM format to params
def sam_format = params.malt_save_reads ? ' --alignments ./ -za false' : ""
new_db_meta['db_params'] = db_meta['db_params'] + sam_format
def new_meta = temp_meta + new_db_meta
new_meta['id'] = new_meta['db_name']
[ new_meta, reads, db ]
// As MALT has huge databases, we don't run on a per-sample basis but multiple
// samples at once. This replaces the ID of the particular process with the
// db_name instead to prevent `null` in job name, and in publishDir)
def updated_meta = new_meta + new_db_meta
updated_meta['id'] = updated_meta['db_name']
[ updated_meta, reads, db ]
}
.groupTuple(by: [0,2])
.multiMap {