Skip to content

Commit

Permalink
Merge pull request nf-core#78 from LouisLeNezet/validate
Browse files Browse the repository at this point in the history
Validate
  • Loading branch information
LouisLeNezet authored Jun 7, 2024
2 parents cf7a7fc + aa46859 commit ec11c67
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Initial release of nf-core/phaseimpute, created with the [nf-core](https://nf-co
- [#51](https://github.com/nf-core/phaseimpute/pull/51) - Update all process and fix linting errors. Remove fastqc added by the template.
- [#56](https://github.com/nf-core/phaseimpute/pull/56) - Move to nf-test to check the output files names generated. Fix validation and concatenation by chromosomes missing. Add dedicated GLIMPSE1 subworkflow. Fix posfile generation to be done once for glimpse and stitch.
- [#68](https://github.com/nf-core/phaseimpute/pull/68) - QUILT can handle external params chunks and hap-legend files.
- [#78](https://github.com/nf-core/phaseimpute/pull/78) - Separate validate step from panel preparation.

### `Fixed`

Expand Down
2 changes: 1 addition & 1 deletion assets/schema_posfile.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"type": "string",
"pattern": "^\\S+$",
"errorMessage": "Panel name must be provided as a string and cannot contain spaces",
"meta": ["panel"]
"meta": ["id"]
},
"chr": {
"type": "string",
Expand Down
7 changes: 3 additions & 4 deletions conf/test_validate.config
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@ params {
input_region = "${projectDir}/tests/csv/region.csv"

// Genome references
fasta = params.pipelines_testdata_base_path + "reference_genome/21_22/hs38DH.chr21_22.fa"
panel = "${projectDir}/tests/csv/panel.csv"
phased = true
map = "${projectDir}/tests/csv/map.csv"
fasta = params.pipelines_testdata_base_path + "reference_genome/21_22/hs38DH.chr21_22.fa"
posfile = "${projectDir}/tests/csv/posfile.csv"
map = "${projectDir}/tests/csv/map.csv"

// Pipeline steps
steps = "validate"
Expand Down
3 changes: 2 additions & 1 deletion docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -320,12 +320,13 @@ Make sure the csv with the input panel is the output from `--step panelprep` or
### Start with validation `--steps validate`

This steps compares a _truth_ VCF to an _imputed_ VCF in order to compute imputation accuracy.
This also needs the frequency of the alleles. They can be computed from the reference panel by running the `--steps panelprep` and using the `--panel` with the `--compute_freq` flag ; or by using `--posfile samplesheet.csv`.

```bash
nextflow run nf-core/phaseimpute --input samplesheet.csv --input_truth truth.csv --steps validate --outdir results --genome GRCh37 -profile docker
```

The required flags for this mode are:
The required flags for this mode only are:

- `--steps validate`: The steps to run.
- `--input samplesheet.csv`: The samplesheet containing the input sample files in `vcf` format.
Expand Down
3 changes: 1 addition & 2 deletions subworkflows/local/utils_nfcore_phaseimpute_pipeline/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,7 @@ workflow PIPELINE_INITIALISATION {
//
if (params.posfile) {
ch_posfile = Channel
.fromSamplesheet("posfile")
.map {meta, vcf, csi, txt -> [ meta, vcf, csi, txt ]}
.fromSamplesheet("posfile")
} else {
ch_posfile = [[],[]]
}
Expand Down
2 changes: 1 addition & 1 deletion tests/csv/posfile.csv
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
panel,chr,vcf,index,txt
1000GP.s.norel,chr21,"https://raw.githubusercontent.com/nf-core/test-datasets/phaseimpute/data/panel/21/1000GP.chr21.s.norel.sites.vcf.gz","https://raw.githubusercontent.com/nf-core/test-datasets/phaseimpute/data/panel/21/1000GP.chr21.s.norel.sites.vcf.gz.csi","https://raw.githubusercontent.com/nf-core/test-datasets/phaseimpute/data/panel/21/1000GP.chr21.s.norel.tsv.gz"
1000GP.s.norel,chr22,"https://raw.githubusercontent.com/nf-core/test-datasets/phaseimpute/data/panel/22/1000GP.chr22.s.norel.sites.vcf.gz","https://raw.githubusercontent.com/nf-core/test-datasets/phaseimpute/data/panel/21/1000GP.chr21.s.norel.sites.vcf.gz.csi","https://raw.githubusercontent.com/nf-core/test-datasets/phaseimpute/data/panel/22/1000GP.chr22.s.norel.tsv.gz"
1000GP.s.norel,chr22,"https://raw.githubusercontent.com/nf-core/test-datasets/phaseimpute/data/panel/22/1000GP.chr22.s.norel.sites.vcf.gz","https://raw.githubusercontent.com/nf-core/test-datasets/phaseimpute/data/panel/22/1000GP.chr22.s.norel.sites.vcf.gz.csi","https://raw.githubusercontent.com/nf-core/test-datasets/phaseimpute/data/panel/22/1000GP.chr22.s.norel.tsv.gz"
4 changes: 2 additions & 2 deletions workflows/phaseimpute/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ workflow PHASEIMPUTE {
ch_region // channel: region to use [ [chr, region], region]
ch_depth // channel: depth select [ [depth], depth ]
ch_map // channel: genetic map [ [chr], map]
ch_posfile // channel: posfile [ [chr], txt]
ch_posfile // channel: posfile [ [chr], vcf, txt]
ch_chunks // channel: chunks [ [chr], txt]
ch_versions // channel: versions of software used

Expand Down Expand Up @@ -135,7 +135,7 @@ workflow PHASEIMPUTE {
//
// Prepare panel
//
if (params.steps.split(',').contains("panelprep") || params.steps.split(',').contains("validate") || params.steps.split(',').contains("all")) {
if (params.steps.split(',').contains("panelprep") || params.steps.split(',').contains("all")) {
// Check chr prefix and remove if necessary
VCF_CHR_CHECK(ch_panel, ch_fasta)
ch_versions = ch_versions.mix(VCF_CHR_CHECK.out.versions)
Expand Down

0 comments on commit ec11c67

Please sign in to comment.