Multisample VCF file to Structure file format ?
2
1
Entering edit mode
9.8 years ago

Is there any tool available to convert multisample VCF file to Structure file format ? I have tried PGDSpider but it did not seem to work with multisample VCF and I could not figure out the usage of mega2 program.

One alternative way is to make fasta from VCF (FastaAlternateReferenceMaker) and convert it back to structure, but this may include lot of manipulations in between.

vcf structure population-genetics • 16k views
ADD COMMENT
4
Entering edit mode
9.8 years ago

With PLINK 1.9,

plink --vcf [vcf filename] --recode structure

should work.

ADD COMMENT
0
Entering edit mode

Ok I will look in to it.

The exact command is

plink --vcf [vcf filename] --recode structure --out <base name>
ADD REPLY
0
Entering edit mode

Hello chrchang523,

I know that it has been quite a while since this post, but I am trying to run this method with my vcf file; however, I keep getting an error:

Error: Invalid bp coordinate on line 1 of .bim file

I removed the logical information from the original vcf file as a means of improving the conversion process. Here is an image of my working vcf file:

The file is tab delimited if that information is helpful. I would appreciate any feedback.

With best regards,
Gio

ADD REPLY
0
Entering edit mode

plink does not allow "." blank POS values. Replace that column with zeroes.

ADD REPLY
0
Entering edit mode

Thank you for the response. I have replaced the "." with zeros within the POS column; however, I am now receiving this error: Error: Line 2 of .vcf file has an invalid GT field.

Looking at the head of the file through the terminal is a bit difficult due to the top row being crunched up, but in a spread sheet the data looks fine. Any recommendations?

https://s33.postimg.cc/j8j6hp3jj/Image479.jpg https://s33.postimg.cc/ij0e5capr/Image479_2.jpg

ADD REPLY
0
Entering edit mode

The problem is the surrounding double-quotes. They're ignored by Excel, but practically every VCF file reader will complain.

ADD REPLY
0
Entering edit mode

Thank you very much! That seemed to do the trick. You have saved me a lot of time and headache. I appreciate your help.

ADD REPLY
2
Entering edit mode
9.8 years ago

Try to use Mega2, it is freely available can convert from VCF or BCF format to Structure format, as well as to a number of other formats.

ADD COMMENT

Login before adding your answer.

Traffic: 1808 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