Dear all,<br><br>I am glad to have these excellent tools (ade4, adegenet) for my study. Thanks a lot for its contributors and maintainers.<br><br>I am facing problem when I tried to import file in structure input format to adegenet. I tried it for many times, still can not figure out the reason. <br>
<br>Could you please give me any helps/instructions or explanations? Thanks a lot in advance.<br><br>Best,<br><br>Jian-Feng,<br><br><br>##############################<div># (1) the data file in structure input format, Those are what contained in the file "test.str", which used in the following command.<br>
# In this file, the first column is the flag for individual. The second column is for population. The others for haplotypic sites, here 8 haplotypic sites.<br># -9 are missing data<br># This haplotypic data are from DNA sequencing. This means each 1,2,3,4,5 corresponded to one nucleotide acid, or deletion.<br>
<br>
MN47 1 1 2 1 2 4 4 3 3<br>13a 10 3 2 1 2 4 4 1 3<br>14b 10 1 2 2 2 4 4 3 4<br>16a <a href="tel:4%C2%A0%C2%A0%C2%A0%201%C2%A0%C2%A0%C2%A0%202%C2%A0%C2%A0%C2%A0%201%C2%A0%C2%A0%C2%A0%202%C2%A0%C2%A0%C2%A0%204%C2%A0%C2%A0%C2%A0%204%C2%A0%C2%A0%C2%A0%203%C2%A0%C2%A0%C2%A0%203" value="+49412124433" target="_blank">4 1 2 1 2 4 4 3 3</a><br>
17a 3 1 2 1 3 4 4 3 3<br>
23a 6 -<a href="tel:9%C2%A0%C2%A0%C2%A0%202%C2%A0%C2%A0%C2%A0%201%C2%A0%C2%A0%C2%A0%202%C2%A0%C2%A0%C2%A0%204%C2%A0%C2%A0%C2%A0%201%C2%A0%C2%A0%C2%A0%203%C2%A0%C2%A0%C2%A0%203" value="+4992124133" target="_blank">9 2 1 2 4 1 3 3</a><br>
24a 6 -<a href="tel:9%C2%A0%C2%A0%C2%A0%202%C2%A0%C2%A0%C2%A0%202%C2%A0%C2%A0%C2%A0%202%C2%A0%C2%A0%C2%A0%204%C2%A0%C2%A0%C2%A0%204%C2%A0%C2%A0%C2%A0%203%C2%A0%C2%A0%C2%A0%204" value="+4992224434" target="_blank">9 2 2 2 4 4 3 4</a><br>
25b <a href="tel:6%C2%A0%C2%A0%C2%A0%201%C2%A0%C2%A0%C2%A0%202%C2%A0%C2%A0%C2%A0%202%C2%A0%C2%A0%C2%A0%202%C2%A0%C2%A0%C2%A0%204%C2%A0%C2%A0%C2%A0%204%C2%A0%C2%A0%C2%A0%203%C2%A0%C2%A0%C2%A0%204" value="+49612224434" target="_blank">6 1 2 2 2 4 4 3 4</a><br>
26a <a href="tel:6%C2%A0%C2%A0%C2%A0%201%C2%A0%C2%A0%C2%A0%202%C2%A0%C2%A0%C2%A0%202%C2%A0%C2%A0%C2%A0%202%C2%A0%C2%A0%C2%A0%204%C2%A0%C2%A0%C2%A0%204%C2%A0%C2%A0%C2%A0%203%C2%A0%C2%A0%C2%A0%204" value="+49612224434" target="_blank">6 1 2 2 2 4 4 3 4</a><br>
34a <a href="tel:7%C2%A0%C2%A0%C2%A0%201%C2%A0%C2%A0%C2%A0%202%C2%A0%C2%A0%C2%A0%201%C2%A0%C2%A0%C2%A0%202%C2%A0%C2%A0%C2%A0%204%C2%A0%C2%A0%C2%A0%204%C2%A0%C2%A0%C2%A0%203%C2%A0%C2%A0%C2%A0%203" value="+49712124433" target="_blank">7 1 2 1 2 4 4 3 3</a><br>
35a <a href="tel:2%C2%A0%C2%A0%C2%A0%201%C2%A0%C2%A0%C2%A0%202%C2%A0%C2%A0%C2%A0%201%C2%A0%C2%A0%C2%A0%202%C2%A0%C2%A0%C2%A0%201%C2%A0%C2%A0%C2%A0%204%C2%A0%C2%A0%C2%A0%203%C2%A0%C2%A0%C2%A0%203" value="+49212121433" target="_blank">2 1 2 1 2 1 4 3 3</a><br>
37a <a href="tel:2%C2%A0%C2%A0%C2%A0%201%C2%A0%C2%A0%C2%A0%202%C2%A0%C2%A0%C2%A0%201%C2%A0%C2%A0%C2%A0%202%C2%A0%C2%A0%C2%A0%204%C2%A0%C2%A0%C2%A0%204%C2%A0%C2%A0%C2%A0%203%C2%A0%C2%A0%C2%A0%203" value="+49212124433" target="_blank">2 1 2 1 2 4 4 3 3</a><br>
38a 1 1 2 1 2 4 4 3 3<br>3b <a href="tel:8%C2%A0%C2%A0%C2%A0%201%C2%A0%C2%A0%C2%A0%203%C2%A0%C2%A0%C2%A0%201%C2%A0%C2%A0%C2%A0%202%C2%A0%C2%A0%C2%A0%204%C2%A0%C2%A0%C2%A0%204%C2%A0%C2%A0%C2%A0%203%C2%A0%C2%A0%C2%A0%203" value="+49813124433" target="_blank">8 1 3 1 2 4 4 3 3</a><br>
4a <a href="tel:5%C2%A0%C2%A0%C2%A0%201%C2%A0%C2%A0%C2%A0%202%C2%A0%C2%A0%C2%A0%201%C2%A0%C2%A0%C2%A0%202%C2%A0%C2%A0%C2%A0%201%C2%A0%C2%A0%C2%A0%204%C2%A0%C2%A0%C2%A0%203%C2%A0%C2%A0%C2%A0%203" value="+49512121433" target="_blank">5 1 2 1 2 1 4 3 3</a><br>
8b <a href="tel:9%C2%A0%C2%A0%C2%A0%201%C2%A0%C2%A0%C2%A0%202%C2%A0%C2%A0%C2%A0%202%C2%A0%C2%A0%C2%A0%202%C2%A0%C2%A0%C2%A0%204%C2%A0%C2%A0%C2%A0%204%C2%A0%C2%A0%C2%A0%203%C2%A0%C2%A0%C2%A0%203" value="+49912224433" target="_blank">9 1 2 2 2 4 4 3 3</a><br>
10b <a href="tel:9%C2%A0%C2%A0%C2%A0%201%C2%A0%C2%A0%C2%A0%202%C2%A0%C2%A0%C2%A0%201%C2%A0%C2%A0%C2%A0%202%C2%A0%C2%A0%C2%A0%204%C2%A0%C2%A0%C2%A0%204%C2%A0%C2%A0%C2%A0%203%C2%A0%C2%A0%C2%A0%203" value="+49912124433" target="_blank">9 1 2 1 2 4 4 3 3</a><br>
13b 10 -9 -9 -9 -9 -9 -9 -9 -9<br>14a 10 -9 2 2 2 -9 4 3 4<br>16b 4 -9 -9 -9 -9 -9 -9 -9 -9<br>
17b 3 -9 -9 -9 -9 -9 -9 -9 -9<br>23b 6 -9 -9 -9 -9 -9 -9 -9 -9<br>24b 6 -9 -9 -9 -9 -9 -9 -9 -9<br>25a 6 -9 -9 -9 -9 -9 -9 -9 -9<br>
26b 6 -<a href="tel:9%C2%A0%C2%A0%C2%A0%202%C2%A0%C2%A0%C2%A0%202%C2%A0%C2%A0%C2%A0%202%C2%A0%C2%A0%C2%A0%204%C2%A0%C2%A0%C2%A0%204%C2%A0%C2%A0%C2%A0%203%C2%A0%C2%A0%C2%A0%204" value="+4992224434" target="_blank">9 2 2 2 4 4 3 4</a><br>
34b <a href="tel:7%C2%A0%C2%A0%C2%A0%201%C2%A0%C2%A0%C2%A0%202%C2%A0%C2%A0%C2%A0%201%C2%A0%C2%A0%C2%A0%202%C2%A0%C2%A0%C2%A0%204%C2%A0%C2%A0%C2%A0%201%C2%A0%C2%A0%C2%A0%203%C2%A0%C2%A0%C2%A0%203" value="+49712124133" target="_blank">7 1 2 1 2 4 1 3 3</a><br>
35b 2 -<a href="tel:9%C2%A0%C2%A0%C2%A0%202%C2%A0%C2%A0%C2%A0%201%C2%A0%C2%A0%C2%A0%202%C2%A0%C2%A0%C2%A0%204%C2%A0%C2%A0%C2%A0%204%C2%A0%C2%A0%C2%A0%203%C2%A0%C2%A0%C2%A0%203" value="+4992124433" target="_blank">9 2 1 2 4 4 3 3</a><br>
37b 2 -<a href="tel:9%C2%A0%C2%A0%C2%A0%202%C2%A0%C2%A0%C2%A0%201%C2%A0%C2%A0%C2%A0%202%C2%A0%C2%A0%C2%A0%204%C2%A0%C2%A0%C2%A0%204%C2%A0%C2%A0%C2%A0%203%C2%A0%C2%A0%C2%A0%203" value="+4992124433" target="_blank">9 2 1 2 4 4 3 3</a><br>
38b 1 -<a href="tel:9%C2%A0%C2%A0%C2%A0%202%C2%A0%C2%A0%C2%A0%201%C2%A0%C2%A0%C2%A0%202%C2%A0%C2%A0%C2%A0%204%C2%A0%C2%A0%C2%A0%204%C2%A0%C2%A0%C2%A0%203%C2%A0%C2%A0%C2%A0%203" value="+4992124433" target="_blank">9 2 1 2 4 4 3 3</a><br>
3a <a href="tel:8%C2%A0%C2%A0%C2%A0%201%C2%A0%C2%A0%C2%A0%203%C2%A0%C2%A0%C2%A0%201%C2%A0%C2%A0%C2%A0%202%C2%A0%C2%A0%C2%A0%204%C2%A0%C2%A0%C2%A0%201%C2%A0%C2%A0%C2%A0%203%C2%A0%C2%A0%C2%A0%203" value="+49813124133" target="_blank">8 1 3 1 2 4 1 3 3</a><br>
8a <a href="tel:9%C2%A0%C2%A0%C2%A0%201%C2%A0%C2%A0%C2%A0%202%C2%A0%C2%A0%C2%A0%201%C2%A0%C2%A0%C2%A0%202%C2%A0%C2%A0%C2%A0%204%C2%A0%C2%A0%C2%A0%204%C2%A0%C2%A0%C2%A0%203%C2%A0%C2%A0%C2%A0%203" value="+49912124433" target="_blank">9 1 2 1 2 4 4 3 3</a><br>
10a 9 -9 -9 -9 -9 -9 -9 -9 -9<br><br></div>
<br><br>#################################################################################<br># (2) commands I tried, with the prompt I got<br><br>> who.data <- read.structure("test.str", n.ind=32, n.loc=8, onerowperind=T, col.lab=1, col.pop=2, ask=F)<br>
<br> Converting data from a STRUCTURE .stru file to a genind object... <br>
<br>
Error in read.structure("test.str", n.ind = 32, n.loc = 8, onerowperind = T, : <br> only 0's may be mixed with negative subscripts<br><br>> who.data <- read.structure("test.str", onerowperind=T, col.lab=1, col.pop=2, ask=F)<br>
<br> How many genotypes are there? 32<br>
<br> How many markers are there? 8<br><br> Converting data from a STRUCTURE .stru file to a genind object... <br><br>Error in read.structure("test.str", onerowperind = T, col.lab = 1, col.pop = 2, : <br> only 0's may be mixed with negative subscripts<br>
<br>> who.data <- read.structure("test.str", n.ind=32, onerowperind=T, col.lab=1, col.pop=2, ask=F)<br><br> How many markers are there? 8<br><br> Converting data from a STRUCTURE .stru file to a genind object... <br>
<br>Error in read.structure("test.str", n.ind = 32, onerowperind = T, col.lab = 1, : <br> only 0's may be mixed with negative subscripts<br><br>> who.data <- read.structure("test.str", n.ind=32, n.loc=8, onerowperind=T, col.lab=1, col.pop=2, ask=F)<br>
<br> Converting data from a STRUCTURE .stru file to a genind object... <br><br>Error in read.structure("test.str", n.ind = 32, n.loc = 8, onerowperind = T, : <br> only 0's may be mixed with negative subscripts<br>
<br>> who.data <- read.structure("test.str", n.ind=32, n.loc=8, col.lab=1, col.pop=2, ask=F)<br><br> Are genotypes coded by a single row (y/n)? y<br><br> Converting data from a STRUCTURE .stru file to a genind object... <br>
<br>Error in read.structure("test.str", n.ind = 32, n.loc = 8, col.lab = 1, : <br> only 0's may be mixed with negative subscripts<br><br>> who.data <- read.structure("test.str", n.ind=32, n.loc=8, ask=F)<br>
<br> Are genotypes coded by a single row (y/n)? y<br><br> Converting data from a STRUCTURE .stru file to a genind object... <br><br>Error in read.structure("test.str", n.ind = 32, n.loc = 8, ask = F) : <br> only 0's may be mixed with negative subscripts<br>
<br>> who.data <- read.structure(file="test.str", n.ind=32, n.loc=8, ask=F)<br><div><br> Are genotypes coded by a single row (y/n)? y<br><br> Converting data from a STRUCTURE .stru file to a genind object... <br>
<br>
Error in read.structure(file = "test.str", n.ind = 32, n.loc = 8, ask = F) : <br> only 0's may be mixed with negative subscripts<br><br><br><br>
</div>