Question: Multisample VCF file to Structure file format ?
1
gravatar for geek_y
5.9 years ago by
geek_y11k
Barcelona
geek_y11k wrote:

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.

ADD COMMENTlink modified 5.9 years ago by chrchang5237.4k • written 5.9 years ago by geek_y11k
3
gravatar for chrchang523
5.9 years ago by
chrchang5237.4k
United States
chrchang5237.4k wrote:

With PLINK 1.9,

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

should work.

ADD COMMENTlink written 5.9 years ago by chrchang5237.4k

Ok I will look in to it.

The exact command is 

plink --vcf [vcf filename] --recode structure --out <base name>
ADD REPLYlink written 5.9 years ago by geek_y11k

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: https://s22.postimg.cc/kq5w3fkj5/Image156.jpg

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

With best regards, Gio

ADD REPLYlink modified 2.5 years ago • written 2.5 years ago by Giovanni.madrigal12180

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

ADD REPLYlink written 2.5 years ago by chrchang5237.4k

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 REPLYlink modified 2.5 years ago • written 2.5 years ago by Giovanni.madrigal12180

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

ADD REPLYlink written 2.5 years ago by chrchang5237.4k

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 REPLYlink written 2.5 years ago by Giovanni.madrigal12180
2
gravatar for Abdul Rafay Khan
5.9 years ago by
Karachi, PK
Abdul Rafay Khan1.1k wrote:

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 COMMENTlink written 5.9 years ago by Abdul Rafay Khan1.1k
Please log in to add an answer.

Help
Access

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