Skip to content

Commit 2ac8cbf

Browse files
authored
fix issue when sex field in samplesheet is empty (#118)
1 parent a31c40f commit 2ac8cbf

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3030
1. Fail the pipeline when the sex determination failed. This will now prompt the user to add the sex to the samplesheet so the pipeline doesn't do any wrong assumptions
3131
2. Fixed the Jasmine module output VCFs being empty when no variants have been merged. This file now contains the header of one of the input VCFs
3232
3. AnnotSV VCF files are now sorted before trying to combine it with the VEP output.
33+
4. Fixed a map issue when the sex field is empty in the samplesheet
3334

3435
## v0.2.0 - [19 July 2024] - Mighty Manneken Pis
3536

workflows/structural.nf

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -300,19 +300,26 @@ workflow STRUCTURAL {
300300
no_sex: !meta.sex
301301
}
302302

303+
def ch_samplegender_multi = ch_samplegender_input.no_sex
304+
.multiMap { meta, cram, crai, small_variants ->
305+
cram: [ meta, cram, crai ]
306+
other: [ meta, small_variants ]
307+
}
308+
303309
NGSBITS_SAMPLEGENDER(
304-
ch_samplegender_input.no_sex,
310+
ch_samplegender_multi.cram,
305311
ch_fasta,
306312
ch_fai,
307313
"xy"
308314
)
309315
ch_versions = ch_versions.mix(NGSBITS_SAMPLEGENDER.out.versions.first())
310316

311317
ch_input_sex = NGSBITS_SAMPLEGENDER.out.tsv
312-
.join(ch_samplegender_input.no_sex, failOnDuplicate:true, failOnMismatch:true)
313-
.map { meta, tsv, cram, crai ->
318+
.join(ch_samplegender_multi.cram, failOnDuplicate:true, failOnMismatch:true)
319+
.join(ch_samplegender_multi.other, failOnDuplicate:true, failOnMismatch:true)
320+
.map { meta, tsv, cram, crai, small_variants ->
314321
def new_meta = meta + [sex:get_sex(tsv, meta.sample)]
315-
return [ new_meta, cram, crai ]
322+
return [ new_meta, cram, crai, small_variants ]
316323
}
317324
.mix(ch_samplegender_input.sex)
318325
} else {

0 commit comments

Comments
 (0)