PyVCF
PyVCF copied to clipboard
How to obtain the Allelic depths field using pyvcf reader?
Hello, I need to extract the 'AD' field from VCF file, but I couldn't locate the object for the AD field: "Allelic depths for the ref and alt alleles in the order listed".
Many of my intersted fields can be found in the record.INFO, but not this AD field. Thanks
Related, I am wondering if there is a method to return the raw text from each row (record), so that some fields could be manually extracted with the raw text. thanks
vcfreader = vcf.Reader(open(vcffile, 'r'))
for record in vcfreader:
for call in record:
print(call.data.AD)