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

AlignK not working with increasing numbers of samples #76

Open
mcfiston opened this issue Mar 12, 2021 · 6 comments
Open

AlignK not working with increasing numbers of samples #76

mcfiston opened this issue Mar 12, 2021 · 6 comments

Comments

@mcfiston
Copy link

mcfiston commented Mar 12, 2021

alignK_not_working.zip

The alignK step seems to work fine for me in some situations but not others. Example below run in exactly the same way is using the same dataset twice but with more individuals in the 2nd case. For example: In the first case ("working") you can see that in the plot, the right hand three individuals are correctly changed to dark blue, whereas in the second case ("not working") that same cluster on the right hand side (now 7 individuals) are not changed. Any idea why this would be?

Super nice program - thank you!!

`

alignK seems to work fine here

sfiles <- list.files(path="/path/working/", full.names=T)
slist <- readQ(sfiles)

p1 <- plotQ(slist,imgoutput="join",returnplot=T,exportplot=F,basesize=11)
grid.arrange(p1$plot[[1]])

slist1 <- alignK(slist)
p2 <- plotQ(slist1,imgoutput="join",returnplot=T,exportplot=F,basesize=11)
grid.arrange(p1$plot[[1]], p2$plot[[1]], ncol = 2)

But once I add more individuals it stops aligning them

sfiles <- list.files(path="/path/notworking/", full.names=T)
slist <- readQ(sfiles)

p1 <- plotQ(slist,imgoutput="join",returnplot=T,exportplot=F,basesize=11)
grid.arrange(p1$plot[[1]])

slist1 <- alignK(slist)
p2 <- plotQ(slist1,imgoutput="join",returnplot=T,exportplot=F,basesize=11)
grid.arrange(p1$plot[[1]], p2$plot[[1]], ncol = 2)`

@sekhwal
Copy link

sekhwal commented Mar 13, 2021

Did you try online version? http://pophelper.com/

@mcfiston
Copy link
Author

Yes - I have tried there but even with the "working" dataset above I get an error message that says "Cannot Align/Merge runs. Value of K differs between selected runs." I am confused by that because I thought that alignK was supposed to align between K's? Attached is an image of before aligning (on online version) and error message when trying to align. I also attach a figure showing what I think it should look like where I have manually aligned the colours in excel

manually_aligned.pdf
online_alignK.pdf
online_unaligned.pdf

@eugeniadat
Copy link

Hi,
I am having the same issue, both with R and pophelperShiny.
Are there any updates about this issue?
I really want to use this powerful tool for my analyses but this issue makes my plots really hard ro read.
Thanks!

@royfrancis royfrancis added bug Incorrect results and removed bug Incorrect results labels Jan 18, 2022
@cjfiscus
Copy link

Just ran into this issue myself using R package 2.3.1 trying to align K across K = 2-4 for 1225 individuals. Is there a solution in the works?

@cjfiscus
Copy link

cjfiscus commented Jul 1, 2022

To clarify, I attempted to first align K between 10 runs of the same K (this works as intended), but then attempted to align between K (this doesn't work). Code snippets are as follows:

`
k2<-mergeQ(alignK(slist[c(21:30)]))

k3<-mergeQ(alignK(slist[c(31:40)]))

k4<-mergeQ(alignK(slist[c(41:50)]))

out<-alignK(c(k2,k3,k4))
`
When plotted manually, the result is this, which is obviously not aligned between K:
check

This is the result of manual alignment and should be the result:
check2

@juliannasantoseco
Copy link

I aligned K across the entire slist and it worked.

slist <- alignK(slist, type = "across")

p <- plotQ (slist[c(20, 40)],
imgoutput = "join", returnplot=T, exportplot=F, showdiv=T,basesize=11,
showyaxis = T, showticks=T, panelspacer=0.4, ticksize=0.3, ticklength=0.1,
sortind = "all", barsize = 1, barbordercolour = "darkgrey",
useindlab = T, showindlab = T, sharedindlab=F,
sppos = "right",
showlegend = T, legendkeysize = 10, legendtextsize = 10,
splab = spnames[c(20, 40)], # apply strip panel names
splabcol = "black", splabface = "italic", splabsize = 10, # strip panel label appearance
clustercol = brewer.pal (n = 4, name = "Dark2"))

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

6 participants