GithubHelp home page GithubHelp logo

royfrancis / pophelper Goto Github PK

View Code? Open in Web Editor NEW
136.0 13.0 37.0 50.91 MB

An R package to analyse and visualise admixture proportions from STRUCTURE, fastSTRUCTURE, TESS, ADMIXTURE etc.

Home Page: http://royfrancis.github.io/pophelper/

R 97.98% CSS 2.02%
population-genetics r population-structure admixture faststructure clumpp distruct

pophelper's Introduction

pophelper

ci_badge codecov_.io_badge

pophelper is an R package and web app to analyse and visualise population structure. See the project website for more details. An interactive version of this package using shiny web framework is available as pophelperShiny.

Disclaimer

This R package is offered free and without warranty of any kind, either expressed or implied. I will not be held liable to you for any damage arising out of the use, modification or inability to use this program. This R package can be used, redistributed and/or modified freely for non-commercial purposes subject to the original source being properly cited. Licensed under GPL-3. Please make sure you verify all your results.

Contact

If you have an comments, suggestions, corrections or ideas on ways to improve or extend this package, feel free to contact me. Submit a report on the Github issues page.

2021 | Roy M Francis

pophelper's People

Contributors

royfrancis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pophelper's Issues

Order of K out of control when I plot my data with population informations

Hi,

When I plotting structure/admixtrue results with population informations, K = 2 ALWAYS follow by K=11, even though Q file names have been sorted in input list, can you tell me what was wrong there?

Here is my r script to plot my results.

fclum <- list.files(path = "pop-both", full.names = T, pattern = "merge")
qclum <- readQ(fclum)
sample_order <- read.table("demon2_pop_code.txt", header = T, stringsAsFactors = F)
ind_name <- sample_order[,1]
for(i in 1:length(qclum)){
row.names(qclum[[i]]) <- ind_name
}

determine orders and labels

mink <- 2
maxk <- 12
k_order <- vector()
if(maxk < 10){
k_order <- 1:length(qclum)
} else if (maxk < 20) {
end1 <- maxk - 10 + 1
start2 <- end1 + 1
k_order <- c(start2:length(qclum), 1:end1)
}
klab <- vector()
if(mink == 1){
klab <- 2:maxk
} else {
klab <- mink:maxk
}

prefix <- "demo_label"
plotQ(qclum[k_order], imgoutput="join",showindlab=T, showlegend=F, sortind = "all",
indlabsize=0.5,indlabheight=0,indlabspacer=0.05,barbordersize=NA,
outputfilename=prefix,imgtype="pdf", sharedindlab = F,
useindlab = T, showyaxis = T, basesize = 10, sppos = "right", showticks = T,
splab = paste0("K = ", klab), splabsize = 6, splabface = "bold",
width = width, height = height, panelspacer = 0.02, dpi = 600, barbordercolour = NA,
grplab=sample_order[,2,drop=FALSE], grplabsize=2, grplabheight = 4)

and got
snp_pop

Best wishes,
Kun

Why is pophelper not on CRAN?

This is a question I get asked often and I am offering an explanation here.

I've been asked a few times about why this package is not on CRAN. And the answer is simply that the package contains windows and linux executables (clumpp/distruct) which is not allowed on CRAN under submission guidelines.

Source packages may not contain any form of binary executable code.

One possibility (the easy option) would be to have a version without these executables for CRAN. Another option (more work) is to re-write/implement the CLUMPP code in R. Personally, I don't think it's too much extra effort to install from GitHub anyway.

If you have any thoughts on this, feel free to comment here.

Separate individual labels from group labels

Hi Roy,

First of all you've done an amazing job with customising the plots! However, there's one thing I'd like to do which I haven't been able to sort. Is it possible to 'de-concatenate' the individual labels from the group labels? I am using plotQMultiline with group and individual labels but would like to display the individual labels ONLY below the bars and not the individual and group lables concatenated. As the group labels are displayed above the bars I don't see the necessety to have them concatenated to the individual labels as well as this makes the graph/ind labels unecessarily long and crowded.

Thanks for your help

Markus

Sort by group AND individual labels?

Hello!
I want to generate a barplot where individuals are sorted by their population group and also have their labels displayed.

I can sort individuals by group labels using plotQ:

plotQ(qlist=qlist2[i],sortind="all",grplab=list("lab1"=grp$V2),sp=F,subsetgrp=c("Wild","Landrace","Improved"))

OR

I can use individual labels using plotQMultiline:

inds <- read.delim("structureindlabels.txt",header=FALSE,stringsAsFactors=FALSE)
# add labels as rownames to qlist
rownames(qlist2[[1]]) <- inds$V1
#plot with individual labels
plotQMultiline(qlist2[i],spl=48,lpp=2,useindlab=T,sortind = "Cluster1")

However I can't find any way to both sort by group and label individuals in the same plot. It seems that this would be a very common need for users, so I must be missing something. Without this, it's extremely difficult for me to get or display the basic information about my data in one plot.

Thank you!
Heather Rose``

Graphs in graphics device instead of direct file export

Hi! I love the package, it makes my work with STRUCTURE a lot easier already. I like the plotting functions included in the package but I would love to plot them on a graphics device instead of having them directly as a file export so I can integrate the graphs into my R notebook (for example the evannoMethodStructure() function). Is there a straightforward way of doing this?

y-axis label

Thanks very much for this helpful tool! Two enhancements that I think might make it even better:

  1. Adding ability to enable y-axis w/ label ("proportion ancestry") and controls for ticks. Seems like this could be easily accomplished via ggplot?
  2. Add ability to plot lines separating the individual samples (similar to the dashed lines that can currently be used to separate groups). For some reason, simply modifying the barsize= value does not seem to produce reliable results.

Cheers!

Adjust colors for different K

Hi!
When plotting for several values of K ("plotQ(slist[2:6]..."), the colors of clusters do not match.
Imaginge cluster 1 from K=2 stays the same but cluster 2 from K=2 is devided into two clusters at K=3.
However, the cluster identities are not maintained between Ks. Thus old cluster 1 (from K=2) is cluster 2 at K=3 etc.
I would thus like to keep the same color for those clusters that are the same across Ks.
This means I would like to use different color schemes for the different files of slist in the plotQ command.

