Convert your VCF data to migrate format data

789 views
Skip to first unread message

Shankar Kaji Shakya

unread,
Jul 6, 2017, 2:32:15 PM7/6/17
to migrate-support
Dear Peter and all, 

Here is a link to R script to convert the VCF data to migrate format data (SNP format or Hapmap format). Feel free to use and post comment. This function is a part of larger package vcfR to work with vcf files.



Peter, I see the Hapmap format infile generates following error with the example infile from the manual.  

Reading (1) pop1 ...
Reading (2)  ...
SEVERE ERROR: Segmentation fault
              this results in an non recoverable crash.
              But check the datatype and your infile for errors, too.
              Please report error with as much detail as possible to
              Peter Beerli <bee...@fsu.edu>





Breanna Sipley

unread,
Jan 13, 2018, 11:49:14 PM1/13/18
to migrate-support
Thank you for sharing this script, but can you please give more information re: how to use it?  Especially what arguments are necessary/ optional? & how to call the .vcf?

Shankar Kaji Shakya

unread,
Jan 14, 2018, 4:26:49 PM1/14/18
to migrate-support
Dear Breanna,

The script written to convert your vcf data to snp format data that can be used my migrate-n is written in R. So, you need to read your vcf data first using read.vcfR function (available in package vcfR). You can specify which format you want as output SNP (N) or Hapmap(H) using N or H flag in the function. VCF data doesnt have population slot thus that also need to be specified along with your output population.

If you are having trouble with that send me the 
1. vcf file
2. population names (this should be of same lenght as number of samples in your vcf file)
3. population names you want to include in final migrate data.


good luck

Shankar

Breanna Sipley

unread,
Jan 14, 2018, 7:04:33 PM1/14/18
to migrate...@googlegroups.com
Hi Shankar,

Thank you for your response!  I was able to get PGBSpider to work for me, but maybe I'll try your script again another time.

Cheers,
Breanna

--
You received this message because you are subscribed to a topic in the Google Groups "migrate-support" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/migrate-support/vP7j2Fg_sYM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to migrate-support+unsubscribe@googlegroups.com.
To post to this group, send email to migrate-support@googlegroups.com.
Visit this group at https://groups.google.com/group/migrate-support.
For more options, visit https://groups.google.com/d/optout.

Patricia Wepfer

unread,
Mar 21, 2018, 7:21:46 AM3/21/18
to migrate-support
Hi Shankar,

Thank you for sharing this script.

However, running it with your example data as described in your linked file, I get the following error:

> vcfR2migrate(vcf=vcf, pop=pops, in_pop= my_pop, out_file="migrateInfile", method='H')
Error in Ops.factor(x, pop) : level sets of factors are different
Called from: Ops.factor(x, pop)

I'm using R version 3.4.

Any ideas what could be wrong?

Best,
Patricia

goom...@gmail.com

unread,
Jan 13, 2019, 10:16:15 AM1/13/19
to migrate-support


在 2017年7月7日星期五 UTC+8上午2:32:15,Shankar Kaji Shakya写道:

Mikel Mendiola

unread,
Jun 21, 2019, 5:34:30 PM6/21/19
to migrate-support
Hello, I'm getting this error. Can you please help?
Reply all
Reply to author
Forward
0 new messages