Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

different qmatrix each time I run? #4

Open
Dahn-YoungDong opened this issue Dec 9, 2020 · 2 comments
Open

different qmatrix each time I run? #4

Dahn-YoungDong opened this issue Dec 9, 2020 · 2 comments

Comments

@Dahn-YoungDong
Copy link

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)
`

@Dahn-YoungDong
Copy link
Author

Is it possible to access your Pilocarpus dataset so that I can run your tutorial code as it was originally written for?

Best,

@jdalapicolla
Copy link
Owner

jdalapicolla commented Dec 9, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants