Entering edit mode
3.5 years ago
mike.rightmire
•
0
I'm using pysam (a wrapper around samtools) to pull information from VCF records.
Is there a way to pull out the type/subtype information regarding a single mutation (line of data) contained in a VCF file? I.e. Whether the mutation is a SNP/SUB, INS, DEL, Etc.?
The following snippet pulls out the POSITION and the CHROMOSOME (respectively.)
bcf_in = VariantFile("test.bcf")
for rec in bcf_in.fetch():
print (rec.pos)
print (rec.chrom)
Is there a similar way to pull out the type info, or do I have to calculate it from the REF/ALT?