From matthieu.bogard at clermont.inra.fr Tue Dec 3 08:53:45 2013 From: matthieu.bogard at clermont.inra.fr (Matthieu BOGARD) Date: Tue, 03 Dec 2013 08:53:45 +0100 Subject: [adegenet-forum] seeking advice on how to use DAPC grouping in association genetics In-Reply-To: <529CA417.8040509@clermont.inra.fr> References: <529CA417.8040509@clermont.inra.fr> Message-ID: <529D8E09.6090606@clermont.inra.fr> Dear Thibaut, Thank you very much for your answer. I hope you don't mind if I ask you some precisions: At the moment, I used the following code to extract individuals coordinates but I'm not sure this is what you meant when you said "As an alternative, you can use the discriminant functions of the DAPC": gen <- df2genind(gen, sep="", ploidy=2) grp <- find.clusters(gen) dapc2 <- dapc(gen, grp$grp, n.da=100, n.pca=50) temp <- optim.a.score(dapc2) OptimalNbPCA <- temp$best dapc3 <- dapc(gen, grp$grp, n.da=100, n.pca=OptimalNbPCA) dapc3$ind.coord If this is wrong, could you please precise how to extract the discriminant functions of the DAPC? Cheers, Matthieu Le 23/11/2013 17:07, Jombart, Thibaut a ?crit : > Hi there, > > there are several ways you can do this. > > First, the groups being known, you can simply remove entirely all potential stratification by regressing your genetic data (or your response variable) onto the group membership vectors using a simple ANOVA (and keeping the residuals of the corresponding model). This could be an overkill though, as stratification may be mainly concerning sets of your groups (expl: groups 1-2 vs groups 3-5). As an alternative, you can use the discriminant functions of the DAPC as regressors, and keep the residuals. > > In any case, the operation will look like: > > new.x <- residuals(lm(x ~ myRegressor)) > > Please consider using the forum for such questions - other people may be interested in the answer. See section 'contacts' on: > http://adegenet.r-forge.r-project.org/ > > Cheers > Thibaut > > > ________________________________________ > From: Matthieu BOGARD [matthieu.bogard at clermont.inra.fr] > Sent: 21 November 2013 16:04 > To: Jombart, Thibaut > Subject: seeking advice on how to use DAPC grouping in association genetics > > Dear Thibault, > > I'm currently carrying an association genetics study on earliness in > wheat. I've been looking at stratification of my panel with the DAPC > method you described in Jombart et al. 2010. > > Could you please advise me on the best way to take into account panel > stratification in the model testing single marker association? > > At the moment, I was thinking of using the group membership > probabilities output in DAPC{} of the k-1 groups (with k the total > number of groups) as people usually do with group membership > probabilities output in STRUCTURE (Price, Pritchard et al. software). Do > you think that would be right or would you prevent doing this? Is there > another way to do so by using the PCA coordinates of individuals for > example? > > Your help would be much apreciated. > > Kind regards, > Matthieu BOGARD > > From emmanuel.wicker at cirad.fr Wed Dec 4 07:56:07 2013 From: emmanuel.wicker at cirad.fr (Emmanuel Wicker) Date: Wed, 04 Dec 2013 10:56:07 +0400 Subject: [adegenet-forum] Fwd: Help: incorporating SPCA results on a map In-Reply-To: <5296D988.1080908@cirad.fr> References: <5296D988.1080908@cirad.fr> Message-ID: <529ED207.9020706@cirad.fr> -------- Message original -------- Sujet: Help: incorporating SPCA results on a map Date : Thu, 28 Nov 2013 09:50:00 +0400 De : Emmanuel Wicker Organisation : CIRAD-UMR PVBMT Pour : adegenet-forum-request at lists.r-forge.r-project.org Dear adegenet users I am relatively new in using ADEGENET, especially sPCA. I would like to draw my SPCA output results on a map ("map" object), that I successfully imported in the genind file. The command plot.spca works, but I don't know to which argument I should affect the map. Thank you in advance for your help Manu -- Emmanuel WICKER, PhD Phytopathologiste / Plant Pathologist CIRAD, UMR Peuplements V?g?taux et Bioagresseurs en Milieu Tropical P?le de Protection des Plantes 7, chemin de l'IRAT F-97410 Saint Pierre La R?union, France wicker at cirad.fr http://umr-pvbmt.cirad.fr/ Tel : 0262 49 92 42 fax : 0262 49 92 93 From abroad Tel : 00 262 262 49 92 42 Fax :00 262 262 49 92 93 -------------- next part -------------- An HTML attachment was scrubbed... URL: From RoyFrancis.Mathew at agrsci.dk Wed Dec 4 09:49:23 2013 From: RoyFrancis.Mathew at agrsci.dk (Roy Mathew Francis) Date: Wed, 4 Dec 2013 08:49:23 +0000 Subject: [adegenet-forum] Fwd: Help: incorporating SPCA results on a map In-Reply-To: <529ED207.9020706@cirad.fr> References: <5296D988.1080908@cirad.fr> <529ED207.9020706@cirad.fr> Message-ID: To overplot the sPCA results on to a map, use s.value(). Regards Roy Mathew Francis From: adegenet-forum-bounces at lists.r-forge.r-project.org [mailto:adegenet-forum-bounces at lists.r-forge.r-project.org] On Behalf Of Emmanuel Wicker Sent: 04 December 2013 07:56 To: adegenet-forum at lists.r-forge.r-project.org Subject: [adegenet-forum] Fwd: Help: incorporating SPCA results on a map -------- Message original -------- Sujet: Help: incorporating SPCA results on a map Date : Thu, 28 Nov 2013 09:50:00 +0400 De : Emmanuel Wicker Organisation : CIRAD-UMR PVBMT Pour : adegenet-forum-request at lists.r-forge.r-project.org Dear adegenet users I am relatively new in using ADEGENET, especially sPCA. I would like to draw my SPCA output results on a map ("map" object), that I successfully imported in the genind file. The command plot.spca works, but I don't know to which argument I should affect the map. Thank you in advance for your help Manu -- Emmanuel WICKER, PhD Phytopathologiste / Plant Pathologist CIRAD, UMR Peuplements V?g?taux et Bioagresseurs en Milieu Tropical P?le de Protection des Plantes 7, chemin de l'IRAT F-97410 Saint Pierre La R?union, France wicker at cirad.fr http://umr-pvbmt.cirad.fr/ Tel : 0262 49 92 42 fax : 0262 49 92 93 >From abroad Tel : 00 262 262 49 92 42 Fax :00 262 262 49 92 93 -------------- next part -------------- An HTML attachment was scrubbed... URL: From t.jombart at imperial.ac.uk Wed Dec 4 09:51:52 2013 From: t.jombart at imperial.ac.uk (Jombart, Thibaut) Date: Wed, 4 Dec 2013 08:51:52 +0000 Subject: [adegenet-forum] Fwd: Help: incorporating SPCA results on a map In-Reply-To: References: <5296D988.1080908@cirad.fr> <529ED207.9020706@cirad.fr>, Message-ID: <2CB2DA8E426F3541AB1907F98ABA65706391B9C2@icexch-m1.ic.ac.uk> Hello, please also check the sPCA tutorial for other plotting options. See section 'documents' on: http://adegenet.r-forge.r-project.org/ or the corresponding vignette. 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 Roy Mathew Francis [RoyFrancis.Mathew at agrsci.dk] Sent: 04 December 2013 08:49 To: Emmanuel Wicker; adegenet-forum at lists.r-forge.r-project.org Subject: Re: [adegenet-forum] Fwd: Help: incorporating SPCA results on a map To overplot the sPCA results on to a map, use s.value(). Regards Roy Mathew Francis From: adegenet-forum-bounces at lists.r-forge.r-project.org [mailto:adegenet-forum-bounces at lists.r-forge.r-project.org] On Behalf Of Emmanuel Wicker Sent: 04 December 2013 07:56 To: adegenet-forum at lists.r-forge.r-project.org Subject: [adegenet-forum] Fwd: Help: incorporating SPCA results on a map -------- Message original -------- Sujet: Help: incorporating SPCA results on a map Date : Thu, 28 Nov 2013 09:50:00 +0400 De : Emmanuel Wicker Organisation : CIRAD-UMR PVBMT Pour : adegenet-forum-request at lists.r-forge.r-project.org Dear adegenet users I am relatively new in using ADEGENET, especially sPCA. I would like to draw my SPCA output results on a map ("map" object), that I successfully imported in the genind file. The command plot.spca works, but I don't know to which argument I should affect the map. Thank you in advance for your help Manu -- Emmanuel WICKER, PhD Phytopathologiste / Plant Pathologist CIRAD, UMR Peuplements V?g?taux et Bioagresseurs en Milieu Tropical P?le de Protection des Plantes 7, chemin de l'IRAT F-97410 Saint Pierre La R?union, France wicker at cirad.fr http://umr-pvbmt.cirad.fr/ Tel : 0262 49 92 42 fax : 0262 49 92 93 >From abroad Tel : 00 262 262 49 92 42 Fax :00 262 262 49 92 93 From t.jombart at imperial.ac.uk Wed Dec 4 09:53:07 2013 From: t.jombart at imperial.ac.uk (Jombart, Thibaut) Date: Wed, 4 Dec 2013 08:53:07 +0000 Subject: [adegenet-forum] seeking advice on how to use DAPC grouping in association genetics In-Reply-To: <529D8E09.6090606@clermont.inra.fr> References: <529CA417.8040509@clermont.inra.fr>, <529D8E09.6090606@clermont.inra.fr> Message-ID: <2CB2DA8E426F3541AB1907F98ABA65706391B9D3@icexch-m1.ic.ac.uk> Hi there, yes, $ind.coord is what you want to use. 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 Matthieu BOGARD [matthieu.bogard at clermont.inra.fr] Sent: 03 December 2013 07:53 To: adegenet-forum at lists.r-forge.r-project.org Subject: [adegenet-forum] seeking advice on how to use DAPC grouping in association genetics Dear Thibaut, Thank you very much for your answer. I hope you don't mind if I ask you some precisions: At the moment, I used the following code to extract individuals coordinates but I'm not sure this is what you meant when you said "As an alternative, you can use the discriminant functions of the DAPC": gen <- df2genind(gen, sep="", ploidy=2) grp <- find.clusters(gen) dapc2 <- dapc(gen, grp$grp, n.da=100, n.pca=50) temp <- optim.a.score(dapc2) OptimalNbPCA <- temp$best dapc3 <- dapc(gen, grp$grp, n.da=100, n.pca=OptimalNbPCA) dapc3$ind.coord If this is wrong, could you please precise how to extract the discriminant functions of the DAPC? Cheers, Matthieu Le 23/11/2013 17:07, Jombart, Thibaut a ?crit : > Hi there, > > there are several ways you can do this. > > First, the groups being known, you can simply remove entirely all potential stratification by regressing your genetic data (or your response variable) onto the group membership vectors using a simple ANOVA (and keeping the residuals of the corresponding model). This could be an overkill though, as stratification may be mainly concerning sets of your groups (expl: groups 1-2 vs groups 3-5). As an alternative, you can use the discriminant functions of the DAPC as regressors, and keep the residuals. > > In any case, the operation will look like: > > new.x <- residuals(lm(x ~ myRegressor)) > > Please consider using the forum for such questions - other people may be interested in the answer. See section 'contacts' on: > http://adegenet.r-forge.r-project.org/ > > Cheers > Thibaut > > > ________________________________________ > From: Matthieu BOGARD [matthieu.bogard at clermont.inra.fr] > Sent: 21 November 2013 16:04 > To: Jombart, Thibaut > Subject: seeking advice on how to use DAPC grouping in association genetics > > Dear Thibault, > > I'm currently carrying an association genetics study on earliness in > wheat. I've been looking at stratification of my panel with the DAPC > method you described in Jombart et al. 2010. > > Could you please advise me on the best way to take into account panel > stratification in the model testing single marker association? > > At the moment, I was thinking of using the group membership > probabilities output in DAPC{} of the k-1 groups (with k the total > number of groups) as people usually do with group membership > probabilities output in STRUCTURE (Price, Pritchard et al. software). Do > you think that would be right or would you prevent doing this? Is there > another way to do so by using the PCA coordinates of individuals for > example? > > Your help would be much apreciated. > > Kind regards, > Matthieu BOGARD > > _______________________________________________ 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 mayalopez at gmail.com Mon Dec 9 19:42:28 2013 From: mayalopez at gmail.com (Margarita Lopez Uribe) Date: Mon, 9 Dec 2013 13:42:28 -0500 Subject: [adegenet-forum] sPCA - xy coordinate matrix Message-ID: Dear all, I am relatively new to ADEGENET. I have used this program in the past for DAPC and now I am trying to use sPCA. What I usually do is import genepop files into genind files to work in adegenet. However, for the sPCA I need to add the binary L mastrix as an xy coordinate object. I have tried adding the L matrix after the last individual of the genepop file (as shown below), but adegenet cannot read the file. I would really appreciate it if someone can help me get started with the input file. It is a very basic question, but I read the sPCA documentation and it is not clear how you add this matrix to your file. Thanks in advance for your help. Best, Margarita ___________________ Microsatellite dataset PP4, PP8, PP11, PP356, PP420, PP588 Pop Pep001_NYI, 220220 154154 194194 130130 380380 430430 Pep002_NYI, 220220 154154 194194 130130 372372 430430 Pep003_NYI, 218218 154154 194194 130130 380380 431431 .... Pep655_CA, 226226 146146 194194 134134 372372 428428 Pep656_CA, 226226 146146 194194 134134 372372 428428 Pep657_CA, 226226 146146 194194 134134 372372 428428 xy Pep001_NYI Pep002_NYI 1 Pep002_NYI Pep003_NYI 1 .... .... Pep001_NYI Pep655_CA, 0 -------------- next part -------------- An HTML attachment was scrubbed... URL: From t.jombart at imperial.ac.uk Tue Dec 10 04:16:12 2013 From: t.jombart at imperial.ac.uk (Jombart, Thibaut) Date: Tue, 10 Dec 2013 03:16:12 +0000 Subject: [adegenet-forum] sPCA - xy coordinate matrix In-Reply-To: References: Message-ID: <2CB2DA8E426F3541AB1907F98ABA65706391EF54@icexch-m1.ic.ac.uk> Hello there, I don't think the basic genepop format handles information beside the markers themselves. The easiest way for you to proceed is to have xy coordinates in a separate file (e.g. csv or tab-delimited txt file), read them into R using read.csv (csv file) or read.table (tab-delimited txt file), and then pass the xy coordinates as argument to the sPCA function (see ?spca and sPCA vignette). This will look like: ### myXY <- read.csv("myFilewithXY.csv") # read xy coord head(myXY) # check that it's OK spca1 <- spca(myGenindObject, xy=myXY) ### Note that this is assuming that your xy coordinates are in the same order as the genotypes in your .gen file. 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 Margarita Lopez Uribe [mayalopez at gmail.com] Sent: 09 December 2013 18:42 To: adegenet-forum at lists.r-forge.r-project.org Subject: [adegenet-forum] sPCA - xy coordinate matrix Dear all, I am relatively new to ADEGENET. I have used this program in the past for DAPC and now I am trying to use sPCA. What I usually do is import genepop files into genind files to work in adegenet. However, for the sPCA I need to add the binary L mastrix as an xy coordinate object. I have tried adding the L matrix after the last individual of the genepop file (as shown below), but adegenet cannot read the file. I would really appreciate it if someone can help me get started with the input file. It is a very basic question, but I read the sPCA documentation and it is not clear how you add this matrix to your file. Thanks in advance for your help. Best, Margarita ___________________ Microsatellite dataset PP4, PP8, PP11, PP356, PP420, PP588 Pop Pep001_NYI, 220220 154154 194194 130130 380380 430430 Pep002_NYI, 220220 154154 194194 130130 372372 430430 Pep003_NYI, 218218 154154 194194 130130 380380 431431 .... Pep655_CA, 226226 146146 194194 134134 372372 428428 Pep656_CA, 226226 146146 194194 134134 372372 428428 Pep657_CA, 226226 146146 194194 134134 372372 428428 xy Pep001_NYI Pep002_NYI 1 Pep002_NYI Pep003_NYI 1 .... .... Pep001_NYI Pep655_CA, 0 From Willyard at hendrix.edu Sat Dec 14 21:40:46 2013 From: Willyard at hendrix.edu (Willyard, Ann) Date: Sat, 14 Dec 2013 14:40:46 -0600 Subject: [adegenet-forum] error on find.clusters Message-ID: <1EA534317955F049B658EA656C2FBF78039C6C21F4BD@HNXEXCH.hendrix.local> On my way to DAPC, I am stuck on an error finding clusters: > grp <- find.clusters(a, max.n.clust=40) Error in if (nf > rank) nf <- rank : missing value where TRUE/FALSE needed I imported an SSR matrix that has 1022 individuals, 6 loci, and 47 populations: >df <- read.loci(file.choose(), loci.sep=",", col.pop=2, col.loci=3:8) And created a Genuind object using >loci<-df[,3:8] >pop<-df[,2] >sample<-df[,1] >a <- df2genind (loci, ncode=3, sep = ",", missing = NA, ploidy = 1, >pop=pop, ind.names=sample) And confirmed that it is in the correct format using: print(a, details = TRUE) ##################### ### Genind object ### ##################### - genotypes of individuals - S4 class: genind @call: df2genind(X = loci, sep = ",", ncode = 3, ind.names = sample, pop = pop, missing = NA, ploidy = 1) @tab: 1022 x 6 matrix of genotypes @ind.names: vector of 1022 individual names @loc.names: vector of 6 locus names @loc.nall: number of alleles per locus @loc.fac: locus factor for the 6 columns of @tab @all.names: list of 6 components yielding allele names for each locus @ploidy: 1 @type: codom Optionnal contents: @pop: factor giving the population of each individual @pop.names: factor giving the population of each individual @other: - empty - I am running 32 bit R version on a Windows 7 PC. I unintalled my R vers. 2.15.3 and installed R. vers. 3.0.2. I have adegenet vers. 1.3-9.2. According to your web page, this is the most recent stable version, although adegenet-basics.pdf indicates that the adegenet version should be 1.4. I have loaded the adegenet, pegas, MASS, and ade4 libraries. I have searched the FAQ and every other source I can think of. Help for an adegenet newbie will be most appreciated. NSF proposal deadline is looming ...... Ann Willyard Assistant Professor Hendrix College 1600 Washington Ave Conway AR 72032 501-450-1376 Willyard at hendrix.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: From t.jombart at imperial.ac.uk Sun Dec 15 06:25:30 2013 From: t.jombart at imperial.ac.uk (Jombart, Thibaut) Date: Sun, 15 Dec 2013 05:25:30 +0000 Subject: [adegenet-forum] error on find.clusters In-Reply-To: <1EA534317955F049B658EA656C2FBF78039C6C21F4BD@HNXEXCH.hendrix.local> References: <1EA534317955F049B658EA656C2FBF78039C6C21F4BD@HNXEXCH.hendrix.local> Message-ID: <2CB2DA8E426F3541AB1907F98ABA6570639204D9@icexch-m1.ic.ac.uk> Dear Ann, your script looks good to me, so it may be a quirk in find.clusters. Can you please send me a sample dataset / code to reproduce the error off the ML? 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: adegenet-forum-bounces at lists.r-forge.r-project.org [adegenet-forum-bounces at lists.r-forge.r-project.org] on behalf of Willyard, Ann [Willyard at hendrix.edu] Sent: 14 December 2013 20:40 To: adegenet-forum at lists.r-forge.r-project.org Subject: [adegenet-forum] error on find.clusters On my way to DAPC, I am stuck on an error finding clusters: > grp <- find.clusters(a, max.n.clust=40) Error in if (nf > rank) nf <- rank : missing value where TRUE/FALSE needed I imported an SSR matrix that has 1022 individuals, 6 loci, and 47 populations: >df <- read.loci(file.choose(), loci.sep=",", col.pop=2, col.loci=3:8) And created a Genuind object using >loci<-df[,3:8] >pop<-df[,2] >sample<-df[,1] >a <- df2genind (loci, ncode=3, sep = ",", missing = NA, ploidy = 1, >pop=pop, ind.names=sample) And confirmed that it is in the correct format using: print(a, details = TRUE) ##################### ### Genind object ### ##################### - genotypes of individuals - S4 class: genind @call: df2genind(X = loci, sep = ",", ncode = 3, ind.names = sample, pop = pop, missing = NA, ploidy = 1) @tab: 1022 x 6 matrix of genotypes @ind.names: vector of 1022 individual names @loc.names: vector of 6 locus names @loc.nall: number of alleles per locus @loc.fac: locus factor for the 6 columns of @tab @all.names: list of 6 components yielding allele names for each locus @ploidy: 1 @type: codom Optionnal contents: @pop: factor giving the population of each individual @pop.names: factor giving the population of each individual @other: - empty - I am running 32 bit R version on a Windows 7 PC. I unintalled my R vers. 2.15.3 and installed R. vers. 3.0.2. I have adegenet vers. 1.3-9.2. According to your web page, this is the most recent stable version, although adegenet-basics.pdf indicates that the adegenet version should be 1.4. I have loaded the adegenet, pegas, MASS, and ade4 libraries. I have searched the FAQ and every other source I can think of. Help for an adegenet newbie will be most appreciated. NSF proposal deadline is looming ?? Ann Willyard Assistant Professor Hendrix College 1600 Washington Ave Conway AR 72032 501-450-1376 Willyard at hendrix.edu From t.jombart at imperial.ac.uk Mon Dec 16 04:21:12 2013 From: t.jombart at imperial.ac.uk (Jombart, Thibaut) Date: Mon, 16 Dec 2013 03:21:12 +0000 Subject: [adegenet-forum] error on find.clusters In-Reply-To: <1EA534317955F049B658EA656C2FBF78039C6C21F4BD@HNXEXCH.hendrix.local> References: <1EA534317955F049B658EA656C2FBF78039C6C21F4BD@HNXEXCH.hendrix.local> Message-ID: <2CB2DA8E426F3541AB1907F98ABA6570639206B6@icexch-m1.ic.ac.uk> Hello, thanks for sending the data off-list. As it turns out, there is an issue in your script. Your data are all "1" once recoded into a genind: > table(truenames(a)$tab) 1 6132 > alleles(a) $L1 1 "" $L2 1 "" $L3 1 "" $L4 1 "" $L5 1 "" $L6 1 "" Which comes from the conversion from pegas, but then I am not sure if it is a problem in pegas's function or in the way you used them. In any case, the classical conversion from a table using df2genind works: > dat <- read.csv("cpSSR_BigPuzzle.csv") > head(dat) X X.1 pt100783 PcG2R1 PcI1A2 PcI2T1 Pt71936 Pc10 1 A101 A1 125 106 206 277 163 208 2 A102 A1 125 106 205 278 163 207 3 A103 A1 126 105 205 278 163 207 4 A104 A1 126 105 205 278 163 207 5 A105 A1 125 106 205 278 164 207 6 A106 A1 126 106 205 278 164 207 > x <- df2genind(dat[,-c(1,2)], ind.names=dat[,1], pop=dat[,2], ploidy=1) > alleles(x) $L1 1 2 3 4 5 "124" "125" "126" "127" "128" $L2 1 2 3 4 5 "104" "105" "106" "107" "108" $L3 01 02 03 04 05 06 07 08 09 10 11 "200" "201" "202" "203" "204" "205" "206" "207" "208" "209" "210" $L4 1 2 3 4 5 6 7 8 "267" "276" "277" "278" "279" "280" "281" "288" $L5 1 2 3 4 5 6 7 8 9 "158" "159" "160" "161" "162" "163" "164" "165" "166" $L6 1 2 3 4 5 6 7 8 "205" "206" "207" "208" "209" "210" "211" "212" > clust <- find.clusters(x) # THIS WORKS In this case, the BIC profile suggests that there is no clear-cut number of clusters, but classifying individuals into around 10 groups would probably be a useful simplification. Cheers 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: adegenet-forum-bounces at lists.r-forge.r-project.org [adegenet-forum-bounces at lists.r-forge.r-project.org] on behalf of Willyard, Ann [Willyard at hendrix.edu] Sent: 14 December 2013 20:40 To: adegenet-forum at lists.r-forge.r-project.org Subject: [adegenet-forum] error on find.clusters On my way to DAPC, I am stuck on an error finding clusters: > grp <- find.clusters(a, max.n.clust=40) Error in if (nf > rank) nf <- rank : missing value where TRUE/FALSE needed I imported an SSR matrix that has 1022 individuals, 6 loci, and 47 populations: >df <- read.loci(file.choose(), loci.sep=",", col.pop=2, col.loci=3:8) And created a Genuind object using >loci<-df[,3:8] >pop<-df[,2] >sample<-df[,1] >a <- df2genind (loci, ncode=3, sep = ",", missing = NA, ploidy = 1, >pop=pop, ind.names=sample) And confirmed that it is in the correct format using: print(a, details = TRUE) ##################### ### Genind object ### ##################### - genotypes of individuals - S4 class: genind @call: df2genind(X = loci, sep = ",", ncode = 3, ind.names = sample, pop = pop, missing = NA, ploidy = 1) @tab: 1022 x 6 matrix of genotypes @ind.names: vector of 1022 individual names @loc.names: vector of 6 locus names @loc.nall: number of alleles per locus @loc.fac: locus factor for the 6 columns of @tab @all.names: list of 6 components yielding allele names for each locus @ploidy: 1 @type: codom Optionnal contents: @pop: factor giving the population of each individual @pop.names: factor giving the population of each individual @other: - empty - I am running 32 bit R version on a Windows 7 PC. I unintalled my R vers. 2.15.3 and installed R. vers. 3.0.2. I have adegenet vers. 1.3-9.2. According to your web page, this is the most recent stable version, although adegenet-basics.pdf indicates that the adegenet version should be 1.4. I have loaded the adegenet, pegas, MASS, and ade4 libraries. I have searched the FAQ and every other source I can think of. Help for an adegenet newbie will be most appreciated. NSF proposal deadline is looming ?? Ann Willyard Assistant Professor Hendrix College 1600 Washington Ave Conway AR 72032 501-450-1376 Willyard at hendrix.edu From rita.castil at gmail.com Mon Dec 16 06:02:36 2013 From: rita.castil at gmail.com (Rita Castilho) Date: Mon, 16 Dec 2013 05:02:36 +0000 Subject: [adegenet-forum] DNAbin and pop Message-ID: <52AE896C.4030406@gmail.com> Hi! I am new to R and I have a lot of trouble in going from a phylip or fasta file to a genind object or fasta2DNAbin containing pop information. My files are always phylip or fasta files, and sequences have a reference composed of an di-alpha followed by 4 numeric digits (e.g. CD1495). The first two letters determine the population to which the sequence belongs to. Is there a quick way to do it instead of doing this, as the grouping factor can be easily deduced from the current individual labels, saving the task of read that info R separately? #reading data dna<- fasta2DNAbin('data.fas') # setting pops data.pop<- as.factor(rep(c('AD', 'CD', 'FR', 'GE', 'RE', 'OT', 'YU', 'AU'), c(17,11,12,12, 25, 14, 13, 20))) Many thanks Rita -------------- next part -------------- An HTML attachment was scrubbed... URL: From t.jombart at imperial.ac.uk Mon Dec 16 06:33:58 2013 From: t.jombart at imperial.ac.uk (Jombart, Thibaut) Date: Mon, 16 Dec 2013 05:33:58 +0000 Subject: [adegenet-forum] DNAbin and pop In-Reply-To: <52AE896C.4030406@gmail.com> References: <52AE896C.4030406@gmail.com> Message-ID: <2CB2DA8E426F3541AB1907F98ABA657075F13A67@icexch-m2.ic.ac.uk> Hello, yes, there are simpler ways. sub/gsub and regular expressions are immensely useful to extract information contained in the labels of sequences. For instance: ## > lab <- c("AD01012","AD666","FR1212","AD0101","FR9873") > lab [1] "AD01012" "AD666" "FR1212" "AD0101" "FR9873" > pop <- gsub("[[:digit:]]","",lab) > pop [1] "AD" "AD" "FR" "AD" "FR" ## For some useful examples, see ?sub and ?regexp 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 Rita Castilho [rita.castil at gmail.com] Sent: 16 December 2013 05:02 To: adegenet-forum at lists.r-forge.r-project.org Subject: [adegenet-forum] DNAbin and pop Hi! I am new to R and I have a lot of trouble in going from a phylip or fasta file to a genind object or fasta2DNAbin containing pop information. My files are always phylip or fasta files, and sequences have a reference composed of an di-alpha followed by 4 numeric digits (e.g. CD1495). The first two letters determine the population to which the sequence belongs to. Is there a quick way to do it instead of doing this, as the grouping factor can be easily deduced from the current individual labels, saving the task of read that info R separately? #reading data dna <- fasta2DNAbin('data.fas') # setting pops data.pop <- as.factor(rep(c('AD', 'CD', 'FR', 'GE', 'RE', 'OT', 'YU', 'AU'), c(17, 11, 12, 12, 25, 14, 13, 20))) Many thanks Rita From rita.castil at gmail.com Mon Dec 16 07:42:34 2013 From: rita.castil at gmail.com (Rita Castilho) Date: Mon, 16 Dec 2013 06:42:34 +0000 Subject: [adegenet-forum] DNAbin and pop In-Reply-To: <2CB2DA8E426F3541AB1907F98ABA657075F13A67@icexch-m2.ic.ac.uk> References: <52AE896C.4030406@gmail.com> <2CB2DA8E426F3541AB1907F98ABA657075F13A67@icexch-m2.ic.ac.uk> Message-ID: <52AEA0DA.6050807@gmail.com> Dear Thibaut Thanks for the prompt reply! Unfortunately I do not see how that improves on the example given. When one uses allelic data, there are simple (automatic) ways to build a genind object that includes the factor pop or even a xy coordinates factor. That is because the read.file functions available include that possibility (read.genepop, retains the pop info, read.genalex, retains pop, and xy info). And there is no need of further manipulations. So I was looking for something similar, perhaps not a read.file function, because read.fasta does not include that, but a set of scritps that will do it. I saw another previous suggestion of yours, but it implies still an extra file: popFac <- read.csv("oneColumnFileWithMyGroupsInIt.csv") popFac <- factor(unlist(popFac)) pop(obj) <- popFac and in any case I could not understand how to use it, as I get an error: data.dnabin <- fasta2DNAbin("Engraulis_P3_mtDNA.fas") popFac <- read.csv("Engraulis_P3_mtDNA_pops.csv") popFac <- factor(unlist(popFac)) pop(data.dnabin) <- popFac Error in (function (classes, fdef, mtable) : unable to find an inherited method for function 'pop<-' for signature '"DNAbin"' It would be neat to have a way of reading from the fasta/phylip files the first two letters, and use them as factors. I am not familiarized with R enough to be able to do it. I just use the packages, and most of the times I have a hard time to get things working, because the departure examples include R.data, which are not very useful for the beginners. In any case I appreciate your efforts towards programming for the community! Best Rita > Jombart, Thibaut > December 16, 2013 5:33 AM > Hello, > > yes, there are simpler ways. sub/gsub and regular expressions are immensely useful to extract information contained in the labels of sequences. > > For instance: > ## >> lab<- c("AD01012","AD666","FR1212","AD0101","FR9873") >> lab > [1] "AD01012" "AD666" "FR1212" "AD0101" "FR9873" >> pop<- gsub("[[:digit:]]","",lab) >> pop > [1] "AD" "AD" "FR" "AD" "FR" > ## > > For some useful examples, see ?sub and ?regexp > > 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 Rita Castilho [rita.castil at gmail.com] > Sent: 16 December 2013 05:02 > To: adegenet-forum at lists.r-forge.r-project.org > Subject: [adegenet-forum] DNAbin and pop > > Hi! > I am new to R and I have a lot of trouble in going from a phylip or fasta file to a genind object or fasta2DNAbin containing pop information. > My files are always phylip or fasta files, and sequences have a reference composed of an di-alpha followed by 4 numeric digits (e.g. CD1495). The first two letters determine the population to which the sequence belongs to. > > Is there a quick way to do it instead of doing this, as the grouping factor can be easily deduced from the current individual labels, saving the task of read that info R separately? > > #reading data > dna<- fasta2DNAbin('data.fas') > # setting pops > data.pop<- as.factor(rep(c('AD', 'CD', 'FR', 'GE', 'RE', 'OT', 'YU', 'AU'), c(17, 11, 12, 12, 25, 14, 13, 20))) > > Many thanks > Rita > > > Rita Castilho > December 16, 2013 5:02 AM > Hi! > I am new to R and I have a lot of trouble in going from a phylip or > fasta file to a genind object or fasta2DNAbin containing pop information. > My files are always phylip or fasta files, and sequences have a > reference composed of an di-alpha followed by 4 numeric digits (e.g. > CD1495). The first two letters determine the population to which the > sequence belongs to. > > Is there a quick way to do it instead of doing this, as the grouping > factor can be easily deduced from the current individual labels, > saving the task of read that info R separately? > > #reading data > dna <- fasta2DNAbin('data.fas') > # setting pops > data.pop <- as.factor(rep(c('AD', 'CD', 'FR', 'GE', 'RE', 'OT', 'YU', > 'AU'), c(17, 11, 12, 12, 25, 14,13,20))) > > Many thanks > Rita -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: compose-unknown-contact.jpg Type: image/jpeg Size: 770 bytes Desc: not available URL: From t.jombart at imperial.ac.uk Mon Dec 16 08:02:11 2013 From: t.jombart at imperial.ac.uk (Jombart, Thibaut) Date: Mon, 16 Dec 2013 07:02:11 +0000 Subject: [adegenet-forum] DNAbin and pop In-Reply-To: <52AEA0DA.6050807@gmail.com> References: <52AE896C.4030406@gmail.com> <2CB2DA8E426F3541AB1907F98ABA657075F13A67@icexch-m2.ic.ac.uk>, <52AEA0DA.6050807@gmail.com> Message-ID: <2CB2DA8E426F3541AB1907F98ABA657075F13AB4@icexch-m2.ic.ac.uk> Hello, no, it does improve on your first script drastically. You had to enter manually the population factor in R; now you can just process the names of your sequences to extract this information automatically with one short command (gsub(...)). In : gsub("[[:digit:]]","",lab) you just need to replace 'lab' with the labels of your sequences (labels(youDNAbinObject). What you are asking for won't be possible because fasta files only store 1) one sequence label and 2) the sequence. However, since we are talking of just one extra command line, I think this is still an efficient way to do things. There is no storage of population information in DNAbin objects, so pop(...) won't work. If you want to store both data in a single object, you can use a list where $dna will be your DNAbin and $pop will be a population. > It would be neat to have a way of reading from the fasta/phylip files the first two letters, and use them as factors No, it would not, because this is not part of the format definition nor a common practice (though storing info in the sequence labels is). > because the departure examples include R.data, which are not very useful for the beginners. RData are usually easier to distribute alongside a R package. However, this is not always the case. Examples with non RData inputs include: - read.genetix - read.fstat - read.genepop - read.structure - read.snp - read.dna - fasta2DNAbin - ... You can find at least 2 tutorials on adegenet's website with non-RData input files (actually, fasta files). 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 Rita Castilho [rita.castil at gmail.com] Sent: 16 December 2013 06:42 To: adegenet-forum at lists.r-forge.r-project.org Subject: Re: [adegenet-forum] DNAbin and pop Dear Thibaut Thanks for the prompt reply! Unfortunately I do not see how that improves on the example given. When one uses allelic data, there are simple (automatic) ways to build a genind object that includes the factor pop or even a xy coordinates factor. That is because the read.file functions available include that possibility (read.genepop, retains the pop info, read.genalex, retains pop, and xy info). And there is no need of further manipulations. So I was looking for something similar, perhaps not a read.file function, because read.fasta does not include that, but a set of scritps that will do it. I saw another previous suggestion of yours, but it implies still an extra file: popFac <- read.csv("oneColumnFileWithMyGroupsInIt.csv") popFac <- factor(unlist(popFac)) pop(obj) <- popFac and in any case I could not understand how to use it, as I get an error: data.dnabin <- fasta2DNAbin("Engraulis_P3_mtDNA.fas") popFac <- read.csv("Engraulis_P3_mtDNA_pops.csv") popFac <- factor(unlist(popFac)) pop(data.dnabin) <- popFac Error in (function (classes, fdef, mtable) : unable to find an inherited method for function ?pop<-? for signature ?"DNAbin"? It would be neat to have a way of reading from the fasta/phylip files the first two letters, and use them as factors. I am not familiarized with R enough to be able to do it. I just use the packages, and most of the times I have a hard time to get things working, because the departure examples include R.data, which are not very useful for the beginners. In any case I appreciate your efforts towards programming for the community! Best Rita [cid:part1.05070704.06000907 at gmail.com] Jombart, Thibaut December 16, 2013 5:33 AM Hello, yes, there are simpler ways. sub/gsub and regular expressions are immensely useful to extract information contained in the labels of sequences. For instance: ## lab <- c("AD01012","AD666","FR1212","AD0101","FR9873") lab [1] "AD01012" "AD666" "FR1212" "AD0101" "FR9873" pop <- gsub("[[:digit:]]","",lab) pop [1] "AD" "AD" "FR" "AD" "FR" ## For some useful examples, see ?sub and ?regexp 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 Rita Castilho [rita.castil at gmail.com] Sent: 16 December 2013 05:02 To: adegenet-forum at lists.r-forge.r-project.org Subject: [adegenet-forum] DNAbin and pop Hi! I am new to R and I have a lot of trouble in going from a phylip or fasta file to a genind object or fasta2DNAbin containing pop information. My files are always phylip or fasta files, and sequences have a reference composed of an di-alpha followed by 4 numeric digits (e.g. CD1495). The first two letters determine the population to which the sequence belongs to. Is there a quick way to do it instead of doing this, as the grouping factor can be easily deduced from the current individual labels, saving the task of read that info R separately? #reading data dna <- fasta2DNAbin('data.fas') # setting pops data.pop <- as.factor(rep(c('AD', 'CD', 'FR', 'GE', 'RE', 'OT', 'YU', 'AU'), c(17, 11, 12, 12, 25, 14, 13, 20))) Many thanks Rita [cid:part1.05070704.06000907 at gmail.com] Rita Castilho December 16, 2013 5:02 AM Hi! I am new to R and I have a lot of trouble in going from a phylip or fasta file to a genind object or fasta2DNAbin containing pop information. My files are always phylip or fasta files, and sequences have a reference composed of an di-alpha followed by 4 numeric digits (e.g. CD1495). The first two letters determine the population to which the sequence belongs to. Is there a quick way to do it instead of doing this, as the grouping factor can be easily deduced from the current individual labels, saving the task of read that info R separately? #reading data dna <- fasta2DNAbin('data.fas') # setting pops data.pop <- as.factor(rep(c('AD', 'CD', 'FR', 'GE', 'RE', 'OT', 'YU', 'AU'), c(17, 11, 12, 12, 25, 14, 13, 20))) Many thanks Rita -------------- next part -------------- A non-text attachment was scrubbed... Name: compose-unknown-contact.jpg Type: image/jpeg Size: 770 bytes Desc: compose-unknown-contact.jpg URL: From tohamyy at yahoo.com Wed Dec 18 09:44:28 2013 From: tohamyy at yahoo.com (Tohamy Yousef) Date: Wed, 18 Dec 2013 00:44:28 -0800 (PST) Subject: [adegenet-forum] Inbreeding coefficient calculation by adegenet Message-ID: <1387356268.84469.YahooMailNeo@web121104.mail.ne1.yahoo.com> 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: finalFiltered_noLowCov_e0_LOCUS_10.stru Type: application/octet-stream Size: 2975331 bytes Desc: not available URL: From t.jombart at imperial.ac.uk Wed Dec 18 09:55:05 2013 From: t.jombart at imperial.ac.uk (Jombart, Thibaut) Date: Wed, 18 Dec 2013 08:55:05 +0000 Subject: [adegenet-forum] Inbreeding coefficient calculation by adegenet In-Reply-To: <1387356268.84469.YahooMailNeo@web121104.mail.ne1.yahoo.com> References: <1387356268.84469.YahooMailNeo@web121104.mail.ne1.yahoo.com> Message-ID: <2CB2DA8E426F3541AB1907F98ABA657075F1EC54@icexch-m1.ic.ac.uk> Hello, I can't seem to read your data using the command line provided: #### > toto<-read.structure(file="finalFiltered_noLowCov_e0_LOCUS_10.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... Error in txt[(lastline - n + 1):lastline] : only 0's may be mixed with negative subscripts #### Less individuals in the sample data maybe? Cheers 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: 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 From t.jombart at imperial.ac.uk Thu Dec 19 06:32:13 2013 From: t.jombart at imperial.ac.uk (Jombart, Thibaut) Date: Thu, 19 Dec 2013 05:32:13 +0000 Subject: [adegenet-forum] Inbreeding coefficient calculation by adegenet In-Reply-To: <1387356268.84469.YahooMailNeo@web121104.mail.ne1.yahoo.com> References: <1387356268.84469.YahooMailNeo@web121104.mail.ne1.yahoo.com> Message-ID: <2CB2DA8E426F3541AB1907F98ABA657075F34DF5@icexch-m1.ic.ac.uk> 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 -------------- A non-text attachment was scrubbed... Name: inbreeding.R Type: application/octet-stream Size: 5793 bytes Desc: inbreeding.R URL: From adamrickbessa at gmail.com Thu Dec 19 07:52:03 2013 From: adamrickbessa at gmail.com (Adam Rick Bessa) Date: Thu, 19 Dec 2013 04:52:03 -0200 Subject: [adegenet-forum] Help with SPCA Message-ID: Dear Jombart; I'm trying to use the SPCA in package adegenet, but I'm finding it difficult to assemble the input data. I would love some guidance how to assemble the data of the microsatellite with the geographic coordinates. Thanks very much for your help Adam Rick -------------- next part -------------- An HTML attachment was scrubbed... URL: From t.jombart at imperial.ac.uk Thu Dec 19 09:46:11 2013 From: t.jombart at imperial.ac.uk (Jombart, Thibaut) Date: Thu, 19 Dec 2013 08:46:11 +0000 Subject: [adegenet-forum] Help with SPCA In-Reply-To: References: Message-ID: <2CB2DA8E426F3541AB1907F98ABA657075F34E8A@icexch-m1.ic.ac.uk> Hello, please have a look at the sPCA vignette/tutorial - see section 'documents' on: http://adegenet.r-forge.r-project.org/ The 'basics' vignette can also be useful, as you'll have details on how to import data into adegenet. Also look in the archives as there were recent emails on this topic 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 Adam Rick Bessa [adamrickbessa at gmail.com] Sent: 19 December 2013 06:52 To: adegenet-forum at lists.r-forge.r-project.org Subject: [adegenet-forum] Help with SPCA Dear Jombart; I'm trying to use the SPCA in package adegenet, but I'm finding it difficult to assemble the input data. I would love some guidance how to assemble the data of the microsatellite with the geographic coordinates. Thanks very much for your help Adam Rick From peter.rooney at blueyonder.co.uk Sun Dec 22 19:14:51 2013 From: peter.rooney at blueyonder.co.uk (Peter) Date: Sun, 22 Dec 2013 18:14:51 -0000 Subject: [adegenet-forum] Delaunay Triangulation editing Message-ID: <002b01ceff41$b5287e10$1f797a30$@blueyonder.co.uk> Dear all, I am using adegenet sPCA for the first time, so apologies if this has been asked before, however, I couldn't find any information from a search of the archives. I wish to edit the Delaunay triangulation to be used in an sPCA analysis. I have successfully created the Neighbour List object using chooseCN from my data, but the editor it invokes, "edit.cn", is very difficult to use, displays my data very poorly (many nodes are too close on the screen image), and doesn't appear to reference its nodes with the individual ids in my data. Therefore, I wonder if anyone could describe another way, in R or not, that I could use to remove some of the unwanted edges in the triangulation? Many thanks for your help. Peter -------------- next part -------------- An HTML attachment was scrubbed... URL: From rita.castil at gmail.com Sat Dec 21 19:07:44 2013 From: rita.castil at gmail.com (Rita Castilho) Date: Sat, 21 Dec 2013 18:07:44 +0000 Subject: [adegenet-forum] DAPC a priori grouping and find.clusters Message-ID: <52B5D8F0.5070607@gmail.com> Hi, I am trying to get two DAPCs done: 1. a DAPC1 that displays the a priori established groups (in this case a complex of 5 nominal species) and 2. a DAPC2 that displays the genetic gorups, with no a priori determination= K clusters I have produced two scatter plots for these two DAPCs which are attached. The first graph (DAPC1) seems to have a y-axis clear division, and I was expecting that DAPC2 would display that. But DAPC2 shows a horizontal grouping. Maybe my scripts are not correct. Does anyone can comment if the code is correct, or am I making some very basic mistakes? Many thanks, Rita The coding I am using is the following: data.gp <- read.genepop('infile.gen') #perform temporary DAPC dapc <- dapc(data.gp, pop=NULL, n.pca=NULL, n.da=NULL) a=optim.a.score(dapc, n.pca = 1:ncol(dapc$tab), smart=TRUE, n=10, plot=TRUE, n.sim=100, n.da=length(levels(dapc$grp))) ##perform DAPC based on species dapc.species <- dapc(data.gp, pop=NULL, n.pca=a$best, n.da=NULL, scale=FALSE, truenames=FALSE, all.contrib=TRUE) <<<<<<<<<<<>>>>>>>>>>>>> #FIND CLUSTERS################################## clusters <- find.clusters(data.gp, choose.n.clust=TRUE,criterion=c("diffNgroup"), n.pca=a$best,n.clust=NULL, stat='BIC', max.n.clust=10) dapc.clusters<- dapc(data.gp, grp=clusters$grp, n.pca=a$best) <<<<<<<<<<<>>>>>>>>>>>>> -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Forum.png Type: image/png Size: 31783 bytes Desc: not available URL: From t.jombart at imperial.ac.uk Mon Dec 23 04:10:23 2013 From: t.jombart at imperial.ac.uk (Jombart, Thibaut) Date: Mon, 23 Dec 2013 03:10:23 +0000 Subject: [adegenet-forum] DAPC a priori grouping and find.clusters In-Reply-To: <52B5D8F0.5070607@gmail.com> References: <52B5D8F0.5070607@gmail.com> Message-ID: <2CB2DA8E426F3541AB1907F98ABA657075F367F9@icexch-m1.ic.ac.uk> Hello, the discrimination of groups is always better on axes of lower rank, and by default the lower ranks are always represented on the x-axis. So in this case, the better differentiation is actually on your x-axis for graph #1. Graph #2 puzzles me a little. There is always at maximum K-1 discriminant axes, so when K=2 there is only one axis to be plotted. I'm not sure how you got two axes there... Plus the ellipses are missing, suggesting this is not the basic graph. 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 Rita Castilho [rita.castil at gmail.com] Sent: 21 December 2013 18:07 To: adegenet-forum at lists.r-forge.r-project.org Subject: [adegenet-forum] DAPC a priori grouping and find.clusters Hi, I am trying to get two DAPCs done: 1. a DAPC1 that displays the a priori established groups (in this case a complex of 5 nominal species) and 2. a DAPC2 that displays the genetic gorups, with no a priori determination= K clusters I have produced two scatter plots for these two DAPCs which are attached. The first graph (DAPC1) seems to have a y-axis clear division, and I was expecting that DAPC2 would display that. But DAPC2 shows a horizontal grouping. Maybe my scripts are not correct. Does anyone can comment if the code is correct, or am I making some very basic mistakes? Many thanks, Rita The coding I am using is the following: data.gp <- read.genepop('infile.gen') #perform temporary DAPC dapc <- dapc(data.gp, pop=NULL, n.pca=NULL, n.da=NULL) a=optim.a.score(dapc, n.pca = 1:ncol(dapc$tab), smart=TRUE, n=10, plot=TRUE, n.sim=100, n.da=length(levels(dapc$grp))) ##perform DAPC based on species dapc.species <- dapc(data.gp, pop=NULL, n.pca=a$best, n.da=NULL, scale=FALSE, truenames=FALSE, all.contrib=TRUE) <<<<<<<<<<<>>>>>>>>>>>>> #FIND CLUSTERS################################## clusters <- find.clusters(data.gp, choose.n.clust=TRUE,criterion=c("diffNgroup"), n.pca=a$best,n.clust=NULL, stat='BIC', max.n.clust=10) dapc.clusters<- dapc(data.gp, grp=clusters$grp, n.pca=a$best) <<<<<<<<<<<>>>>>>>>>>>>> From t.jombart at imperial.ac.uk Mon Dec 23 04:03:32 2013 From: t.jombart at imperial.ac.uk (Jombart, Thibaut) Date: Mon, 23 Dec 2013 03:03:32 +0000 Subject: [adegenet-forum] Delaunay Triangulation editing In-Reply-To: <002b01ceff41$b5287e10$1f797a30$@blueyonder.co.uk> References: <002b01ceff41$b5287e10$1f797a30$@blueyonder.co.uk> Message-ID: <2CB2DA8E426F3541AB1907F98ABA657075F367DC@icexch-m1.ic.ac.uk> Hello, I had developed a package on R-forge which handles large spatial graphs in an interactive way. You can zoom in/out, move around, add/remove edges, etc. See vignette attached. The URL of the package website is there: https://r-forge.r-project.org/projects/geograph/ It works, but I never released it on CRAN and won't provide a lot of support for it. For your task, it may be total overkill though. Usually the only thing to change in Delaunay's graph are the peripheral edges connecting very distant points. If you have more than that to remove, maybe you should consider Gabriel's graph? Cheers 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: adegenet-forum-bounces at lists.r-forge.r-project.org [adegenet-forum-bounces at lists.r-forge.r-project.org] on behalf of Peter [peter.rooney at blueyonder.co.uk] Sent: 22 December 2013 18:14 To: adegenet-forum at lists.r-forge.r-project.org Subject: [adegenet-forum] Delaunay Triangulation editing Dear all, I am using adegenet sPCA for the first time, so apologies if this has been asked before, however, I couldn?t find any information from a search of the archives. I wish to edit the Delaunay triangulation to be used in an sPCA analysis. I have successfully created the Neighbour List object using chooseCN from my data, but the editor it invokes, ?edit.cn?, is very difficult to use, displays my data very poorly (many nodes are too close on the screen image), and doesn?t appear to reference its nodes with the individual ids in my data. Therefore, I wonder if anyone could describe another way, in R or not, that I could use to remove some of the unwanted edges in the triangulation? Many thanks for your help. Peter -------------- next part -------------- A non-text attachment was scrubbed... Name: geograph-basics.pdf Type: application/pdf Size: 1751659 bytes Desc: geograph-basics.pdf URL: From rita.castil at gmail.com Mon Dec 23 16:32:20 2013 From: rita.castil at gmail.com (Rita Castilho) Date: Mon, 23 Dec 2013 15:32:20 +0000 Subject: [adegenet-forum] DAPC a priori grouping and find.clusters In-Reply-To: <2CB2DA8E426F3541AB1907F98ABA657075F367F9@icexch-m1.ic.ac.uk> References: <52B5D8F0.5070607@gmail.com> <2CB2DA8E426F3541AB1907F98ABA657075F367F9@icexch-m1.ic.ac.uk> Message-ID: <52B85784.7000003@gmail.com> Hi! Here are the the scatter commands too. If I ask for ellipses, I get 5 (species) ellipses. But then, what is the meaning of the two colors (light blue and red)? And for two groups, what is the graphic solution? Thanks Rita #DAPC Analysis# #perform temporary DAPC dapc <- dapc(infile, pop=NULL, n.pca=NULL, n.da=NULL) ###evaluate number of PCAs to retain a=optim.a.score(dapc, n.pca = 1:ncol(dapc$tab), smart=TRUE, n=10, plot=TRUE, n.sim=100, n.da=length(levels(dapc$grp))) ##perform DAPC based on species dapc.species <- dapc(infile, pop=NULL, n.pca=a$best, n.da=NULL, scale=FALSE, truenames=FALSE, all.contrib=TRUE) scatter(dapc.species, xax=1, yax=2,col=rainbow(length(levels(dapc.species$grp))), clabel=0.8, bg="white", csub=0.5, pch=19, solid=1) <<<<<<<<<<<>>>>>>>>>>>>> #FIND CLUSTERS clusters <- find.clusters(data.gp, choose.n.clust=TRUE,criterion=c("diffNgroup"), n.pca=a$best,n.clust=NULL, stat='BIC', max.n.clust=10, n.iter=1e5, n.start=100) #data.clust<- find.clusters(data.gp, n.pca=a$best, choose=TRUE, stat="BIC", choose.n.clust=TRUE,criterion=c("diffNgroup"),max.n.clust=10) dapc.clusters<- dapc(data.gp, grp=clusters$grp, n.pca=a$best) scatter(dapc.clusters, xax=1, yax=2,col=rainbow(length(levels(clusters$grp))), clabel=0, bg="white", csub=0.5, pch=19, solid=1,cstar=0) <<<<<<<<<<<>>>>>>>>>>>>> > Jombart, Thibaut > December 23, 2013 3:10 AM > Hello, > > the discrimination of groups is always better on axes of lower rank, > and by default the lower ranks are always represented on the x-axis. > So in this case, the better differentiation is actually on your x-axis > for graph #1. > > Graph #2 puzzles me a little. There is always at maximum K-1 > discriminant axes, so when K=2 there is only one axis to be plotted. > I'm not sure how you got two axes there... Plus the ellipses are > missing, suggesting this is not the basic graph. > > 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 Rita > Castilho [rita.castil at gmail.com] > Sent: 21 December 2013 18:07 > To: adegenet-forum at lists.r-forge.r-project.org > Subject: [adegenet-forum] DAPC a priori grouping and find.clusters > > Hi, > > I am trying to get two DAPCs done: > 1. a DAPC1 that displays the a priori established groups (in this case > a complex of 5 nominal species) and > 2. a DAPC2 that displays the genetic gorups, with no a priori > determination= K clusters > > I have produced two scatter plots for these two DAPCs which are > attached. The first graph (DAPC1) seems to have a y-axis clear > division, and I was expecting that DAPC2 would display that. But DAPC2 > shows a horizontal grouping. > > Maybe my scripts are not correct. Does anyone can comment if the code > is correct, or am I making some very basic mistakes? > > Many thanks, > Rita > > > > The coding I am using is the following: > > data.gp <- read.genepop('infile.gen') > #perform temporary DAPC > dapc <- dapc(data.gp, pop=NULL, n.pca=NULL, n.da=NULL) > a=optim.a.score(dapc, n.pca = 1:ncol(dapc$tab), smart=TRUE, n=10, > plot=TRUE, n.sim=100, n.da=length(levels(dapc$grp))) > ##perform DAPC based on species > dapc.species <- dapc(data.gp, pop=NULL, n.pca=a$best, n.da=NULL, > scale=FALSE, truenames=FALSE, all.contrib=TRUE) > <<<<<<<<<<<>>>>>>>>>>>>> > > #FIND CLUSTERS################################## > clusters <- find.clusters(data.gp, > choose.n.clust=TRUE,criterion=c("diffNgroup"), > n.pca=a$best,n.clust=NULL, stat='BIC', max.n.clust=10) > dapc.clusters<- dapc(data.gp, grp=clusters$grp, n.pca=a$best) > <<<<<<<<<<<>>>>>>>>>>>>> > > > > Rita Castilho > December 21, 2013 6:07 PM > Hi, > > I am trying to get two DAPCs done: > 1. a DAPC1 that displays the a priori established groups (in this case > a complex of 5 nominal species) and > 2. a DAPC2 that displays the genetic gorups, with no a priori > determination= K clusters > > I have produced two scatter plots for these two DAPCs which are > attached. The first graph (DAPC1) seems to have a y-axis clear > division, and I was expecting that DAPC2 would display that. But DAPC2 > shows a horizontal grouping. > > Maybe my scripts are not correct. Does anyone can comment if the code > is correct, or am I making some very basic mistakes? > > Many thanks, > Rita > > > > The coding I am using is the following: > > data.gp <- read.genepop('infile.gen') > #perform temporary DAPC > dapc <- dapc(data.gp, pop=NULL, n.pca=NULL, n.da=NULL) > a=optim.a.score(dapc, n.pca = 1:ncol(dapc$tab), smart=TRUE, n=10, > plot=TRUE, n.sim=100, n.da=length(levels(dapc$grp))) > ##perform DAPC based on species > dapc.species <- dapc(data.gp, pop=NULL, n.pca=a$best, n.da=NULL, > scale=FALSE, truenames=FALSE, all.contrib=TRUE) > <<<<<<<<<<<>>>>>>>>>>>>> > > #FIND CLUSTERS################################## > clusters <- find.clusters(data.gp, > choose.n.clust=TRUE,criterion=c("diffNgroup"), > n.pca=a$best,n.clust=NULL, stat='BIC', max.n.clust=10) > dapc.clusters<- dapc(data.gp, grp=clusters$grp, n.pca=a$best) > <<<<<<<<<<<>>>>>>>>>>>>> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: compose-unknown-contact.jpg Type: image/jpeg Size: 770 bytes Desc: not available URL: From sun-ye at scib.ac.cn Mon Dec 30 01:50:52 2013 From: sun-ye at scib.ac.cn (sun-ye at scib.ac.cn) Date: Mon, 30 Dec 2013 08:50:52 +0800 (GMT+08:00) Subject: [adegenet-forum] Fw: unable to import a diploid dataset using read.strucutre Message-ID: <16c17f9.f676.14340fb5f70.Coremail.sun-ye@scib.ac.cn> Dear I am unable to import a diploid dataset using read.strucutre. I attached data, Can you help fix this? Thank you, Ye -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 14loci.stru Type: application/octet-stream Size: 7597 bytes Desc: not available URL: From sun-ye at scib.ac.cn Mon Dec 30 04:09:42 2013 From: sun-ye at scib.ac.cn (sun-ye at scib.ac.cn) Date: Mon, 30 Dec 2013 11:09:42 +0800 (GMT+08:00) Subject: [adegenet-forum] unable to import a diploid dataset using read.strucutre Message-ID: <15a7f97.1013c.143417a7b24.Coremail.sun-ye@scib.ac.cn> Dear I am unable to import a diploid dataset using read.strucutre. I always got an error: Converting data from a STRUCTURE .stru file to a genind object... df2genind(X = X, pop = pop, missing = missing, ploidy = 2) : 2 alleles cannot be coded by a total of 3 characters I paste data (104 individual, 14 loci), Can you help fix this? RADid_0000113 RADid_0000114 RADid_0000250 RADid_0000388 RADid_0000798 RADid_0001205 RADid_0001522 RADid_0001584 RADid_0001771 RADid_0002962 RADid_0003463 RADid_0003558 RADid_0004239 RADid_0004366 QCS10 1 0 2 2 -9 -9 -9 -9 -9 -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 1 8 1 1 3 6 2 2 3 3 3 3 1 1 FT20 12 0 1 1 2 2 -9 -9 1 1 2 2 1 1 2 2 1 4 1 1 3 3 2 2 3 3 1 5 1 1 FT21 12 0 1 1 2 2 2 8 1 6 2 5 -9 -9 2 2 1 1 1 1 3 3 2 2 3 3 -9 -9 1 2 FT3 12 0 1 1 2 2 5 5 1 1 2 5 1 2 1 2 -9 -9 1 1 3 6 2 2 3 3 1 3 -9 -9 FT5 12 0 1 1 2 2 5 5 1 2 2 3 1 1 2 2 1 4 1 1 3 3 2 2 1 3 1 4 1 1 FT9 12 0 1 1 2 2 2 7 1 1 -9 -9 1 3 2 2 1 4 1 1 3 3 2 2 3 3 4 5 1 1 GS13 13 0 1 1 2 2 2 2 1 1 2 3 1 1 2 2 1 6 1 1 3 3 2 2 3 3 1 3 1 1 GS1 13 0 1 1 2 2 -9 -9 1 5 3 3 1 1 2 2 6 6 1 3 3 3 1 1 3 3 1 3 1 3 GS25 13 0 1 1 2 2 2 2 -9 -9 2 2 1 1 2 2 1 6 1 1 1 3 2 2 3 3 1 3 1 1 GS27 13 0 1 1 2 10 2 2 1 3 2 3 1 6 2 2 1 1 1 1 3 3 2 2 3 3 1 3 1 10 GS28 13 0 1 1 2 2 2 2 1 10 3 3 1 1 2 2 1 1 1 1 3 3 2 2 3 3 1 2 1 1 GS2 13 0 1 1 -9 -9 -9 -9 1 1 2 3 1 1 2 2 1 4 1 1 3 3 2 2 3 3 3 3 -9 -9 GS3 13 0 1 1 -9 -9 -9 -9 1 1 2 3 1 1 1 2 -9 -9 1 1 3 3 -9 -9 3 3 -9 -9 1 4 GS9 13 0 1 1 2 2 2 2 1 1 2 2 1 1 2 2 4 4 1 1 3 3 2 2 1 3 1 2 1 1 Thank you, Ye -------------- next part -------------- An HTML attachment was scrubbed... URL: From t.jombart at imperial.ac.uk Mon Dec 30 10:42:18 2013 From: t.jombart at imperial.ac.uk (Jombart, Thibaut) Date: Mon, 30 Dec 2013 09:42:18 +0000 Subject: [adegenet-forum] unable to import a diploid dataset using read.strucutre In-Reply-To: <15a7f97.1013c.143417a7b24.Coremail.sun-ye@scib.ac.cn> References: <15a7f97.1013c.143417a7b24.Coremail.sun-ye@scib.ac.cn> Message-ID: <2CB2DA8E426F3541AB1907F98ABA657075F3788B@icexch-m1.ic.ac.uk> Hello, the file seems to contain one column to many. > x <- read.table("temp/14loci.stru",skip=1) > head(x) V1 V2 V3 V4 V5 V6 V7 V8 V9 V10 V11 V12 V13 V14 V15 V16 V17 V18 V19 V20 V21 1 QCS10 1 0 2 2 -9 -9 -9 -9 -9 -9 2 2 2 2 1 1 -9 -9 1 2 2 QCS13 1 0 2 2 -9 -9 2 2 -9 -9 -9 -9 2 2 -9 -9 1 1 2 2 3 QCS16 1 0 2 2 -9 -9 -9 -9 1 1 2 2 2 2 -9 -9 1 1 2 2 4 QCS19 1 0 -9 -9 2 8 2 2 1 1 2 2 2 2 1 1 1 1 2 2 5 QCS22 1 0 -9 -9 2 2 2 2 1 1 2 2 -9 -9 -9 -9 1 1 2 2 6 QCS4 1 0 2 2 1 1 2 2 -9 -9 2 2 1 2 1 1 -9 -9 -9 -9 V22 V23 V24 V25 V26 V27 V28 V29 V30 V31 1 1 2 1 1 1 1 1 1 1 1 2 1 1 1 3 3 3 1 1 1 1 3 1 1 1 1 1 3 1 1 1 1 4 -9 -9 1 1 -9 -9 1 1 1 1 5 1 1 3 3 1 3 1 1 1 1 6 1 1 1 3 3 3 1 1 1 1 > Here, there should be 30 columns and not 31. 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 sun-ye at scib.ac.cn [sun-ye at scib.ac.cn] Sent: 30 December 2013 03:09 To: adegenet-forum at lists.r-forge.r-project.org Subject: [adegenet-forum] unable to import a diploid dataset using read.strucutre Dear I am unable to import a diploid dataset using read.strucutre. I always got an error: Converting data from a STRUCTURE .stru file to a genind object... df2genind(X = X, pop = pop, missing = missing, ploidy = 2) : 2 alleles cannot be coded by a total of 3 characters I paste data (104 individual, 14 loci), Can you help fix this? RADid_0000113 RADid_0000114 RADid_0000250 RADid_0000388 RADid_0000798 RADid_0001205 RADid_0001522 RADid_0001584 RADid_0001771 RADid_0002962 RADid_0003463 RADid_0003558 RADid_0004239 RADid_0004366 QCS10 1 0 2 2 -9 -9 -9 -9 -9 -9 2 2 2 2 1 1 -9 -9 1 2 1 2 1 1 1 1 1 1 1 1 QCS13 1 0 2 2 -9 -9 2 2 -9 -9 -9 -9 2 2 -9 -9 1 1 2 2 1 1 1 3 3 3 1 1 1 1 QCS16 1 0 2 2 -9 -9 -9 -9 1 1 2 2 2 2 -9 -9 1 1 2 2 1 1 1 1 1 3 1 1 1 1 QCS19 1 0 -9 -9 2 8 2 2 1 1 2 2 2 2 1 1 1 1 2 2 -9 -9 1 1 -9 -9 1 1 1 1 QCS22 1 0 -9 -9 2 2 2 2 1 1 2 2 -9 -9 -9 -9 1 1 2 2 1 1 3 3 1 3 1 1 1 1 QCS4 1 0 2 2 1 1 2 2 -9 -9 2 2 1 2 1 1 -9 -9 -9 -9 1 1 1 3 3 3 1 1 1 1 QCS7 1 0 2 2 2 2 2 2 1 1 2 2 -9 -9 1 1 1 1 2 2 1 1 1 1 2 3 1 1 1 1 QCSI 1 0 1 1 -9 -9 2 2 1 1 2 2 2 2 1 1 -9 -9 2 2 1 1 3 3 3 3 1 9 -9 -9 EM13 2 0 2 2 -9 -9 2 11 -9 -9 2 2 2 2 1 1 1 1 2 2 1 1 1 1 1 3 1 1 1 1 EM16 2 0 1 1 2 2 -9 -9 1 1 2 2 2 2 1 1 1 1 1 2 1 1 1 1 1 1 1 1 -9 -9 EM19 2 0 -9 -9 2 2 2 6 1 1 2 2 2 2 -9 -9 1 1 2 2 -9 -9 1 3 1 3 1 1 1 1 EM20 2 0 -9 -9 2 2 2 4 1 1 2 2 2 2 -9 -9 1 1 2 2 1 1 1 1 1 1 1 1 1 2 EM22 2 0 2 2 2 2 -9 -9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 0 1 1 2 2 2 2 1 1 2 2 1 1 2 2 4 4 1 1 3 3 2 2 1 3 1 2 1 1 Thank you, Ye From cwaters8 at uw.edu Mon Dec 30 20:37:13 2013 From: cwaters8 at uw.edu (Charlie Waters) Date: Mon, 30 Dec 2013 11:37:13 -0800 Subject: [adegenet-forum] Inertia ellipse in DAPC Message-ID: Hello, I'm conducting a DAPC but do not know what the inertia ellipses represent. Do these represent the variances of dispersion for the groups along the discriminant functions or something else? Thank you for your time and help, Charlie -- Charlie Waters Box 355020 School of Aquatic and Fishery Sciences University of Washington Seattle, WA 98105 -------------- next part -------------- An HTML attachment was scrubbed... URL: From mayalopez at gmail.com Tue Dec 31 01:51:21 2013 From: mayalopez at gmail.com (Margarita Lopez Uribe) Date: Mon, 30 Dec 2013 19:51:21 -0500 Subject: [adegenet-forum] Global Test Message-ID: Dear Dr. Jombart and Adegenet users, I am trying to use the global and local test to interpret sPCA results. However, I am getting the following error message: > Ebom.Gtest<-global.rtest(Ebom_adeg,Ebom.spca$lw,nper=99) Error in if (any(temp)) { : missing value where TRUE/FALSE needed In addition: Warning message: In is.na(X) : is.na() applied to non-(list or vector) of type 'S4' Any feedback on what the problem is would be greatly appreciated. Thanks in advance for your help! Margarita -------------- next part -------------- An HTML attachment was scrubbed... URL: