adegenet icon indicating copy to clipboard operation
adegenet copied to clipboard

Reading Triploid VCF in useable adegenet object

Open laurelfloral opened this issue 4 years ago • 2 comments

I have a mutli-sample vcf (~307 samples, 2,662 loci, 5,708 alleles) created in GATK for a triploid dataset.

I was hoping to do some pop gen analysis on this data set using adegenet such as glPCA and snapclust (not sure if it works with ploidy other than diploid). I have read the file into R using read.vcfR, but I am having trouble getting it loaded as a genlight object. It says 100% of my data is missing and ploidy is NULL even though I specified 3.

Is genlight the right object to create for using triploid data? Are there specific tags that need to be used when running vcfR2genlight? Any advice on working with polyploid data in adegenet would be helpful. I am struggling to find the right resources. Thank you!

laurelfloral avatar Apr 24 '20 01:04 laurelfloral

You can try to read your data with read.vcf (in pegas): the output will be an object of class "loci" that you can convert to the class "genind" with the function loci2genind (also in pegas). The class "loci" supports all levels of ploidiy and all types of mixed ploidy within the data. Once you have your data in "genind" class, you can do multivariate analyses in adegenet.

emmanuelparadis avatar Apr 24 '20 06:04 emmanuelparadis

Hi, I have kind of big data (millions of SNPs) of mixed ploidy (haploid and diploid bee samples). I intend to conduct PCA and admixture or snapclust analysis by taking into account ploidy level. I found adegenet is a nice one for dealing with this issue. So it's supposed to use genlight input file in adegenet according to its manual. The genlight file can be converted using vcfR2genlight. However, I did not see where we can specify the ploidy of each sample. A bit confused because @laurelfloral mentioned that in his/her question. pegas seems to have only loci2genind as far as I know now, which has the ploidy flag. @emmanuelparadis do you have any suggestions for my case? Thank you very much in advance.

yzliu01 avatar Jun 28 '22 11:06 yzliu01