<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style>
<!--
@font-face
        {font-family:Calibri}
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif"}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline}
span.EmailStyle17
        {font-family:"Calibri","sans-serif";
        color:windowtext}
.MsoChpDefault
        {font-family:"Calibri","sans-serif"}
@page WordSection1
        {margin:1.0in 1.0in 1.0in 1.0in}
-->
</style><style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1" lang="EN-US" link="blue" vlink="purple">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">Dear John,
<br>
<br>
Sorry for this problem. The issue comes from the fact that read.structure has been designed for diploid data. I never came across structure files such as your until now, I should probably add a word about this in the doc. What do the numbers in your file represent?
 I assume they identify alleles.<br>
<br>
A simple workaround is reading the file in R using read.table and then converting into a genind the dataframe using df2genind:<br>
####<br>
dat &lt;- read.table(&quot;test_data.stru&quot;, head=FALSE,row.names=1)<br>
dat<br>
x &lt;- df2genind(dat, ploidy=1) # conversion to genind<br>
x<br>
truenames(x) # see internal coding<br>
genind2df(x) # check that conversion is OK<br>
####<br>
<div><br>
All the best<br>
<br>
Thibaut<br>
<br>
<div class="BodyFragment"><font size="2">
<div class="PlainText">-- <br>
######################################<br>
Dr Thibaut JOMBART<br>
MRC Centre for Outbreak Analysis and Modelling<br>
Department of Infectious Disease Epidemiology<br>
Imperial College - Faculty of Medicine<br>
St Mary’s Campus<br>
Norfolk Place<br>
London W2 1PG<br>
United Kingdom<br>
Tel. : 0044 (0)20 7594 3658<br>
t.jombart@imperial.ac.uk<br>
http://sites.google.com/site/thibautjombart/<br>
http://adegenet.r-forge.r-project.org/<br>
</div>
</font></div>
</div>
<div style="font-family: Times New Roman; color: rgb(0, 0, 0); font-size: 16px;">
<hr tabindex="-1">
<div style="direction: ltr;" id="divRpF308674"><font color="#000000" face="Tahoma" size="2"><b>From:</b> adegenet-forum-bounces@r-forge.wu-wien.ac.at [adegenet-forum-bounces@r-forge.wu-wien.ac.at] on behalf of Gibbons, John G. [john.g.gibbons@Vanderbilt.Edu]<br>
<b>Sent:</b> 14 June 2011 17:31<br>
<b>To:</b> 'adegenet-forum@lists.r-forge.r-project.org'<br>
<b>Subject:</b> [adegenet-forum] problems importing structure data<br>
</font><br>
</div>
<div></div>
<div>
<div class="WordSection1">
<p class="MsoNormal">Hello,</p>
<p class="MsoNormal">I have been having some problems loading my structure data to a geneid object using the “read.structure” command. I’ve read through the forum archive and tried everything but am still getting the same error.</p>
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal">Here is the example of my test dataset:</p>
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal">Afum001 3 4 1 2 1 1 3 1 3 1</p>
<p class="MsoNormal">Afum002 1 3 2 1 1 2 1 1 2 2</p>
<p class="MsoNormal">Afum003 2 3 1 2 1 1 2 2 2 2</p>
<p class="MsoNormal">Afum004 1 3 1 2 1 2 1 2 2 2</p>
<p class="MsoNormal">Afum005 1 1 1 1 1 1 1 2 1 2</p>
<p class="MsoNormal">Afum006 1 3 2 1 1 1 2 2 1 2</p>
<p class="MsoNormal">Afum007 1 1 1 2 2 1 1 2 2 2</p>
<p class="MsoNormal">Afum008 2 1 1 2 2 1 1 1 2 2</p>
<p class="MsoNormal">Afum009 1 1 1 2 1 1 4 2 2 2</p>
<p class="MsoNormal">Afum011 1 3 1 1 1 2 4 2 2 1</p>
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal">I then issue the following command:</p>
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal" style="text-indent: 0.5in;">a &lt;- read.structure(&quot;test_data.stru&quot;, row.marknames=0, onerowperind=TRUE, n.ind=10, n.loc=10, col.lab=1, col.pop=0, ask=TRUE)</p>
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal">I then get the following promt</p>
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal" style="text-indent: 0.5in;">Which other optional columns should be read (press 'return' when done)? 1:</p>
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal">When I press return here (as I do not have any other optional columns to be read) I get the following error:</p>
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal" style="text-indent: 0.5in;">Converting data from a STRUCTURE .stru file to a genind object...
</p>
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal" style="text-indent: 0.5in;">Error in read.structure(&quot;test_data.stru &quot;,&nbsp; :
</p>
<p class="MsoNormal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; only 0's may be mixed with negative subscripts</p>
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal">I have been struggling with this for a few days now and cannot figure out what the problem is. Any thoughts or advice would be greatly appreciated.</p>
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal">Thanks,</p>
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal">John</p>
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal">----</p>
<p class="MsoNormal">John G Gibbons</p>
<p class="MsoNormal">Department of Biological Sciences</p>
<p class="MsoNormal">VU Station B, Box 35-1634</p>
<p class="MsoNormal">Vanderbilt University</p>
<p class="MsoNormal">Nashville TN, 37212</p>
<p class="MsoNormal">The Rokas Lab</p>
<p class="MsoNormal">Email: <a href="mailto:John.G.Gibbons@Vanderbilt.Edu" target="_blank">
<span style="color: blue;">John.G.Gibbons@Vanderbilt.Edu</span></a></p>
<p class="MsoNormal">Tel: (615) 936-3893</p>
<p class="MsoNormal"><a href="http://sitemason.vanderbilt.edu/people/jggibbons" target="_blank"><span style="color: blue;">http://sitemason.vanderbilt.edu/people/jggibbons</span></a></p>
<p class="MsoNormal">&nbsp;</p>
</div>
</div>
</div>
</div>
</body>
</html>