knausb / vcfR

Tools to work with variant call format files
240 stars 54 forks source link

How can I add population information to genind converted using vcfR2genind? #194

Closed kopelol closed 2 years ago

kopelol commented 2 years ago

Hi everyone,

How can I add population information to genind converted using vcfR2genind?

I have vcf file(obtained using Snippy) and population information. I can use vcfRgenind successfully, and I'd like to add population data for further analysis. I found some ways. For example, is this the right way?

genind <- vcfR2genind("core.vcf") #for example n=5 pop.data <- c(aaa,bbb,ccc,ddd,eee) #aaa ... are population name. genind@pop <- as.factor(pop.data)

And how can I check correspondence between Individual name and population name? Do I have to input population data in order of Individual name included vcf file?

Thanks,

knausb commented 2 years ago

Hi @kopelol , did you look at the sections on GBS analysis and genome analysis? I think you might find what you're looking for there.

Thanks! Brian

kopelol commented 2 years ago

Hi @knausb Thank you for your advice! I'll check the link. Thank you.