[adegenet-forum] sPCA Error: Duplicate locations detected

Roy Francis Mathew RoyFrancis.Mathew at agrsci.dk
Thu Oct 27 12:55:47 CEST 2011


Try
duplicated(obj at other$xy)


Regards
Roy Mathew Francis
From: adegenet-forum-bounces at r-forge.wu-wien.ac.at [mailto:adegenet-forum-bounces at r-forge.wu-wien.ac.at] On Behalf Of Rebecca Citroen
Sent: 27 October 2011 06:06
To: adegenet-forum at r-forge.wu-wien.ac.at
Subject: [adegenet-forum] sPCA Error: Duplicate locations detected

Hi there.

I'm having issues trying to perform an sPCA on a binary data set of 290 samples, 50 loci, with latitude and longitude as the xy data.  I am coming up with the following error (see below for full script):
Error in chooseCN(xy = xy, ask = ask, type = type, plot.nb = plot.nb,  :
  Duplicate locations detected and incompatible with graph type 1-4.
Please choose another graph (5-7) or add random noise to locations (see ?jitter).
Despite all my searching I cannot find two samples that share the same location.  Every position is unique.
I have had this error before but have managed to resolve it by finding the offending samples or by converting the lat longs to UTM.  I have used 90% of these samples in the past and the sPCA has run without a problem.  Doing exactly the same as previous analysis (same script, just updated data set) I cannot get past this error.  Changing the lat longs to UTM is not resolving the issue this time either.
Is there another possible reason I may be getting this error?  Does the sPCA round to a certain number of decimal places (have had sample differ by only the 5th decimal place in the past and they have worked fine)?  I've included the lat long data in case I'm missing something very obvious.

Thanks very much for you help!

Cheers,
Rebecca.

Rebecca Citroen
Research Assistant
Plant Sciences and Biodiversity
Royal Botanic Gardens Melbourne

> alldata<-read.table("All_samples.txt")
> obj<-genind(alldata,ploidy=1,type="PA")
> obj at other$xy<-read.table("All_lat_longs.txt",header=TRUE)
> spca<-spca(obj,type=1)
Error in chooseCN(xy = xy, ask = ask, type = type, plot.nb = plot.nb,  :
  Duplicate locations detected and incompatible with graph type 1-4.
Please choose another graph (5-7) or add random noise to locations (see ?jitter).

> obj
   #####################
   ### Genind object ###
   #####################
- genotypes of individuals -
S4 class:  genind
@call: genind(tab = alldata, ploidy = 1, type = "PA")
@tab:  290 x 50 matrix of genotypes
@ind.names: vector of  290 individual names
@loc.names: vector of  50 locus names
@loc.nall: NULL
@loc.fac: NULL
@all.names: NULL
@ploidy:  1
@type:  PA
Optionnal contents:
@pop:  - empty -
@pop.names:  - empty -
@other: a list containing: xy


> obj at other$xy
           X         Y
1   147.1789 -38.02317
2   147.1755 -38.02367
3   147.1747 -38.02360
4   147.1719 -38.02338
5   147.1740 -38.02345
6   147.1764 -38.02333
7   147.1777 -38.02293
8   147.1787 -38.02298
9   147.1876 -38.01928
10  147.2604 -38.04002
11  147.2578 -38.03764
12  147.2162 -38.01533
13  147.2526 -38.03500
14  147.2182 -38.01533
15  147.2509 -38.03452
16  147.2481 -38.03177
17  147.2480 -38.02905
18  147.8496 -37.75718
19  147.8465 -37.75798
20  147.8465 -37.76120
21  147.8467 -37.76393
22  147.8385 -37.79523
23  146.7910 -38.14567
24  146.7915 -38.14468
25  147.3602 -38.04223
26  147.3819 -38.03648
27  147.3822 -38.03543
28  147.4080 -38.04757
29  147.4080 -38.04927
30  147.3939 -38.04410
31  147.3854 -38.04595
32  147.3882 -38.04672
33  147.3903 -38.04638
34  147.3911 -38.04625
35  147.3889 -38.03848
36  147.3877 -38.01000
37  147.3879 -38.02689
38  147.2490 -38.06693
39  147.2402 -38.05523
40  147.2126 -38.03258
41  147.1881 -38.01660
42  147.2500 -38.05940
43  147.2479 -38.06790
44  147.2466 -38.07508
45  147.2480 -38.07323
46  147.2124 -38.05962
47  147.2399 -38.05242
48  147.2198 -38.03467
49  147.2264 -38.03650
50  147.2112 -38.02880
51  147.2105 -38.02930
52  147.7325 -37.81450
53  147.7355 -37.81897
54  147.7365 -37.82110
55  147.7353 -37.82092
56  147.7347 -37.82187
57  147.7361 -37.82220
58  147.7374 -37.82115
59  147.7387 -37.82195
60  147.7381 -37.82445
61  147.7354 -37.82432
62  147.7312 -37.81857
63  147.4574 -38.00665
64  147.4572 -38.00720
65  147.4557 -38.00712
66  147.4552 -38.00698
67  147.4541 -38.00585
68  148.0360 -37.79487
69  147.6215 -37.81092
70  147.6202 -37.81105
71  147.6211 -37.81310
72  147.6221 -37.81338
73  147.6233 -37.81465
74  147.6205 -37.81173
75  147.6192 -37.79812
76  147.6193 -37.79752
77  147.6185 -37.79710
78  147.1726 -38.14487
79  147.1709 -38.14512
80  147.1715 -38.14592
81  147.1615 -38.14475
82  147.1507 -38.14305
83  147.1884 -38.15668
84  147.1474 -38.15015
85  147.1920 -38.15830
86  147.1488 -38.14965
87  147.1528 -38.14950
88  147.1545 -38.14803
89  147.1530 -38.14817
90  147.1503 -38.14835
91  147.1493 -38.14867
92  147.1474 -38.14323
93  147.1810 -38.15683
94  147.1855 -38.15630
95  147.1845 -38.15800
96  147.1824 -38.15793
97  147.1791 -38.15897
98  147.2158 -38.14953
99  147.2089 -38.14425
100 147.0714 -38.11480
101 147.0739 -38.11505
102 147.0738 -38.11625
103 147.0726 -38.11737
104 147.0734 -38.11812
105 147.0749 -38.11883
106 147.0758 -38.11810
107 147.4672 -38.04667
108 147.4684 -38.04605
109 147.4596 -38.05502
110 147.4589 -38.05553
111 147.4586 -38.05635
112 147.4576 -38.05297
113 147.4576 -38.05293
114 147.4570 -38.04905
115 147.4669 -38.04355
116 147.4656 -38.04223
117 147.4592 -38.03595
118 147.4018 -38.01103
119 147.2140 -38.12895
120 147.2128 -38.12423
121 147.2196 -38.11410
122 147.2119 -38.09759
123 147.2217 -38.07368
124 147.2133 -38.12660
125 148.0456 -37.86717
126 148.0420 -37.86652
127 148.0407 -37.85478
128 148.0060 -37.87668
129 147.9763 -37.88258
130 147.9803 -37.87980
131 147.9752 -37.88062
132 147.9737 -37.88078
133 147.9996 -37.87325
134 147.9934 -37.88232
135 147.9703 -37.88320
136 147.6455 -37.81621
137 147.6468 -37.81712
138 147.6466 -37.81755
139 147.6446 -37.81878
140 147.6465 -37.81848
141 147.5934 -38.03498
142 147.5950 -38.03442
143 147.5967 -38.03382
144 147.5818 -38.04622
145 147.5754 -38.05073
146 147.5674 -38.05468
147 148.0648 -37.85155
148 148.0626 -37.84890
149 147.6249 -37.84163
150 147.6232 -37.83645
151 147.6504 -37.87713
152 147.6475 -37.87190
153 147.6468 -37.87068
154 147.6563 -37.88208
155 147.6543 -37.88083
156 147.6543 -37.87973
157 147.6540 -37.87897
158 147.6527 -37.87835
159 147.8576 -37.89695
160 147.8533 -37.84383
161 147.6652 -37.88303
162 147.6483 -37.86409
163 147.6402 -37.83892
164 147.6767 -37.84592
165 147.7401 -37.81628
166 148.0891 -37.73528
167 148.0913 -37.73467
168 148.0952 -37.73335
169 148.0965 -37.73320
170 148.0937 -37.73077
171 147.1126 -38.14824
172 147.1154 -38.14542
173 148.9613 -37.76217
174 148.9599 -37.75257
175 148.9702 -37.75045
176 148.9722 -37.76053
177 148.9717 -37.76083
178 148.9519 -37.74367
179 148.5379 -37.70392
180 148.4634 -37.71883
181 147.2672 -38.00487
182 147.2114 -38.15314
183 147.1990 -38.15583
184 147.1767 -38.15705
185 147.1667 -38.15722
186 147.1500 -38.15267
187 147.8256 -37.45770
188 147.1668 -38.14502
189 147.1623 -38.14245
190 147.1374 -38.14328
191 147.1376 -38.14380
192 147.1084 -38.15018
193 147.0819 -38.15125
194 147.0610 -38.12587
195 147.2731 -37.94292
196 147.2727 -37.94315
197 147.2754 -37.92165
198 147.2746 -37.92065
199 147.2744 -37.92012
200 147.2740 -37.91963
201 147.2738 -37.92428
202 147.2730 -37.92484
203 147.2739 -37.91944
204 147.2378 -38.01565
205 147.2365 -38.01330
206 147.2373 -38.01578
207 147.2371 -38.01568
208 147.2366 -38.01548
209 147.2364 -38.01543
210 147.2362 -38.01488
211 147.2360 -38.01547
212 147.2363 -38.01568
213 147.2369 -38.01583
214 147.2370 -38.01573
215 146.7501 -38.15705
216 147.0789 -38.12640
217 147.0787 -38.12598
218 147.0770 -38.12455
219 147.0994 -38.14520
220 147.0931 -38.14542
221 147.0872 -38.14708
222 147.0856 -38.14648
223 147.0783 -38.13715
224 147.0813 -38.12917
225 147.0816 -38.12970
226 147.0821 -38.12737
227 147.0809 -38.14057
228 147.0803 -38.13880
229 147.0803 -38.13792
230 147.0811 -38.13667
231 147.0814 -38.13555
232 147.0794 -38.13563
233 147.0792 -38.13492
234 147.0780 -38.13265
235 147.0755 -38.13067
236 147.0765 -38.12695
237 147.7239 -37.75215
238 147.7255 -37.75153
239 147.7262 -37.75112
240 147.7270 -37.75043
241 147.7237 -37.75288
242 147.7406 -37.85870
243 147.7362 -37.85913
244 147.7239 -37.86568
245 147.7152 -37.86912
246 147.7087 -37.87442
247 147.6815 -37.88198
248 148.5212 -37.79923
249 148.5030 -37.78270
250 148.5007 -37.78067
251 148.5060 -37.78337
252 148.5161 -37.77648
253 148.5192 -37.77005
254 148.5339 -37.76883
255 148.5373 -37.76195
256 148.5337 -37.75938
257 148.5268 -37.77177
258 148.5272 -37.77430
259 148.5288 -37.77478
260 148.5354 -37.78023
261 148.5762 -37.77540
262 148.5765 -37.77143
263 148.5741 -37.76730
264 148.5620 -37.75362
265 148.5598 -37.75567
266 148.5573 -37.75435
267 148.5637 -37.74485
268 148.5733 -37.75362
269 148.5764 -37.75855
270 148.5765 -37.76657
271 148.5702 -37.76725
272 148.5665 -37.77462
273 148.5612 -37.77702
274 148.5468 -37.77948
275 148.0444 -37.74463
276 147.1939 -38.01888
277 147.2085 -38.01688
278 147.2156 -38.01695
279 147.7966 -37.85505
280 147.8465 -37.76045
281 147.8433 -37.76693
282 147.8410 -37.77020
283 147.8389 -37.77522
284 147.8436 -37.78857
285 147.8404 -37.79667
286 147.8513 -37.79450
287 147.8589 -37.80155
288 147.4086 -37.98273
289 147.4089 -37.98172
290 147.3795 -37.98245




--

This email and any attachments may contain information that is personal, confidential, legally privileged and/or copyright. No part of it should be reproduced, adapted or communicated without the prior written consent of the sender and/or copyright owner.



It is the responsibility of the recipient to check for and remove viruses.



If you have received this email in error, please notify the sender by return email, delete it from your system and destroy any copies. You are not authorised to use, communicate or rely on the information contained in this email.



Please consider the environment before printing this email.



This email was Anti Virus checked by RBG Astaro Mail Gateway.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/adegenet-forum/attachments/20111027/9bfbc5f3/attachment-0001.htm>


More information about the adegenet-forum mailing list