Combing population information from other file in Poppr

30 views
Skip to first unread message

RN Sarma

unread,
Jun 29, 2023, 3:11:54 AM6/29/23
to poppr
I have a VCF file of 100000 SNP markers and 196 genotypes.  I have determined the population structure in other programme and saved the genotype-wise population information in a txt file.  If I want to go for AMOVA in poppr how to proceed with using the two files?

Please suggest.

Zhian Kamvar

unread,
Jun 29, 2023, 1:22:42 PM6/29/23
to RN Sarma, poppr
Import the population structure in R as a data frame and then use the `strata()` function to add the data frame (see https://rdrr.io/cran/adegenet/man/strata-methods.html for details).

For example, if you have VCF file called "population.vcf" and your populations structure file is called "population-data.txt" and it's comma-delimited, you can use:

vcf <- vcfR::read.vcfR("population.vcf")
gid <- vcfR::vcfR2genlight(vcf)
# if you want a genind object (8X larger memory footprint), you can use vcfR::vcfR2genind(vcf, return.alleles = TRUE)
population_strata <- read.csv("population-data.txt", header = TRUE)
strata(gid) <- population_strata # this will set the strata based on the column names of your stratifications


On Thu, Jun 29, 2023 at 12:11 AM 'RN Sarma' via poppr <po...@googlegroups.com> wrote:
I have a VCF file of 100000 SNP markers and 196 genotypes.  I have determined the population structure in other programme and saved the genotype-wise population information in a txt file.  If I want to go for AMOVA in poppr how to proceed with using the two files?

Please suggest.

--
You received this message because you are subscribed to the Google Groups "poppr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to poppr+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/poppr/8d0eaac1-816e-41de-81c1-d83b6cbda7b3n%40googlegroups.com.

Zhian Kamvar

unread,
Jul 21, 2023, 9:56:43 AM7/21/23
to RN Sarma, poppr
This would be a table of population information for each individual in rows across strata in columns. 

On Thu, Jul 20, 2023 at 19:08 RN Sarma <ramendr...@aau.ac.in> wrote:
What will information should I have in "population-data.txt" as you have suggested?

Ramen
--
Warm regards,
------------------------------------------------------------------------------------------------------
Dr R N Sarma
Professor
Department of Plant Breeding and Genetics
Assam Agricultural University
Jorhat-785013
Assam, India
Orcid id: 0000-0002-9106-7926
web: www.aau.ac.in; Phone: +91- 9435350529(M)

--------------------------------------------------------------------------------------------------------------------------

RN Sarma

unread,
Jul 21, 2023, 10:29:47 AM7/21/23
to Zhian Kamvar, poppr
I will try it. Thank you
Reply all
Reply to author
Forward
0 new messages