Hi Susan,
We are no longer maintaining the dartR package. Instead, we are now developing the dartRverse packages. You can find more information here:
https://github.com/green-striped-gecko/dartR/wiki/Installation-tutorial#dartrverseTo install the development versions of the dartRverse packages, please follow these steps:
# 1. Clean your workspace
# Menu > Session > Clear workspace
# 2. Restart your R session
# Menu > Session > Restart R
# 3. Install the necessary Bioconductor packages
install.packages("devtools")
install.packages("BiocManager")
BiocManager::install("SNPRelate",force = TRUE)
BiocManager::install("LEA",force = TRUE)
BiocManager::install("snpStats",force = TRUE)
BiocManager::install("gdsfmt",force = TRUE)
BiocManager::install("BiocGenerics",force = TRUE)
BiocManager::install("zlibbioc",force = TRUE)
# 4. Install dartRverse
install.packages("dartRverse")
# 4. Install the development versions of the dartRverse packages
devtools::install_github('green-striped-gecko/dartR.sexlinked@dev',force = TRUE)
devtools::install_github('green-striped-gecko/dartR.spatial@dev',force = TRUE)
devtools::install_github('green-striped-gecko/dartR.captive@dev',force = TRUE)
devtools::install_github('green-striped-gecko/dartR.popgen@dev',force = TRUE)
devtools::install_github('green-striped-gecko/dartR.base@dev',force = TRUE)
devtools::install_github('green-striped-gecko/dartR.sim@dev',force = TRUE)
# Example usage
library(dartRverse)
t1 <-
platypus.gl# Download the popcluster binary and place it in your working directory:
#
https://www.zsl.org/about-zsl/resources/software/popclusterr1 <- gl.run.popcluster(
x = t1,
popcluster.path = getwd(),
output.path = getwd(),
filename = "output",
minK = 2,
maxK = 4,
rep = 2
)
p1 <- gl.plot.popcluster(r1, plot.K = 3)
# Download the STRUCTURE binary for your OS and place it in your working directory:
#
https://web.stanford.edu/group/pritchardlab/structure_software/release_versions/v2.3.4/html/structure.html# For Windows, use exec = './structure.exe'
r2 <- gl.run.structure(
x = t1,
exec = "./structure",
k.range = 2:4,
num.k.rep = 2,
burnin = 1000,
numreps = 1000,
noadmix = TRUE,
freqscorr = FALSE,
randomize = TRUE,
seed = 0,
locpriorinit = 1,
maxlocprior = 20,
gensback = 2,
migrprior = 0.05,
pfrompopflagonly = TRUE,
inferalpha = FALSE,
alpha = 1,
unifprioralpha = TRUE,
alphamax = 20,
alphapriora = 0.05,
alphapriorb = 0.001,
plot.out = TRUE,
plot_theme = theme_dartR(),
plot.dir = tempdir(),
delete.files = TRUE
)
p2 <- gl.plot.structure(r2, K = 2:4,
color_clusters = c("green","red","yellow","blue"),
den = TRUE, x = t1)
p3 <- gl.plot.structure(r2, K = 3,
color_clusters = c("green","red","yellow","blue"),
den = FALSE, x = t1)
p4 <- gl.map.structure(p3, x = t1, K = 3)
Cheers,
Luis