This is a test version of Biostars. For the public version, visit https://www.biostars.org.
problem in vcf to genlight conversion

Hi , I have a file with snp data in vcf format. I need to do population genetics studies. Therefore, I installed the Adegenet package into R. Also I installed the vcfR package as well. I read the vcf file as My_vcf<- read.vcfR(). then I tried to convert imported vcf file to genlight as vcf_gl <- vcfR2genlight(My_vcf). however, when I run vcf_gl, it gives me en error mentioning no object found as vcf_gl. can someone help me to find out what is wrong in the script? here is the R output

My_vcf

Object of Class vcfR 0 samples 42 CHROMs 15000 variants Object size: 1.4 Mb NaN percent missing data *

vcf_gl <- vcfR2genlight(My_vcf)

Error in input$gen[i, ] : subscript out of bounds In addition: Warning message: In vcfR2genlight(My_vcf) : Found 611 loci with more than two alleles. Objects of class genlight only support loci with two alleles. 611 loci will be omitted from the genlight object.

vcf_gl

Error: object 'vcf_gl' not found

snp software error r next-gen

0 answers

No answers yet.

Log in to answer this question.