<BR><BR>
<P>Dear Thibaut<BR> The file (31 columns) is a Structure format file obtained from Genalex. I try to read. structure by</P>
<P>obj <- read.structure(system.file("files/14loci.stru",package="adegenet"),n.ind=104,n.loc=14,onerowperind=TRUE,col.lab=1,col.pop=2,<STRONG>col.others=3</STRONG>,row.marknames=1,NA.char="-9")</P>
<P> and always got an error:<BR>Converting data from a STRUCTURE .stru file to a genind object...<BR>df2genind(X = X, pop = pop, missing = missing, ploidy = 2) :<BR>2 alleles cannot be coded by a total of 3 characters</P>
<P> If I remove the third column (pop flag), and read.structure by </P>
<P>obj <- read.structure(system.file("files/14loci.stru",package="adegenet"),n.ind=104,n.loc=14,onerowperind=TRUE,col.lab=1,col.pop=2,row.marknames=1,NA.char="-9")</P>
<P> The data cannot be imported and will be asked</P>
<P> Which other optional columns should be read (press 'return' when done)? </P>
<P> Can you help fix this? Thank you!</P>
<P> Ye<BR><BR><BR>> -----原始邮件-----<BR>> 发件人: "Jombart, Thibaut" <<A href="mailto:t.jombart@imperial.ac.uk" target="_blank">t.jombart@imperial.ac.uk</A>><BR>> 发送时间: 2013年12月30日 星期一<BR>> 收件人: "<A href="mailto:sun-ye@scib.ac.cn" target="_blank">sun-ye@scib.ac.cn</A>" <<A href="mailto:sun-ye@scib.ac.cn" target="_blank">sun-ye@scib.ac.cn</A>>, "<A href="mailto:adegenet-forum@lists.r-forge.r-project.org" target="_blank">adegenet-forum@lists.r-forge.r-project.org</A>" <<A href="mailto:adegenet-forum@lists.r-forge.r-project.org" target="_blank">adegenet-forum@lists.r-forge.r-project.org</A>><BR>> 抄送: <BR>> 主题: RE: [adegenet-forum] unable to import a diploid dataset using read.strucutre<BR>> <BR>> Hello, <BR>> <BR>> the file seems to contain one column to many. <BR>> > x <- read.table("temp/14loci.stru",skip=1)<BR>> > head(x)<BR>> V1 V2 V3 V4 V5 V6 V7 V8 V9 V10 V11 V12 V13 V14 V15 V16 V17 V18 V19 V20 V21<BR>> 1 QCS10 1 0 2 2 -9 -9 -9 -9 -9 -9 2 2 2 2 1 1 -9 -9 1 2<BR>> 2 QCS13 1 0 2 2 -9 -9 2 2 -9 -9 -9 -9 2 2 -9 -9 1 1 2 2<BR>> 3 QCS16 1 0 2 2 -9 -9 -9 -9 1 1 2 2 2 2 -9 -9 1 1 2 2<BR>> 4 QCS19 1 0 -9 -9 2 8 2 2 1 1 2 2 2 2 1 1 1 1 2 2<BR>> 5 QCS22 1 0 -9 -9 2 2 2 2 1 1 2 2 -9 -9 -9 -9 1 1 2 2<BR>> 6 QCS4 1 0 2 2 1 1 2 2 -9 -9 2 2 1 2 1 1 -9 -9 -9 -9<BR>> V22 V23 V24 V25 V26 V27 V28 V29 V30 V31<BR>> 1 1 2 1 1 1 1 1 1 1 1<BR>> 2 1 1 1 3 3 3 1 1 1 1<BR>> 3 1 1 1 1 1 3 1 1 1 1<BR>> 4 -9 -9 1 1 -9 -9 1 1 1 1<BR>> 5 1 1 3 3 1 3 1 1 1 1<BR>> 6 1 1 1 3 3 3 1 1 1 1<BR>> > <BR>> <BR>> Here, there should be 30 columns and not 31.<BR>> <BR>> Cheers<BR>> Thibaut<BR>> <BR>> <BR>> ________________________________________<BR>> From: <A href="mailto:adegenet-forum-bounces@lists.r-forge.r-project.org" target="_blank">adegenet-forum-bounces@lists.r-forge.r-project.org</A> [<A href="mailto:adegenet-forum-bounces@lists.r-forge.r-project.org" target="_blank">adegenet-forum-bounces@lists.r-forge.r-project.org</A>] on behalf of <A href="mailto:sun-ye@scib.ac.cn" target="_blank">sun-ye@scib.ac.cn</A> [<A href="mailto:sun-ye@scib.ac.cn" target="_blank">sun-ye@scib.ac.cn</A>]<BR>> Sent: 30 December 2013 03:09<BR>> To: <A href="mailto:adegenet-forum@lists.r-forge.r-project.org" target="_blank">adegenet-forum@lists.r-forge.r-project.org</A><BR>> Subject: [adegenet-forum] unable to import a diploid dataset using read.strucutre<BR>> <BR>> Dear<BR>> <BR>> I am unable to import a diploid dataset using read.strucutre. I always got an error:<BR>> <BR>> Converting data from a STRUCTURE .stru file to a genind object...<BR>> df2genind(X = X, pop = pop, missing = missing, ploidy = 2) :<BR>> 2 alleles cannot be coded by a total of 3 characters<BR>> <BR>> I paste data (104 individual, 14 loci), Can you help fix this?<BR>> 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<BR>> 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<BR>> 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<BR>> 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<BR>> 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<BR>> 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<BR>> 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<BR>> 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<BR>> 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<BR>> 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<BR>> 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<BR>> EM19 2 0 -9 -9 2 2 2 6 1 1 2 2 2 2 -9 -9 1 1 2 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2 2 1 1 2 3 1 1 2 2 1 6 1 1 3 3 2 2 3 3 1 3 1 1<BR>> 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<BR>> 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<BR>> 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<BR>> 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<BR>> 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<BR>> 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<BR>> 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<BR>> <BR>> <BR>> Thank you,<BR>> <BR>> Ye<BR>> <BR>> <BR>> <BR>> <BR><BR><BR><SPAN><BR>--<BR>Dr. Ye SUN<BR>Key Laboratory of Plant Resources Conservation and Sustainable Utilization<BR>South China Botanical Garden, Chinese Academy of Sciences<BR>Xingke Road 723,Tianhe District, Guangzhou 510650, PR China<BR></SPAN><BR></P><BR><BR><BR><BR><SPAN><BR>--<BR>Dr. Ye SUN<BR>Key Laboratory of Plant Resources Conservation and Sustainable Utilization<BR>South China Botanical Garden, Chinese Academy of Sciences<BR>Xingke Road 723,Tianhe District, Guangzhou 510650, PR China<BR></SPAN><br><br><br>