This is a test version of Biostars. For the public version, visit https://www.biostars.org.
VCF using Python

I am looking for a python script to merge two vcf files into a single VCF file, so that overlapping variants are present only once in the output file

python vcf

2 answers

bcftools merge

Check out the pyvcf.merge() method (documentation) and the pyvcf.VcfFrame.merge() method (documentation) in the Python package fuc (documentation). If you have any questions about the use of these methods, please feel free to leave a comment (I'm the author of fuc).

Thankyou for your kind reply. The assignment says that avoid usage of Pandas or any other vcf reader modules to read vcf files. and Solve using core python data structures. I am pretty much newbie in this field and still trying to grasp the assignment.

Log in to answer this question.