Closed GrimPerez closed 4 years ago
Hi, What error do you get? Also, if possible, could you please send me some sample files? Thanks.
Good morning Roy Francis,
I apologize for my late reply. I was away from any form of technology this whole time.
Please find attached 3 files as follows: 1_pop_K7-combined-merged 2_MK7Sorted 3_sample plot
I was able to make the scripts work. I was hoping you could help me out with the following.
Your help is sincerely appreciated. Thank you so much and I appreciate any time you can spare me.
Sincerely, Grimar A. Perez
From: Roy Francis notifications@github.com Sent: Tuesday, June 18, 2019 7:05 AM To: royfrancis/pophelper Cc: GrimPerez; Author Subject: Re: [royfrancis/pophelper] Workflow error at generating qlist (#45)
Hi, What error do you get? Also, if possible, could you please send me some sample files? Thanks.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/royfrancis/pophelper/issues/45?email_source=notifications&email_token=AML2CLJWOQVSTKD6X3N572LP3DMSLA5CNFSM4HYRDEX2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODX6RUKI#issuecomment-503126569, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AML2CLIBULA2YRZ7HK5DLLTP3DMSLANCNFSM4HYRDEXQ.
1: 0.0350 0.0022 0.0329 0.7715 0.0160 0.1359 0.0066 1 2: 0.0411 0.0010 0.0317 0.7550 0.0010 0.1683 0.0019 1 3: 0.0895 0.1292 0.0033 0.3261 0.0009 0.4505 0.0006 1 4: 0.0033 0.0013 0.0457 0.6639 0.0066 0.1577 0.1215 1 5: 0.0517 0.0000 0.1048 0.7992 0.0000 0.0432 0.0010 1 6: 0.0528 0.0010 0.0103 0.7085 0.0010 0.2254 0.0010 1 7: 0.0254 0.0076 0.0072 0.5398 0.3295 0.0743 0.0162 1 8: 0.0320 0.0014 0.0177 0.7262 0.0043 0.2164 0.0020 1 9: 0.0402 0.0019 0.0095 0.7460 0.0068 0.1942 0.0014 1 10: 0.0264 0.0106 0.0040 0.6061 0.0458 0.0994 0.2077 1 11: 0.0325 0.0015 0.0060 0.7287 0.0127 0.1379 0.0806 1 12: 0.0429 0.0000 0.0061 0.6485 0.0000 0.3024 0.0000 1 13: 0.0501 0.0000 0.0094 0.8133 0.0001 0.1270 0.0000 1 14: 0.0365 0.0000 0.0031 0.6723 0.0022 0.1768 0.1091 1 15: 0.0435 0.0046 0.0105 0.6978 0.0043 0.2332 0.0061 1 16: 0.0545 0.0027 0.0025 0.7842 0.0024 0.1527 0.0010 1 17: 0.0386 0.0107 0.0008 0.5449 0.0007 0.4038 0.0006 1 18: 0.0422 0.0006 0.0015 0.5031 0.0005 0.4521 0.0000 1 19: 0.0464 0.0009 0.0096 0.6953 0.0010 0.2447 0.0021 1 20: 0.0284 0.0038 0.1405 0.6028 0.0453 0.0135 0.1658 1 21: 0.0242 0.0007 0.6788 0.2458 0.0010 0.0485 0.0010 1 22: 0.0451 0.0010 0.0043 0.7746 0.0152 0.1504 0.0094 1 23: 0.0553 0.0010 0.0507 0.7953 0.0077 0.0815 0.0085 1 24: 0.0652 0.0483 0.0038 0.5645 0.0538 0.2598 0.0046 1 25: 0.0348 0.0352 0.0102 0.3189 0.0045 0.5060 0.0904 1 26: 0.0795 0.0436 0.0082 0.5915 0.0931 0.1443 0.0397 1 27: 0.5987 0.0000 0.0026 0.3706 0.0000 0.0281 0.0000 1 28: 0.0589 0.0005 0.0125 0.7737 0.0013 0.0040 0.1490 1 29: 0.0548 0.0014 0.0204 0.8073 0.0318 0.0010 0.0834 1 30: 0.0091 0.0138 0.0062 0.4009 0.5692 0.0002 0.0006 1 31: 0.0426 0.0039 0.0010 0.6816 0.0041 0.2658 0.0010 1 32: 0.0399 0.0003 0.0053 0.5647 0.0010 0.0028 0.3860 1 33: 0.0529 0.0006 0.0014 0.6896 0.0007 0.0312 0.2236 1 34: 0.0413 0.0017 0.0751 0.6947 0.0010 0.1817 0.0045 1 35: 0.0586 0.0000 0.0019 0.9009 0.0373 0.0012 0.0000 1 36: 0.0312 0.0056 0.0471 0.5318 0.0168 0.3664 0.0010 1 37: 0.0324 0.0022 0.0016 0.5408 0.0229 0.3991 0.0010 1 38: 0.0641 0.0004 0.0186 0.8629 0.0388 0.0055 0.0097 1 39: 0.0402 0.0010 0.0037 0.6337 0.0086 0.2941 0.0187 1 40: 0.0018 0.0031 0.0010 0.0002 0.0636 0.0015 0.9288 1 41: 0.0189 0.0189 0.0016 0.4829 0.1090 0.0401 0.3286 1 42: 0.0520 0.0000 0.0019 0.5190 0.0000 0.4271 0.0000 1 43: 0.0024 0.0000 0.9931 0.0013 0.0000 0.0026 0.0006 1 44: 0.0525 0.0027 0.0175 0.5129 0.0007 0.4127 0.0010 1 45: 0.0358 0.0000 0.0017 0.3265 0.0000 0.6360 0.0000 1 46: 0.0473 0.0000 0.0004 0.5406 0.0000 0.4116 0.0000 1 47: 0.1463 0.1880 0.0072 0.4314 0.0020 0.2244 0.0007 1 48: 0.0006 0.0000 0.7427 0.0009 0.0000 0.0007 0.2551 1 49: 0.0256 0.0006 0.0024 0.5572 0.0010 0.4132 0.0000 1 50: 0.0301 0.0017 0.0023 0.5567 0.0020 0.4066 0.0006 1 51: 0.0292 0.0021 0.0561 0.5240 0.0012 0.3865 0.0009 1 52: 0.0736 0.0000 0.0154 0.6614 0.0010 0.2479 0.0006 1 53: 0.3075 0.4676 0.0019 0.0212 0.0010 0.2004 0.0004 1 54: 0.1537 0.2199 0.0012 0.3323 0.0010 0.2885 0.0035 1 55: 0.1224 0.2039 0.0186 0.3292 0.0606 0.2620 0.0033 1 56: 0.1151 0.2028 0.1658 0.0403 0.0013 0.4000 0.0747 1 57: 0.2814 0.4265 0.2896 0.0001 0.0000 0.0023 0.0000 1 58: 0.0252 0.0468 0.0011 0.0111 0.0002 0.9150 0.0006 1 59: 0.0526 0.0000 0.0237 0.7795 0.0000 0.1422 0.0020 1 60: 0.0369 0.0040 0.1053 0.6189 0.0052 0.1687 0.0610 1 61: 0.0041 0.0291 0.0366 0.0002 0.0015 0.9269 0.0016 1 62: 0.0038 0.0278 0.0017 0.0010 0.0010 0.9611 0.0036 1 63: 0.0051 0.0336 0.0640 0.0000 0.0006 0.7864 0.1103 1 64: 0.0302 0.0018 0.0010 0.0018 0.0050 0.9592 0.0010 1 65: 0.0416 0.0595 0.0252 0.1605 0.0403 0.6659 0.0071 1 66: 0.0010 0.0016 0.0010 0.0742 0.0369 0.8848 0.0005 1 67: 0.0443 0.0553 0.0056 0.3364 0.0132 0.4657 0.0794 1 68: 0.1039 0.1731 0.0447 0.4096 0.1063 0.1602 0.0022 1 69: 0.0162 0.0044 0.0038 0.4629 0.0010 0.5102 0.0015 1 70: 0.0014 0.0006 0.0085 0.0567 0.0000 0.9303 0.0025 1 71: 0.0125 0.0000 0.6783 0.1962 0.0003 0.1127 0.0000 1 72: 0.0404 0.0010 0.0083 0.7632 0.0502 0.1066 0.0303 1 73: 0.0274 0.0096 0.0081 0.6433 0.0598 0.1485 0.1033 1 74: 0.0063 0.0006 0.0000 0.0950 0.0005 0.8966 0.0010 1 75: 0.0716 0.1098 0.1765 0.2512 0.0977 0.2635 0.0296 1 76: 0.0337 0.0013 0.0144 0.7020 0.0104 0.2362 0.0020 1 77: 0.0891 0.1959 0.0125 0.0677 0.1720 0.3280 0.1349 1 78: 0.0211 0.0417 0.0008 0.1296 0.7652 0.0189 0.0227 1 79: 0.0584 0.0007 0.0024 0.8836 0.0045 0.0485 0.0020 1 80: 0.0000 0.0000 1.0000 0.0000 0.0000 0.0000 0.0000 1 81: 0.0517 0.0000 0.0063 0.7232 0.0000 0.2177 0.0010 1 82: 0.0005 0.0010 0.0026 0.0268 0.9664 0.0014 0.0013 1 83: 0.0019 0.0029 0.0010 0.0785 0.8510 0.0565 0.0082 1 84: 0.0000 0.0000 0.0000 0.0000 1.0000 0.0000 0.0000 1 85: 0.0010 0.0010 0.0000 0.0031 0.9917 0.0025 0.0007 1 86: 0.0035 0.0005 0.0006 0.2846 0.0010 0.1334 0.5764 1 87: 0.0243 0.0030 0.4440 0.1947 0.1163 0.0072 0.2105 1 88: 0.0034 0.0195 0.0782 0.0743 0.1643 0.0706 0.5898 1 89: 0.0472 0.0017 0.0405 0.7248 0.0220 0.0851 0.0788 1 90: 0.0045 0.0115 0.3725 0.1843 0.0636 0.0117 0.3519 1 91: 0.0112 0.0495 0.0016 0.0865 0.2411 0.0665 0.5436 1 92: 0.0009 0.0010 0.5561 0.0069 0.3154 0.0000 0.1197 1 93: 0.0003 0.9997 0.0000 0.0000 0.0000 0.0000 0.0000 1 94: 0.0000 0.9999 0.0000 0.0000 0.0000 0.0001 0.0000 1
Here are the files. Sorry. Thank you for your time.
Hi, I think the plot you have looks similar to the attached figure. They are both sorted by the largest proportions. The data is just different, that's all. To change individual labels, you need to manually read in the labels to R and add that as the rownames of the qlist object.
library(pophelper)
# read clumpp file as a qlist
x <- readQClumpp("../runs/structureruns/grimperez/1_pop_K7-combined-merged.txt")
# read labels as a tab delimited text file (labels in same order as in clumpp file)
labs <- read.csv("../runs/structureruns/grimperez/labels.csv",header=F,stringsAsFactors=F)
# add labels to qlist
rownames(x$`1_pop_K7-combined-merged-1`) <- labs$V1
Then, use showindlab=T
and useindlab=T
during plotting.
plotQ(x,exportplot=F,returnplot=T,showindlab=T,useindlab=T)
Thank you very much. Your input was very helpful.
If I may ask, is it possible to calculate %admixture within the pophelper workflow? For example: K= 3, % admixture for for each cluster?
Hmmm. I am not quite sure what you mean. The admixture values are in proportions already which is the same as percentage. For each individual, the values sum to 1.
For example; K=2
Sample Cluster1 Cluster2
Sample1 0.7 0.3
or K=3
Sample Cluster1 Cluster2 Cluster3
Sample1 0.7 0.2 0.1
Thank you for your kind response. I will try to elaborate a bit more on what I mean. For example: if I have K=3, I would like to know the percentage of genotypes (%) containing a degree of intermixing greater than 10% for each cluster. K=3, n=120, Cluster1= 40, Cluster2=40, Cluster3=40. Cluster1, 20 of 40 genotypes (50%) contain a degree of intermixing greater than 10%.
Is this possible to calculate using the data generated through pophelper? Thank you again for your time and patience.
Sincerely, Grimar A. Perez
Good day,
I want to thank you for your patience and time. I am new to using pophelper. I read the "Pophelper 2.2.9 Roy M Francis | 14-Apr-2019" before attempting to use pophelper. I have acquired my STRUCTURE results for K1-K10 with 10 repeats each (100 total outputs). I am using RStudio in MAC.
I am encountering an error at clumppExport(qlist) as seen below.
This is the set of commands that I am trying to use to plot Q and to acquire plots produced by the Evanno method.
library(pophelper) setwd("~/Desktop/structurepop") sfiles <- list.files(path="~/Desktop/structurepop, full.names=T) readQ(files=sfiles) tabulateQ(qlist) summariseQ(df1) evannoMethodStructure(df2, exportplot=T) clumppExport(qlist) setwd("~/Desktop/structurepop") collectClumppOutput(prefix="pop", filetype="aligned") collectClumppOutput(filetype="both") plotQ(qlist) plotQ(qlist,imgoutput="join") plotQMultiline(qlist[1]) plotQMultiline(qlist[1], spl=70, lpp=10)
analyseQ(qfiles)
Your input is sincerely appreciated. Thanks.