From t.jombart at imperial.ac.uk Mon Dec 1 12:41:55 2014 From: t.jombart at imperial.ac.uk (Jombart, Thibaut) Date: Mon, 1 Dec 2014 11:41:55 +0000 Subject: [adegenet-forum] Use of other projected coordinate systems (e.g. Lambert conformal conic) in the sPCA In-Reply-To: References: Message-ID: <2CB2DA8E426F3541AB1907F98ABA6570ABE862A0@icexch-m1.ic.ac.uk> Hi there, the projection system does not matter too much as long as the Euclidean distances between your locations are a decent reflection of the actual distances. Best Thibaut ________________________________ From: adegenet-forum-bounces at lists.r-forge.r-project.org [adegenet-forum-bounces at lists.r-forge.r-project.org] on behalf of Cristen Watt [cristenwatt at trentu.ca] Sent: 29 November 2014 04:37 To: adegenet-forum at lists.r-forge.r-project.org Subject: [adegenet-forum] Use of other projected coordinate systems (e.g. Lambert conformal conic) in the sPCA Hello, I have a question regarding conversion to UTM and the way the sPCA handles spatial data. I have lynx sampling locations from Western Canada and Alaska. I was originally given these locations in the North America Lambert Conformal Conic projection. However, I saw that the sPCA should be done using UTM. I converted my points to lat/long in ArcMap, then tried using convUL to convert to UTM. However, I am concerned with this method because my coordinates span a wide geographical extent. The convUL conversion is not recommended for more than one zone to the right or left of the central zone. My data span 10 zones (from Western Alaska to Eastern Alberta). I tried using convUL with the most central zone, but the connection network looked quite distorted, and am concerned about the possibility of 'erroneous results' mentioned in the PBSmapping package. Here is my main question: Since the projection I originally used (North America Lambert Conformal Conic) is already in meters, is it possible to use these coordinates without conversion to UTM? Will the sPCA perform the correct analyses using this projection? Thank you, Cristen -------------- next part -------------- An HTML attachment was scrubbed... URL: From coulsonmw at gmail.com Mon Dec 1 12:48:26 2014 From: coulsonmw at gmail.com (Mark Coulson) Date: Mon, 1 Dec 2014 11:48:26 +0000 Subject: [adegenet-forum] importing data frame as a genind file Message-ID: Dear all, I have had some success getting data files into adegenet but only with the import2genind command using a genpop file and never from the importstructure, genepop, etc. My preference would be to import a dataframe with column 1 as the population name, column 2 as the individual identifier and the remaining columns as the individual loci. I did get this to work with some previous suggestions on the forum, however, the summary(x) command tells me I have precisely 10 alleles at each locus (actually there are between 9 and 63) and massive differences in Hexp vs. Hobs (which there aren't). So clearly something isn't being interpreted correctly despite the fact that I can create both the genind and genpop files. Any ideas why my loci are being mis-read? Thanks, Mark -------------- next part -------------- An HTML attachment was scrubbed... URL: From vojta at trapa.cz Mon Dec 1 12:50:45 2014 From: vojta at trapa.cz (=?utf-8?B?Vm9qdMSbY2g=?= Zeisek) Date: Mon, 01 Dec 2014 12:50:45 +0100 Subject: [adegenet-forum] importing data frame as a genind file In-Reply-To: References: Message-ID: <1611968.19hCybi3kS@veles> Hello, I think we would need some reproducible example - piece of Your original data, commands You did and errors and other output produced by those commands... Yours, Vojt?ch Dne Po 1. prosince 2014 11:48:26, Mark Coulson napsal(a): > Dear all, > > I have had some success getting data files into adegenet but only with the > import2genind command using a genpop file and never from the > importstructure, genepop, etc. My preference would be to import a dataframe > with column 1 as the population name, column 2 as the individual identifier > and the remaining columns as the individual loci. I did get this to work > with some previous suggestions on the forum, however, the summary(x) > command tells me I have precisely 10 alleles at each locus (actually there > are between 9 and 63) and massive differences in Hexp vs. Hobs (which there > aren't). So clearly something isn't being interpreted correctly despite the > fact that I can create both the genind and genpop files. > > Any ideas why my loci are being mis-read? > > Thanks, > > Mark -- Vojt?ch Zeisek http://trapa.cz/en/ Department of Botany, Faculty of Science Charles University in Prague Ben?tsk? 2, Prague, 12801, CZ http://botany.natur.cuni.cz/en/ Institute of Botany, Academy of Science Z?mek 1, Pr?honice, 25243, CZ http://www.ibot.cas.cz/en/ Czech Republic -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 473 bytes Desc: This is a digitally signed message part. URL: From coulsonmw at gmail.com Mon Dec 1 13:51:24 2014 From: coulsonmw at gmail.com (Mark Coulson) Date: Mon, 1 Dec 2014 12:51:24 +0000 Subject: [adegenet-forum] error in DAPC Message-ID: Hello, A while back I asked about the following error when running DAPC Warning messages: 1: Quick-TRANSfer stage steps exceeded maximum (= 636200) 2: Quick-TRANSfer stage steps exceeded maximum (= 636200) 3: Quick-TRANSfer stage steps exceeded maximum (= 636200) I got this after running DAPC and choosing my number of PCs to retain as well as the number of groups. It was suggested at the time to be an error in the kmeans implentation. Does this mean I cannot run DAPC on this dataset? It is ~12,000 individuals for a couple of hundred sites at 17 microsatellite markers. I could try sub-setting the data, although the point was to see how these clustered considering them as a whole. Mark -------------- next part -------------- An HTML attachment was scrubbed... URL: From coulsonmw at gmail.com Mon Dec 1 14:01:54 2014 From: coulsonmw at gmail.com (Mark Coulson) Date: Mon, 1 Dec 2014 13:01:54 +0000 Subject: [adegenet-forum] importing data frame as a genind object Message-ID: My data are structured as follows C1 C2 C3 C4 etc. Population Individual Locus1 Locus2 etc. PopA C0001 0205 1326 etc. PopA C0002 etc etc etc PopB X0001 PopB X0002 etc. . . . Missing data coded as NA Issued the following commands scotdata <- read.table("Scotland_adegenet_no_river_names.txt", header=TRUE, sep="\t", quote="\"", colClasses="character", stringsAsFactors=FALSE) scotind <- df2genind(scotdata[,-(1:2)], sep="", ind.names=scotdata$Individual, pop=scotdata$Population, missing="NA", ploidy=2, type="codom", ncode=4) This converted it to a genind format and issuing 'scotind' gave the correct number of loci, individuals, etc. However, x <- summary(scotind) gave exactly 10 alleles per locus and massive differences between Hexp and Hobs. I have since made a modified genepop file which reads in correctly and gives the correct number of alleles, Hexp, Hobs, etc. (however see my other post for DAPC issues!). So I can go with this for now, but routinely would find the dataframe format above easier to work with given large datasets. Cheers, Mark -------------- next part -------------- An HTML attachment was scrubbed... URL: From t.jombart at imperial.ac.uk Mon Dec 1 14:40:28 2014 From: t.jombart at imperial.ac.uk (Jombart, Thibaut) Date: Mon, 1 Dec 2014 13:40:28 +0000 Subject: [adegenet-forum] error in DAPC In-Reply-To: References: Message-ID: <2CB2DA8E426F3541AB1907F98ABA6570ABE87407@icexch-m1.ic.ac.uk> Hi, this definitely does not come from the DAPC implementation itself, but possibly kmeans indeed. If you have groups already defined, it would be best use them. K-means is quite fast compared to most other clustering methods used in genetics, so I'm not sure which other approach would work better. I'm guessing some hierarchical clustering methods might be faster.. How long did the clustering step take? If not too long, you could try increasing the max number of steps for kmeans (see ?find.clusters). Cheers Thibaut ________________________________________ From: adegenet-forum-bounces at lists.r-forge.r-project.org [adegenet-forum-bounces at lists.r-forge.r-project.org] on behalf of Mark Coulson [coulsonmw at gmail.com] Sent: 01 December 2014 12:51 To: adegenet-forum at lists.r-forge.r-project.org Subject: [adegenet-forum] error in DAPC Hello, A while back I asked about the following error when running DAPC Warning messages: 1: Quick-TRANSfer stage steps exceeded maximum (= 636200) 2: Quick-TRANSfer stage steps exceeded maximum (= 636200) 3: Quick-TRANSfer stage steps exceeded maximum (= 636200) I got this after running DAPC and choosing my number of PCs to retain as well as the number of groups. It was suggested at the time to be an error in the kmeans implentation. Does this mean I cannot run DAPC on this dataset? It is ~12,000 individuals for a couple of hundred sites at 17 microsatellite markers. I could try sub-setting the data, although the point was to see how these clustered considering them as a whole. Mark From coulsonmw at gmail.com Mon Dec 1 15:49:40 2014 From: coulsonmw at gmail.com (Mark Coulson) Date: Mon, 1 Dec 2014 14:49:40 +0000 Subject: [adegenet-forum] error in DAPC Message-ID: Hi, I do have groups already defined (sites within rivers) and could therefore use those (or indeed the river-level). The clustering step didn't take too long (~ 30 min). Do you mean iter.max (or n.inter) for the number of steps in Kmeans? What is the default for this, so I have an idea for what to increase to? Cheers, Mark -------------- next part -------------- An HTML attachment was scrubbed... URL: From coulsonmw at gmail.com Mon Dec 1 16:28:57 2014 From: coulsonmw at gmail.com (Mark Coulson) Date: Mon, 1 Dec 2014 15:28:57 +0000 Subject: [adegenet-forum] error in DAPC Message-ID: Thanks - think that has worked! I now goes through defining the clusters. Cheers, Mark -------------- next part -------------- An HTML attachment was scrubbed... URL: From t.jombart at imperial.ac.uk Mon Dec 1 17:07:29 2014 From: t.jombart at imperial.ac.uk (Jombart, Thibaut) Date: Mon, 1 Dec 2014 16:07:29 +0000 Subject: [adegenet-forum] error in DAPC In-Reply-To: References: Message-ID: <2CB2DA8E426F3541AB1907F98ABA6570ABE87502@icexch-m1.ic.ac.uk> Best to use existing clusters then. Check ?find.clusters: ", n.iter=1e5, ..." and " n.iter: an ?integer? indicating the number of iterations to be used in each run of K-means algorithm. Corresponds to ?iter.max? of ?kmeans? function. " Cheers Thibaut ________________________________ From: adegenet-forum-bounces at lists.r-forge.r-project.org [adegenet-forum-bounces at lists.r-forge.r-project.org] on behalf of Mark Coulson [coulsonmw at gmail.com] Sent: 01 December 2014 14:49 To: adegenet-forum at lists.r-forge.r-project.org Subject: [adegenet-forum] error in DAPC Hi, I do have groups already defined (sites within rivers) and could therefore use those (or indeed the river-level). The clustering step didn't take too long (~ 30 min). Do you mean iter.max (or n.inter) for the number of steps in Kmeans? What is the default for this, so I have an idea for what to increase to? Cheers, Mark -------------- next part -------------- An HTML attachment was scrubbed... URL: From coulsonmw at gmail.com Wed Dec 3 14:53:57 2014 From: coulsonmw at gmail.com (Mark Coulson) Date: Wed, 3 Dec 2014 13:53:57 +0000 Subject: [adegenet-forum] removing groups of individuals from genind object Message-ID: Hello, This is probably quite simple, but I have done a DAPC on a large number of samples (~300) and have found quite good separation between samples from a couple of very unique sites and the rest of the dataset. I'd like to now run another DAPC on just the remaining samples (i.e. kick out the most distinct groups) and am wondering how to easiest remove whole samples of individuals from the genind file (say pop70-pop100), rather than having to make a separate input file. I think I could do this with a normal dataframe but not sure about a genind object?? Cheers, Mark -------------- next part -------------- An HTML attachment was scrubbed... URL: From t.jombart at imperial.ac.uk Wed Dec 3 14:57:25 2014 From: t.jombart at imperial.ac.uk (Jombart, Thibaut) Date: Wed, 3 Dec 2014 13:57:25 +0000 Subject: [adegenet-forum] removing groups of individuals from genind object In-Reply-To: References: Message-ID: <2CB2DA8E426F3541AB1907F98ABA6570ABE8793C@icexch-m1.ic.ac.uk> Hi there, genind objects can be subsetted like matrices, e.g. x[foo, ] where foo is a subset of individuals. Should be documented in the adegenet basics tutorial. Best Thibaut ________________________________ From: adegenet-forum-bounces at lists.r-forge.r-project.org [adegenet-forum-bounces at lists.r-forge.r-project.org] on behalf of Mark Coulson [coulsonmw at gmail.com] Sent: 03 December 2014 13:53 To: adegenet-forum at lists.r-forge.r-project.org Subject: [adegenet-forum] removing groups of individuals from genind object Hello, This is probably quite simple, but I have done a DAPC on a large number of samples (~300) and have found quite good separation between samples from a couple of very unique sites and the rest of the dataset. I'd like to now run another DAPC on just the remaining samples (i.e. kick out the most distinct groups) and am wondering how to easiest remove whole samples of individuals from the genind file (say pop70-pop100), rather than having to make a separate input file. I think I could do this with a normal dataframe but not sure about a genind object?? Cheers, Mark -------------- next part -------------- An HTML attachment was scrubbed... URL: From t.jombart at imperial.ac.uk Thu Dec 4 12:49:43 2014 From: t.jombart at imperial.ac.uk (Jombart, Thibaut) Date: Thu, 4 Dec 2014 11:49:43 +0000 Subject: [adegenet-forum] FW: [R-sig-phylo] Population Genetics in R Hackathon - Open Call for Participation In-Reply-To: <547FDFDE.5080506@nescent.org> References: <547FDFAD.2020009@nescent.org>,<547FDFDE.5080506@nescent.org> Message-ID: <2CB2DA8E426F3541AB1907F98ABA6570ABE973C4@icexch-m1.ic.ac.uk> Dear all, please find below the call for participation to an exciting hackathon for population genetics in R taking place in NESCent, North Carolina, next year. Best Thibaut ============================== Dr Thibaut Jombart MRC Centre for Outbreak Analysis and Modelling Department of Infectious Disease Epidemiology Imperial College - School of Public Health Norfolk Place, London W2 1PG, UK Tel. : 0044 (0)20 7594 3658 http://sites.google.com/site/thibautjombart/ http://sites.google.com/site/therepiproject/ http://adegenet.r-forge.r-project.org/ Twitter: @thibautjombart ________________________________________ From: R-sig-phylo [r-sig-phylo-bounces at r-project.org] on behalf of Hilmar Lapp [hlapp at nescent.org] Sent: 04 December 2014 04:15 To: R-SIG-Phylo List Subject: [R-sig-phylo] Population Genetics in R Hackathon - Open Call for Participation # Population Genetics in R Hackathon - Open Call for Participation Do you develop population genetics methods or algorithms in R? Are you a researcher wrestling with analyzing population genetics data in R? Have you run into difficulties with passing data or metadata from one R package to another? Have you run into problems with large datasets? Have you found documentation on building workflows from packages for population genetics analysis difficult to come by? Do you have expertise and ideas to share and energy to spend on overcoming these challenges? Do you enjoy collaborating with like-minded others to do so? If you answered some (or all) of these questions with yes, then the following event may be for you. ## Synopsis NESCent is sponsoring a hackathon to be held at NESCent in Durham, North Carolina, on March 16-20, 2015, with the objective to help foster an interoperating ecosystem of scalable tools and resources for population genetics data analysis in the popular R platform. The event is designed to target interoperability, scalability, and workflow building challenges among the many population genetics R packages that already exist. The gathering provides an opportunity for a diverse group of population genetics researchers, method developers, and people with other relevant areas of expertise to collaborate on code, documentation, use-cases, and other resources that will aid their communities. Full details and additional background are available at the following website: http://informatics.nescent.org/wiki/R_PopGen_Hackathon ## How to participate Applications to participate in the hackathon are now being accepted. To apply, please fill out the following form: http://goo.gl/forms/siwNo1P3ti Deadline for receiving your application is December 11, 2014. Support for travel, food and lodging costs are available to successful applicants who indicate need. We particularly welcome applications from women and members of other groups underrepresented in science and in software engineering. Our plan is to begin sending out acceptance letters December 15, 2014, and if your application is successful, we will need you to confirm attendance within 2 days of receiving notice, so please ensure you can receive and send email during the week of December 15. Sincerely, The organizing team: Thibaut Jombart, Hilmar Lapp, St?phanie Manel, Emmanuel Paradis, Bastian Pfeifer, and Greg Warnes -- Hilmar Lapp -:- informatics.nescent.org/wiki -:- lappland.io [[alternative HTML version deleted]] -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: ATT00002.txt URL: From zkamvar at gmail.com Thu Dec 4 16:25:46 2014 From: zkamvar at gmail.com (Zhian Kamvar) Date: Thu, 4 Dec 2014 07:25:46 -0800 Subject: [adegenet-forum] removing groups of individuals from genind object (Mark Coulson) Message-ID: Hi Mark, As Dr. Jombart mentioned, the genind object can be treated like a matrix. If you are interested in removing specific populations, the function popsub from the package 'poppr' sounds like it's suited to your needs. Here's some documentation: http://www.rdocumentation.org/packages/poppr/functions/popsub Cheers, Zhian From andrea.gloria-soria at yale.edu Tue Dec 9 15:40:19 2014 From: andrea.gloria-soria at yale.edu (Gloria-Soria, Andrea) Date: Tue, 9 Dec 2014 14:40:19 +0000 Subject: [adegenet-forum] population distances of genlight object Message-ID: Hello, I am trying to calculate the Reynold's distances between 4 populations of individuals with lots of SNPs (~150,000), I have the data as .vcf, plink, .stru files, and I have been reading them into adegenet as genlight objects (it seems that reading them as a genind object is not possible). I also know that dist.genpop() can be used to calculate these distances when having a genpop object, but it seems that there is no command to convert a genlight to a genpop (is that true?). Is there a way around it? or is there a way to get the Reynold's distances between the populations in any other way? I appreciate your help, Andrea From emi.trucchi at gmail.com Wed Dec 10 16:14:40 2014 From: emi.trucchi at gmail.com (Emiliano Trucchi) Date: Wed, 10 Dec 2014 16:14:40 +0100 Subject: [adegenet-forum] scatter.dapc function plots only density of individuals Message-ID: Hi there, I have a basic problem with the graphic function scatter.dapc. Running > scatter(dapc1) I plot the density of individuals in my groups and not the scatterplot as expected. Versions: adegenet 1-4.2; R 3.1.1 Thanks in advance for the help Emiliano -------------- next part -------------- An HTML attachment was scrubbed... URL: From t.jombart at imperial.ac.uk Wed Dec 10 16:32:58 2014 From: t.jombart at imperial.ac.uk (Jombart, Thibaut) Date: Wed, 10 Dec 2014 15:32:58 +0000 Subject: [adegenet-forum] scatter.dapc function plots only density of individuals In-Reply-To: References: Message-ID: <2CB2DA8E426F3541AB1907F98ABA6570ABE9B1DA@icexch-m1.ic.ac.uk> Hello, I am guessing you have only two groups, in which case there is only one discriminant function for your dataset. Hence the 1-dimensional, density plot. Otherwise, you can select which axis is plotted using the arguments xax and yax. Cheers Thibaut ============================== Dr Thibaut Jombart MRC Centre for Outbreak Analysis and Modelling Department of Infectious Disease Epidemiology Imperial College - School of Public Health Norfolk Place, London W2 1PG, UK Tel. : 0044 (0)20 7594 3658 http://sites.google.com/site/thibautjombart/ http://sites.google.com/site/therepiproject/ http://adegenet.r-forge.r-project.org/ Twitter: @thibautjombart ________________________________ From: adegenet-forum-bounces at lists.r-forge.r-project.org [adegenet-forum-bounces at lists.r-forge.r-project.org] on behalf of Emiliano Trucchi [emi.trucchi at gmail.com] Sent: 10 December 2014 15:14 To: adegenet-forum at lists.r-forge.r-project.org Subject: [adegenet-forum] scatter.dapc function plots only density of individuals Hi there, I have a basic problem with the graphic function scatter.dapc. Running > scatter(dapc1) I plot the density of individuals in my groups and not the scatterplot as expected. Versions: adegenet 1-4.2; R 3.1.1 Thanks in advance for the help Emiliano -------------- next part -------------- An HTML attachment was scrubbed... URL: From emi.trucchi at gmail.com Wed Dec 10 16:44:31 2014 From: emi.trucchi at gmail.com (Emiliano Trucchi) Date: Wed, 10 Dec 2014 16:44:31 +0100 Subject: [adegenet-forum] scatter.dapc function plots only density of individuals In-Reply-To: <2CB2DA8E426F3541AB1907F98ABA6570ABE9B1DA@icexch-m1.ic.ac.uk> References: <2CB2DA8E426F3541AB1907F98ABA6570ABE9B1DA@icexch-m1.ic.ac.uk> Message-ID: Hi, You are right. There are only two groups. Thanks for clarifying. Best, Emiliano On Wed, Dec 10, 2014 at 4:32 PM, Jombart, Thibaut wrote: > Hello, > > I am guessing you have only two groups, in which case there is only one > discriminant function for your dataset. Hence the 1-dimensional, density > plot. Otherwise, you can select which axis is plotted using the arguments > xax and yax. > > Cheers > Thibaut > > > ============================== > Dr Thibaut Jombart > MRC Centre for Outbreak Analysis and Modelling > Department of Infectious Disease Epidemiology > Imperial College - School of Public Health > Norfolk Place, London W2 1PG, UK > Tel. : 0044 (0)20 7594 3658 > http://sites.google.com/site/thibautjombart/ > http://sites.google.com/site/therepiproject/ > http://adegenet.r-forge.r-project.org/ > Twitter: @thibautjombart > ------------------------------ > *From:* adegenet-forum-bounces at lists.r-forge.r-project.org [ > adegenet-forum-bounces at lists.r-forge.r-project.org] on behalf of Emiliano > Trucchi [emi.trucchi at gmail.com] > *Sent:* 10 December 2014 15:14 > *To:* adegenet-forum at lists.r-forge.r-project.org > *Subject:* [adegenet-forum] scatter.dapc function plots only density of > individuals > > Hi there, > > I have a basic problem with the graphic function scatter.dapc. > Running > > scatter(dapc1) > > I plot the density of individuals in my groups and not the scatterplot > as expected. > > Versions: adegenet 1-4.2; R 3.1.1 > > Thanks in advance for the help > Emiliano > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From t.jombart at imperial.ac.uk Wed Dec 10 16:51:33 2014 From: t.jombart at imperial.ac.uk (Jombart, Thibaut) Date: Wed, 10 Dec 2014 15:51:33 +0000 Subject: [adegenet-forum] population distances of genlight object In-Reply-To: References: Message-ID: <2CB2DA8E426F3541AB1907F98ABA6570ABE9B207@icexch-m1.ic.ac.uk> Hi there, this is no conversion routine from genlight to genpop, so no Reynolds distance. However, Reynolds' distance on SNP may be overly fancy and the basic Euclidean distance between allele frequencies should already do a decent job. To do this, you need to convert the genlight to a matrix of number of second alleles, compute allele frequencies by population, and then use 'dist'. Here's an example using simulated data: ##### ## simulate genlight x= glSim(100, 1e3, pop.freq=c(.5,.5)) pop(x) = other(x)$ancestral.pops ## get allele freq for pop x locus temp=apply(as.matrix(x),2, tapply, pop(x), function(e) mean(e)/ploidy(x)[1]) # assumes same ploidy for all individuals ## compute Euclidean distance dist(temp) ##### Best Thibaut ________________________________________ From: adegenet-forum-bounces at lists.r-forge.r-project.org [adegenet-forum-bounces at lists.r-forge.r-project.org] on behalf of Gloria-Soria, Andrea [andrea.gloria-soria at yale.edu] Sent: 09 December 2014 14:40 To: adegenet-forum at lists.r-forge.r-project.org Subject: [adegenet-forum] population distances of genlight object Hello, I am trying to calculate the Reynold's distances between 4 populations of individuals with lots of SNPs (~150,000), I have the data as .vcf, plink, .stru files, and I have been reading them into adegenet as genlight objects (it seems that reading them as a genind object is not possible). I also know that dist.genpop() can be used to calculate these distances when having a genpop object, but it seems that there is no command to convert a genlight to a genpop (is that true?). Is there a way around it? or is there a way to get the Reynold's distances between the populations in any other way? I appreciate your help, Andrea _______________________________________________ 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 andrea.gloria-soria at yale.edu Wed Dec 10 19:12:37 2014 From: andrea.gloria-soria at yale.edu (Gloria-Soria, Andrea) Date: Wed, 10 Dec 2014 18:12:37 +0000 Subject: [adegenet-forum] population distances of genlight object In-Reply-To: <2CB2DA8E426F3541AB1907F98ABA6570ABE9B207@icexch-m1.ic.ac.uk> References: <2CB2DA8E426F3541AB1907F98ABA6570ABE9B207@icexch-m1.ic.ac.uk> Message-ID: Thank you. Andrea Andrea Gloria-Soria, PhD Associate Research Scientist Department of Ecology and Evolutionary Biology Yale University On Dec 10, 2014, at 10:51 AM, "Jombart, Thibaut" wrote: > Hi there, > > this is no conversion routine from genlight to genpop, so no Reynolds distance. However, Reynolds' distance on SNP may be overly fancy and the basic Euclidean distance between allele frequencies should already do a decent job. To do this, you need to convert the genlight to a matrix of number of second alleles, compute allele frequencies by population, and then use 'dist'. > > Here's an example using simulated data: > ##### > ## simulate genlight > x= glSim(100, 1e3, pop.freq=c(.5,.5)) > pop(x) = other(x)$ancestral.pops > > ## get allele freq for pop x locus > temp=apply(as.matrix(x),2, tapply, pop(x), function(e) mean(e)/ploidy(x)[1]) # assumes same ploidy for all individuals > > ## compute Euclidean distance > dist(temp) > ##### > > Best > Thibaut > > ________________________________________ > From: adegenet-forum-bounces at lists.r-forge.r-project.org [adegenet-forum-bounces at lists.r-forge.r-project.org] on behalf of Gloria-Soria, Andrea [andrea.gloria-soria at yale.edu] > Sent: 09 December 2014 14:40 > To: adegenet-forum at lists.r-forge.r-project.org > Subject: [adegenet-forum] population distances of genlight object > > Hello, > > I am trying to calculate the Reynold's distances between 4 populations of individuals with lots of SNPs (~150,000), I have the data as .vcf, plink, .stru files, and I have been reading them into adegenet as genlight objects (it seems that reading them as a genind object is not possible). > > I also know that dist.genpop() can be used to calculate these distances when having a genpop object, but it seems that there is no command to convert a genlight to a genpop (is that true?). > > Is there a way around it? or is there a way to get the Reynold's distances between the populations in any other way? > > I appreciate your help, > Andrea > _______________________________________________ > 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 carla.rivarossi at gmail.com Wed Dec 10 19:59:15 2014 From: carla.rivarossi at gmail.com (Carla Riva Rossi) Date: Wed, 10 Dec 2014 15:59:15 -0300 Subject: [adegenet-forum] DAPC scatterplot vs membership probabilities Message-ID: I'm using DAPC to assess the origin of an introduced salmonid in Patagonia and I have problems interpreting my results. I used pre-defined groups corresponding to the native range source populations and then I applied the predict.dapc function to position the introduced individuals (that were not used in constructing the model) onto these discriminant functions (DFs). On the basis of the derived DFs, I derived for each introduced individual a membership probability to original source populations. Then, In the DAPC scatterplot the introduced individuals (population) fell more in the space with of native pop 1 than with pop 2, but the DAPC probabilites indicate more native pop2 ancestry. Which of these two results shoud I give more credit/support? Thanks a lot in advance!!! Carla.- -- Dra. Carla Riva Rossi CENPAT-CONICET Blvd Brown 2915 Puerto Madryn (CP 9120) Chubut - ARGENTINA Tel: + 54-280 - 4883184 Interno: 1349 Fax:+ 54-280 - 4883543 email: rivarossi at cenpat- conicet.gob.ar -------------- next part -------------- An HTML attachment was scrubbed... URL: From t.jombart at imperial.ac.uk Wed Dec 10 20:18:35 2014 From: t.jombart at imperial.ac.uk (Jombart, Thibaut) Date: Wed, 10 Dec 2014 19:18:35 +0000 Subject: [adegenet-forum] DAPC scatterplot vs membership probabilities In-Reply-To: References: Message-ID: <2CB2DA8E426F3541AB1907F98ABA6570ABE9B2BD@icexch-m1.ic.ac.uk> Hi Carla, sounds like an interesting problem. Just to make sure, how did you derive the group membership probabilities? Manually, or did you use the output of predict.dapc? If this is based on predict.dapc, we would need a reproducible example (small subset of data) to see what is going on. Assignment is based on the discriminant functions, so there should never be any mismatch, at least not with the first DF. Cheers Thibaut ________________________________ From: adegenet-forum-bounces at lists.r-forge.r-project.org [adegenet-forum-bounces at lists.r-forge.r-project.org] on behalf of Carla Riva Rossi [carla.rivarossi at gmail.com] Sent: 10 December 2014 18:59 To: adegenet-forum at lists.r-forge.r-project.org Subject: [adegenet-forum] DAPC scatterplot vs membership probabilities I'm using DAPC to assess the origin of an introduced salmonid in Patagonia and I have problems interpreting my results. I used pre-defined groups corresponding to the native range source populations and then I applied the predict.dapc function to position the introduced individuals (that were not used in constructing the model) onto these discriminant functions (DFs). On the basis of the derived DFs, I derived for each introduced individual a membership probability to original source populations. Then, In the DAPC scatterplot the introduced individuals (population) fell more in the space with of native pop 1 than with pop 2, but the DAPC probabilites indicate more native pop2 ancestry. Which of these two results shoud I give more credit/support? Thanks a lot in advance!!! Carla.- -- Dra. Carla Riva Rossi CENPAT-CONICET Blvd Brown 2915 Puerto Madryn (CP 9120) Chubut - ARGENTINA Tel: + 54-280 - 4883184 Interno: 1349 Fax:+ 54-280 - 4883543 email: rivarossi at cenpat-conicet.gob.ar -------------- next part -------------- An HTML attachment was scrubbed... URL: From yadavps at mail.uc.edu Fri Dec 12 06:16:01 2014 From: yadavps at mail.uc.edu (Yadav-Pauletti, Sunita (yadavps)) Date: Fri, 12 Dec 2014 05:16:01 +0000 Subject: [adegenet-forum] question regarding error for mantel.randtest Message-ID: Hello, I would like to test isolation by distance in my dataset and have tried the following code: genfile <- read.genalex(filepath, ploidy=2, geo=TRUE, region=FALSE) #read file toto <- genind2genpop(genfile,miss="0") Dgen <- dist.genpop(toto,method=2) Dgeo <- dist(genfile$other$xy, method="euclidean") object.size(Dgen) object.size(Dgeo) ibd <- mantel.randtest(Dgen,Dgeo) ibd The data file (genfile) is in a GenAlEx format. However, I get the following error; I think it is related to the size of matrices for Dgen and Dgeo but I am unsure why the sizes would be off, is there something wrong with the code above (I got it from the adegenet tutorials)? > Error in mantel.rtest(Dgen, Dgeo) : Non convenient dimension Thank you for your help. Sunita Y. Ph.D. Student Univ. of Cincinnati, OH From t.jombart at imperial.ac.uk Fri Dec 12 14:04:07 2014 From: t.jombart at imperial.ac.uk (Jombart, Thibaut) Date: Fri, 12 Dec 2014 13:04:07 +0000 Subject: [adegenet-forum] question regarding error for mantel.randtest In-Reply-To: References: Message-ID: <2CB2DA8E426F3541AB1907F98ABA6570ABEA2AA5@icexch-m1.ic.ac.uk> Hi there, your matrices don't seem to have the same size. Can you check? E.g. dim(as.matrix(Dgen)) dim(as.matrix(Dgeo)) Cheers Thibaut _______________________________________ From: adegenet-forum-bounces at lists.r-forge.r-project.org [adegenet-forum-bounces at lists.r-forge.r-project.org] on behalf of Yadav-Pauletti, Sunita (yadavps) [yadavps at mail.uc.edu] Sent: 12 December 2014 05:16 To: adegenet-forum at lists.r-forge.r-project.org Subject: [adegenet-forum] question regarding error for mantel.randtest Hello, I would like to test isolation by distance in my dataset and have tried the following code: genfile <- read.genalex(filepath, ploidy=2, geo=TRUE, region=FALSE) #read file toto <- genind2genpop(genfile,miss="0") Dgen <- dist.genpop(toto,method=2) Dgeo <- dist(genfile$other$xy, method="euclidean") object.size(Dgen) object.size(Dgeo) ibd <- mantel.randtest(Dgen,Dgeo) ibd The data file (genfile) is in a GenAlEx format. However, I get the following error; I think it is related to the size of matrices for Dgen and Dgeo but I am unsure why the sizes would be off, is there something wrong with the code above (I got it from the adegenet tutorials)? > Error in mantel.rtest(Dgen, Dgeo) : Non convenient dimension Thank you for your help. Sunita Y. Ph.D. Student Univ. of Cincinnati, OH _______________________________________________ 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 yadavps at mail.uc.edu Fri Dec 12 16:18:49 2014 From: yadavps at mail.uc.edu (Yadav-Pauletti, Sunita (yadavps)) Date: Fri, 12 Dec 2014 15:18:49 +0000 Subject: [adegenet-forum] question regarding error for mantel.randtest Message-ID: Hello Thibaut, Thank you for your suggestion. The code I used was looking at overall object sizes and not matrices so I could see that Dgen and Dgeo were different sizes but not why. The issue seems to be that Dgen (genetic) matrix is a 7x7 matrix - populations, and Dgeo (geographic) is a 241x241 - individuals. I would like to test IBD both at the population level and individual level (within populations). For populations, can I get geographic distances in adegenet or should I calculate it in my GIS software and read the distances? Secondly, can the following code be used for individual genetic distances in adegenet? It seems to work and I could run the mantel test. Dgen <- dist(genfile, method="euclidean") Dgeo <- dist(genfile$other$xy, method="euclidean") The genAlEx file format is the following, data starts at row 4: Individual_ID Pop_ID Alelle_1 Allele_1b ...... Blank Column X Y 951_gps22 951 187 187 ...... 748600 2326728 The next question I have is how I can incorporate distances from a friction surface (cost surface) for a mantel test. Is there a way to read those distances in adegenet? Thanks, Sunita From zkamvar at gmail.com Fri Dec 12 17:09:14 2014 From: zkamvar at gmail.com (Zhian Kamvar) Date: Fri, 12 Dec 2014 08:09:14 -0800 Subject: [adegenet-forum] adegenet-forum Digest, Vol 76, Issue 7 In-Reply-To: References: Message-ID: Hello, To run a mantel test, the matrices need to be the same size. Dgen in this case, is the distance between populations (not samples). If you have an xy coordinate for each sample, then Dgeo will be much larger than Dgen. If you want to do a mantel test utilizing these distances, you have two options: 1. Calculate Dgen as an individual-based distance. 2. Find the average geographic coordinate for each population and construct Dgeo from those coordinates. Hope that helps, Zhian > Date: Fri, 12 Dec 2014 05:16:01 +0000 > From: "Yadav-Pauletti, Sunita (yadavps)" > To: "adegenet-forum at lists.r-forge.r-project.org" > > Subject: [adegenet-forum] question regarding error for mantel.randtest > Message-ID: > > > Content-Type: text/plain; charset="us-ascii" > > Hello, > > I would like to test isolation by distance in my dataset and have tried the following code: > > genfile <- read.genalex(filepath, ploidy=2, geo=TRUE, region=FALSE) #read file > toto <- genind2genpop(genfile,miss="0") > Dgen <- dist.genpop(toto,method=2) > Dgeo <- dist(genfile$other$xy, method="euclidean") > object.size(Dgen) > object.size(Dgeo) > ibd <- mantel.randtest(Dgen,Dgeo) > ibd > > The data file (genfile) is in a GenAlEx format. However, I get the following error; I think it is related to the size of matrices for Dgen and Dgeo but I am unsure why the sizes would be off, is there something wrong with the code above (I got it from the adegenet tutorials)? > >> Error in mantel.rtest(Dgen, Dgeo) : Non convenient dimension > > Thank you for your help. > > Sunita Y. > Ph.D. Student > Univ. of Cincinnati, OH > > > ------------------------------ > > _______________________________________________ > 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 > > End of adegenet-forum Digest, Vol 76, Issue 7 > ********************************************* From t.jombart at imperial.ac.uk Fri Dec 12 17:17:15 2014 From: t.jombart at imperial.ac.uk (Jombart, Thibaut) Date: Fri, 12 Dec 2014 16:17:15 +0000 Subject: [adegenet-forum] adegenet-forum Digest, Vol 76, Issue 7 In-Reply-To: References: , Message-ID: <2CB2DA8E426F3541AB1907F98ABA6570ABEA2CF4@icexch-m1.ic.ac.uk> Thanks Zhian for jumping in and helping. As a side note, genind2genpop can compute average spatial coordinates of the populations for you, if the geographic coordinates are in a matrix in the @other of your genind object, and if this matrix has exactly one row per individual. See ?genind2genpop, you basically need "process.other=TRUE". Cheers Thibaut ________________________________________ From: adegenet-forum-bounces at lists.r-forge.r-project.org [adegenet-forum-bounces at lists.r-forge.r-project.org] on behalf of Zhian Kamvar [zkamvar at gmail.com] Sent: 12 December 2014 16:09 To: adegenet-forum at lists.r-forge.r-project.org Subject: Re: [adegenet-forum] adegenet-forum Digest, Vol 76, Issue 7 Hello, To run a mantel test, the matrices need to be the same size. Dgen in this case, is the distance between populations (not samples). If you have an xy coordinate for each sample, then Dgeo will be much larger than Dgen. If you want to do a mantel test utilizing these distances, you have two options: 1. Calculate Dgen as an individual-based distance. 2. Find the average geographic coordinate for each population and construct Dgeo from those coordinates. Hope that helps, Zhian > Date: Fri, 12 Dec 2014 05:16:01 +0000 > From: "Yadav-Pauletti, Sunita (yadavps)" > To: "adegenet-forum at lists.r-forge.r-project.org" > > Subject: [adegenet-forum] question regarding error for mantel.randtest > Message-ID: > > > Content-Type: text/plain; charset="us-ascii" > > Hello, > > I would like to test isolation by distance in my dataset and have tried the following code: > > genfile <- read.genalex(filepath, ploidy=2, geo=TRUE, region=FALSE) #read file > toto <- genind2genpop(genfile,miss="0") > Dgen <- dist.genpop(toto,method=2) > Dgeo <- dist(genfile$other$xy, method="euclidean") > object.size(Dgen) > object.size(Dgeo) > ibd <- mantel.randtest(Dgen,Dgeo) > ibd > > The data file (genfile) is in a GenAlEx format. However, I get the following error; I think it is related to the size of matrices for Dgen and Dgeo but I am unsure why the sizes would be off, is there something wrong with the code above (I got it from the adegenet tutorials)? > >> Error in mantel.rtest(Dgen, Dgeo) : Non convenient dimension > > Thank you for your help. > > Sunita Y. > Ph.D. Student > Univ. of Cincinnati, OH > > > ------------------------------ > > _______________________________________________ > 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 > > End of adegenet-forum Digest, Vol 76, Issue 7 > ********************************************* _______________________________________________ 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 vojta at trapa.cz Mon Dec 15 17:49:06 2014 From: vojta at trapa.cz (=?utf-8?B?Vm9qdMSbY2g=?= Zeisek) Date: Mon, 15 Dec 2014 17:49:06 +0100 Subject: [adegenet-forum] Trouble converting to genid object In-Reply-To: References: Message-ID: <1650051.9YHaf6qmEA@veles> Hello, I experienced same error with PA data. I had dots in locus names (eg. XY.123-123). After replacement of dots with underscores, it worked perfectly. Sincerely, Vojt?ch Dne Po 22. z??? 2014 11:59:47, Jackie Lighten napsal(a): > Hi, > > I am having trouble converting a presence/absence genotype data frame to a > genid object > > Please see attached for test data file. > > Using > > obj2 <- genind(test, ploidy=1, type="PA") > > I get the error: > > Error in `colnames<-`(`*tmp*`, value = c("L1", "L2")) : > length of 'dimnames' [2] not equal to array extent > > Using > > obj2 <- df2genind(test, ploidy=1, type="PA") > > I get the error: > > Error in `colnames<-`(`*tmp*`, value = "L1") : > length of 'dimnames' [2] not equal to array extent > In addition: Warning messages: > 1: In eval(expr, envir, enclos) : NAs introduced by coercion > 2: In df2genind(test, ploidy = 1, type = "PA") : > entirely non-type marker(s) deleted > > Any help would be much appreciated > > Thanks, > > Jack -- Vojt?ch Zeisek http://trapa.cz/en/ Department of Botany, Faculty of Science Charles University in Prague Ben?tsk? 2, Prague, 12801, CZ http://botany.natur.cuni.cz/en/ Institute of Botany, Academy of Science Z?mek 1, Pr?honice, 25243, CZ http://www.ibot.cas.cz/en/ Czech Republic -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 473 bytes Desc: This is a digitally signed message part. URL: From mergey_marina at yahoo.fr Wed Dec 17 10:29:06 2014 From: mergey_marina at yahoo.fr (Marina Mergey) Date: Wed, 17 Dec 2014 09:29:06 +0000 (UTC) Subject: [adegenet-forum] inbreeding coefficient Message-ID: <598055593.107031.1418808546126.JavaMail.yahoo@jws11107.mail.ir2.yahoo.com> Hi everybody,i'm sending a message for the first time on the forum and i would like to take this opportunity to thank all of you and your messages for their interesting help .At the moment, i'm trying to understand significant positive Fis in many study sites. I checked for null alleles first and it's ok for the set of loci. Then i would like to discriminate inbreeding consequences and wahlund effect. So i would like to know if i can use the mean inbreeding coefficient for each study site (from the inbreeding function in the adegenet package) to validate or not the inbreeding hypothesis. Is it enough to reject it since all the values are under 0.5 ?Thanks for your help,All the best,Marina -------------- next part -------------- An HTML attachment was scrubbed... URL: From goatsrunfaster at gmail.com Wed Dec 17 22:09:13 2014 From: goatsrunfaster at gmail.com (Spencer Bruce) Date: Wed, 17 Dec 2014 16:09:13 -0500 Subject: [adegenet-forum] Error when converting STRUCTURE file to genind Message-ID: I get the following Error Message when I attempt to convert a STRUCTURE file to a genind object: Converting data from a STRUCTURE .stru file to a genind object... Error in mat[, (ncol(mat) - p + 1):ncol(mat)] : only 0's may be mixed with negative subscripts > traceback() 2: read.structure(file, missing = missing, quiet = quiet, ...) 1: import2genind("Bird.str") I've looked through the data and everything is in order, this runs fine in STRUCTURE and I've never had problems importing STRUCTURE files before. Just for the record this is SNP data in haploid format where G,C,A,T is coded for as 1,2,3,4 respectively. Any help would be greatly appreciated! -Spencer -- Spencer A Bruce 113 Hill St. Troy, NY 12180 518 225 0787 -------------- next part -------------- An HTML attachment was scrubbed... URL: From crypticlineage at gmail.com Wed Dec 17 23:08:37 2014 From: crypticlineage at gmail.com (Vikram Chhatre) Date: Wed, 17 Dec 2014 17:08:37 -0500 Subject: [adegenet-forum] Error when converting STRUCTURE file to genind In-Reply-To: References: Message-ID: I use this: Bird_genind <- import2genind('Bird.str', missing='missing', onerowperind=1, n.ind=10, n.loc=20, col.lab=1, col.pop=2, ask=FALSE) This assumes you have data coded as one row per individual, with 10 individuals, 20 loci, individual labels in column 1, population labels in column 2. Also, I code missing data with a '-9'. V On Wed, Dec 17, 2014 at 4:09 PM, Spencer Bruce wrote: > > I get the following Error Message when I attempt to convert a STRUCTURE > file to a genind object: > > Converting data from a STRUCTURE .stru file to a genind object... > > Error in mat[, (ncol(mat) - p + 1):ncol(mat)] : > only 0's may be mixed with negative subscripts > > traceback() > 2: read.structure(file, missing = missing, quiet = quiet, ...) > 1: import2genind("Bird.str") > > I've looked through the data and everything is in order, this runs fine in > STRUCTURE and I've never had problems importing STRUCTURE files before. > > Just for the record this is SNP data in haploid format where G,C,A,T is > coded for as 1,2,3,4 respectively. > > Any help would be greatly appreciated! > > -Spencer > > -- > Spencer A Bruce > 113 Hill St. > Troy, NY 12180 > 518 225 0787 > > _______________________________________________ > 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 t.jombart at imperial.ac.uk Thu Dec 18 16:39:11 2014 From: t.jombart at imperial.ac.uk (Jombart, Thibaut) Date: Thu, 18 Dec 2014 15:39:11 +0000 Subject: [adegenet-forum] inbreeding coefficient In-Reply-To: <598055593.107031.1418808546126.JavaMail.yahoo@jws11107.mail.ir2.yahoo.com> References: <598055593.107031.1418808546126.JavaMail.yahoo@jws11107.mail.ir2.yahoo.com> Message-ID: <2CB2DA8E426F3541AB1907F98ABA6570ABEB2DCC@icexch-m1.ic.ac.uk> Hi Marina, 'inbreeding' in adegenet will estimate the likelihood function of the inbreeding coefficient (F), which is a richer result than a mere test of significance: you get the full distribution of F, that is, which values of F are most likely given your data. Note that 0.5 does not have any specific meaning here (did you mean 5%?), but it is actually quite a strong inbreeding already. F=0.5 means there are 50% chances of being homozygote through shared ancestry only. Cheers Thibaut ________________________________ From: adegenet-forum-bounces at lists.r-forge.r-project.org [adegenet-forum-bounces at lists.r-forge.r-project.org] on behalf of Marina Mergey [mergey_marina at yahoo.fr] Sent: 17 December 2014 09:29 To: adegenet-forum at lists.r-forge.r-project.org Subject: [adegenet-forum] inbreeding coefficient Hi everybody, i'm sending a message for the first time on the forum and i would like to take this opportunity to thank all of you and your messages for their interesting help . At the moment, i'm trying to understand significant positive Fis in many study sites. I checked for null alleles first and it's ok for the set of loci. Then i would like to discriminate inbreeding consequences and wahlund effect. So i would like to know if i can use the mean inbreeding coefficient for each study site (from the inbreeding function in the adegenet package) to validate or not the inbreeding hypothesis. Is it enough to reject it since all the values are under 0.5 ? Thanks for your help, All the best, Marina -------------- next part -------------- An HTML attachment was scrubbed... URL: From goatsrunfaster at gmail.com Thu Dec 18 21:25:51 2014 From: goatsrunfaster at gmail.com (Spencer Bruce) Date: Thu, 18 Dec 2014 15:25:51 -0500 Subject: [adegenet-forum] Error when converting STRUCTURE file to genind In-Reply-To: References: Message-ID: Thanks, but still getting the same error message below: Converting data from a STRUCTURE .stru file to a genind object... Error in mat[, (ncol(mat) - p + 1):ncol(mat)] : only 0's may be mixed with negative subscripts > traceback() 2: read.structure(file, missing = missing, quiet = quiet, ...) 1: import2genind("Bird.str", missing = "missing", onerowperind = 1, n.ind = 239, n.loc = 98, col.lab = 1, col.pop = 2, ask = FALSE) > On Wed, Dec 17, 2014 at 5:08 PM, Vikram Chhatre wrote: > > I use this: > > Bird_genind <- import2genind('Bird.str', missing='missing', > onerowperind=1, n.ind=10, n.loc=20, col.lab=1, col.pop=2, ask=FALSE) > > This assumes you have data coded as one row per individual, with 10 > individuals, 20 loci, individual labels in column 1, population labels in > column 2. Also, I code missing data with a '-9'. > > V > > On Wed, Dec 17, 2014 at 4:09 PM, Spencer Bruce > wrote: > >> I get the following Error Message when I attempt to convert a STRUCTURE >> file to a genind object: >> >> Converting data from a STRUCTURE .stru file to a genind object... >> >> Error in mat[, (ncol(mat) - p + 1):ncol(mat)] : >> only 0's may be mixed with negative subscripts >> > traceback() >> 2: read.structure(file, missing = missing, quiet = quiet, ...) >> 1: import2genind("Bird.str") >> >> I've looked through the data and everything is in order, this runs fine >> in STRUCTURE and I've never had problems importing STRUCTURE files before. >> >> Just for the record this is SNP data in haploid format where G,C,A,T is >> coded for as 1,2,3,4 respectively. >> >> Any help would be greatly appreciated! >> >> -Spencer >> >> -- >> Spencer A Bruce >> 113 Hill St. >> Troy, NY 12180 >> 518 225 0787 >> >> _______________________________________________ >> 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 >> > -- Spencer A Bruce 113 Hill St. Troy, NY 12180 518 225 0787 -------------- next part -------------- An HTML attachment was scrubbed... URL: