Skip to content

Commit

Permalink
Merge pull request #184 from nf-cmgg/fix/automap-updio-issues
Browse files Browse the repository at this point in the history
Fix/automap updio issues
  • Loading branch information
nvnieuwk committed Aug 8, 2024
2 parents 62ced4c + 7f36cda commit 55a68ab
Show file tree
Hide file tree
Showing 9 changed files with 74 additions and 47 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## v1.7.0dev

## Fixes

1. Automap analysis should now give the correct output files for individuals.

## v1.6.0 - Offbeat Ostend - [April 29 2024]

### New features
Expand Down
2 changes: 1 addition & 1 deletion conf/modules.config
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ process {
withName: "^.*VCF_ROH_AUTOMAP:AUTOMAP_AUTOMAP\$" {
ext.prefix = {"automap_${meta.caller}"}
ext.args = {[
meta.family_count > 1 ? "--multivcf" : "",
meta.family_count > 1 ? "--multivcf" : "--id ${meta.samples}",
params.automap_panel_name ? "--panelname ${params.automap_panel_name}" : ""
].findAll { it != "" }.join(" ")}
publishDir = [
Expand Down
2 changes: 1 addition & 1 deletion modules/local/automap/automap/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ process AUTOMAP_AUTOMAP {
automap \\
--vcf $vcf \\
--genome $hg_genome \\
--out $prefix \\
--out $prefix/ \\
--repeats $repeats \\
$panel_file \\
$args
Expand Down
4 changes: 4 additions & 0 deletions subworkflows/local/cram_call_vardictjava/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@ workflow CRAM_CALL_VARDICTJAVA {

ch_filter_output
.join(TABIX_TABIX.out.tbi, failOnDuplicate: true, failOnMismatch: true)
.map { meta, vcf, tbi ->
def new_meta = meta + [samples: meta.sample]
[ new_meta, vcf, tbi ]
}
.set { ch_vcfs }

emit:
Expand Down
12 changes: 10 additions & 2 deletions subworkflows/local/gvcf_joint_genotype_gatk4/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,13 @@ workflow GVCF_JOINT_GENOTYPE_GATK4 {
family_count: meta.family_count,
caller: meta.caller
]
[ groupKey(new_meta, meta.family_count.toInteger()), gvcf, tbi ]
[ groupKey(new_meta, meta.family_count.toInteger()), gvcf, tbi, meta.sample ]
}
.groupTuple()
.map { meta, gvcf, tbi, samples ->
def new_meta = meta + [samples: "${samples.sort(false).join(',')}"] // Having a comma-separated string ensures that joins don't fail
[ new_meta, gvcf, tbi ]
}
.combine(GAWK.out.output.map { it[1] })
.map { meta, gvcfs, tbis, bed ->
[ meta, gvcfs, tbis, bed, [], [] ]
Expand Down Expand Up @@ -89,9 +93,13 @@ workflow GVCF_JOINT_GENOTYPE_GATK4 {
family_count: meta.family_count,
caller: meta.caller
]
[ groupKey(new_meta, meta.family_count.toInteger()), bed ]
[ groupKey(new_meta, meta.family_count.toInteger()), bed, meta.sample ]
}
.groupTuple()
.map { meta, bed, samples ->
def new_meta = meta + [samples: "${samples.sort(false).join(',')}"] // Having a comma-separated string ensures that joins don't fail
[ new_meta, bed ]
}
.dump(tag:'merge_beds_input', pretty: true)
.set { ch_merge_beds_input }

Expand Down
45 changes: 25 additions & 20 deletions tests/subworkflows/local/cram_call_genotype_gatk4/main.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"family": "Ashkenazim",
"id": "Ashkenazim",
"family_count": 3,
"caller": "haplotypecaller"
"caller": "haplotypecaller",
"samples": "NA24143,NA24149,NA24835"
},
"Ashkenazim.haplotypecaller.vcf.gz",
"Ashkenazim.haplotypecaller.vcf.gz.tbi"
Expand All @@ -37,10 +38,10 @@
]
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.02.0"
"nf-test": "0.9.0",
"nextflow": "24.04.3"
},
"timestamp": "2024-03-27T10:07:15.389498873"
"timestamp": "2024-08-06T13:01:36.711373912"
},
"filter - family": {
"content": [
Expand All @@ -50,7 +51,8 @@
"family": "Ashkenazim",
"id": "Ashkenazim",
"family_count": 3,
"caller": "haplotypecaller"
"caller": "haplotypecaller",
"samples": "NA24143,NA24149,NA24835"
},
"Ashkenazim.haplotypecaller.vcf.gz",
"Ashkenazim.haplotypecaller.vcf.gz.tbi"
Expand All @@ -63,10 +65,10 @@
]
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.02.0"
"nf-test": "0.9.0",
"nextflow": "24.04.3"
},
"timestamp": "2024-03-27T10:11:00.537979751"
"timestamp": "2024-08-06T13:02:26.651064532"
},
"default - gvcfs": {
"content": [
Expand All @@ -76,7 +78,8 @@
"family": "Ashkenazim",
"id": "Ashkenazim",
"family_count": 1,
"caller": "haplotypecaller"
"caller": "haplotypecaller",
"samples": "NA24143"
},
"Ashkenazim.haplotypecaller.vcf.gz",
"Ashkenazim.haplotypecaller.vcf.gz.tbi"
Expand All @@ -87,10 +90,10 @@
]
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.02.0"
"nf-test": "0.9.0",
"nextflow": "24.04.3"
},
"timestamp": "2024-03-27T10:09:15.858225835"
"timestamp": "2024-08-06T12:56:23.435795439"
},
"default - crams": {
"content": [
Expand All @@ -100,7 +103,8 @@
"family": "Ashkenazim",
"id": "Ashkenazim",
"family_count": 1,
"caller": "haplotypecaller"
"caller": "haplotypecaller",
"samples": "NA24143"
},
"Ashkenazim.haplotypecaller.vcf.gz",
"Ashkenazim.haplotypecaller.vcf.gz.tbi"
Expand All @@ -113,10 +117,10 @@
]
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.02.0"
"nf-test": "0.9.0",
"nextflow": "24.04.3"
},
"timestamp": "2024-03-27T10:06:11.00007181"
"timestamp": "2024-08-06T12:55:51.608812907"
},
"only_call - family": {
"content": [
Expand All @@ -143,7 +147,8 @@
"family": "Ashkenazim",
"id": "Ashkenazim",
"family_count": 2,
"caller": "haplotypecaller"
"caller": "haplotypecaller",
"samples": "NA24143,NA24835"
},
"Ashkenazim.haplotypecaller.vcf.gz",
"Ashkenazim.haplotypecaller.vcf.gz.tbi"
Expand All @@ -156,9 +161,9 @@
]
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.02.0"
"nf-test": "0.9.0",
"nextflow": "24.04.3"
},
"timestamp": "2024-03-27T10:22:47.471505664"
"timestamp": "2024-08-06T13:04:20.473178165"
}
}
30 changes: 17 additions & 13 deletions tests/subworkflows/local/cram_call_vardictjava/main.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,19 @@
"sample": "NA24143",
"family": "Ashkenazim",
"family_count": 1,
"caller": "vardict"
"caller": "vardict",
"samples": "NA24143"
},
"NA24143.vardict.vcf.gz",
"NA24143.vardict.vcf.gz.tbi"
]
]
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.02.0"
"nf-test": "0.9.0",
"nextflow": "24.04.3"
},
"timestamp": "2024-03-27T10:30:53.553985963"
"timestamp": "2024-08-06T13:05:31.562298546"
},
"default": {
"content": [
Expand All @@ -30,18 +31,19 @@
"sample": "NA24143",
"family": "Ashkenazim",
"family_count": 1,
"caller": "vardict"
"caller": "vardict",
"samples": "NA24143"
},
"NA24143.vardict.vcf.gz",
"NA24143.vardict.vcf.gz.tbi"
]
]
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.02.0"
"nf-test": "0.9.0",
"nextflow": "24.04.3"
},
"timestamp": "2024-03-27T10:31:27.5084132"
"timestamp": "2024-08-06T13:05:04.322416692"
},
"family": {
"content": [
Expand All @@ -52,7 +54,8 @@
"sample": "NA24143",
"family": "Ashkenazim",
"family_count": 2,
"caller": "vardict"
"caller": "vardict",
"samples": "NA24143"
},
"NA24143.vardict.vcf.gz",
"NA24143.vardict.vcf.gz.tbi"
Expand All @@ -63,17 +66,18 @@
"sample": "NA24149",
"family": "Ashkenazim",
"family_count": 2,
"caller": "vardict"
"caller": "vardict",
"samples": "NA24149"
},
"NA24149.vardict.vcf.gz",
"NA24149.vardict.vcf.gz.tbi"
]
]
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.02.0"
"nf-test": "0.9.0",
"nextflow": "24.04.3"
},
"timestamp": "2024-03-27T10:33:57.915748864"
"timestamp": "2024-08-06T13:06:05.012625054"
}
}
4 changes: 2 additions & 2 deletions tests/subworkflows/local/vcf_roh_automap/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ nextflow_workflow {
workflow {
"""
input[0] = Channel.of([
[id:"Ashkenazim", family:"Ashkenazim", family_count:3, caller:"haplotypecaller"],
[id:"Ashkenazim", family:"Ashkenazim", family_count:3, caller:"haplotypecaller", samples: "NA24143,NA24835,NA24149"],
file(params.famvcf, checkIfExists:true),
file(params.famtbi, checkIfExists:true)
])
Expand Down Expand Up @@ -58,7 +58,7 @@ nextflow_workflow {
workflow {
"""
input[0] = Channel.of([
[id:"NA24143", family:"NA24143", family_count:1, caller:"haplotypecaller"],
[id:"NA24143", family:"NA24143", family_count:1, caller:"haplotypecaller", samples: "NA24143,NA24835,NA24149"],
file(params.vcf1, checkIfExists:true),
file(params.tbi1, checkIfExists:true)
])
Expand Down
18 changes: 10 additions & 8 deletions tests/subworkflows/local/vcf_roh_automap/main.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"id": "Ashkenazim",
"family": "Ashkenazim",
"family_count": 3,
"caller": "haplotypecaller"
"caller": "haplotypecaller",
"samples": "NA24143,NA24835,NA24149"
},
[
[
Expand All @@ -24,10 +25,10 @@
]
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.02.0"
"nf-test": "0.9.0",
"nextflow": "24.04.3"
},
"timestamp": "2024-04-04T16:13:43.925198036"
"timestamp": "2024-08-06T13:06:37.322068108"
},
"default - sample": {
"content": [
Expand All @@ -37,7 +38,8 @@
"id": "NA24143",
"family": "NA24143",
"family_count": 1,
"caller": "haplotypecaller"
"caller": "haplotypecaller",
"samples": "NA24143,NA24835,NA24149"
},
[
"NA24143.HomRegions.cmgg_bio.tsv:md5,d41d8cd98f00b204e9800998ecf8427e",
Expand All @@ -49,9 +51,9 @@
]
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.02.0"
"nf-test": "0.9.0",
"nextflow": "24.04.3"
},
"timestamp": "2024-04-04T16:03:23.276826691"
"timestamp": "2024-08-06T13:06:47.205904762"
}
}

0 comments on commit 55a68ab

Please sign in to comment.