#Example with a tetraploid population
set.seed(123)
test_gmat <- matrix(sample(0:4, 100, replace = TRUE), nrow = 10)
colnames(test_gmat) <- paste0("Sample", 1:10)
rownames(test_gmat) <- paste0("Marker", 1:10)
test_gmat <- as.data.frame(test_gmat)
#Estimate the number of samples required to capture 90% of the population's genomic diversity
result <- capture_diversity.Gmat(test_gmat,
ploidy = 4,
r2_threshold = 0.90,
iterations = 10,
save.result = FALSE,
parallel=FALSE,
verbose=FALSE)
#View results
print(result)
Run the code above in your browser using DataLab