# LOAD A. euteiches data set
data(Aeut)
# Check the number of multilocus genotypes
mlg(Aeut)
Aeut$pop.names
# Clone correct at the population level.
Aeut.pop <- clonecorrect(Aeut, hier="Pop")
mlg(Aeut.pop)
Aeut.pop$pop.names
# Clone correct at the subpopulation level with respect to population and
# combine.
Aeut.subpop <- clonecorrect(Aeut, hier=c("Pop", "Subpop"), combine=TRUE)
mlg(Aeut.subpop)
Aeut.subpop$pop.names
# Do the same, but set to the population level.
Aeut.subpop2 <- clonecorrect(Aeut, hier=c("Pop", "Subpop"), keep=1)
mlg(Aeut.subpop2)
Aeut.subpop2$pop.names
# LOAD H3N2 dataset
data(H3N2)
# Extract only the individuals located in China
country <- clonecorrect(H3N2, hier=c("country"), dfname="x")
# How many isolates did we have from China before clone correction?
length(which(other(H3N2)$x$country=="China")) # 155
# How many unique isolates from China after clone correction?
length(which(other(country)$x$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, hier=c("year","month","country"), dfname="x")
# How many isolates in the original data set?
length(other(H3N2)$x$country) # 1903
# How many after we clone corrected for country, year, and month?
length(other(c.y.m)$x$country) # 1190
Run the code above in your browser using DataLab