-
Notifications
You must be signed in to change notification settings - Fork 273
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
END coordinates in VCF files #527
Comments
Hi @nspies: I've run some tests locally and it does appear that example.vcf
test.pyimport pysam
vars = pysam.VariantFile('foo_vcf42.vcf')
for record in vars:
print(record.contig, record.start, record.stop) output
If
|
Hrm, I'm not seeing what you're seeing. If I copy your vcf and python script, I get this when using the latest release or the git development version (0.12):
I've tried this in python 3.5 and 3.6 on mac and linux with the same result. |
That isn't good. Let me do some more digging and get back to you. |
I am having a similar (the same?) issue to this. Loading a bcf file through pysam will give me different results if I load it as a bcf directly vs if I use bcftools to convert it to a vcf first. The stop/end is the same as record.pos when loaded from the bcf file (152450946) but if I read it from the converted vcf it is correct (152451266) This was using pysam 0.14.1 the vcf record
I am able to replicate this with the vcf if I remove the END definition from in the header |
I'm trying to parse VCF files with perhaps incomplete headers. This generally works okay, but I'm not sure how best to parse the "END" coordinate if it's not defined in the header. It seems to only be parsed into
variant.stop
when "END" been defined in the header -- which would be okay, except I also can't get it out ofvariant.info
since pysam insists that "END" is a reserved keyword (https://github.com/pysam-developers/pysam/blob/master/pysam/libcbcf.pyx#L2525). I'm not sure how much of this behavior is caused by pysam or by htslib, but ideallyvariant.stop
would get set irrespective of the header value. I can get around this with this awkward workaround:See also #402 -- I regularly see VCF files without any headers at all and it'd be great if pysam could deal more nicely with this case.
The text was updated successfully, but these errors were encountered: