Description Usage Arguments Details Value Author(s) Examples
This function removes any duplicated multilocus genotypes from any specified population strata.
1 | clonecorrect(pop, strata = 1, combine = FALSE, keep = 1)
|
pop |
a |
strata |
a hierarchical formula or numeric vector. This will define the columns of the data frame in the strata slot to use. |
combine |
|
keep |
|
This function will clone correct based on the stratification
provided. To clone correct indiscriminately of population structure, set
strata = NA
.
a clone corrected genclone
,
snpclone
, or genind
object.
Zhian N. Kamvar
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | # LOAD A. euteiches data set
data(Aeut)
# Redefine it as a genclone object
Aeut <- as.genclone(Aeut)
strata(Aeut) <- other(Aeut)$population_hierarchy[-1]
# Check the number of multilocus genotypes
mlg(Aeut)
popNames(Aeut)
# Clone correct at the population level.
Aeut.pop <- clonecorrect(Aeut, strata = ~Pop)
mlg(Aeut.pop)
popNames(Aeut.pop)
## Not run:
# Clone correct at the subpopulation level with respect to population and
# combine.
Aeut.subpop <- clonecorrect(Aeut, strata = ~Pop/Subpop, combine=TRUE)
mlg(Aeut.subpop)
popNames(Aeut.subpop)
# Do the same, but set to the population level.
Aeut.subpop2 <- clonecorrect(Aeut, strata = ~Pop/Subpop, keep=1)
mlg(Aeut.subpop2)
popNames(Aeut.subpop2)
# LOAD H3N2 dataset
data(H3N2)
strata(H3N2) <- other(H3N2)$x
# Extract only the individuals located in China
country <- clonecorrect(H3N2, strata = ~country)
# How many isolates did we have from China before clone correction?
sum(strata(H3N2, ~country) == "China") # 155
# How many unique isolates from China after clone correction?
sum(strata(country, ~country) == "China") # 79
# Something a little more complicated. (This could take a few minutes on
# slower computers)
# setting the hierarchy to be Country > Year > Month
c.y.m <- clonecorrect(H3N2, strata = ~year/month/country)
# How many isolates in the original data set?
nInd(H3N2) # 1903
# How many after we clone corrected for country, year, and month?
nInd(c.y.m) # 1190
## End(Not run)
|
Loading required package: adegenet
Loading required package: ade4
Registered S3 method overwritten by 'spdep':
method from
plot.mst ape
/// adegenet 2.1.3 is loaded ////////////
> overview: '?adegenet'
> tutorials/doc/questions: 'adegenetWeb()'
> bug reports/feature requests: adegenetIssues()
Registered S3 method overwritten by 'pegas':
method from
print.amova ade4
This is poppr version 2.8.6. To get started, type package?poppr
OMP parallel support: available
#############################
# Number of Individuals: 187
# Number of MLG: 119
#############################
[1] 119
[1] "Athena" "Mt. Vernon"
#############################
# Number of Individuals: 120
# Number of MLG: 119
#############################
[1] 119
[1] "Athena" "Mt. Vernon"
#############################
# Number of Individuals: 141
# Number of MLG: 119
#############################
[1] 119
[1] "Athena_1" "Athena_2" "Athena_3" "Athena_4" "Athena_5"
[6] "Athena_6" "Athena_7" "Athena_8" "Athena_9" "Athena_10"
[11] "Mt. Vernon_1" "Mt. Vernon_2" "Mt. Vernon_3" "Mt. Vernon_4" "Mt. Vernon_5"
[16] "Mt. Vernon_6" "Mt. Vernon_7" "Mt. Vernon_8"
#############################
# Number of Individuals: 141
# Number of MLG: 119
#############################
[1] 119
[1] "Athena" "Mt. Vernon"
[1] 155
[1] 79
[1] 1903
[1] 1190
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.