From maria.david.salas at gmail.com Wed Mar 1 13:40:24 2017 From: maria.david.salas at gmail.com (Maria del Carmen David) Date: Wed, 1 Mar 2017 07:40:24 -0500 Subject: [adegenet-forum] scatter plot labels In-Reply-To: <6773CB2C-48AD-492C-9C78-94096F896BBB@cmich.edu> References: <6773CB2C-48AD-492C-9C78-94096F896BBB@cmich.edu> Message-ID: This must be somewhere in the email records, it's a message from Caitlin Collins on 2014: Hi, If you think the individuals you are plotting are spaced far enough that you will be able to read labels at the individual level, one way to do it is to use s.label. Here is an example of how to use s.label to overlap labels to a scatterplot of DAPC: ############# ## EXAMPLE ## ############# set.seed(14) # generate a simulated dataset with 3 populations simpop <- glSim(100, 500, 5, k=3, sort.pop=TRUE) # isolate the SNPs and the population factor snps <- as.matrix(simpop) phen <- simpop at other$ancestral.pops # run a dapc dapc1 <- dapc(snps, phen, n.pca=20, n.da=4) # create the scatter plot as before scatter(dapc1, cstar=0, cex=5, label=NULL) # change graphical parameter to subsequently overlay the labels without drawing a new plot par(new=TRUE) # make a data frame of the dapc coordinates used in scatter df <- data.frame(x = dapc1$ind.coord[,1], y = dapc1$ind.coord[,2]) # identify/ create a vector of names for the individuals in your plot noms <- paste("ind", c(1:100), sep=".") # use the text function to add labels to the positions given by the coordinates you used in plot s.label(dfxy = df, xax=1, yax=2, label=noms, clabel=0.7, # change the size of the labels boxes=TRUE, # if points are spaced wide enough, can use TRUE to add boxes around the labels grid=FALSE, addaxes=FALSE) # do not draw lines or axes in addition to the labels The comments in the example above hopefully should give you all of the relevant information, so please give them a read and then feel free to let me know if you have any questions. You will almost certainly want to play around with the arguments clabel and boxes in the s.label function to get the labels to be readable for your case. I hope that helps! -------------------------------------- I don't know if it will have the same results now, I mean, in case any upgrade in the package could have change the function of these commands. But it worked fine when I used it back then. On Tue, Feb 28, 2017 at 4:43 PM, Mahon, Andrew R wrote: > Hi all, > New to using adegenet. Quick question (that may or may not be simple?.). > Is there a way to use actual sample labels (i.e., what I named them) and > plotting them in the scatter of the DAPC (i.e., when you run scatter(dapc) > command)? > > Thanks for any help in advance. > > -andy > -- > > > > _______________________________________________ > adegenet-forum mailing list > adegenet-forum at lists.r-forge.r-project.org > https://lists.r-forge.r-project.org/cgi-bin/mailman/ > listinfo/adegenet-forum > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fhernandeu at uc.cl Thu Mar 2 18:04:42 2017 From: fhernandeu at uc.cl (=?UTF-8?Q?Felipe_Hern=C3=A1ndez?=) Date: Thu, 2 Mar 2017 12:04:42 -0500 Subject: [adegenet-forum] HWE calculation Message-ID: Hi everyone, I have used the adegenet/pegas packages to estimate HWE using a genind object. I got the results from chi-squared and exact test based on Monte Carlo for my whole set of loci (52 loci) across all my 29 populations. I wonder if there is any option to calculate HWE and get exact test Monte Carlo results, but for each population separately. Sorry if the question is so basic, but I would appreciate any helpful advice! Best, Felipe -- Felipe Hern?ndez M?dico Veterinario (DVM), MSc. PhD. Candidate Interdisciplinary Ecology Program School of Natural Resources and Environment Wildlife Ecology and Conservation Department University of Florida -------------- next part -------------- An HTML attachment was scrubbed... URL: From roman.lustrik at biolitika.si Fri Mar 3 11:21:55 2017 From: roman.lustrik at biolitika.si (Roman =?utf-8?Q?Lu=C5=A1trik?=) Date: Fri, 3 Mar 2017 11:21:55 +0100 (CET) Subject: [adegenet-forum] HWE calculation In-Reply-To: References: Message-ID: <1032246952.496264.1488536515931.JavaMail.zimbra@biolitika.si> Perhaps something like this? library(adegenet) library(pegas) data(nancycats) lvls <- levels(pop(nancycats)) out <- vector("list", length(lvls)) # prepare list for output names(out) <- lvls for (i in lvls) { out[[i]] <- hw.test(nancycats[pop(nancycats) == i]) } Cheers, Roman ---- In god we trust, all others bring data. From: "Felipe Hern?ndez" To: adegenet-forum at lists.r-forge.r-project.org Sent: Thursday, March 2, 2017 6:04:42 PM Subject: [adegenet-forum] HWE calculation Hi everyone, I have used the adegenet/pegas packages to estimate HWE using a genind object. I got the results from chi-squared and exact test based on Monte Carlo for my whole set of loci (52 loci) across all my 29 populations. I wonder if there is any option to calculate HWE and get exact test Monte Carlo results, but for each population separately. Sorry if the question is so basic, but I would appreciate any helpful advice! Best, Felipe -- Felipe Hern?ndez M?dico Veterinario (DVM), MSc. PhD. Candidate Interdisciplinary Ecology Program School of Natural Resources and Environment Wildlife Ecology and Conservation Department University of Florida _______________________________________________ adegenet-forum mailing list adegenet-forum at lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/adegenet-forum -------------- next part -------------- An HTML attachment was scrubbed... URL: From thibautjombart at gmail.com Fri Mar 3 12:20:00 2017 From: thibautjombart at gmail.com (Thibaut Jombart) Date: Fri, 3 Mar 2017 11:20:00 +0000 Subject: [adegenet-forum] HWE calculation In-Reply-To: <1032246952.496264.1488536515931.JavaMail.zimbra@biolitika.si> References: <1032246952.496264.1488536515931.JavaMail.zimbra@biolitika.si> Message-ID: As a side note, Felipe, please avoid posting the same msg to several mailing lists at the same time, as it makes tracking answers much more difficult. Best Thibaut -- Dr Thibaut Jombart Lecturer, Department of Infectious Disease Epidemiology, Imperial College London Head of RECON: repidemicsconsortium.org sites.google.com/site/thibautjombart/ github.com/thibautjombart Twitter: @TeebzR +44(0)20 7594 3658 On 3 March 2017 at 10:21, Roman Lu?trik wrote: > Perhaps something like this? > > library(adegenet) > library(pegas) > > data(nancycats) > > lvls <- levels(pop(nancycats)) > out <- vector("list", length(lvls)) # prepare list for output > names(out) <- lvls > > for (i in lvls) { > out[[i]] <- hw.test(nancycats[pop(nancycats) == i]) > } > > Cheers, > Roman > > ---- > In god we trust, all others bring data. > > ------------------------------ > *From: *"Felipe Hern?ndez" > *To: *adegenet-forum at lists.r-forge.r-project.org > *Sent: *Thursday, March 2, 2017 6:04:42 PM > *Subject: *[adegenet-forum] HWE calculation > > Hi everyone, > > I have used the adegenet/pegas packages to estimate HWE using a genind > object. I got the results from chi-squared and exact test based on Monte > Carlo for my whole set of loci (52 loci) across all my 29 populations. I > wonder if there is any option to calculate HWE and get exact test Monte > Carlo results, but for each population separately. Sorry if the question is > so basic, but I would appreciate any helpful advice! > > Best, > Felipe > > -- > Felipe Hern?ndez > M?dico Veterinario (DVM), MSc. > PhD. Candidate > Interdisciplinary Ecology Program > School of Natural Resources and Environment > Wildlife Ecology and Conservation Department > University of Florida > > _______________________________________________ > adegenet-forum mailing list > adegenet-forum at lists.r-forge.r-project.org > https://lists.r-forge.r-project.org/cgi-bin/mailman/ > listinfo/adegenet-forum > > _______________________________________________ > adegenet-forum mailing list > adegenet-forum at lists.r-forge.r-project.org > https://lists.r-forge.r-project.org/cgi-bin/mailman/ > listinfo/adegenet-forum > -------------- next part -------------- An HTML attachment was scrubbed... URL: From alangarcia87 at hotmail.com Fri Mar 3 18:18:56 2017 From: alangarcia87 at hotmail.com (Alan Garcia-Elfring) Date: Fri, 3 Mar 2017 17:18:56 +0000 Subject: [adegenet-forum] DAPC - 3.4 Interpreting variable contributions (using a genlight object) In-Reply-To: References: Message-ID: (2nd try) Hi all, I have a genlight object and I would like to analyze the contributions of different alleles to populations structure. The example on the manual is for genind objects and a previous answer indicated that the fix-around, using as.data.frame, is only good for haploid data. http://lists.r-forge.r-project.org/pipermail/adegenet-forum/2014-May/000840.html Is it yet possible to do section 3.4 (Jombart and Collins 2015) with a diploid dataset? It would be really cool if so! Thanks, Alan > pldata /// GENLIGHT OBJECT ///////// // 223 genotypes, 76,288 binary SNPs, size: 9 Mb 0 (0 %) missing data // Basic content @gen: list of 223 SNPbin @ploidy: ploidy of each individual (range: 2-2) // Optional content @ind.names: 223 individual labels @loc.names: 76288 locus labels @pop: population of each individual (group size range: 1-1) @other: a list containing: sex phenotype pat mat > freq399 <- tab(genind2genpop(pldata[loc=c("41837")]),freq=TRUE) Error in genind2genpop(pldata[loc = c("41837")]) : x is not a valid genind object [cid:732fdd8f-ab46-46ff-97d3-0dd3b4bc8971] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Rplot.png Type: image/png Size: 41041 bytes Desc: Rplot.png URL: From S.Bourne at soton.ac.uk Tue Mar 28 14:02:01 2017 From: S.Bourne at soton.ac.uk (Bourne S.) Date: Tue, 28 Mar 2017 12:02:01 +0000 Subject: [adegenet-forum] dist.genpop giving NaNs Message-ID: Hi there, I've got three species I'm looking to do a mantel test on, but for some reason only one of them gives results when calculating the genetic distance between populations with dist.genpop. All three are based off genepops which are generated the same way and in the exact same format. I import them as a genind, then reconvert to genpop to run the dist.genpop on. One of them works fine, the others give NaN, and then do not work when performing the mantel test as NaNs are present. I'm a bit confused because they're all in the same format, and if one works then all should work. Has anyone come across this and been able to overcome it? Cheers, Steve --------------------------------------------- Steven Bourne PhD Student - Adaptation and Genomics of Biological Invasions School of Ocean and Earth Science National Oceanography Centre University of Southampton -------------- next part -------------- An HTML attachment was scrubbed... URL: From roman.lustrik at biolitika.si Tue Mar 28 14:28:40 2017 From: roman.lustrik at biolitika.si (Roman =?utf-8?Q?Lu=C5=A1trik?=) Date: Tue, 28 Mar 2017 14:28:40 +0200 (CEST) Subject: [adegenet-forum] dist.genpop giving NaNs In-Reply-To: References: Message-ID: <1869061957.37252.1490704120437.JavaMail.zimbra@biolitika.si> Can you make a reproducible example and post an issue at GitHub? https://github.com/thibautjombart/adegenet/issues Cheers, Roman ---- In god we trust, all others bring data. From: "Bourne S." To: adegenet-forum at lists.r-forge.r-project.org Sent: Tuesday, March 28, 2017 2:02:01 PM Subject: [adegenet-forum] dist.genpop giving NaNs Hi there, I've got three species I'm looking to do a mantel test on, but for some reason only one of them gives results when calculating the genetic distance between populations with dist.genpop. All three are based off genepops which are generated the same way and in the exact same format. I import them as a genind, then reconvert to genpop to run the dist.genpop on. One of them works fine, the others give NaN, and then do not work when performing the mantel test as NaNs are present. I'm a bit confused because they're all in the same format, and if one works then all should work. Has anyone come across this and been able to overcome it? Cheers, Steve --------------------------------------------- Steven Bourne PhD Student - Adaptation and Genomics of Biological Invasions School of Ocean and Earth Science National Oceanography Centre University of Southampton _______________________________________________ adegenet-forum mailing list adegenet-forum at lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/adegenet-forum -------------- next part -------------- An HTML attachment was scrubbed... URL: From thibautjombart at gmail.com Wed Mar 29 14:49:43 2017 From: thibautjombart at gmail.com (Thibaut Jombart) Date: Wed, 29 Mar 2017 13:49:43 +0100 Subject: [adegenet-forum] dist.genpop giving NaNs In-Reply-To: <1869061957.37252.1490704120437.JavaMail.zimbra@biolitika.si> References: <1869061957.37252.1490704120437.JavaMail.zimbra@biolitika.si> Message-ID: Hi there, +1 to a reproducible example. Usual reasons for this would be missing data in your allele counts. Check tab(x) where 'x' is your genpop object to have an idea. Cheers Thibaut -- Dr Thibaut Jombart Lecturer, Department of Infectious Disease Epidemiology, Imperial College London Head of RECON: repidemicsconsortium.org sites.google.com/site/thibautjombart/ github.com/thibautjombart Twitter: @TeebzR +44(0)20 7594 3658 On 28 March 2017 at 13:28, Roman Lu?trik wrote: > Can you make a reproducible example and post an issue at GitHub? > https://github.com/thibautjombart/adegenet/issues > > Cheers, > Roman > > ---- > In god we trust, all others bring data. > > ________________________________ > From: "Bourne S." > To: adegenet-forum at lists.r-forge.r-project.org > Sent: Tuesday, March 28, 2017 2:02:01 PM > Subject: [adegenet-forum] dist.genpop giving NaNs > > Hi there, > > > I've got three species I'm looking to do a mantel test on, but for some > reason only one of them gives results when calculating the genetic distance > between populations with dist.genpop. All three are based off genepops which > are generated the same way and in the exact same format. I import them as a > genind, then reconvert to genpop to run the dist.genpop on. One of them > works fine, the others give NaN, and then do not work when performing the > mantel test as NaNs are present. > > > I'm a bit confused because they're all in the same format, and if one works > then all should work. > > > Has anyone come across this and been able to overcome it? > > > Cheers, > > Steve > > --------------------------------------------- > Steven Bourne > PhD Student - Adaptation and Genomics of Biological Invasions > School of Ocean and Earth Science > National Oceanography Centre > University of Southampton > > > > > _______________________________________________ > adegenet-forum mailing list > adegenet-forum at lists.r-forge.r-project.org > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/adegenet-forum > > _______________________________________________ > adegenet-forum mailing list > adegenet-forum at lists.r-forge.r-project.org > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/adegenet-forum From M.Ruhsam at rbge.ac.uk Mon Mar 20 16:16:26 2017 From: M.Ruhsam at rbge.ac.uk (Markus Ruhsam) Date: Mon, 20 Mar 2017 15:16:26 +0000 Subject: [adegenet-forum] Older version of adegenet Message-ID: <6597957BE88F22419CB987B2E084C50504F73E9E502D@MBX-EXC-ED-01.rbge.org.uk> Hello, I would like to install v1.4-1 but the link on the http://adegenet.r-forge.r-project.org/ website to the Windows binary results in an 404 error. Has this been moved or is the file not available more? Thank you Markus Dr Markus Ruhsam Molecular Plant Ecologist Royal Botanic Garden Edinburgh 20A Inverleith Row Edinburgh EH3 5LR United Kingdom Tel: +44 (0) 131 248 2859 Fax: +44 (0) 131 248 2901 http://www.rbge.org.uk/science/genetics-and-conservation/markus-ruhsam-homepage The mission of the Royal Botanic Garden Edinburgh is to "To explore, conserve and explain the world of plants for a better future" [cid:image001.png at 01D2A18C.F14CA0B0] The Royal Botanic Garden Edinburgh is a charity registered in Scotland (No SC007983) -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.png Type: image/png Size: 31595 bytes Desc: image001.png URL: From bowlese at gmail.com Thu Mar 30 22:27:31 2017 From: bowlese at gmail.com (Ella Bowles) Date: Thu, 30 Mar 2017 16:27:31 -0400 Subject: [adegenet-forum] addendum to question about how to remove outliers (http://lists.r-forge.r-project.org/pipermail/adegenet-forum/2015-July/001194.html) Message-ID: Hello, I am trying to remove a set of loci, as in the question posted here: http://lists.r-forge.r-project.org/pipermail/adegenet-forum/2015-July/001194.html. However, I'm wondering if there is a way to list the exact locus names instead of simply the position of the locus. And, what is more, if there is a way to provide a vector with loci to remove, with the identifier be only part of the full locus name? Say I have the following > dat.s_subset <- dat.s[1:5,1:5] > dat.s_subset /// GENIND OBJECT ///////// // 5 individuals; 3 loci; 5 alleles; size: 6.7 Kb // Basic content @tab: 5 x 5 matrix of allele counts @loc.n.all: number of alleles per locus (range: 1-2) @loc.fac: locus factor for the 5 columns of @tab @all.names: list of allele names for each locus @ploidy: ploidy of each individual (range: 2-2) @type: codom @call: .local(x = x, i = i, j = j, drop = drop) // Optional content @pop: population of each individual (group size range: 5-5) > locNames(dat.s_subset) [1] "12706_10" "14223_16" "14481_7" As I understand it, if I want to remove locus 14223_16, I can use > toRemove=c(2) > x=dat.s_subset[loc=-toRemove] > x /// GENIND OBJECT ///////// // 5 individuals; 2 loci; 3 alleles; size: 6.3 Kb // Basic content @tab: 5 x 3 matrix of allele counts @loc.n.all: number of alleles per locus (range: 1-2) @loc.fac: locus factor for the 3 columns of @tab @all.names: list of allele names for each locus @ploidy: ploidy of each individual (range: 2-2) @type: codom @call: .local(x = x, i = i, j = j, loc = ..1, drop = drop) // Optional content @pop: population of each individual (group size range: 5-5) > locNames(x) [1] "12706_10" "14481_7" However, I have thousands of loci, and from the analysis that I have done, my vector of loci that I want to remove has the number of the locus before the underscore. Is there a way of specifying loci using only this information? So, I'd need something like the unix wildcard "*", and to be able to say something like toRemove=c(14223*). I've done a bunch of searching on the web to see if it would be easier to do this outside of adegenet, but it seems like it is going to be hard. Any help would be much appreciated. Sincerely, Ella -- Ella Bowles, PhD Postdoctoral Researcher Department of Biology Concordia University Website: https://ellabowlesphd.wordpress.com/ Email: bowlese at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: