Stratification of data

22 views
Skip to first unread message

Martin Boys

unread,
Nov 3, 2022, 8:42:54 AM11/3/22
to po...@googlegroups.com
Good day everyone

Is it possible to have 0 populations defined after a stratum has been assigned to a dataset? I have data which is quite difficult to stratify hence, I have assigned a single strata to it and got 0 defined populations. I did the same to another dataset just assigning one stratum to it and didn't get 0 defined populations hence I am certain that I didn't make a mistake in the command given that I copied the same script for both datasets. Please help.

Regards
Martin

Zhian Kamvar

unread,
Nov 4, 2022, 8:51:01 PM11/4/22
to Martin Boys, po...@googlegroups.com
Hello Martin,

Yes, it is possible. The strata is merely a box to hold potential population factors. You can set the population using the `setPop()` command (see examples in https://grunwaldlab.github.io/Population_Genetics_in_R/Population_Strata.html).

Here's an example with the P. infestans data set from poppr:

library("poppr")
data(Pinf)
print(Pinf) # two strata, two populations from the Continent stratum
#>
#> This is a genclone object
#> -------------------------
#> Genotype information:
#>
#>    72 multilocus genotypes
#>    86 tetraploid
#> individuals
#>    11 codominant loci
#>
#>
#> Population information:
#>
#>     2 strata - Continent Country
#>     2 populations defined - South America North America
pop(Pinf) <- NULL # remove population factor
print(Pinf) # two strata, zero populations defined
#>
#> This is a genclone object
#> -------------------------
#> Genotype information:
#>
#>    72 multilocus genotypes
#>    86 tetraploid
#> individuals
#>    11 codominant loci
#>
#>
#> Population information:
#>
#>     2 strata - Continent Country
#>     0 populations defined.
setPop(Pinf) <- ~Continent # set the population to be based on continent
print(Pinf)
#>
#> This is a genclone object
#> -------------------------
#> Genotype information:
#>
#>    72 multilocus genotypes
#>    86 tetraploid
#> individuals
#>    11 codominant loci
#>
#>
#> Population information:
#>
#>     2 strata - Continent Country
#>     2 populations defined - South America North America
setPop(Pinf) <- ~Country # based on country
print(Pinf)
#>
#> This is a genclone object
#> -------------------------
#> Genotype information:
#>
#>    72 multilocus genotypes
#>    86 tetraploid
#> individuals
#>    11 codominant loci
#>
#>
#> Population information:
#>
#>     2 strata - Continent Country
#>     4 populations defined - Colombia Ecuador Mexico Peru
setPop(Pinf) <- ~Continent/Country # continent and country combined
print(Pinf)
#>
#> This is a genclone object
#> -------------------------
#> Genotype information:
#>
#>    72 multilocus genotypes
#>    86 tetraploid
#> individuals
#>    11 codominant loci
#>
#>
#> Population information:
#>
#>     2 strata - Continent Country
#>     4 populations defined - South America_Colombia South America_Ecuador
#> North America_Mexico South America_Peru


--
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/CAKiZ3%3DsLWr9cs-Be2KZdRd7o22jotyGCv0cwt-YLzQtC25C%2B%3Dg%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages