forked from nf-core/modules
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update glimpse2 modules (nf-core#6825)
* Update glimpse2 modules * Update glimpse2 phase tuple * Update snapshot * Add versions --------- Co-authored-by: LouisLeNezet <[email protected]> Co-authored-by: Sateesh_Peri <[email protected]>
- Loading branch information
1 parent
567c24f
commit cc64e71
Showing
17 changed files
with
434 additions
and
200 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
199 changes: 199 additions & 0 deletions
199
modules/nf-core/glimpse2/concordance/tests/main.nf.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,199 @@ | ||
nextflow_process { | ||
|
||
name "Test Process GLIMPSE2_CONCORDANCE" | ||
script "../main.nf" | ||
process "GLIMPSE2_CONCORDANCE" | ||
tag "glimpse2" | ||
tag "glimpse2/concordance" | ||
tag "glimpse2/phase" | ||
tag "bcftools/index" | ||
tag "modules_nfcore" | ||
tag "modules" | ||
|
||
setup { | ||
run("GLIMPSE2_PHASE") { | ||
script "../../phase/main.nf" | ||
process { | ||
""" | ||
input_vcf = Channel.of([ | ||
[ id:'input'], // meta map | ||
file("https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/glimpse/NA12878.chr21.s.1x.vcf.gz", checkIfExists: true), | ||
file("https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/glimpse/NA12878.chr21.s.1x.vcf.gz.csi", checkIfExists: true), | ||
[] | ||
]) | ||
samples_infos = Channel.of('NA12878 2').collectFile(name: 'sampleinfos.txt') | ||
region = Channel.of(["chr21:16600000-16800000","chr21:16650000-16750000"]) | ||
ch_ref_panel = Channel.of([ | ||
file("https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/glimpse/1000GP.chr21.noNA12878.s.bcf", checkIfExists: true), | ||
file("https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/glimpse/1000GP.chr21.noNA12878.s.bcf.csi", checkIfExists: true) | ||
]) | ||
ch_map = Channel.of([ | ||
file("https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/glimpse/chr21.b38.gmap.gz", checkIfExists: true), | ||
]) | ||
// [meta, vcf, index, sample_infos, regionin, regionout, regionindex, ref, ref_index, map] | ||
input[0] = input_vcf | ||
.combine(samples_infos) | ||
.combine(region) | ||
.combine( ch_ref_panel ) | ||
.combine( ch_map ) | ||
input[1]= Channel.of([[],[],[]]) | ||
""" | ||
} | ||
} | ||
|
||
run("BCFTOOLS_INDEX") { | ||
script "../../../bcftools/index/main.nf" | ||
process { | ||
""" | ||
input[0] = GLIMPSE2_PHASE.output.phased_variants | ||
""" | ||
} | ||
} | ||
} | ||
|
||
|
||
test("test_glimpse2_concordance") { | ||
config "./nextflow.config" | ||
|
||
when { | ||
process { | ||
""" | ||
allele_freq = Channel.of([ | ||
file("https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/glimpse/1000GP.chr21.noNA12878.s.sites.vcf.gz",checkIfExists:true), | ||
file("https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/glimpse/1000GP.chr21.noNA12878.s.sites.vcf.gz.csi",checkIfExists:true) | ||
]) | ||
truth = Channel.of([ | ||
file("https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/glimpse/NA12878.chr21.s.bcf",checkIfExists:true), | ||
file("https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/glimpse/NA12878.chr21.s.bcf.csi",checkIfExists:true) | ||
]) | ||
list_inputs = GLIMPSE2_PHASE.output.phased_variants | ||
.join( BCFTOOLS_INDEX.out.csi ) | ||
.combine( truth ) | ||
.combine( allele_freq ) | ||
.combine( Channel.of([[]]) ) | ||
.combine( Channel.of(["chr21"]) ) | ||
input[0] = list_inputs | ||
input[1] = Channel.of([[id:"params"],[],"0 0.01 0.05 0.1 0.2 0.5",[],[]]) | ||
input[2] = 0.9999 | ||
input[3] = 8 | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot( | ||
process.out.errors_cal.collect{ file(it[1]).name }, | ||
process.out.errors_grp.collect{ file(it[1]).name }, | ||
process.out.errors_spl.collect{ file(it[1]).name }, | ||
process.out.rsquare_grp.collect{ file(it[1]).name }, | ||
process.out.rsquare_spl.collect{ file(it[1]).name }, | ||
process.out.versions | ||
).match() } | ||
) | ||
} | ||
|
||
} | ||
|
||
test("test_list_region") { | ||
config "./nextflow.config" | ||
|
||
when { | ||
process { | ||
""" | ||
allele_freq = Channel.of([ | ||
file("https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/glimpse/1000GP.chr21.noNA12878.s.sites.vcf.gz",checkIfExists:true), | ||
file("https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/glimpse/1000GP.chr21.noNA12878.s.sites.vcf.gz.csi",checkIfExists:true) | ||
]) | ||
truth = Channel.of([ | ||
file("https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/glimpse/NA12878.chr21.s.bcf",checkIfExists:true), | ||
file("https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/glimpse/NA12878.chr21.s.bcf.csi",checkIfExists:true) | ||
]) | ||
list_inputs = GLIMPSE2_PHASE.output.phased_variants | ||
.join( BCFTOOLS_INDEX.out.csi ) | ||
.combine( truth ) | ||
.combine( allele_freq ) | ||
.combine( Channel.of([[]]) ) | ||
.combine( Channel.of(["chr21", "chr21"]) ) | ||
input[0] = list_inputs | ||
input[1] = Channel.of([[id:"params"],[],"0 0.01 0.05 0.1 0.2 0.5",[],[]]) | ||
input[2] = 0.9999 | ||
input[3] = 8 | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot( | ||
process.out.errors_cal.collect{ file(it[1]).name }, | ||
process.out.errors_grp.collect{ file(it[1]).name }, | ||
process.out.errors_spl.collect{ file(it[1]).name }, | ||
process.out.rsquare_grp.collect{ file(it[1]).name }, | ||
process.out.rsquare_spl.collect{ file(it[1]).name }, | ||
process.out.versions | ||
).match() | ||
} | ||
) | ||
} | ||
|
||
} | ||
|
||
test("test_r2_per_site") { | ||
config "./nextflow_R2.config" | ||
|
||
when { | ||
process { | ||
""" | ||
allele_freq = Channel.of([ | ||
file("https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/glimpse/1000GP.chr21.noNA12878.s.sites.vcf.gz",checkIfExists:true), | ||
file("https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/glimpse/1000GP.chr21.noNA12878.s.sites.vcf.gz.csi",checkIfExists:true) | ||
]) | ||
truth = Channel.of([ | ||
file("https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/glimpse/NA12878.chr21.s.bcf",checkIfExists:true), | ||
file("https://github.com/nf-core/test-datasets/raw/modules/data/delete_me/glimpse/NA12878.chr21.s.bcf.csi",checkIfExists:true) | ||
]) | ||
list_inputs = GLIMPSE2_PHASE.output.phased_variants | ||
.join( BCFTOOLS_INDEX.out.csi ) | ||
.combine( truth ) | ||
.combine( allele_freq ) | ||
.combine( Channel.of([[]]) ) | ||
.combine( Channel.of(["chr21"]) ) | ||
input[0] = list_inputs | ||
input[1] = Channel.of([[id:"params"],[],"0 0.01 0.05 0.1 0.2 0.5",[],[]]) | ||
input[2] = 0.9999 | ||
input[3] = 8 | ||
""" | ||
} | ||
} | ||
|
||
then { | ||
assertAll( | ||
{ assert process.success }, | ||
{ assert snapshot( | ||
process.out.errors_cal.collect{ file(it[1]).name }, | ||
process.out.errors_grp.collect{ file(it[1]).name }, | ||
process.out.errors_spl.collect{ file(it[1]).name }, | ||
process.out.rsquare_grp.collect{ file(it[1]).name }, | ||
process.out.rsquare_spl.collect{ file(it[1]).name }, | ||
process.out.rsquare_per_site.collect{ file(it[1]).name }, | ||
process.out.versions | ||
).match() | ||
} | ||
) | ||
} | ||
|
||
} | ||
|
||
} |
86 changes: 86 additions & 0 deletions
86
modules/nf-core/glimpse2/concordance/tests/main.nf.test.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
{ | ||
"test_r2_per_site": { | ||
"content": [ | ||
[ | ||
"input.error.cal.txt.gz" | ||
], | ||
[ | ||
"input.error.grp.txt.gz" | ||
], | ||
[ | ||
"input.error.spl.txt.gz" | ||
], | ||
[ | ||
"input.rsquare.grp.txt.gz" | ||
], | ||
[ | ||
"input.rsquare.spl.txt.gz" | ||
], | ||
[ | ||
"input_r2_sites.txt.gz" | ||
], | ||
[ | ||
"versions.yml:md5,ba729289bab6b9fbb8c36a620c86bb82" | ||
] | ||
], | ||
"meta": { | ||
"nf-test": "0.8.4", | ||
"nextflow": "24.04.3" | ||
}, | ||
"timestamp": "2024-10-22T16:23:00.623182365" | ||
}, | ||
"test_glimpse2_concordance": { | ||
"content": [ | ||
[ | ||
"input.error.cal.txt.gz" | ||
], | ||
[ | ||
"input.error.grp.txt.gz" | ||
], | ||
[ | ||
"input.error.spl.txt.gz" | ||
], | ||
[ | ||
"input.rsquare.grp.txt.gz" | ||
], | ||
[ | ||
"input.rsquare.spl.txt.gz" | ||
], | ||
[ | ||
"versions.yml:md5,ba729289bab6b9fbb8c36a620c86bb82" | ||
] | ||
], | ||
"meta": { | ||
"nf-test": "0.8.4", | ||
"nextflow": "24.04.3" | ||
}, | ||
"timestamp": "2024-10-22T16:22:26.823581573" | ||
}, | ||
"test_list_region": { | ||
"content": [ | ||
[ | ||
"input.error.cal.txt.gz" | ||
], | ||
[ | ||
"input.error.grp.txt.gz" | ||
], | ||
[ | ||
"input.error.spl.txt.gz" | ||
], | ||
[ | ||
"input.rsquare.grp.txt.gz" | ||
], | ||
[ | ||
"input.rsquare.spl.txt.gz" | ||
], | ||
[ | ||
"versions.yml:md5,ba729289bab6b9fbb8c36a620c86bb82" | ||
] | ||
], | ||
"meta": { | ||
"nf-test": "0.8.4", | ||
"nextflow": "24.04.3" | ||
}, | ||
"timestamp": "2024-10-22T16:22:43.352729014" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
process { | ||
withName: GLIMPSE2_CHUNK { | ||
ext.prefix = { "${meta.id}" } | ||
} | ||
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } | ||
} |
14 changes: 7 additions & 7 deletions
14
...core/glimpse2/concordance/nextflow.config → ...pse2/concordance/tests/nextflow_R2.config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
process { | ||
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } | ||
|
||
withName:GLIMPSE2_CONCORDANCE_R2_PER_SITE { | ||
ext.args = "--out-r2-per-site" | ||
} | ||
} | ||
process { | ||
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } | ||
|
||
withName:GLIMPSE2_CONCORDANCE { | ||
ext.args = "--out-r2-per-site" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
glimpse2/concordance: | ||
- modules/nf-core/glimpse2/concordance/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.