From tohamyy at yahoo.com Tue Mar 4 16:12:16 2014 From: tohamyy at yahoo.com (Tohamy Yousef) Date: Tue, 4 Mar 2014 07:12:16 -0800 (PST) Subject: [adegenet-forum] DAPC legend Message-ID: <1393945936.13621.YahooMailNeo@web121102.mail.ne1.yahoo.com> HI all, I have made? DAPC with adegenet package and it was successfully done. I tried to save the plot as .eps but it gives me a warning message? and after that it gives me an empty plot as in the attachment file. When I save it in .Jpeg format it works well but as you know most of the journals need figures in .eps format. ? > setEPS() > postscript("DAPC.eps") > scatter(dapc1) Warning message: In polygon(c(ldens[[i]]$x, rev(ldens[[i]]$x)), c(ldens[[i]]$y, rep(0,? : ? semi-transparency is not supported on this device: reported only once per page do you have an idea how can I save it as .eps? Thanks in advance. Best, Tohamy ------------------------------------------- Eltohamy Yousef? M.Sc. Crop Biodiversity and Breeding Informatics Institute of Plant Breeding, Seed Science and Population Genetics (350) University of Hohenheim Fruwirtstrasse 21, 70599 Stuttgart Office phone:0049711 459-24437 Email: tohamyy at yahoo.com ? ? ? ? ? ? E.yousef at uni-hohenheim.de ??????????? tohamy_yousef at agr.suez.edu.eg Web.www.evoplant.uni-hohenheim.de -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: DAPC.eps Type: application/ps Size: 4203 bytes Desc: not available URL: From t.jombart at imperial.ac.uk Tue Mar 4 16:20:42 2014 From: t.jombart at imperial.ac.uk (Jombart, Thibaut) Date: Tue, 4 Mar 2014 15:20:42 +0000 Subject: [adegenet-forum] DAPC legend In-Reply-To: <1393945936.13621.YahooMailNeo@web121102.mail.ne1.yahoo.com> References: <1393945936.13621.YahooMailNeo@web121102.mail.ne1.yahoo.com> Message-ID: <2CB2DA8E426F3541AB1907F98ABA657075F6490B@icexch-m1.ic.ac.uk> Hi there, eps does not handle transparency, so you'll have to save the image as pdf or even better svg if you want it saved as vector graphics. 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 Tohamy Yousef [tohamyy at yahoo.com] Sent: 04 March 2014 15:12 To: adegenet-forum at lists.r-forge.r-project.org Subject: [adegenet-forum] DAPC legend HI all, I have made DAPC with adegenet package and it was successfully done. I tried to save the plot as .eps but it gives me a warning message and after that it gives me an empty plot as in the attachment file. When I save it in .Jpeg format it works well but as you know most of the journals need figures in .eps format. > setEPS() > postscript("DAPC.eps") > scatter(dapc1) Warning message: In polygon(c(ldens[[i]]$x, rev(ldens[[i]]$x)), c(ldens[[i]]$y, rep(0, : semi-transparency is not supported on this device: reported only once per page do you have an idea how can I save it as .eps? Thanks in advance. Best, Tohamy ------------------------------------------- Eltohamy Yousef M.Sc. Crop Biodiversity and Breeding Informatics Institute of Plant Breeding, Seed Science and Population Genetics (350) University of Hohenheim Fruwirtstrasse 21, 70599 Stuttgart Office phone:0049711 459-24437 Email: tohamyy at yahoo.com E.yousef at uni-hohenheim.de tohamy_yousef at agr.suez.edu.eg Web.www.evoplant.uni-hohenheim.de From celinewuyts at hotmail.com Sat Mar 8 18:54:33 2014 From: celinewuyts at hotmail.com (Celine Wuyts) Date: Sat, 8 Mar 2014 17:54:33 +0000 Subject: [adegenet-forum] read.PLINK alleles not properly read Message-ID: Hi, I am new to this package but have been googling for a problem I encounter with the extract.PLINKmap function and cannot find an answer. I read my SNP data from plink format with a standard line, choosing the appropriate files with .raw and .map extension from my directory as required. x<-read.PLINK(file.choose(),map.file=file.choose(),parallel=F) Worked perfectly, although it took more than an hour to finally get my genlight object built. However, the SNP map information is not read as it should. The x$other$chromosome is a vector of NA's, as is x$other$position. I tried the extract.PLINKmap as well but it gave the same result. Also, the x$alleles is empty (NULL) and the locNames are the original names with the letter of the allele that is counted added to it. For example: SNP1909 becomes SNP1909_C. I assume that the fact that my SNP map information is not read properly is due to the fact that names of SNPs have changed and R cannot find any matches so to say. What did I do wrong and how can I fix it? Also, I would like to subset my genlight object for individuals based on information (geographic grouping) in a seperate file. I thought about simply reading this information in x$other and working from their, but also this is not straightforward, as the seperate file contains more individuals and in a different order. Last question: seems that not many functions that work for genind objects are implemented for genlight objects. Is there a workaround for this, other than converting genlight to data frame and data frame to a genind object? Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From t.jombart at imperial.ac.uk Wed Mar 12 11:36:48 2014 From: t.jombart at imperial.ac.uk (Jombart, Thibaut) Date: Wed, 12 Mar 2014 10:36:48 +0000 Subject: [adegenet-forum] read.PLINK alleles not properly read In-Reply-To: References: Message-ID: <2CB2DA8E426F3541AB1907F98ABA657075F66BF8@icexch-m1.ic.ac.uk> Hello, So far this function seemed to have behaved all right. Can you please send me off list a small subset of the data to reproduce the error? As for your other question, yes, storing things in the @other slot is the way to go, but you probably want to reorder the data first. The simplest way to go is to name the rows of your meta-data matrix/dataframe, or the elements of your meta-data vector, after the individual labels used in the genlight, and then subset your object using these names. E.g.: > lab <- c('c','a','b') > meta <- 1:20 > names(meta) <- letters[1:20] > meta a b c d e f g h i j k l m n o p q r s t 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 > meta[lab] c a b 3 1 2 As for your last point, it is true that generally only the most recent methods implemented in adegenet (e.g. dapc, find.clusters) are available for genlight objects. This is mostly because the overhead of implementing methods for this class is quite high if we want to keep things memory-efficient (the purpose of this class). If RAM is not a problem, then by all means, just use a matrix or a data.frame to store your binary SNPs, or DNAbin to store data as sequences, or DNAbin for SNPs data allowing >2 alleles. 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 Celine Wuyts [celinewuyts at hotmail.com] Sent: 08 March 2014 17:54 To: adegenet-forum at lists.r-forge.r-project.org Subject: [adegenet-forum] read.PLINK alleles not properly read Hi, I am new to this package but have been googling for a problem I encounter with the extract.PLINKmap function and cannot find an answer. I read my SNP data from plink format with a standard line, choosing the appropriate files with .raw and .map extension from my directory as required. x<-read.PLINK(file.choose(),map.file=file.choose(),parallel=F) Worked perfectly, although it took more than an hour to finally get my genlight object built. However, the SNP map information is not read as it should. The x$other$chromosome is a vector of NA's, as is x$other$position. I tried the extract.PLINKmap as well but it gave the same result. Also, the x$alleles is empty (NULL) and the locNames are the original names with the letter of the allele that is counted added to it. For example: SNP1909 becomes SNP1909_C. I assume that the fact that my SNP map information is not read properly is due to the fact that names of SNPs have changed and R cannot find any matches so to say. What did I do wrong and how can I fix it? Also, I would like to subset my genlight object for individuals based on information (geographic grouping) in a seperate file. I thought about simply reading this information in x$other and working from their, but also this is not straightforward, as the seperate file contains more individuals and in a different order. Last question: seems that not many functions that work for genind objects are implemented for genlight objects. Is there a workaround for this, other than converting genlight to data frame and data frame to a genind object? Thanks. From karim.karimi81 at gmail.com Wed Mar 12 18:07:50 2014 From: karim.karimi81 at gmail.com (karim karimi) Date: Wed, 12 Mar 2014 20:37:50 +0330 Subject: [adegenet-forum] SNP genotype codes input Message-ID: Dear all I am working on SNPs genotypes data set that was related to 600,000 snp sites in 100 individuls. i found that "adegenet" package have many useful functions that we are searching them but i dont know if i can use this package for my analyse: i have a text file included 0,1,2 and 9 codes that show AA,AB,BB and NA (missing data) genotypes respectively. SNP in rows and individuls in columns: indivi1 indivi2 ............................................ snp1 0 1 9 2 0 snp2 1 1 0 9 9 snp3 0 0 9 9 1 . . . how can i change the format of my data in adegenet input format ( what codes should be replaced) and can "adegenet" do analyse process for huge data set ? regards -- Karim Karimi Ph.D Candidate of Animal Breeding & Genetics Department of Animal Science, College of Agricultural Science, Shahid Bahonar University of Kerman, Iran *********************************************** From t.jombart at imperial.ac.uk Fri Mar 14 16:48:33 2014 From: t.jombart at imperial.ac.uk (Jombart, Thibaut) Date: Fri, 14 Mar 2014 15:48:33 +0000 Subject: [adegenet-forum] SNP genotype codes input In-Reply-To: References: Message-ID: <2CB2DA8E426F3541AB1907F98ABA657075F67525@icexch-m1.ic.ac.uk> Hi there, this is quite close the one of the possible input to get genlight objects. See the vignette on 'genomics': vignette("adegenet-genomics") (in current adegenet version) or: adegenetTutorial("genomics") (in release 1.4-0, on CRAN imminently, though tutorial will take a couple of more days) 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 karim karimi [karim.karimi81 at gmail.com] Sent: 12 March 2014 17:07 To: adegenet-forum at lists.r-forge.r-project.org Subject: [adegenet-forum] SNP genotype codes input Dear all I am working on SNPs genotypes data set that was related to 600,000 snp sites in 100 individuls. i found that "adegenet" package have many useful functions that we are searching them but i dont know if i can use this package for my analyse: i have a text file included 0,1,2 and 9 codes that show AA,AB,BB and NA (missing data) genotypes respectively. SNP in rows and individuls in columns: indivi1 indivi2 ............................................ snp1 0 1 9 2 0 snp2 1 1 0 9 9 snp3 0 0 9 9 1 . . . how can i change the format of my data in adegenet input format ( what codes should be replaced) and can "adegenet" do analyse process for huge data set ? regards -- Karim Karimi Ph.D Candidate of Animal Breeding & Genetics Department of Animal Science, College of Agricultural Science, Shahid Bahonar University of Kerman, Iran *********************************************** _______________________________________________ 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 yom7 at hotmail.fr Tue Mar 18 12:33:32 2014 From: yom7 at hotmail.fr (Guillaume Louvel) Date: Tue, 18 Mar 2014 12:33:32 +0100 Subject: [adegenet-forum] How are NA values handled by glPca ? Message-ID: Hi all, I am doing a glPca on a genlight object of 627719 SNPs and 934 individuals (so I don't want to use genind and dudi.pca which are too slow and too heavy for this size). With genind objects, it's easy to replace NA by the mean for example, using na.replace or creating it with df2genind( dataframe , missing="mean"). However, it's not possible to replace missing values in genlight objects, because it is binary encoded, and the function glPca does not complaint about missing values (not like dudi.pca). So, the question is, what does glPca with missing values ? Because this function is part of the adegenet package whereas dudi.pca comes from ade4, is the replacement of NA by the mean implemented in glPca ? or do I need to do a specific trick ? Thank you ! Guillaume From t.jombart at imperial.ac.uk Tue Mar 18 13:32:57 2014 From: t.jombart at imperial.ac.uk (Jombart, Thibaut) Date: Tue, 18 Mar 2014 12:32:57 +0000 Subject: [adegenet-forum] How are NA values handled by glPca ? In-Reply-To: References: Message-ID: <2CB2DA8E426F3541AB1907F98ABA657075F775D5@icexch-m1.ic.ac.uk> Hello, missing values are replaced by the means of available observations (i.e. mean allele frequency). 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 Guillaume Louvel [yom7 at hotmail.fr] Sent: 18 March 2014 11:33 To: adegenet-forum at lists.r-forge.r-project.org Subject: [adegenet-forum] How are NA values handled by glPca ? Hi all, I am doing a glPca on a genlight object of 627719 SNPs and 934 individuals (so I don't want to use genind and dudi.pca which are too slow and too heavy for this size). With genind objects, it's easy to replace NA by the mean for example, using na.replace or creating it with df2genind( dataframe , missing="mean"). However, it's not possible to replace missing values in genlight objects, because it is binary encoded, and the function glPca does not complaint about missing values (not like dudi.pca). So, the question is, what does glPca with missing values ? Because this function is part of the adegenet package whereas dudi.pca comes from ade4, is the replacement of NA by the mean implemented in glPca ? or do I need to do a specific trick ? Thank you ! Guillaume _______________________________________________ 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 t.jombart at imperial.ac.uk Wed Mar 19 18:02:12 2014 From: t.jombart at imperial.ac.uk (Jombart, Thibaut) Date: Wed, 19 Mar 2014 17:02:12 +0000 Subject: [adegenet-forum] new release(s) of adegenet Message-ID: <2CB2DA8E426F3541AB1907F98ABA657075F77B9B@icexch-m1.ic.ac.uk> Dear all as some of you might have noticed, we have just released a new version of adegenet. Well, actually two, but 1.4-0 had a bug we had to correct quickly, so new version is 1.4-1. Big changes for this new release. The tutorials are no longer distributed as vignettes, but are accessible online from the adegenet website, or using the new command "adegenetTutorial". We have revamped the tutorials, which are now using knitr rather than Sweave (meaning: prettier, and easier to copy/paste command from the pdf into R). The other big news is that Caitlin and I have been working on a web server for DAPC, which is now part of the package. Type "adegenetServer()", and this will open up a web interface for DAPC. This includes some of the most recent work Caitlin has done on DAPC, like the feature selection procedure or the cross validation. As always, feedback and contributions welcome. Happy data analysis! Best Thibaut -- ###################################### Dr Thibaut JOMBART MRC Centre for Outbreak Analysis and Modelling Department of Infectious Disease Epidemiology Imperial College - School of Public Health St Mary?s Campus Norfolk Place London W2 1PG United Kingdom Tel. : 0044 (0)20 7594 3658 t.jombart at imperial.ac.uk http://sites.google.com/site/thibautjombart/ http://adegenet.r-forge.r-project.org/ From francesco.montinaro at gmail.com Thu Mar 20 12:26:31 2014 From: francesco.montinaro at gmail.com (Francesco Montinaro) Date: Thu, 20 Mar 2014 11:26:31 +0000 Subject: [adegenet-forum] adegenet-forum Digest, Vol 67, Issue 6 In-Reply-To: References: Message-ID: Hi Thibaut, Thank you very much for this big update! When I type adegenetServer() on Rstudio (on Linuxmint) I get this error. Listening on http://127.0.0.1:7727 Error in substitute(value)[[2]] : subscript out of bounds Error in if (!ONEDIM) { : argument is of length zero Best, Francesco Francesco Montinaro On 20 March 2014 11:00, wrote: > Send adegenet-forum mailing list submissions to > adegenet-forum at lists.r-forge.r-project.org > > To subscribe or unsubscribe via the World Wide Web, visit > > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/adegenet-forum > > or, via email, send a message with subject or body 'help' to > adegenet-forum-request at lists.r-forge.r-project.org > > You can reach the person managing the list at > adegenet-forum-owner at lists.r-forge.r-project.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of adegenet-forum digest..." > > > Today's Topics: > > 1. new release(s) of adegenet (Jombart, Thibaut) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 19 Mar 2014 17:02:12 +0000 > From: "Jombart, Thibaut" > To: "adegenet-forum at lists.r-forge.r-project.org" > > Subject: [adegenet-forum] new release(s) of adegenet > Message-ID: > <2CB2DA8E426F3541AB1907F98ABA657075F77B9B at icexch-m1.ic.ac.uk> > Content-Type: text/plain; charset="Windows-1252" > > > Dear all > > as some of you might have noticed, we have just released a new version of > adegenet. Well, actually two, but 1.4-0 had a bug we had to correct > quickly, so new version is 1.4-1. > > Big changes for this new release. The tutorials are no longer distributed > as vignettes, but are accessible online from the adegenet website, or using > the new command "adegenetTutorial". We have revamped the tutorials, which > are now using knitr rather than Sweave (meaning: prettier, and easier to > copy/paste command from the pdf into R). > > The other big news is that Caitlin and I have been working on a web server > for DAPC, which is now part of the package. Type "adegenetServer()", and > this will open up a web interface for DAPC. This includes some of the most > recent work Caitlin has done on DAPC, like the feature selection procedure > or the cross validation. > > As always, feedback and contributions welcome. > > Happy data analysis! > > Best > > Thibaut > > -- > ###################################### > Dr Thibaut JOMBART > MRC Centre for Outbreak Analysis and Modelling > Department of Infectious Disease Epidemiology > Imperial College - School of Public Health > St Mary?s Campus > Norfolk Place > London W2 1PG > United Kingdom > Tel. : 0044 (0)20 7594 3658 > t.jombart at imperial.ac.uk > http://sites.google.com/site/thibautjombart/ > http://adegenet.r-forge.r-project.org/ > > ------------------------------ > > _______________________________________________ > 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 67, Issue 6 > ********************************************* > -------------- next part -------------- An HTML attachment was scrubbed... URL: From caitiecollins at gmail.com Thu Mar 20 14:52:49 2014 From: caitiecollins at gmail.com (Caitlin Collins) Date: Thu, 20 Mar 2014 13:52:49 +0000 Subject: [adegenet-forum] adegenet-forum Digest, Vol 67, Issue 6 In-Reply-To: References: Message-ID: Hi Francesco, Glad to see you are already testing out the new version of adegenet! I recognise the second message (Error in if (!ONEDIM) { : argument is of length zero). It appears twice in my R console upon start-up of the adegenetServer on Rstudio. It is also matched very briefly by the appearance of the truncated message (Error: argument is of length zero) in the adegenetServer browser. This occurs because the adegenetServer, upon start-up, attempts to immediately and simultaneously load the data and plot the DAPC scatterplot. This causes the plot function to return an error message in the moment before it is able to find the data. I will attempt to silence this error message in the next version of the adegenetServer. For now, unless you think the adegenetServer is otherwise misbehaving, I would say it is safe to simply ignore this error message. As for the first error message you mentioned (Error in substitute(value)[[2]] : subscript out of bounds), could you tell me when and where this is occurring, and also what processes it seems to be interrupting? Thank you for the feedback. Best, Caitlin. On Thu, Mar 20, 2014 at 11:26 AM, Francesco Montinaro < francesco.montinaro at gmail.com> wrote: > Hi Thibaut, > Thank you very much for this big update! > > When I type adegenetServer() on Rstudio (on Linuxmint) > I get this error. > > Listening on http://127.0.0.1:7727 > Error in substitute(value)[[2]] : subscript out of bounds > Error in if (!ONEDIM) { : argument is of length zero > > > Best, > > Francesco > > Francesco Montinaro > > > On 20 March 2014 11:00, < > adegenet-forum-request at lists.r-forge.r-project.org> wrote: > >> Send adegenet-forum mailing list submissions to >> adegenet-forum at lists.r-forge.r-project.org >> >> To subscribe or unsubscribe via the World Wide Web, visit >> >> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/adegenet-forum >> >> or, via email, send a message with subject or body 'help' to >> adegenet-forum-request at lists.r-forge.r-project.org >> >> You can reach the person managing the list at >> adegenet-forum-owner at lists.r-forge.r-project.org >> >> When replying, please edit your Subject line so it is more specific >> than "Re: Contents of adegenet-forum digest..." >> >> >> Today's Topics: >> >> 1. new release(s) of adegenet (Jombart, Thibaut) >> >> >> ---------------------------------------------------------------------- >> >> Message: 1 >> Date: Wed, 19 Mar 2014 17:02:12 +0000 >> From: "Jombart, Thibaut" >> To: "adegenet-forum at lists.r-forge.r-project.org" >> >> Subject: [adegenet-forum] new release(s) of adegenet >> Message-ID: >> <2CB2DA8E426F3541AB1907F98ABA657075F77B9B at icexch-m1.ic.ac.uk> >> Content-Type: text/plain; charset="Windows-1252" >> >> >> Dear all >> >> as some of you might have noticed, we have just released a new version of >> adegenet. Well, actually two, but 1.4-0 had a bug we had to correct >> quickly, so new version is 1.4-1. >> >> Big changes for this new release. The tutorials are no longer distributed >> as vignettes, but are accessible online from the adegenet website, or using >> the new command "adegenetTutorial". We have revamped the tutorials, which >> are now using knitr rather than Sweave (meaning: prettier, and easier to >> copy/paste command from the pdf into R). >> >> The other big news is that Caitlin and I have been working on a web >> server for DAPC, which is now part of the package. Type "adegenetServer()", >> and this will open up a web interface for DAPC. This includes some of the >> most recent work Caitlin has done on DAPC, like the feature selection >> procedure or the cross validation. >> >> As always, feedback and contributions welcome. >> >> Happy data analysis! >> >> Best >> >> Thibaut >> >> -- >> ###################################### >> Dr Thibaut JOMBART >> MRC Centre for Outbreak Analysis and Modelling >> Department of Infectious Disease Epidemiology >> Imperial College - School of Public Health >> St Mary?s Campus >> Norfolk Place >> London W2 1PG >> United Kingdom >> Tel. : 0044 (0)20 7594 3658 >> t.jombart at imperial.ac.uk >> http://sites.google.com/site/thibautjombart/ >> http://adegenet.r-forge.r-project.org/ >> >> ------------------------------ >> >> _______________________________________________ >> 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 67, Issue 6 >> ********************************************* >> > > > _______________________________________________ > 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 Mar 20 16:48:58 2014 From: t.jombart at imperial.ac.uk (Jombart, Thibaut) Date: Thu, 20 Mar 2014 15:48:58 +0000 Subject: [adegenet-forum] adegenet-forum Digest, Vol 67, Issue 6 In-Reply-To: References: , Message-ID: <2CB2DA8E426F3541AB1907F98ABA657075F79013@icexch-m1.ic.ac.uk> Hi there, the web interface displays some messages, in particular warnings and errors, to the R console, but this does not mean that the interface itself is not working. As Caitlin said, depending on the state of the dialogue between the UI and the server, there may be transient errors but which actually don't stop the app from working. Is the web interface working at all on your computer? You may need to go back to your browser manually to see it. 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 Caitlin Collins [caitiecollins at gmail.com] Sent: 20 March 2014 13:52 To: Francesco Montinaro Cc: adegenet-forum at lists.r-forge.r-project.org Subject: Re: [adegenet-forum] adegenet-forum Digest, Vol 67, Issue 6 Hi Francesco, Glad to see you are already testing out the new version of adegenet! I recognise the second message (Error in if (!ONEDIM) { : argument is of length zero). It appears twice in my R console upon start-up of the adegenetServer on Rstudio. It is also matched very briefly by the appearance of the truncated message (Error: argument is of length zero) in the adegenetServer browser. This occurs because the adegenetServer, upon start-up, attempts to immediately and simultaneously load the data and plot the DAPC scatterplot. This causes the plot function to return an error message in the moment before it is able to find the data. I will attempt to silence this error message in the next version of the adegenetServer. For now, unless you think the adegenetServer is otherwise misbehaving, I would say it is safe to simply ignore this error message. As for the first error message you mentioned (Error in substitute(value)[[2]] : subscript out of bounds), could you tell me when and where this is occurring, and also what processes it seems to be interrupting? Thank you for the feedback. Best, Caitlin. On Thu, Mar 20, 2014 at 11:26 AM, Francesco Montinaro > wrote: Hi Thibaut, Thank you very much for this big update! When I type adegenetServer() on Rstudio (on Linuxmint) I get this error. Listening on http://127.0.0.1:7727 Error in substitute(value)[[2]] : subscript out of bounds Error in if (!ONEDIM) { : argument is of length zero Best, Francesco Francesco Montinaro On 20 March 2014 11:00, > wrote: Send adegenet-forum mailing list submissions to adegenet-forum at lists.r-forge.r-project.org To subscribe or unsubscribe via the World Wide Web, visit https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/adegenet-forum or, via email, send a message with subject or body 'help' to adegenet-forum-request at lists.r-forge.r-project.org You can reach the person managing the list at adegenet-forum-owner at lists.r-forge.r-project.org When replying, please edit your Subject line so it is more specific than "Re: Contents of adegenet-forum digest..." Today's Topics: 1. new release(s) of adegenet (Jombart, Thibaut) ---------------------------------------------------------------------- Message: 1 Date: Wed, 19 Mar 2014 17:02:12 +0000 From: "Jombart, Thibaut" > To: "adegenet-forum at lists.r-forge.r-project.org" > Subject: [adegenet-forum] new release(s) of adegenet Message-ID: <2CB2DA8E426F3541AB1907F98ABA657075F77B9B at icexch-m1.ic.ac.uk> Content-Type: text/plain; charset="Windows-1252" Dear all as some of you might have noticed, we have just released a new version of adegenet. Well, actually two, but 1.4-0 had a bug we had to correct quickly, so new version is 1.4-1. Big changes for this new release. The tutorials are no longer distributed as vignettes, but are accessible online from the adegenet website, or using the new command "adegenetTutorial". We have revamped the tutorials, which are now using knitr rather than Sweave (meaning: prettier, and easier to copy/paste command from the pdf into R). The other big news is that Caitlin and I have been working on a web server for DAPC, which is now part of the package. Type "adegenetServer()", and this will open up a web interface for DAPC. This includes some of the most recent work Caitlin has done on DAPC, like the feature selection procedure or the cross validation. As always, feedback and contributions welcome. Happy data analysis! Best Thibaut -- ###################################### Dr Thibaut JOMBART MRC Centre for Outbreak Analysis and Modelling Department of Infectious Disease Epidemiology Imperial College - School of Public Health St Mary?s Campus Norfolk Place London W2 1PG United Kingdom Tel. : 0044 (0)20 7594 3658 t.jombart at imperial.ac.uk http://sites.google.com/site/thibautjombart/ http://adegenet.r-forge.r-project.org/ ------------------------------ _______________________________________________ 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 67, Issue 6 ********************************************* _______________________________________________ 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 tohamyy at yahoo.com Fri Mar 21 14:50:28 2014 From: tohamyy at yahoo.com (Tohamy Yousef) Date: Fri, 21 Mar 2014 06:50:28 -0700 (PDT) Subject: [adegenet-forum] Inbreeding coefficient calculation by adegenet In-Reply-To: <2CB2DA8E426F3541AB1907F98ABA657075F34DF5@icexch-m1.ic.ac.uk> References: <1387356268.84469.YahooMailNeo@web121104.mail.ne1.yahoo.com> <2CB2DA8E426F3541AB1907F98ABA657075F34DF5@icexch-m1.ic.ac.uk> Message-ID: <1395409828.89421.YahooMailNeo@web121101.mail.ne1.yahoo.com> Dear Dr. JombartI wrote you before and asked about inbreeding calculation. You suggested that I use less number of markers and other advices. SO, I tried to follow all your comments. For example I decided to use only 2247 SNP markers without missing data (before I had 43231 with missing data). But I still have the same problem. I attached you the new data (new_inbreeding.stru). Thanks in advance. ######### my script > library(adegenet) > toto<-read.structure(file="new_inbreeding.stru",n.ind=154,n.loc=2247,onerowperind=FALSE,col.lab=1,row.marknames=1,NA.char="-9",missing="mean") Which column contains the population factor ('0' if absent)? 2 ?Which other optional columns should be read (press 'return' when done)? 1: > toto ?? ##################### ?? ### Genind object ### ?? ##################### - genotypes of individuals - S4 class:? genind @call: read.structure(file = "inbreeding.stru", ??? n.ind = 154, n.loc = 2247, onerowperind = FALSE, col.lab = 1, ??? row.marknames = 1, NA.char = "-9", missing = "mean") @tab:? 154 x 3610 matrix of genotypes @ind.names: vector of? 154 individual names @loc.names: vector of? 2247 locus names @loc.nall: number of alleles per locus @loc.fac: locus factor for the? 3610 columns of @tab @all.names: list of? 2247 components yielding allele names for each locus @ploidy:? 2 @type:? codom Optionnal contents: @pop:? factor giving the population of each individual @pop.names:? factor giving the population of each individual @other: - empty - > toto$pop.names ? P1?? P2 "US" "IP" >U<- seppop(toto)$US > U ?? ##################### ?? ### Genind object ### ?? ##################### - genotypes of individuals - S4 class:? genind @call: .local(x = x, i = i, j = j, treatOther = ..1, quiet = ..2, drop = drop) @tab:? 81 x 3610 matrix of genotypes @ind.names: vector of? 81 individual names @loc.names: vector of? 2247 locus names @loc.nall: number of alleles per locus @loc.fac: locus factor for the? 3610 columns of @tab @all.names: list of? 2247 components yielding allele names for each locus @ploidy:? 2 @type:? codom Optionnal contents: @pop:? factor giving the population of each individual @pop.names:? factor giving the population of each individual @other: a list containing: elements without names > U1<- inbreeding(U, N=100) Error in sample.int(length(x), size, replace, prob) : ? NA in probability vector ? On Thursday, December 19, 2013 6:32 AM, "Jombart, Thibaut" wrote: Hello, this was a tricky one. There is a problem in your command line, and then there is a problem inherent to likelihood and large datasets. First, the problem is you replace missing data by "zero"s? allele frequencies (missing=0), which means that for some loci and some individuals, you have no allele, but still not treated as missing data. This screws the definition of homozygotes and thus the computations of inbreeding. Second, for large datasets, the sum of log-likelihoods is so low that reverting them back to likelihoods gives 0. You end up with a density distribution that is approximately zero everywhere. You may still be able to visualize it as a density, but when deriving samples, this results in probabilities of zero and 'sample' complains about it. Note that this is not a theoretical issue, only a numerical precision problem. I have just committed a patch so that now, a meaningful warning will be issued. In principle, one could just add a constant to the sum of log-likelihood values as a workaround. But which value to add is not a trivial choice, and may vary from one individual to another. I'll pass on that for now. As a workaround for your problem: - don't use "missing=0" - ask for the distributions, not the samples: "res.type="function"" - alternatively, use a smaller subset of loci - use the new patch (attached) to replace the error with a warning - you'll get flat (uniform) distributions for the problematic individuals. 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 Tohamy Yousef [tohamyy at yahoo.com] Sent: 18 December 2013 08:44 To: adegenet-forum at lists.r-forge.r-project.org Subject: [adegenet-forum] Inbreeding coefficient calculation by adegenet Dear Dr. Jombart, I am trying to calculate the inbreeding coefficient for two populations (US=81 and IP=73)? with 43231 SNPs. I am using your your manual, an introduction to adgenet 1.4-0, but I have a problem in the calculation. It gives me an error message: Error in sample.int(length(x), size, replace, prob) : ? NA in probability vector I do not know why? I did it as following: > toto<-read.structure(file="finalFiltered_noLowCov_e0_LOCUS_POP.stru",n.ind=154,n.loc=43231,onerowperind=FALSE,col.lab=1,row.marknames=1,NA.char="-9",missing=0) Which column contains the population factor ('0' if absent)? 2 Which other optional columns should be read (press 'return' when done)? 1: Converting data from a STRUCTURE .stru file to a genind object... > is.genind(toto) [1] TRUE > toto$pop.names ? P1? P2 "US" "IP" > sa1<- seppop(toto)$US > sa1 ? ##################### ? ### Genind object ### ? ##################### - genotypes of individuals - S4 class:? genind @call: .local(x = x, i = i, j = j, treatOther = ..1, quiet = ..2, drop = drop) @tab:? 81 x 61169 matrix of genotypes @ind.names: vector of? 81 individual names @loc.names: vector of? 43231 locus names @loc.nall: number of alleles per locus @loc.fac: locus factor for the? 61169 columns of @tab @all.names: list of? 43231 components yielding allele names for each locus @ploidy:? 2 @type:? codom Optionnal contents: @pop:? factor giving the population of each individual @pop.names:? factor giving the population of each individual @other: a list containing: elements without names > temp1<- inbreeding(sa1, N=81) Error in sample.int(length(x), size, replace, prob) : ? NA in probability vector > sa2<- seppop(toto)$IP > sa2 ? ##################### ? ### Genind object ### ? ##################### - genotypes of individuals - S4 class:? genind @call: .local(x = x, i = i, j = j, treatOther = ..1, quiet = ..2, drop = drop) @tab:? 73 x 61169 matrix of genotypes @ind.names: vector of? 73 individual names @loc.names: vector of? 43231 locus names @loc.nall: number of alleles per locus @loc.fac: locus factor for the? 61169 columns of @tab @all.names: list of? 43231 components yielding allele names for each locus @ploidy:? 2 @type:? codom Optionnal contents: @pop:? factor giving the population of each individual @pop.names:? factor giving the population of each individual @other: a list containing: elements without names > temp2<- inbreeding(sa2, N=73) Error in sample.int(length(x), size, replace, prob) : ? NA in probability vector Could you please tell me how can I fix this problem? I attached you a part of my data. and I hope that? help me. Thank you advance Best regards, Tohamy ------------------------------------------- Eltohamy Yousef? M.Sc. Crop Biodiversity and Breeding Informatics Institute of Plant Breeding, Seed Science and Population Genetics (350) University of Hohenheim Fruwirtstrasse 21, 70599 Stuttgart Office phone:0049711 459-24437 Email: tohamyy at yahoo.com ? ? ? ? ? ? E.yousef at uni-hohenheim.de ? ? ? ? ? ? tohamy_yousef at agr.suez.edu.eg Web.www.evoplant.uni-hohenheim.de -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: new_inbreeding.stru Type: application/octet-stream Size: 1416445 bytes Desc: not available URL: From t.jombart at imperial.ac.uk Mon Mar 24 09:51:51 2014 From: t.jombart at imperial.ac.uk (Jombart, Thibaut) Date: Mon, 24 Mar 2014 08:51:51 +0000 Subject: [adegenet-forum] Inbreeding coefficient calculation by adegenet In-Reply-To: <1395409828.89421.YahooMailNeo@web121101.mail.ne1.yahoo.com> References: <1387356268.84469.YahooMailNeo@web121104.mail.ne1.yahoo.com> <2CB2DA8E426F3541AB1907F98ABA657075F34DF5@icexch-m1.ic.ac.uk>, <1395409828.89421.YahooMailNeo@web121101.mail.ne1.yahoo.com> Message-ID: <2CB2DA8E426F3541AB1907F98ABA657075F797D5@icexch-m1.ic.ac.uk> Dear Tohamy sorry, I am currently teaching at a workshop for the week and won't have time to look into this before April. Meanwhile I would suggest trying on a sample of SNPs with growing size (e.g. 10, 50, 100, 500, etc) to ensure that nothing fishy is happening here. Cheers Thibaut ________________________________________ From: Tohamy Yousef [tohamyy at yahoo.com] Sent: 21 March 2014 13:50 To: Jombart, Thibaut; adegenet-forum at lists.r-forge.r-project.org Subject: Re: [adegenet-forum] Inbreeding coefficient calculation by adegenet Dear Dr. Jombart I wrote you before and asked about inbreeding calculation. You suggested that I use less number of markers and other advices. SO, I tried to follow all your comments. For example I decided to use only 2247 SNP markers without missing data (before I had 43231 with missing data). But I still have the same problem. I attached you the new data (new_inbreeding.stru). Thanks in advance. ######### my script > library(adegenet) > toto<-read.structure(file="new_inbreeding.stru",n.ind=154,n.loc=2247,onerowperind=FALSE,col.lab=1,row.marknames=1,NA.char="-9",missing="mean") Which column contains the population factor ('0' if absent)? 2 Which other optional columns should be read (press 'return' when done)? 1: > toto ##################### ### Genind object ### ##################### - genotypes of individuals - S4 class: genind @call: read.structure(file = "inbreeding.stru", n.ind = 154, n.loc = 2247, onerowperind = FALSE, col.lab = 1, row.marknames = 1, NA.char = "-9", missing = "mean") @tab: 154 x 3610 matrix of genotypes @ind.names: vector of 154 individual names @loc.names: vector of 2247 locus names @loc.nall: number of alleles per locus @loc.fac: locus factor for the 3610 columns of @tab @all.names: list of 2247 components yielding allele names for each locus @ploidy: 2 @type: codom Optionnal contents: @pop: factor giving the population of each individual @pop.names: factor giving the population of each individual @other: - empty - > toto$pop.names P1 P2 "US" "IP" >U<- seppop(toto)$US > U ##################### ### Genind object ### ##################### - genotypes of individuals - S4 class: genind @call: .local(x = x, i = i, j = j, treatOther = ..1, quiet = ..2, drop = drop) @tab: 81 x 3610 matrix of genotypes @ind.names: vector of 81 individual names @loc.names: vector of 2247 locus names @loc.nall: number of alleles per locus @loc.fac: locus factor for the 3610 columns of @tab @all.names: list of 2247 components yielding allele names for each locus @ploidy: 2 @type: codom Optionnal contents: @pop: factor giving the population of each individual @pop.names: factor giving the population of each individual @other: a list containing: elements without names > U1<- inbreeding(U, N=100) Error in sample.int(length(x), size, replace, prob) : NA in probability vector On Thursday, December 19, 2013 6:32 AM, "Jombart, Thibaut" wrote: Hello, this was a tricky one. There is a problem in your command line, and then there is a problem inherent to likelihood and large datasets. First, the problem is you replace missing data by "zero"s allele frequencies (missing=0), which means that for some loci and some individuals, you have no allele, but still not treated as missing data. This screws the definition of homozygotes and thus the computations of inbreeding. Second, for large datasets, the sum of log-likelihoods is so low that reverting them back to likelihoods gives 0. You end up with a density distribution that is approximately zero everywhere. You may still be able to visualize it as a density, but when deriving samples, this results in probabilities of zero and 'sample' complains about it. Note that this is not a theoretical issue, only a numerical precision problem. I have just committed a patch so that now, a meaningful warning will be issued. In principle, one could just add a constant to the sum of log-likelihood values as a workaround. But which value to add is not a trivial choice, and may vary from one individual to another. I'll pass on that for now. As a workaround for your problem: - don't use "missing=0" - ask for the distributions, not the samples: "res.type="function"" - alternatively, use a smaller subset of loci - use the new patch (attached) to replace the error with a warning - you'll get flat (uniform) distributions for the problematic individuals. 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 Tohamy Yousef [tohamyy at yahoo.com] Sent: 18 December 2013 08:44 To: adegenet-forum at lists.r-forge.r-project.org Subject: [adegenet-forum] Inbreeding coefficient calculation by adegenet Dear Dr. Jombart, I am trying to calculate the inbreeding coefficient for two populations (US=81 and IP=73) with 43231 SNPs. I am using your your manual, an introduction to adgenet 1.4-0, but I have a problem in the calculation. It gives me an error message: Error in sample.int(length(x), size, replace, prob) : NA in probability vector I do not know why? I did it as following: > toto<-read.structure(file="finalFiltered_noLowCov_e0_LOCUS_POP.stru",n.ind=154,n.loc=43231,onerowperind=FALSE,col.lab=1,row.marknames=1,NA.char="-9",missing=0) Which column contains the population factor ('0' if absent)? 2 Which other optional columns should be read (press 'return' when done)? 1: Converting data from a STRUCTURE .stru file to a genind object... > is.genind(toto) [1] TRUE > toto$pop.names P1 P2 "US" "IP" > sa1<- seppop(toto)$US > sa1 ##################### ### Genind object ### ##################### - genotypes of individuals - S4 class: genind @call: .local(x = x, i = i, j = j, treatOther = ..1, quiet = ..2, drop = drop) @tab: 81 x 61169 matrix of genotypes @ind.names: vector of 81 individual names @loc.names: vector of 43231 locus names @loc.nall: number of alleles per locus @loc.fac: locus factor for the 61169 columns of @tab @all.names: list of 43231 components yielding allele names for each locus @ploidy: 2 @type: codom Optionnal contents: @pop: factor giving the population of each individual @pop.names: factor giving the population of each individual @other: a list containing: elements without names > temp1<- inbreeding(sa1, N=81) Error in sample.int(length(x), size, replace, prob) : NA in probability vector > sa2<- seppop(toto)$IP > sa2 ##################### ### Genind object ### ##################### - genotypes of individuals - S4 class: genind @call: .local(x = x, i = i, j = j, treatOther = ..1, quiet = ..2, drop = drop) @tab: 73 x 61169 matrix of genotypes @ind.names: vector of 73 individual names @loc.names: vector of 43231 locus names @loc.nall: number of alleles per locus @loc.fac: locus factor for the 61169 columns of @tab @all.names: list of 43231 components yielding allele names for each locus @ploidy: 2 @type: codom Optionnal contents: @pop: factor giving the population of each individual @pop.names: factor giving the population of each individual @other: a list containing: elements without names > temp2<- inbreeding(sa2, N=73) Error in sample.int(length(x), size, replace, prob) : NA in probability vector Could you please tell me how can I fix this problem? I attached you a part of my data. and I hope that help me. Thank you advance Best regards, Tohamy ------------------------------------------- Eltohamy Yousef M.Sc. Crop Biodiversity and Breeding Informatics Institute of Plant Breeding, Seed Science and Population Genetics (350) University of Hohenheim Fruwirtstrasse 21, 70599 Stuttgart Office phone:0049711 459-24437 Email: tohamyy at yahoo.com E.yousef at uni-hohenheim.de tohamy_yousef at agr.suez.edu.eg Web.www.evoplant.uni-hohenheim.de