# NOT RUN {
# make up some data
triploid_allele1 <- rbinom(60, 75, 2/3)
triploid_allele2 <- 75 - triploid_allele1
diploid_allele1 <- rbinom(60, 75, 1/2)
diploid_allele2 <- 75 - diploid_allele1
# interleave allele counts
triploid <- c(rbind(triploid_allele1, triploid_allele2))
diploid <- c(rbind(diploid_allele1, diploid_allele2))
# create counts matrix
allele_counts <- matrix(data = c(triploid, diploid), byrow = TRUE, nrow = 2, ncol = 120)
rownames(allele_counts) <- c("triploid", "diploid")
#create h and eps vectors
h_constant <- rep(1, 60)
eps_constant <- rep(.01, 60)
#run function
ploidy <- tripsAndDip(allele_counts, h = h_constant, eps = eps_constant)
# }
Run the code above in your browser using DataLab