Closed philipwfowler closed 1 year ago
This was not actually caused by an equal number of REF/ALT reads. It was a bug due to using DP
to provide the total number of reads (which is as it is defined in the VCF spec).
This sample uses DP
as the Mean read depth of called allele (ie the ALLELE_DP of the called allele)
- causing issues. Work around for this is to use sum(vcf['COV'])
instead of DP
This has a corresponding gumpy
fix as DP
was also used during VCF parsing, so this will not immediately be available on PyPi
Sorry, this is my fault for not following the VCF spec for DP
in minos. It's complicated.
The COV
entry has the total reads mapped to the variant site. But because the method is using a tool that maps reads multi-mapped to a graph, and we want to handle indels properly, we don't actually know DP
defined as "read depth at this position" (unless the variant site is a simple SNP). We can only calculate mean depth per allele. And for non-snps, you can't rely on COV
being the total depth, all we know is it's the total reads intersecting the site (alleles could be 10s/100s/1000s bp long).
To make things more complicated, a single read can be mapped to >1 allele (eg the alleles are long, 2 of them share a common prefix, and the read starts before the site and only overlaps the start of the alleles).
I'm up for changing the the format of the VCF, am open to suggestions to how, but not sure what that would be.
site.10.subj.YA00099926.lab.YA00099926.iso.1.v0.12.4.per_sample.vcf.zip
If I try and process the above VCF via
then I get
I've tried manually altering a row so the n_reads are different and it gets further before hitting another row and then hitting the same assertion.
minor_alleles.txt