Skip to content

Commit

Permalink
Update glimpse/phase output channel to phased_variants nf-core#5172 (n…
Browse files Browse the repository at this point in the history
…f-core#5174)

* Update glimpse/phase output channel to phased_variants

* Update nf-test

* Update tags and meta.yml

* Update tags in ligate

* Fix typo

* Delete non use argument

* Update tags in sbwf

* Update test data

* Update tag nftest

* Change extension individuals files

* Update genetic map

* Change map by chromosome

* Update vcf_impute_glimpse nftest

* Update to phased_variants

* Update glimpse concordance

* Update modules/nf-core/glimpse/ligate/meta.yml

Co-authored-by: Matthias Hörtenhuber <[email protected]>

---------

Co-authored-by: Matthias Hörtenhuber <[email protected]>
  • Loading branch information
2 people authored and Alexander Nater committed Mar 21, 2024
1 parent f3b51f7 commit 74b4561
Show file tree
Hide file tree
Showing 16 changed files with 143 additions and 160 deletions.
2 changes: 1 addition & 1 deletion modules/nf-core/glimpse/chunk/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ tools:
documentation: "https://odelaneau.github.io/GLIMPSE/commands.html"
tool_dev_url: "https://github.com/odelaneau/GLIMPSE"
doi: "10.1038/s41588-020-00756-0"
licence: "['MIT']"
licence: ["MIT"]
input:
- meta:
type: map
Expand Down
2 changes: 1 addition & 1 deletion modules/nf-core/glimpse/concordance/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ tools:
documentation: "https://odelaneau.github.io/GLIMPSE/commands.html"
tool_dev_url: "https://github.com/odelaneau/GLIMPSE"
doi: "10.1038/s41588-020-00756-0"
licence: "['MIT']"
licence: ["MIT"]
input:
- meta:
type: map
Expand Down
29 changes: 16 additions & 13 deletions modules/nf-core/glimpse/concordance/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@ nextflow_process {
name "Test Process GLIMPSE_CONCORDANCE"
script "../main.nf"
process "GLIMPSE_CONCORDANCE"
tag "glimpse"
tag "glimpse/concordance"

tag "modules"
tag "modules_nfcore"
tag "glimpse"
tag "glimpse/concordance"
tag "glimpse/phase"
tag "bcftools/index"

test("test_glimpse_concordance") {
setup {
Expand All @@ -20,15 +23,15 @@ nextflow_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)
file(params.modules_testdata_base_path + "delete_me/glimpse/NA12878.chr21.s.1x.vcf.gz", checkIfExists: true),
file(params.modules_testdata_base_path + "delete_me/glimpse/NA12878.chr21.s.1x.vcf.gz.csi", checkIfExists: true)
])
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)
file(params.modules_testdata_base_path + "delete_me/glimpse/1000GP.chr21.noNA12878.s.bcf", checkIfExists: true),
file(params.modules_testdata_base_path + "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),
file(params.modules_testdata_base_path + "delete_me/glimpse/chr21.b38.gmap.gz", checkIfExists: true),
])
input[0] = input_vcf
Expand All @@ -43,7 +46,7 @@ nextflow_process {
script "../../../bcftools/index/main.nf"
process {
"""
input[0] = GLIMPSE_PHASE.out.phased_variant
input[0] = GLIMPSE_PHASE.out.phased_variants
"""
}
}
Expand All @@ -52,14 +55,14 @@ nextflow_process {
process {
"""
allele_freq = Channel.fromList([
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)
file(params.modules_testdata_base_path + "delete_me/glimpse/1000GP.chr21.noNA12878.s.sites.vcf.gz",checkIfExists:true),
file(params.modules_testdata_base_path + "delete_me/glimpse/1000GP.chr21.noNA12878.s.sites.vcf.gz.csi",checkIfExists:true)
]).collect()
truth = Channel.fromList([
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)
file(params.modules_testdata_base_path + "delete_me/glimpse/NA12878.chr21.s.bcf",checkIfExists:true),
file(params.modules_testdata_base_path + "delete_me/glimpse/NA12878.chr21.s.bcf.csi",checkIfExists:true)
]).collect()
estimate = GLIMPSE_PHASE.out.phased_variant
estimate = GLIMPSE_PHASE.out.phased_variants
| join (BCFTOOLS_INDEX.out.csi)
input[0] = estimate
| combine (allele_freq)
Expand Down
26 changes: 15 additions & 11 deletions modules/nf-core/glimpse/concordance/tests/main.nf.test.snap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion modules/nf-core/glimpse/ligate/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ tools:
documentation: "https://odelaneau.github.io/GLIMPSE/commands.html"
tool_dev_url: "https://github.com/odelaneau/GLIMPSE"
doi: "10.1038/s41588-020-00756-0"
licence: "['MIT']"
licence: ["MIT"]
input:
- meta:
type: map
Expand Down
21 changes: 12 additions & 9 deletions modules/nf-core/glimpse/ligate/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@ nextflow_process {
name "Test Process GLIMPSE_LIGATE"
script "../main.nf"
process "GLIMPSE_LIGATE"
tag "glimpse"
tag "glimpse/ligate"

tag "modules_nfcore"
tag "modules"
tag "glimpse"
tag "glimpse/ligate"
tag "glimpse/phase"
tag "bcftools/index"

test("test_glimpse_ligate") {
setup {
Expand All @@ -21,15 +24,15 @@ nextflow_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)
file(params.modules_testdata_base_path + "delete_me/glimpse/NA12878.chr21.s.1x.vcf.gz", checkIfExists: true),
file(params.modules_testdata_base_path + "delete_me/glimpse/NA12878.chr21.s.1x.vcf.gz.csi", checkIfExists: true)
])
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)
file(params.modules_testdata_base_path + "delete_me/glimpse/1000GP.chr21.noNA12878.s.bcf", checkIfExists: true),
file(params.modules_testdata_base_path + "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),
file(params.modules_testdata_base_path + "delete_me/glimpse/chr21.b38.gmap.gz", checkIfExists: true),
])
input[0] = input_vcf
Expand All @@ -44,7 +47,7 @@ nextflow_process {
script "../../../bcftools/index/main.nf"
process {
"""
input[0] = GLIMPSE_PHASE.out.phased_variant
input[0] = GLIMPSE_PHASE.out.phased_variants
"""
}
}
Expand All @@ -53,7 +56,7 @@ nextflow_process {
when {
process {
"""
input[0] = GLIMPSE_PHASE.out.phased_variant
input[0] = GLIMPSE_PHASE.out.phased_variants
| groupTuple()
| join (BCFTOOLS_INDEX.out.csi.groupTuple())
"""
Expand Down
4 changes: 2 additions & 2 deletions modules/nf-core/glimpse/phase/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ process GLIMPSE_PHASE {

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/glimpse-bio:1.1.1--h2ce4488_2':
'https://depot.galaxyproject.org/singularity/glimpse-bio:1.1.1--hce55b13_1':
'biocontainers/glimpse-bio:1.1.1--hce55b13_1' }"

input:
tuple val(meta) , path(input), path(input_index), path(samples_file), val(input_region), val(output_region), path(reference), path(reference_index), path(map)

output:
tuple val(meta), path("*.{vcf,bcf,vcf.gz,bcf.gz}"), emit: phased_variant
tuple val(meta), path("*.{vcf,bcf,vcf.gz,bcf.gz}"), emit: phased_variants
path "versions.yml" , emit: versions

when:
Expand Down
2 changes: 1 addition & 1 deletion modules/nf-core/glimpse/phase/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ tools:
documentation: "https://odelaneau.github.io/GLIMPSE/commands.html"
tool_dev_url: "https://github.com/odelaneau/GLIMPSE"
doi: "10.1038/s41588-020-00756-0"
licence: "['MIT']"
licence: ["MIT"]
input:
- meta:
type: map
Expand Down
14 changes: 7 additions & 7 deletions modules/nf-core/glimpse/phase/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ nextflow_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)
file(params.modules_testdata_base_path + "delete_me/glimpse/NA12878.chr21.s.1x.vcf.gz", checkIfExists: true),
file(params.modules_testdata_base_path + "delete_me/glimpse/NA12878.chr21.s.1x.vcf.gz.csi", checkIfExists: true)
])
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)
file(params.modules_testdata_base_path + "delete_me/glimpse/1000GP.chr21.noNA12878.s.bcf", checkIfExists: true),
file(params.modules_testdata_base_path + "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),
file(params.modules_testdata_base_path + "delete_me/glimpse/chr21.b38.gmap.gz", checkIfExists: true),
])
input[0] = input_vcf
Expand All @@ -47,7 +47,7 @@ nextflow_process {

then {
String targetFileName = "input_present_chr21_16650000-16800000.vcf.gz"
File selectedFile = process.out.phased_variant.stream()
File selectedFile = process.out.phased_variants.stream()
.filter(vector -> vector.size() > 1)
.map(vector -> new File(vector.get(1).toString()))
.filter(file -> file.getName().equals(targetFileName))
Expand All @@ -58,7 +58,7 @@ nextflow_process {
assertAll(
{ assert process.success },
{ assert snapshot(process.out.versions).match("versions") },
{ assert process.out.phased_variant.size() == 4},
{ assert process.out.phased_variants.size() == 4},
{ assert snapshot(lines).match("imputed") }
)
}
Expand Down
8 changes: 1 addition & 7 deletions modules/nf-core/glimpse/sample/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ tools:
documentation: "https://odelaneau.github.io/GLIMPSE/commands.html"
tool_dev_url: "https://github.com/odelaneau/GLIMPSE"
doi: "10.1038/s41588-020-00756-0"
licence: "['MIT']"
licence: ["MIT"]
input:
- meta:
type: map
Expand All @@ -22,12 +22,6 @@ input:
type: file
description: VCF/BCF file generated using GLIMPSE ligate
pattern: "*.{vcf,bcf,vcf.gz,bcf.gz}"
- sample:
type: parameter
description: Samples a likely haplotype pair for each sample, use it in combination with --seed. Option not recommended for general usage, use --solve instead
- solve:
type: parameter
description: Get the most likely haplotype pair for each sample (the random number generator is not used)
output:
- meta:
type: map
Expand Down
18 changes: 10 additions & 8 deletions modules/nf-core/glimpse/sample/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ nextflow_process {
name "Test Process GLIMPSE_SAMPLE"
script "../main.nf"
process "GLIMPSE_SAMPLE"
tag "glimpse"
tag "glimpse/sample"

tag "modules"
tag "modules_nfcore"
tag "glimpse"
tag "glimpse/sample"
tag "glimpse/phase"

test("test_glimpse_sample") {
config "./nextflow.config"
Expand All @@ -21,15 +23,15 @@ nextflow_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)
file(params.modules_testdata_base_path + "delete_me/glimpse/NA12878.chr21.s.1x.vcf.gz", checkIfExists: true),
file(params.modules_testdata_base_path + "delete_me/glimpse/NA12878.chr21.s.1x.vcf.gz.csi", checkIfExists: true)
])
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)
file(params.modules_testdata_base_path + "delete_me/glimpse/1000GP.chr21.noNA12878.s.bcf", checkIfExists: true),
file(params.modules_testdata_base_path + "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),
file(params.modules_testdata_base_path + "delete_me/glimpse/chr21.b38.gmap.gz", checkIfExists: true),
])
input[0] = input_vcf
Expand All @@ -44,7 +46,7 @@ nextflow_process {
when {
process {
"""
input[0] = GLIMPSE_PHASE.out.phased_variant
input[0] = GLIMPSE_PHASE.out.phased_variants
"""
}
}
Expand Down
4 changes: 2 additions & 2 deletions subworkflows/nf-core/vcf_impute_glimpse/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ workflow VCF_IMPUTE_GLIMPSE {
GLIMPSE_PHASE ( phase_input ) // [meta, vcf, index, sample_infos, regionin, regionout, ref, ref_index, map]
ch_versions = ch_versions.mix(GLIMPSE_PHASE.out.versions )

INDEX_PHASE ( GLIMPSE_PHASE.out.phased_variant )
INDEX_PHASE ( GLIMPSE_PHASE.out.phased_variants )
ch_versions = ch_versions.mix( INDEX_PHASE.out.versions )

// Ligate all phased files in one and index it
ligate_input = GLIMPSE_PHASE.out.phased_variant
ligate_input = GLIMPSE_PHASE.out.phased_variants
.groupTuple( by: 0 )
.combine( INDEX_PHASE.out.csi
.groupTuple( by: 0 ),
Expand Down
Loading

0 comments on commit 74b4561

Please sign in to comment.