Now I would have to re-order the coloums of the files in slist, which is laborious...

Any idea? Or can you adjust plotQ accordingly?
Best regards
Walter

how to italicize group labels

I cannot figure out how to italicize my group labels in my plotQMultiline. The labels are imported from a .csv. Any suggestions? Thank you!

qfile <- "clumpp_k=3_interr.txt"
readQ(qfile)
qlist <- readQ(files=qfile)
subsplab3 <- metadata1
plotQMultiline(qlist,showindlab=F,subsetgrp=c("S. p. interrupta","S. p. putorius","S. p. ambarvalis"),font="italic",useindlab=F,ordergrp=T,showlegend=F,showtitle=F,showsubtitle=F,titlelab="The Great Structure",grplabsize=6,subtitlelab="The amazing population structure of your favourite organism.",grplabbgcol="gray", height=2,indlabsize=2.5,clustercol=c("darkslategray4","chocolate1", "black"),indlabspacer=-1, barbordercol="white",barbordersize=0,spl=46,outputfilename="Plot_Interr_K=3,imgtype="jpeg")

collect clumpp output not working

i am new to STRUCTURE and pophelper. I am running my test result data from STRUCTURE output. Everything is working fine with pophelper other than the function collectClumppOutput().. The part of the script is as follows:

collectClumppOutput(prefix = "pop",
#filetype = "",
runsdir = NA,
newdir = NA,
quiet = FALSE)

There is no error message but this following message:

No suitable file found in directory: pop_K10
No suitable file found in directory: pop_K2
No suitable file found in directory: pop_K3
No suitable file found in directory: pop_K4
No suitable file found in directory: pop_K5
No suitable file found in directory: pop_K6
No suitable file found in directory: pop_K7
No suitable file found in directory: pop_K8
No suitable file found in directory: pop_K9
Directories processed: 0
Files copied: 0
[1] 0 0

I have also uploaded my input data (results from structure) and my entire script.

I am not sure if it is a problem of the code or my files.

Thank you very much.

Pophelper.txt
results_job_f.zip

unable to read files

Hi!
I'm trying to read the admixture files I have on my mac, either from the very same directory or from directory .., but when I type

afiles<- list.files(path=system.file(".",package="pophelper"), full.names=T)
alist <- readQ(files=afiles)
I obtain
Error in scan(file = file, what = what, sep = sep, quote = quote, dec = dec, :
line 1 did not have 15 elements

Alternatively, if I do it from the directory above:

afiles<- list.files(path=system.file("Admix/",package="pophelper"), full.names=T)
alist <- readQ(files=afiles)
I obtain this error
Error in readQ(files = afiles) : readQ: No input files.

All help will be greatly appreciated!

Unable to return plot while using grplab=label

Hello!
I was hoping you could help me. I used your program a couple of moths ago and everything was fine, but Now I'm experience a new problem that I didn't have before.
When I run Qplot()it runs perfect until i add the group label , in this moment the program does not return the plot. I change the return plot to TRUE , but, noting. For the moment I been able to save the images using exportplot=TRUE, but the pgn images its to small, and when I make it bigger I lose a lot of resolution.
Its is what I get when I use grouplabel
Captura de pantalla 2019-03-09 a la(s) 21 16 09

Using the same data, but removing the group label I have no problem...
I wish you could help me.
Thanks!

Space between two sets of group labels

Hi Roy,

I'm trying to plot multiple labels but keep getting a large space between the groups label with no idea how to reduce the gap? My code is below too.

pop_K3-combined-merged.txt
pop_labels.txt

3473 snps k3 merged

k3_merge = readQ("pop-merged/pop_K3-combined-merged.txt")
k3_merge
plotQ(k3_merge, imgoutput="sep", exportplot=T, returnplot=F, # Colouring # clustercol=c("steelblue","coral","palegreen"), # Individual labels useindlab=T, showindlab=F, indlabsize=2.1, indlabheight=0.1, indlabspacer=0, # Group label panel grplab=pop, subsetgrp=pop.order, grplabspacer=-0.1, # Group labels grplabsize=1.5, grplabpos=0.75, grplabcol="grey30", grplabheight=0.5, # Label line linesize=0.1, linepos=0.9, # Label points pointsize=1, # Strip panel showsp=FALSE, # Legend showlegend=TRUE, legendpos="left", # Title showtitle=TRUE, titlelab="SNPs STRUCTURE plot K3", titlevjust=1.5, titlesize=6, # Export options outputfilename = "3473 SNPs k3 merged", imgtype="png", width=8, height=4, dpi=900, units="cm")

suggestion - plot convergence

Hi, pophelper is a great package. One thing that would be really useful would be the ability to plot MCMC samples to assess convergence. Some other packages are designed to do this (Starmie, Rrunstruct) but they don't seem to be actively maintained (and thus some functions no longer work). Any thoughts on incorporating functions to check for convergence and plot MCMC samples?

R version

Hello, can someone help me?
I have a version of R 3.4.1 and I can not install the POPHELPER package ...
Could someone pass me the script?
thank you very much

Gisel

Argument 'grplab' contains one or more fields which are not character datatype.

I am having some issues trying to add the group label panel to my image. I have 141 individuals in my analysis and have created a file with 141 rows corresponding to the population they are from. When I try to read in the file into grplab I get the following error:

Error in verifyGrplab(grplab) :
verifyGrplab: Argument 'grplab' contains one or more fields which are not character datatype.

This is the script I am using:

pop.labels <- read.table("20Xm3M1n1r30-poplabels.txt")

plotQ(Q.data,
clustercol = c("lightblue", "purple"),
#useindlab = T,
showindlab = T,
grplab = pop.labels,
#this needs to be a data.frame, each label set must be a character vector
showlegend = F,
showsp = T,
splab = "20Xm3M1n1r30Neutral \n K2",
splabsize = 3
)

Thanks!

Carly

Evanno plots

Hi,

Is it possible to produce the Evanno plots in a way that the value for K on the x-axis always corresponds to integers. I usually get plots where K is labelled in fractions on the x - axis starting at K=2.5 - 5 - 7.5 ....... (see attached plot)?

Thank you

Markus

evannoMethodStructure.pdf

Aligning plots with varying numbers of individuals

Hi there,

I'm trying to create an "A", "B", and "C" figure with my three structure plots. Each plot has a different number of individuals (97, 55, and 46). When the plots are generated, they are all the same dimensions, but the width of the individual bars are all different sizes (smaller width for larger n and larger width for smaller n). I am trying to get each plot to have matching barsizes. I tried adjusting "barsize" but that left the entire plot the same dimension and only increased or decreased the amount of space between the bars. I generated each as a plotQmultiline. Is there another way to accomplish this? Thank you!

Installation not working

Hello

I followed the installation instructions but ran into a problem associated with Cairo. Step1 seemed to work fine.

install.packages(c("Cairo","ggplot2","gridExtra","gtable","tidyr","devtools"),dependencies=T)
trying URL 'https://cran.mtu.edu/bin/macosx/el-capitan/contrib/3.4/Cairo_1.5-9.tgz'
Content type 'application/x-gzip' length 289249 bytes (282 KB)
==================================================
downloaded 282 KB

(all packages seemed to install fine.)

Step 2 resulted in the following error:

devtools::install_github('royfrancis/pophelper')
Downloading GitHub repo royfrancis/pophelper@master
from URL https://api.github.com/repos/royfrancis/pophelper/zipball/master
Installing pophelper
'/Library/Frameworks/R.framework/Resources/bin/R' --no-site-file
--no-environ --no-save --no-restore --quiet CMD INSTALL
'/private/var/folders/kc/ty_ng2js4mv1yv8m3ryz31f80000gn/T/RtmpoqaSed/devtools228213473e89/royfrancis-pophelper-2ee308d'
--library='/Library/Frameworks/R.framework/Versions/3.4/Resources/library'
--install-tests

  • installing source package ‘pophelper’ ...
    ** R
    ** inst
    ** tests
    ** preparing package for lazy loading
    Error: package or namespace load failed for ‘Cairo’:
    .onLoad failed in loadNamespace() for 'Cairo', details:
    call: dyn.load(file, DLLpath = DLLpath, ...)
    error: unable to load shared object '/Library/Frameworks/R.framework/Versions/3.4/Resources/library/Cairo/libs/Cairo.so':
    dlopen(/Library/Frameworks/R.framework/Versions/3.4/Resources/library/Cairo/libs/Cairo.so, 6): Library not loaded: /opt/X11/lib/libfreetype.6.dylib
    Referenced from: /Library/Frameworks/R.framework/Versions/3.4/Resources/library/Cairo/libs/Cairo.so
    Reason: image not found
    Error : package ‘Cairo’ could not be loaded
    ERROR: lazy loading failed for package ‘pophelper’
  • removing ‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library/pophelper’
    Installation failed: Command failed (1)

I am using R 3.4.3

Thank you for your help!
Jim

Group / region labels on top of plot

I was wondering if it's possible to have an argument in the plotRuns function to allow regional or group labels on the top of the figure. For example, on this plot, I would like to have a straight line above the plot to label Portugal populations (Por, Arm & Far) as "Portugal" and Irish populations (Bla & Thu) as "Ireland".

clump_k3-combined-merged

Problem Installing pop helper in Rstudio

Dear Roy Francis,

Thank you for the nice documentation of the pophelper.

I am having a problem with installing the pophelper package. I am using Rstudio and the version of R is 3.4.0. I have pasted the errors for you to have a look below.
I am badly need of your help on this.
Kind regards,
Manju

> install.packages(c("Cairo","devtools","ggplot2","gridExtra","gtable","tidyr"),dependencies=T)
Warning in install.packages :
  dependency ‘BiocManager’ is not available
also installing the dependencies ‘ini’, ‘RCurl’, ‘packrat’, ‘checkmate’, ‘zoo’, ‘fontBitstreamVera’, ‘fontLiberation’, ‘e1071’, ‘desc’, ‘xopen’, ‘clisymbols’, ‘gh’, ‘rex’, ‘stringdist’, ‘igraph’, ‘highlight’, ‘rematch2’, ‘rsconnect’, ‘parsedate’, ‘rappdirs’, ‘whoami’, ‘brew’, ‘commonmark’, ‘hunspell’, ‘Formula’, ‘latticeExtra’, ‘acepack’, ‘htmlTable’, ‘TH.data’, ‘sandwich’, ‘diffobj’, ‘fontquiver’, ‘freetypeharfbuzz’, ‘gdtools’, ‘htmlwidgets’, ‘classInt’, ‘units’, ‘png’, ‘git2r’, ‘memoise’, ‘pkgbuild’, ‘pkgload’, ‘rcmdcheck’, ‘remotes’, ‘sessioninfo’, ‘usethis’, ‘covr’, ‘foghorn’, ‘gmailr’, ‘lintr’, ‘mockery’, ‘pingr’, ‘pkgdown’, ‘rhub’, ‘roxygen2’, ‘rversions’, ‘spelling’, ‘ggplot2movies’, ‘hexbin’, ‘Hmisc’, ‘mapproj’, ‘multcomp’, ‘vdiffr’, ‘rgeos’, ‘sf’, ‘svglite’, ‘egg’, ‘gapminder’

Warning in install.packages :
  cannot open URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/PACKAGES.rds': HTTP status was '404 Not Found'

  There are binary versions available but the source versions are later:
          binary source needs_compilation
htmlTable   1.12   1.13             FALSE
vdiffr     0.2.3  0.3.0              TRUE
devtools  1.13.6  2.0.1             FALSE

Do you want to install from sources the package which needs compilation?
y/n: y
trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/ini_0.3.1.tgz'
Content type 'application/x-gzip' length 10685 bytes (10 KB)
==================================================
downloaded 10 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/RCurl_1.95-4.11.tgz'
Content type 'application/x-gzip' length 889683 bytes (868 KB)
==================================================
downloaded 868 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/packrat_0.5.0.tgz'
Content type 'application/x-gzip' length 212986 bytes (207 KB)
==================================================
downloaded 207 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/checkmate_1.8.5.tgz'
Content type 'application/x-gzip' length 604407 bytes (590 KB)
==================================================
downloaded 590 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/zoo_1.8-4.tgz'
Content type 'application/x-gzip' length 908613 bytes (887 KB)
==================================================
downloaded 887 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/fontBitstreamVera_0.1.1.tgz'
Content type 'application/x-gzip' length 691079 bytes (674 KB)
==================================================
downloaded 674 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/fontLiberation_0.1.0.tgz'
Content type 'application/x-gzip' length 4526763 bytes (4.3 MB)
==================================================
downloaded 4.3 MB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/e1071_1.7-0.tgz'
Content type 'application/x-gzip' length 761247 bytes (743 KB)
==================================================
downloaded 743 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/desc_1.2.0.tgz'
Content type 'application/x-gzip' length 179131 bytes (174 KB)
==================================================
downloaded 174 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/xopen_1.0.0.tgz'
Content type 'application/x-gzip' length 19089 bytes (18 KB)
==================================================
downloaded 18 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/clisymbols_1.2.0.tgz'
Content type 'application/x-gzip' length 16787 bytes (16 KB)
==================================================
downloaded 16 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/gh_1.0.1.tgz'
Content type 'application/x-gzip' length 31077 bytes (30 KB)
==================================================
downloaded 30 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/rex_1.1.2.tgz'
Content type 'application/x-gzip' length 98205 bytes (95 KB)
==================================================
downloaded 95 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/stringdist_0.9.5.1.tgz'
Content type 'application/x-gzip' length 537953 bytes (525 KB)
==================================================
downloaded 525 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/igraph_1.2.2.tgz'
Content type 'application/x-gzip' length 5888369 bytes (5.6 MB)
==================================================
downloaded 5.6 MB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/highlight_0.4.7.2.tgz'
Content type 'application/x-gzip' length 1797414 bytes (1.7 MB)
==================================================
downloaded 1.7 MB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/rematch2_2.0.1.tgz'
Content type 'application/x-gzip' length 30650 bytes (29 KB)
==================================================
downloaded 29 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/rsconnect_0.8.12.tgz'
Content type 'application/x-gzip' length 334847 bytes (326 KB)
==================================================
downloaded 326 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/parsedate_1.1.3.tgz'
Content type 'application/x-gzip' length 48156 bytes (47 KB)
==================================================
downloaded 47 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/rappdirs_0.3.1.tgz'
Content type 'application/x-gzip' length 79569 bytes (77 KB)
==================================================
downloaded 77 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/whoami_1.2.0.tgz'
Content type 'application/x-gzip' length 21195 bytes (20 KB)
==================================================
downloaded 20 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/brew_1.0-6.tgz'
Content type 'application/x-gzip' length 98225 bytes (95 KB)
==================================================
downloaded 95 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/commonmark_1.7.tgz'
Content type 'application/x-gzip' length 301696 bytes (294 KB)
==================================================
downloaded 294 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/hunspell_3.0.tgz'
Content type 'application/x-gzip' length 2237141 bytes (2.1 MB)
==================================================
downloaded 2.1 MB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/Formula_1.2-3.tgz'
Content type 'application/x-gzip' length 161847 bytes (158 KB)
==================================================
downloaded 158 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/latticeExtra_0.6-28.tgz'
Content type 'application/x-gzip' length 2072202 bytes (2.0 MB)
==================================================
downloaded 2.0 MB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/acepack_1.4.1.tgz'
Content type 'application/x-gzip' length 74840 bytes (73 KB)
==================================================
downloaded 73 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/TH.data_1.0-9.tgz'
Content type 'application/x-gzip' length 8453288 bytes (8.1 MB)
==================================================
downloaded 8.1 MB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/sandwich_2.5-0.tgz'
Content type 'application/x-gzip' length 1320911 bytes (1.3 MB)
==================================================
downloaded 1.3 MB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/diffobj_0.1.11.tgz'
Content type 'application/x-gzip' length 644806 bytes (629 KB)
==================================================
downloaded 629 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/fontquiver_0.2.1.tgz'
Content type 'application/x-gzip' length 2255934 bytes (2.2 MB)
==================================================
downloaded 2.2 MB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/freetypeharfbuzz_0.2.5.tgz'
Content type 'application/x-gzip' length 1942085 bytes (1.9 MB)
==================================================
downloaded 1.9 MB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/gdtools_0.1.7.tgz'
Content type 'application/x-gzip' length 562375 bytes (549 KB)
==================================================
downloaded 549 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/htmlwidgets_1.3.tgz'
Content type 'application/x-gzip' length 762468 bytes (744 KB)
==================================================
downloaded 744 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/classInt_0.3-1.tgz'
Content type 'application/x-gzip' length 45374 bytes (44 KB)
==================================================
downloaded 44 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/units_0.6-2.tgz'
Content type 'application/x-gzip' length 1194360 bytes (1.1 MB)
==================================================
downloaded 1.1 MB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/png_0.1-7.tgz'
Content type 'application/x-gzip' length 351441 bytes (343 KB)
==================================================
downloaded 343 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/git2r_0.23.0.tgz'
Content type 'application/x-gzip' length 1943552 bytes (1.9 MB)
==================================================
downloaded 1.9 MB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/memoise_1.1.0.tgz'
Content type 'application/x-gzip' length 27154 bytes (26 KB)
==================================================
downloaded 26 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/pkgbuild_1.0.2.tgz'
Content type 'application/x-gzip' length 65163 bytes (63 KB)
==================================================
downloaded 63 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/pkgload_1.0.2.tgz'
Content type 'application/x-gzip' length 90970 bytes (88 KB)
==================================================
downloaded 88 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/rcmdcheck_1.3.2.tgz'
Content type 'application/x-gzip' length 1430884 bytes (1.4 MB)
==================================================
downloaded 1.4 MB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/remotes_2.0.2.tgz'
Content type 'application/x-gzip' length 160321 bytes (156 KB)
==================================================
downloaded 156 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/sessioninfo_1.1.1.tgz'
Content type 'application/x-gzip' length 27483 bytes (26 KB)
==================================================
downloaded 26 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/usethis_1.4.0.tgz'
Content type 'application/x-gzip' length 423985 bytes (414 KB)
==================================================
downloaded 414 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/covr_3.2.1.tgz'
Content type 'application/x-gzip' length 181240 bytes (176 KB)
==================================================
downloaded 176 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/foghorn_1.0.2.tgz'
Content type 'application/x-gzip' length 64262 bytes (62 KB)
==================================================
downloaded 62 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/gmailr_0.7.1.tgz'
Content type 'application/x-gzip' length 108932 bytes (106 KB)
==================================================
downloaded 106 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/lintr_1.0.3.tgz'
Content type 'application/x-gzip' length 148880 bytes (145 KB)
==================================================
downloaded 145 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/mockery_0.4.1.1.tgz'
Content type 'application/x-gzip' length 31749 bytes (31 KB)
==================================================
downloaded 31 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/pingr_1.1.2.tgz'
Content type 'application/x-gzip' length 21895 bytes (21 KB)
==================================================
downloaded 21 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/pkgdown_1.3.0.tgz'
Content type 'application/x-gzip' length 304695 bytes (297 KB)
==================================================
downloaded 297 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/rhub_1.0.2.tgz'
Content type 'application/x-gzip' length 802799 bytes (783 KB)
==================================================
downloaded 783 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/roxygen2_6.1.1.tgz'
Content type 'application/x-gzip' length 501881 bytes (490 KB)
==================================================
downloaded 490 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/rversions_1.0.3.tgz'
Content type 'application/x-gzip' length 14519 bytes (14 KB)
==================================================
downloaded 14 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/spelling_2.0.tgz'
Content type 'application/x-gzip' length 29800 bytes (29 KB)
==================================================
downloaded 29 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/ggplot2movies_0.0.1.tgz'
Content type 'application/x-gzip' length 1248043 bytes (1.2 MB)
==================================================
downloaded 1.2 MB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/hexbin_1.27.2.tgz'
Content type 'application/x-gzip' length 682089 bytes (666 KB)
==================================================
downloaded 666 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/Hmisc_4.1-1.tgz'
Content type 'application/x-gzip' length 1798684 bytes (1.7 MB)
==================================================
downloaded 1.7 MB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/mapproj_1.2.6.tgz'
Content type 'application/x-gzip' length 79083 bytes (77 KB)
==================================================
downloaded 77 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/multcomp_1.4-8.tgz'
Content type 'application/x-gzip' length 626720 bytes (612 KB)
==================================================
downloaded 612 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/rgeos_0.4-2.tgz'
Content type 'application/x-gzip' length 5299572 bytes (5.1 MB)
==================================================
downloaded 5.1 MB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/sf_0.7-2.tgz'
Content type 'application/x-gzip' length 40900537 bytes (39.0 MB)
==================================================
downloaded 39.0 MB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/svglite_1.2.1.tgz'
Content type 'application/x-gzip' length 399894 bytes (390 KB)
==================================================
downloaded 390 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/egg_0.4.2.tgz'
Content type 'application/x-gzip' length 707351 bytes (690 KB)
==================================================
downloaded 690 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/gapminder_0.3.0.tgz'
Content type 'application/x-gzip' length 2031705 bytes (1.9 MB)
==================================================
downloaded 1.9 MB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/Cairo_1.5-9.tgz'
Content type 'application/x-gzip' length 289249 bytes (282 KB)
==================================================
downloaded 282 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/ggplot2_3.1.0.tgz'
Content type 'application/x-gzip' length 3179264 bytes (3.0 MB)
==================================================
downloaded 3.0 MB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/gridExtra_2.3.tgz'
Content type 'application/x-gzip' length 1077959 bytes (1.0 MB)
==================================================
downloaded 1.0 MB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/gtable_0.2.0.tgz'
Content type 'application/x-gzip' length 57162 bytes (55 KB)
==================================================
downloaded 55 KB

trying URL 'https://cran.rstudio.com/bin/macosx/el-capitan/contrib/3.4/tidyr_0.8.2.tgz'
Content type 'application/x-gzip' length 586960 bytes (573 KB)
==================================================
downloaded 573 KB


The downloaded binary packages are in
	/var/folders/63/mrh5t29j67g30n4k19w80b3h0000gn/T//RtmpWHIBap/downloaded_packages
installing the source packages ‘htmlTable’, ‘vdiffr’, ‘devtools’

trying URL 'https://cran.rstudio.com/src/contrib/htmlTable_1.13.tar.gz'
Content type 'application/x-gzip' length 174817 bytes (170 KB)
==================================================
downloaded 170 KB

trying URL 'https://cran.rstudio.com/src/contrib/vdiffr_0.3.0.tar.gz'
Content type 'application/x-gzip' length 91681 bytes (89 KB)
==================================================
downloaded 89 KB

trying URL 'https://cran.rstudio.com/src/contrib/devtools_2.0.1.tar.gz'
Content type 'application/x-gzip' length 388953 bytes (379 KB)
==================================================
downloaded 379 KB

Warning in strptime(xx, f <- "%Y-%m-%d %H:%M:%OS", tz = tz) :
  unknown timezone 'zone/tz/2018g.1.0/zoneinfo/Europe/Amsterdam'
* installing *source* package ‘htmlTable’ ...
** package ‘htmlTable’ successfully unpacked and MD5 sums checked
** R
** data
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (htmlTable)
Warning in strptime(xx, f <- "%Y-%m-%d %H:%M:%OS", tz = tz) :
  unknown timezone 'zone/tz/2018g.1.0/zoneinfo/Europe/Amsterdam'
* installing *source* package ‘devtools’ ...
** package ‘devtools’ successfully unpacked and MD5 sums checked
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
*** copying figures
** building package indices
** installing vignettes
** testing if installed package can be loaded
Warning: package ‘usethis’ was built under R version 3.4.4
* DONE (devtools)
Warning in strptime(xx, f <- "%Y-%m-%d %H:%M:%OS", tz = tz) :
  unknown timezone 'zone/tz/2018g.1.0/zoneinfo/Europe/Amsterdam'
* installing *source* package ‘vdiffr’ ...
** package ‘vdiffr’ successfully unpacked and MD5 sums checked
** libs
clang++  -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG  -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/freetypeharfbuzz/include" -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/gdtools/include" -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/BH/include" -I/usr/local/include   -fPIC  -Wall -g -O2  -c RcppExports.cpp -o RcppExports.o
clang++  -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG  -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/freetypeharfbuzz/include" -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/gdtools/include" -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/BH/include" -I/usr/local/include   -fPIC  -Wall -g -O2  -c compare.cpp -o compare.o
clang++  -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG  -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/freetypeharfbuzz/include" -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/gdtools/include" -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/BH/include" -I/usr/local/include   -fPIC  -Wall -g -O2  -c devSVG.cpp -o devSVG.o
clang++  -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG  -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/freetypeharfbuzz/include" -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/gdtools/include" -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/Rcpp/include" -I"/Library/Frameworks/R.framework/Versions/3.4/Resources/library/BH/include" -I/usr/local/include   -fPIC  -Wall -g -O2  -c utils.cpp -o utils.o
clang++ -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/lib -o vdiffr.so RcppExports.o compare.o devSVG.o utils.o -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
installing to /Library/Frameworks/R.framework/Versions/3.4/Resources/library/vdiffr/libs
** R
** inst
** byte-compile and prepare package for lazy loading
Error in dyn.load(file, DLLpath = DLLpath, ...) : 
  unable to load shared object '/Library/Frameworks/R.framework/Versions/3.4/Resources/library/gdtools/libs/gdtools.so':
  dlopen(/Library/Frameworks/R.framework/Versions/3.4/Resources/library/gdtools/libs/gdtools.so, 6): Library not loaded: /opt/X11/lib/libcairo.2.dylib
  Referenced from: /Library/Frameworks/R.framework/Versions/3.4/Resources/library/gdtools/libs/gdtools.so
  Reason: image not found
ERROR: lazy loading failed for package ‘vdiffr’
* removing ‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library/vdiffr’
Warning in install.packages :
  installation of package ‘vdiffr’ had non-zero exit status

The downloaded source packages are in
	‘/private/var/folders/63/mrh5t29j67g30n4k19w80b3h0000gn/T/RtmpWHIBap/downloaded_packages’
> devtools::install_github('royfrancis/pophelper')
Downloading GitHub repo royfrancis/pophelper@master
✔  checking for file ‘/private/var/folders/63/mrh5t29j67g30n4k19w80b3h0000gn/T/RtmpWHIBap/remotes127c798a198c/royfrancis-pophelper-3d6113d/DESCRIPTION’ (691ms)
─  preparing ‘pophelper’: (423ms)
✔  checking DESCRIPTION meta-information ...
   Warning in as.POSIXlt.POSIXct(x, tz) :
     unknown timezone 'zone/tz/2018g.1.0/zoneinfo/Europe/Amsterdam'
─  checking for LF line-endings in source and make files
─  checking for empty or unneeded directories
─  building ‘pophelper_2.2.7.tar.gz’
   
Warning in strptime(xx, f <- "%Y-%m-%d %H:%M:%OS", tz = tz) :
  unknown timezone 'zone/tz/2018g.1.0/zoneinfo/Europe/Amsterdam'
* installing *source* package ‘pophelper’ ...
** R
** inst
** preparing package for lazy loading
Error: package or namespace load failed for ‘Cairo’:
 .onLoad failed in loadNamespace() for 'Cairo', details:
  call: dyn.load(file, DLLpath = DLLpath, ...)
  error: unable to load shared object '/Library/Frameworks/R.framework/Versions/3.4/Resources/library/Cairo/libs/Cairo.so':
  dlopen(/Library/Frameworks/R.framework/Versions/3.4/Resources/library/Cairo/libs/Cairo.so, 6): Library not loaded: /opt/X11/lib/libfreetype.6.dylib
  Referenced from: /Library/Frameworks/R.framework/Versions/3.4/Resources/library/Cairo/libs/Cairo.so
  Reason: image not found
Error : package ‘Cairo’ could not be loaded
ERROR: lazy loading failed for package ‘pophelper’
* removing ‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library/pophelper’
Error in i.p(...) : 
  (converted from warning) installation of package ‘/var/folders/63/mrh5t29j67g30n4k19w80b3h0000gn/T//RtmpWHIBap/file127c72982fb27/pophelper_2.2.7.tar.gz’ had non-zero exit status
> library(pophelper)
Error in library(pophelper) : there is no package called ‘pophelper’

.meanQ file for K=4 plotting only 3 colors

Hi,

I'm using Pophelper to visualize my results from fastStructure. When I plot my .meanQ file for K=4 I can't distinguish four clusters; for some reason, I just visualize three colors in the plot itself, the legend and all the rest looks fine, as you can see in the figure below. This problem also occurs for others K>4. I realize that in all my .meanQ files for K=4 and K>4 I have a column where the values of the cluster are all the same. I'm not sure if this is something relevant or if it is correlated.

My script:

plotQ(qlist_k4[1],imgoutput="sep", showsp = F, height = 5.0,
clustercol = c("blue", "darkorange", "black", "green"), barsize = 1.0,
showtitle=T, titlelab="P. axillaris subsp. parodii", titlesize = 7.0, titlespacer = 0.5,
showsubtitle = T, subtitlelab = "Pampas division", subtitlesize = 4.0, subtitlespacer = 0.5,
showlegend = T, legendtextsize = 4.0, legendlab = c("RS", "URU", "Chaco", "Name"),
useindlab = T, showindlab = T, indlabheight = 1.5, indlabsize = 1.0,
indlabcol = "black", indlabangle = 90, indlabvjust = 0.5, indlabspacer = -1,
ordergrp = T, barbordercolour = "white", barbordersize = 0,
outputfilename = "plotq_k4", dpi = 600, imgtype = "png")

My plot:
plotq_k4
A exemple of (part of) my .meanQ file (K=4), where all individuals of the first column present the same value:

0.000008 0.999976 0.000008 0.000008
0.000008 0.999976 0.000008 0.000008
0.000008 0.999976 0.000008 0.000008
0.000008 0.000008 0.000008 0.999976
0.000008 0.999976 0.000008 0.000008
0.000008 0.999976 0.000008 0.000008
0.000008 0.188496 0.143361 0.668136
0.000008 0.041626 0.071271 0.887095
0.000008 0.000008 0.000008 0.999976
0.000008 0.013699 0.243100 0.743193
0.000008 0.000008 0.000008 0.999976
0.000008 0.180609 0.089187 0.730196
0.000008 0.000008 0.000008 0.999976
0.000008 0.000008 0.000008 0.999976
0.000008 0.000008 0.000008 0.999976

I would like to know if I'm plotting something wrong or if perhaps there's a problem with my .meanQ file. I just use readQ followed by plotQ functions for this analysis, I don't have to use clumppExport for .meanQ files, right?

Best regards,

Giovanna Giudicelli

Suppressing group label panel in plotQ?

Hi Roy,

Is there a way to suppress the group label panel in plotQ? I can't find a method for suppressing it? Something like showgrplab=F was what I am looking for. It appears that function works in plotQMultiline() but not plotQ().

Thanks!

Sorting by group

Hi, I love this tool but am having a heck of a time sorting my samples by group. I've been through tutorials, etc. The individuals unfortunately are not in order by group (pop). I'm reading in group labels via a text file (read.delim) and am using data from Admixture.

I'm using the subsetgrp command to try to reorder and sort by the group ID. However, I get this error:
"Error in pophelper:::grpLabels(df = df1, grplab = grplab[[pp]], subsetgrp = subsetgrp, :
grpLabels: Duplicated contiguous block of grp labels. Not possible to subset or reorder grps.

Is this something I can work around?

Thanks

Thank you!

problems in running pophelper

Hi,
where is the protocol for plot admixture results? I was not familiar with R. So what is the protocol file that I could use? I have get the ***.Q and ***.P files from k2 to k15.
Thanks a lot.

cheers,
Jian

panel labels are wrong in joined plots

Hi,
Me again. Pophelper is a nice package for visualizing admixture/structure results.
But some small problems still trouble me when I using it in my project.

  1. The panel labels are disorderly when K > 10 in plotQ (with imgoutput = "join"), see png in attachment;
    here is my code:
    library(pophelper)
    library(gtools)
    sfiles <- list.files(path="AA_noI_admixture_pop-both", full.names=T, pattern = "merge")
    slist <- readQ(files=sfiles,indlabfromfile=T)
    slist <- slist[match(mixedsort(names(slist)) , names(slist))]
    klabs <- paste0("K", sprintf("%02d", 2:(length(slist)+1)))
    p <- plotQ(slist[1:20],imgoutput="join",showindlab=T,showlegend=F, width = 25, useindlab = T,
    height=1.6, splab = klabs[1:20], indlabsize=0.5, indlabheight=0.1,indlabspacer = 0.05,
    barbordersize=0,outputfilename="AA_noI_abnormal_2-21_merged",imgtype="png",
    exportplot=T, returnplot=T, sortind = "all", sharedindlab = F, returndata = T)

  2. Default color scheme is beautiful when K <= 10, but not so good when K > 10, I found color of Admixture barplot in this paper(http://www.pnas.org/content/110/2/453.full) is nicer than pophelper default, may be you can use it as default. And some pretty color sets for larger K (some times K = 30) are welcomed, but it is difficult for you(and for any others) to prepare.
    aa_noi_abnormal_2-11_merged
    aa_noi_abnormal_2-21_merged
    aa_noi_normal_2-10_merged
    AA_noI_admixture_pop-both.zip
    Best wishes.
    Xie Kun

install problem

I had it installed and working last month...but tried to use it today and it won't install. Tried on two separate computers.
-Russell

Installing package into ‘C:/Users/pfau/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)

  • installing source package 'pophelper' ...
    ** R
    ** inst
    ** byte-compile and prepare package for lazy loading
    Error : (converted from warning) package 'ggplot2' was built under R version 3.5.3
    ERROR: lazy loading failed for package 'pophelper'
  • removing 'C:/Users/pfau/Documents/R/win-library/3.5/pophelper'
    In R CMD INSTALL
    Error in i.p(...) :
    (converted from warning) installation of package ‘C:/Users/pfau/AppData/Local/Temp/RtmpeiyZF8/file286c34155f0c/pophelper_2.2.8.1.tar.gz’ had non-zero exit status

readQ to import 90% probability intervals

Hi,

This is a wonderful package that has solved a bunch of headaches for me recently, so thank you.

Is it possible to use readQ to read in probability intervals from a structure output? I can see them in the structure output textfile, but they're not imported in as part of the list.

Thanks so much!

Sorting when ordered by group

Hello! I love this package, and I'm wondering if you can help me with this. I made a plot where I have sorted by group and also want to sort by clusters. I tried setting "sortind=all", but I guess what I am looking for is to first sort by cluster 1, then cluster 2, etc. "sortind=all" seems to do this for my first population, but then the others aren't fully sorted.

I am running pophelper 2.3.0 on R version 3.5.2

Here is the code I am using:

pk3 = plotQ(qlist=qlist[3],
returnplot=T, exportplot=F, quiet=T, basesize=12,
grplab = poplabel, grplabsize=4, linesize=0.8, pointsize=4,
ordergrp = T, showyaxis=T, showlegend = T,
clustercol = clist$merry_5,
subsetgrp=c("A", "B", "C", "D", "E", "F"),
sortind = "all")

Thanks!

Error creating a qlist from CLUMPP files

Thanks for this tool! Very useful.
I used Pophelper a year ago and now I am learning how to use the latest version 2.2.2. Unfortunately, I am having an error when I tried to create a qlist from my CLUMMP files. I also tried with your example file and I got the same error.

This is the error using your example file:

#CLUMPP file
tabs3<-system.file("STRUCTUREpop_K4-combined-merged.txt", package="pophelper")
#create a qlist
readQ(tabs3, filetype = 'clumpp') 

Error in read.table(files[i], header = FALSE, sep = seps[k], nrows = 1,  : 
  no lines available in input
In addition: Warning message:
In file(con, "r") :
  file("") only supports open = "w+" and open = "w+b": using the former
Error in read.table(files[i], header = FALSE, sep = seps[k], nrows = 1,  : 
  no lines available in input
Error in read.table(files[i], header = FALSE, sep = seps[k], nrows = 1,  : 
  no lines available in input
Error in pophelper:::readQClumpp(files[i]) : 
  readQClumpp: Incorrect input format.

I appreciate your input to understand what is the problem.

Thanks!

Show all panel's individual labels when imgoutput = "join" && align labels to a special k's order

Hi, Roy Francis, I still have some needs when using pophelper.
For plotQ(),
1st , when sortind = "all" & imgoutput = "join", I need to show individual labels of each k panel separately instead of show them only once at bottom of the whole picture. I known I can set imgoutput = "sep" and showindlab = T and then paste each picture together using AI or some other programs, but it’s not convenient for me, so can you add some options to allow user to show all panel’s individual labels?
2nd , if showindlab=T, all other k panels were aligned according to first k panel’s order, but sometimes we need to aligned to another k panel(not the first panel), can you add some options to specified a special k to be aligned to?
Best,
Kun Xie.

plotQ.pdf

wb

I want to access the Pophelper program via web, but it is not ... was removed from the page? Thank you

problem installing pophelper

I am using R 3.5.1. in windows and I get the following message when trying to install from github:

Downloading GitHub repo royfrancis/pophelper@master
from URL https://api.github.com/repos/royfrancis/pophelper/zipball/master
Installation failed: zip file 'C:\Users\Admin\AppData\Local\Temp\Rtmp8i7lPl\file1b70613d3162.zip' cannot be opened
Warning message:
In utils::unzip(src, exdir = target) : error 1 in extracting from zip file

Then I downloaded the zipped file and trying to "install from locl file" option in R and still doesn't work. Nothing happens at all.

I tried an older version of R and the problem persist.

if anyone faced the same problem i would greatly appreciate sharing tips and advice
best
eu

Cant download pophelper version 2.3.0 to get alignK function

Currently using R v3.5.3 using pophelper. Need alignK function, which is not offered in version pophelper 2.2.9. Do not know how to get updated version of pophelper. Have tried using R version 3.5.0 but still shows as version 2.2.9 of pophelper. Have tried to download from both CRAN and GitHub. Please help. Really need the alignK and mergeQ function.

Error importing CLUMPP file

Hey there,
I am using pophelper to create nice pictures with my results :)
I managed to import STRUCTURE output files and now I'm trying with a CLUMPP output file (CLUMPP_Linux64.1.1.2) from my working directory folder but I keep getting an error:

slist2 <- readQ("K14_outfile.txt", filetype = "clumpp")
Error in error("readQClumpp: Input may be in incorrect format.") : 
  could not find function "error"

I tried to follow the instructions given in issue #12 without success.
I attached the file I'm working with.
I also tried to change the file format, by removing the first columns to keep it as the CLUMPP output given in the tutorial.
Any suggestion?
Thanks,

Silvia

K14_outfile.txt

How groups are assigned to samples ?

Hi,

I'm working with the output of admixture. So, I have a file with this format:
0.000011 0.000019 0.000010 0.999930 0.000010 0.000010 0.000010
0.000010 0.000010 0.000010 0.999940 0.000010 0.000010 0.000010

I've got 150 lines like that. I want to plot this result with group information. In the doc of pophelper, you indicate to generate a dataframe (in my case, only one column) with the same number of lines. So, I generate this kind of dataframe with the name of my groups in the same line order of the sample in the result file (As I'm tested your package, you would see that this data frame has the same name as in the example).

onelabset <- pop[,1,drop=FALSE]

and

plotQ(d,returnplot=T,exportplot=F,grplab=onelabset)

with d <- readQ(files="result.7.Q",filetype="basic")

The R console returns me this:
$plot
$plot[[1]]
TableGrob (4 x 1) "arrange": 2 grobs
z cells name grob
1 1 (1-3,1-1) arrange gtable[layout]
2 2 (4-4,1-1) arrange gtable[layout]

$data
$data$qlist
[1] NA
`$data$grplab` `[1] NA

I don't know what to do to solve this problem...

re-ordering groups over multiple label sets

Hi,
Thanks for making pophelper available. I have plotted my admixture results with multiple label sets, Pop (population names) and Ancient/Modern. My input files list the populations in alphabetical order. I re-ordered my groups into contiguous blocks according to Ancient/Modern. Sortind is set to 'all'. However, I would also like to re-order the Pop groups within the blocks of Ancient and Modern. Instead of alphabetical order, I would like to order them according to similarity of admixture proportions. I'm not clear how I could achieve this either automated or manually. Would it be best to drop the ordering by ancient/modern and just re-order the pops somehow by similarity, or is there a way to manually state the order of all the pops that I would like the plot to be in? Could it be done by changing the individual labels and sorting by that somehow?
Thanks for any advice,
Suzanne

ability to sort discontinuous groups

Could you make it possible to sort by group even if the group information is not continuous?

In my dataset, individuals are not in order of population in the original structure file, but are mixed up (Pop1, Pop3, Pop4, Pop1, Pop2, Pop2, Pop1...), and are likewise mixed in the meanQ file. When I ask it to add group labels it just gives each individual a label (except in the case where multiple individuals from the same group are adjacent, in which case it will group them). If I try to sort by group or subset, it says that it cannot do so with discontinuous groups.

Error: Duplicated contiguous block of grp labels. Not possible to subset or reorder grps.

Hello,

when I use group labels and attempt to reorder my samples by group,
I get the error
Error in pophelper:::grpLabels(df = df1, grplab = grplab[[pp]], subsetgrp = subsetgrp, :
grpLabels: Duplicated contiguous block of grp labels. Not possible to subset or reorder grps.

The format of my group labels text file is like:
1 A
2 A
3 B
4 B
5 C
6 C
7 A

And the format of my ind labels file is like:
1 A_ind1
2 A_ind2
3 B_ind3
4 B_ind4
5 C_ind5
6 C_ind6
7 A_ind7

The problem seems to be because population A occurs in two different parts of the group labels vector, but because of the original order of the samples in the STRUCTURE output files, I can't figure out any other way to order the group label vector. (i.e. in this example, the 7th sample in my STRUCTURE files needs to have the same group label as samples 1-2).

I see in the code that the error is caused because
if(length(rlegrp$values) != length(unique(rlegrp$values)))

but I don't understand the rle() function enough to interpret this
R code and example input files attached

issue.zip

Misaligned joined plots

When running joined plots with group labels and sorting by a cluster or 'all' causes this issue:

temp

This is a bug and will be fixed soon! Sorry!
Thanks to Jana for reporting this.

Workflow error at generating qlist

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.

  • clumppExport(qlist)
  • setwd("/Desktop/structurepop")
    Error: unexpected '/' in:
    "clumppExport(qlist)
    setwd("
    /"

collectClumppOutput(prefix="pop", filetype="aligned")
Directories processed: 0
Files copied: 0
[1] 0 0
collectClumppOutput(filetype="both")
Directories processed: 0
Files copied: 0
[1] 0 0

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.