Skip to content

Commit

Permalink
Add samples renaming for truth splitted files
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisLeNezet committed Nov 22, 2024
1 parent c1fd186 commit cd450c3
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 40 deletions.
14 changes: 14 additions & 0 deletions conf/steps/validation.config
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,20 @@ process {
ext.args = ["--ligate", "--output-type z", "--write-index=tbi"].join(' ')
}

// Compute sample files for renaming
withName: 'NFCORE_PHASEIMPUTE:PHASEIMPUTE:BCFTOOLS_QUERY' {
tag = { "${meta.id} Batch ${meta.batch} ${meta.tools}" }
ext.args = '--list-samples'
publishDir = [enabled: false]
}

withName: 'NFCORE_PHASEIMPUTE:PHASEIMPUTE:GAWK' {
tag = { "${meta.id} Batch ${meta.batch} ${meta.tools}" }
ext.prefix = { "${meta.id}_samples"}
ext.args2 = "'BEGIN { OFS = \"\\t\" } { print \$1, \"-\", \$1\".truth\" }'"
publishDir = [enabled: false]
}

// Split by samples
withName: 'NFCORE_PHASEIMPUTE:PHASEIMPUTE:SPLIT_TRUTH:BCFTOOLS_PLUGINSPLIT' {
ext.args = ["--output-type z", "--write-index=tbi"].join(' ')
Expand Down
2 changes: 1 addition & 1 deletion conf/test.config
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
process {
resourceLimits = [
cpus: 4,
memory: '15.GB',
memory: '7.GB',
time: '1.h'
]
}
Expand Down
2 changes: 1 addition & 1 deletion conf/test_all.config
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
process {
resourceLimits = [
cpus: 2,
memory: '10.GB',
memory: '7.GB',
time: '1.h'
]
}
Expand Down
11 changes: 9 additions & 2 deletions workflows/phaseimpute/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ include { BCFTOOLS_STATS as BCFTOOLS_STATS_TOOLS } from '../../modules/nf-co

// Concordance subworkflows
include { BAM_GL_BCFTOOLS as GL_TRUTH } from '../../subworkflows/local/bam_gl_bcftools'
include { BCFTOOLS_QUERY } from '../../modules/nf-core/bcftools/query'
include { GAWK } from '../../modules/nf-core/gawk'
include { VCF_SPLIT_BCFTOOLS as SPLIT_TRUTH } from '../../subworkflows/local/vcf_split_bcftools'
include { BCFTOOLS_STATS as BCFTOOLS_STATS_TRUTH } from '../../modules/nf-core/bcftools/stats'
include { VCF_CONCATENATE_BCFTOOLS as CONCAT_TRUTH } from '../../subworkflows/local/vcf_concatenate_bcftools'
Expand Down Expand Up @@ -372,7 +374,7 @@ workflow PHASEIMPUTE {
}

// Split result by samples
VCF_SPLIT_BCFTOOLS(ch_input_validate)
VCF_SPLIT_BCFTOOLS(ch_input_validate.map{ [it[0], it[1], it[2], []] })
ch_input_validate = VCF_SPLIT_BCFTOOLS.out.vcf_tbi

// Compute stats on imputed files
Expand Down Expand Up @@ -443,8 +445,13 @@ workflow PHASEIMPUTE {
CONCAT_TRUTH(ch_truth_vcf)
ch_versions = ch_versions.mix(CONCAT_TRUTH.out.versions)

// Prepare renaming file
BCFTOOLS_QUERY(CONCAT_TRUTH.out.vcf_tbi, [], [], [])
GAWK(BCFTOOLS_QUERY.out.output, [])
ch_pluginsplit = CONCAT_TRUTH.out.vcf_tbi.join(GAWK.out.output.view())

// Split truth vcf by samples
SPLIT_TRUTH(CONCAT_TRUTH.out.vcf_tbi)
SPLIT_TRUTH(ch_pluginsplit)
ch_versions = ch_versions.mix(SPLIT_TRUTH.out.versions)

// Compute stats on truth files
Expand Down
72 changes: 36 additions & 36 deletions workflows/phaseimpute/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
]
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.4"
"nf-test": "0.9.2",
"nextflow": "24.10.1"
},
"timestamp": "2024-10-25T16:47:19.203956394"
"timestamp": "2024-11-22T13:07:42.012993182"
},
"Check test_all": {
"content": [
Expand Down Expand Up @@ -117,12 +117,12 @@
[
"validation/concat/all.A-truth.vcf.gz",
"validation/concat/all.A-truth.vcf.gz.tbi",
"validation/samples/NA12878.vcf.gz",
"validation/samples/NA12878.vcf.gz.tbi",
"validation/samples/NA19401.vcf.gz",
"validation/samples/NA19401.vcf.gz.tbi",
"validation/samples/NA20359.vcf.gz",
"validation/samples/NA20359.vcf.gz.tbi",
"validation/samples/NA12878.truth.vcf.gz",
"validation/samples/NA12878.truth.vcf.gz.tbi",
"validation/samples/NA19401.truth.vcf.gz",
"validation/samples/NA19401.truth.vcf.gz.tbi",
"validation/samples/NA20359.truth.vcf.gz",
"validation/samples/NA20359.truth.vcf.gz.tbi",
"validation/stats/AllSamples.txt",
"validation/stats/NA12878.truth.bcftools_stats.txt",
"validation/stats/NA12878_P1000GP_Tglimpse1_SNP.txt",
Expand Down Expand Up @@ -167,19 +167,19 @@
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.10.0"
"nextflow": "24.10.1"
},
"timestamp": "2024-11-18T23:36:12.634065627"
"timestamp": "2024-11-22T13:58:54.188813202"
},
"Check test_validate": {
"content": [
[
"validation/samples/NA12878.vcf.gz",
"validation/samples/NA12878.vcf.gz.tbi",
"validation/samples/NA19401.vcf.gz",
"validation/samples/NA19401.vcf.gz.tbi",
"validation/samples/NA20359.vcf.gz",
"validation/samples/NA20359.vcf.gz.tbi",
"validation/samples/NA12878.truth.vcf.gz",
"validation/samples/NA12878.truth.vcf.gz.tbi",
"validation/samples/NA19401.truth.vcf.gz",
"validation/samples/NA19401.truth.vcf.gz.tbi",
"validation/samples/NA20359.truth.vcf.gz",
"validation/samples/NA20359.truth.vcf.gz.tbi",
"validation/stats/AllSamples.txt",
"validation/stats/NA12878.truth.bcftools_stats.txt",
"validation/stats/NA12878_SNP.txt",
Expand All @@ -191,9 +191,9 @@
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.10.0"
"nextflow": "24.10.1"
},
"timestamp": "2024-11-18T23:30:21.177496237"
"timestamp": "2024-11-22T13:54:09.435194577"
},
"Check test_batch": {
"content": [
Expand Down Expand Up @@ -249,12 +249,12 @@
"NA20359"
],
[
"validation/samples/NA12878.vcf.gz",
"validation/samples/NA12878.vcf.gz.tbi",
"validation/samples/NA19401.vcf.gz",
"validation/samples/NA19401.vcf.gz.tbi",
"validation/samples/NA20359.vcf.gz",
"validation/samples/NA20359.vcf.gz.tbi",
"validation/samples/NA12878.truth.vcf.gz",
"validation/samples/NA12878.truth.vcf.gz.tbi",
"validation/samples/NA19401.truth.vcf.gz",
"validation/samples/NA19401.truth.vcf.gz.tbi",
"validation/samples/NA20359.truth.vcf.gz",
"validation/samples/NA20359.truth.vcf.gz.tbi",
"validation/stats/AllSamples.txt",
"validation/stats/NA12878.truth.bcftools_stats.txt",
"validation/stats/NA12878_P1000GP_Tglimpse2_SNP.txt",
Expand All @@ -269,9 +269,9 @@
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.10.0"
"nextflow": "24.10.1"
},
"timestamp": "2024-11-18T23:47:48.301571495"
"timestamp": "2024-11-22T14:06:57.642618122"
},
"Check test_quilt": {
"content": [
Expand Down Expand Up @@ -299,10 +299,10 @@
]
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.4"
"nf-test": "0.9.2",
"nextflow": "24.10.1"
},
"timestamp": "2024-10-25T16:46:11.131198832"
"timestamp": "2024-11-22T13:05:58.709941089"
},
"Check test_sim": {
"content": [
Expand Down Expand Up @@ -380,10 +380,10 @@
]
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.4"
"nf-test": "0.9.2",
"nextflow": "24.10.1"
},
"timestamp": "2024-10-25T16:44:41.049965503"
"timestamp": "2024-11-22T13:03:28.516026252"
},
"Check test": {
"content": [
Expand Down Expand Up @@ -463,9 +463,9 @@
]
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.4"
"nf-test": "0.9.2",
"nextflow": "24.10.1"
},
"timestamp": "2024-10-25T16:56:33.72923425"
"timestamp": "2024-11-22T13:16:12.803136748"
}
}

0 comments on commit cd450c3

Please sign in to comment.