Question: How to convert .vcf files into .csv?
gravatar for feng9oly
3.5 years ago by
feng9oly0 wrote:

Hi everyone,

here I am working on an evaluation of queries on variants and genotypes which needs me to import the tested vcf files into sql database. I am using MySQL and PhpMyAdmin to accomplish it but I am just a beginner.
My questions are:

  1. If I have a .vcf file, how can I convert it into .csv? With python or can be done in vcftools and how?(I consider it's the most accessible way to import it in MySQL later)

  2. How can I get the list of individuals and all variants that they correspond to?

I know that vcftools can filter the variants of a specific individual/sample, but what if I want the whole sample list in 1000genomes in order to create a table assigning individual to their variants, and another table assigning metadata about each variant ( I think these information equals those in a vcf file.)

Your help will be very appreciated.

sql vcftools csv python vcf • 3.0k views
ADD COMMENTlink modified 21 months ago by Biostar ♦♦ 20 • written 3.5 years ago by feng9oly0


how should your mysql datatable look like?

As in the vcf file the columns are tab-seperated you allready have a format you can import via phpmyadmin. But if you want to spilt the several fields in the INFO column, more work is needed.

fin swimmer

ADD REPLYlink written 3.5 years ago by finswimmer13k

Thank you for asking. I want to make a datatable to combine individual id and variant id, type of instance. But now I am actually feeling confused because as far as I am concerned, in a VCF there are many variants assigning to an individual, so these two column are not 1-to-1 so it could be strange to arrange the structure.

Now I have imported some data via phpmyadmin and I thought in order to access to more queries I also need to spilt the fields in the INFO column.

ADD REPLYlink written 3.5 years ago by feng9oly0
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1208 users visited in the last hour