How to determine mutation type/subtype via pysam/samtools
1
0
Entering edit mode
3.5 years ago

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?

SNP vcf samtools pysam type • 821 views
ADD COMMENT
2
Entering edit mode
3.5 years ago
bcftools query --format '%CHROM %POS %TYPE\n' input.vcf
ADD COMMENT

Login before adding your answer.

Traffic: 2711 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6