This is a test version of Biostars. For the public version, visit https://www.biostars.org.
searching tool for calculating switch/phase error rate

I'm looking for a tool which, given a truth vcf file and a test vcf file, calculates the phase/switch error rate. I performed phasing of a vcf using WhatsHap and want to compare the outcome to some ground truth phased vcf I have. I can't find a tool, and I don't want to write it myself. It seems like a rather common thing... so I'd expect it to exist, but my google-fu is weak today.

(Cross posted at https://bioinformatics.stackexchange.com/questions/7242/searching-tool-to-calculate-phase-switch-error-rate )

phasing vcf variants whatshap

Hi genomax, I took a look at the manual and it wasn't obvious to me which metric is homologous to switch error rate.

WhatsHaps has their own compare function:

whatshap compare truth.vcf sample.vcf

1 answer

Have you tried vcftools --diff functions?

https://vcftools.github.io/man_0112a.html "COMPARISON OPTIONS These options are used to compare the original variant file to another variant file and output the results. All diff functions cannot be written to standard out.

--diff-switch-error

Used in conjuction with the --diff option to calculate phasing errors (specifically "switch errors"). This option generates two output files describing switch errors found between sites, and the average switch error per individual. These two files have the suffixes ".diff.switch" and ".diff.indv.switch" respectively."

Log in to answer this question.