Combining VCF files

30 views
Skip to first unread message

Dave Berg

unread,
Jul 27, 2021, 10:48:06 AM7/27/21
to Pysam User group
I've been set the task of combining VCF files from varying callers into one unified VCF. As part of the process any multi-sample VCFs need to be collapsed into a single sample record.

I thought I'd use this task as an opportunity to become familiar with pysam's vcf interface and get more readable code as a result.

I'm starting by collapsing the format field of the variant record. Example
This record:
"""chr1\t69106\t.\tAT\tA\t.\tPASS\tEND=69107;HOMLEN=4;HOMSEQ=TTTT;SVLEN=-1;SVTYPE=DEL;SRC=PINDEL\tGT:AD\t0/0:315,1\t0/0:396,1"""
"""chr1\t69106\t.\tAT\tA\t.\tPASS\tEND=69107;HOMLEN=4;HOMSEQ=TTTT;SVLEN=-1;SVTYPE=DEL;SRC=PINDEL\tGT1:AD1:GT2:AD2\t0/0:315,1:0/0:396,1"""

How can I construct a new VariantRecordFormat object so that it replaces/updates the existing one?   
Reply all
Reply to author
Forward
0 new messages