[adegenet-forum] can not import structure format to adegenet

Mao Jianfeng jianfeng.mao at gmail.com
Fri Sep 9 19:36:54 CEST 2011


Dear all,

I am glad to have these excellent tools (ade4, adegenet) for my study.
Thanks a lot for its contributors and maintainers.

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.

Could you please give me any helps/instructions or explanations? Thanks a
lot in advance.

Best,

Jian-Feng,


##############################
# (1) the data file in structure input format, Those are what contained in
the file "test.str", which used in the following command.
# 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.
# -9 are missing data
# This haplotypic data are from DNA sequencing. This means each 1,2,3,4,5
corresponded to one nucleotide acid, or deletion.

MN47    1    1    2    1    2    4    4    3    3
13a    10    3    2    1    2    4    4    1    3
14b    10    1    2    2    2    4    4    3    4
16a    4    1    2    1    2    4    4    3    3
17a    3    1    2    1    3    4    4    3    3
23a    6    -9    2    1    2    4    1    3    3
24a    6    -9    2    2    2    4    4    3    4
25b    6    1    2    2    2    4    4    3    4
26a    6    1    2    2    2    4    4    3    4
34a    7    1    2    1    2    4    4    3    3
35a    2    1    2    1    2    1    4    3    3
37a    2    1    2    1    2    4    4    3    3
38a    1    1    2    1    2    4    4    3    3
3b    8    1    3    1    2    4    4    3    3
4a    5    1    2    1    2    1    4    3    3
8b    9    1    2    2    2    4    4    3    3
10b    9    1    2    1    2    4    4    3    3
13b    10    -9    -9    -9    -9    -9    -9    -9    -9
14a    10    -9    2    2    2    -9    4    3    4
16b    4    -9    -9    -9    -9    -9    -9    -9    -9
17b    3    -9    -9    -9    -9    -9    -9    -9    -9
23b    6    -9    -9    -9    -9    -9    -9    -9    -9
24b    6    -9    -9    -9    -9    -9    -9    -9    -9
25a    6    -9    -9    -9    -9    -9    -9    -9    -9
26b    6    -9    2    2    2    4    4    3    4
34b    7    1    2    1    2    4    1    3    3
35b    2    -9    2    1    2    4    4    3    3
37b    2    -9    2    1    2    4    4    3    3
38b    1    -9    2    1    2    4    4    3    3
3a    8    1    3    1    2    4    1    3    3
8a    9    1    2    1    2    4    4    3    3
10a    9    -9    -9    -9    -9    -9    -9    -9    -9



#################################################################################
# (2) commands I tried, with the prompt I got

> who.data <- read.structure("test.str", n.ind=32, n.loc=8, onerowperind=T,
col.lab=1, col.pop=2, ask=F)

 Converting data from a STRUCTURE .stru file to a genind object...

Error in read.structure("test.str", n.ind = 32, n.loc = 8, onerowperind =
T,  :
  only 0's may be mixed with negative subscripts

> who.data <- read.structure("test.str", onerowperind=T, col.lab=1,
col.pop=2, ask=F)

 How many genotypes are there? 32

 How many markers are there? 8

 Converting data from a STRUCTURE .stru file to a genind object...

Error in read.structure("test.str", onerowperind = T, col.lab = 1, col.pop =
2,  :
  only 0's may be mixed with negative subscripts

> who.data <- read.structure("test.str", n.ind=32, onerowperind=T,
col.lab=1, col.pop=2, ask=F)

 How many markers are there? 8

 Converting data from a STRUCTURE .stru file to a genind object...

Error in read.structure("test.str", n.ind = 32, onerowperind = T, col.lab =
1,  :
  only 0's may be mixed with negative subscripts

> who.data <- read.structure("test.str", n.ind=32, n.loc=8, onerowperind=T,
col.lab=1, col.pop=2, ask=F)

 Converting data from a STRUCTURE .stru file to a genind object...

Error in read.structure("test.str", n.ind = 32, n.loc = 8, onerowperind =
T,  :
  only 0's may be mixed with negative subscripts

> who.data <- read.structure("test.str", n.ind=32, n.loc=8,  col.lab=1,
col.pop=2, ask=F)

 Are genotypes coded by a single row (y/n)? y

 Converting data from a STRUCTURE .stru file to a genind object...

Error in read.structure("test.str", n.ind = 32, n.loc = 8, col.lab = 1,  :
  only 0's may be mixed with negative subscripts

> who.data <- read.structure("test.str", n.ind=32, n.loc=8, ask=F)

 Are genotypes coded by a single row (y/n)? y

 Converting data from a STRUCTURE .stru file to a genind object...

Error in read.structure("test.str", n.ind = 32, n.loc = 8, ask = F) :
  only 0's may be mixed with negative subscripts

> who.data <- read.structure(file="test.str", n.ind=32, n.loc=8, ask=F)

 Are genotypes coded by a single row (y/n)? y

 Converting data from a STRUCTURE .stru file to a genind object...

Error in read.structure(file = "test.str", n.ind = 32, n.loc = 8, ask = F) :

  only 0's may be mixed with negative subscripts
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/adegenet-forum/attachments/20110909/3b080a5b/attachment.htm>


More information about the adegenet-forum mailing list