-
Notifications
You must be signed in to change notification settings - Fork 6
Description
LanGen_pipeline_version2/1.1_FILTERING_SNPs.R
Lines 847 to 849 in d98a65e
set.seed(13) | |
for (i in lambda_values){ | |
tess3.ls = tess3(genotypes, coord = coordinates, K = K, mask = mask, lambda = i, |
Hello Jeronymo, Thanks for your help along the way.
Whenever I rerun the tess3 function, I receive a different qmatrix, and result in different ancestry proportions for my barplot. Why is it so? Should I do the "set.seed()?"
I adapted your code and took out the loop and lambda parameter.
`K = c(1:5) # set the number of K to be tested
ploidy = 2 # species ploidy
CPU = 4 #Number of cores for run in parallel
tess3.ls <- tess3(X = genotypes, coord = coordinates, K = K,
method = "projected.ls", ploidy = ploidy, openMP.core.num = CPU)
q.matrix <- qmatrix(tess3.ls, K = 5)
my.colors <- c(1:5)
my.palette <- CreatePalette(my.colors, 6)
barplot(q.matrix, border = T, space = 0,
main = "Ancestry matrix",
xlab = "Individuals", ylab = "Ancestry proportions",
col.palette = my.palette) -> bp
axis(1, at = 0.5:nrow(q.matrix), labels = snps@meta[,3][bp$order], las = 3, cex.axis = 1)
`