[adegenet-forum] read.genepop for haploid data

Jombart, Thibaut t.jombart at imperial.ac.uk
Wed Jul 6 12:53:54 CEST 2011


Hello,

read.genepop has been designed for diploid data. For haploid data, please use read.table to read the data in R and df2genind to convert the table to genind. You'll probably need to remove the "POP" lines from the original file before importing it.

Will add a warning in the doc of the function.

Cheers

Thibaut

--
######################################
Dr Thibaut JOMBART
MRC Centre for Outbreak Analysis and Modelling
Department of Infectious Disease Epidemiology
Imperial College - Faculty of Medicine
St Mary’s Campus
Norfolk Place
London W2 1PG
United Kingdom
Tel. : 0044 (0)20 7594 3658
t.jombart at imperial.ac.uk
http://sites.google.com/site/thibautjombart/
http://adegenet.r-forge.r-project.org/
________________________________
From: adegenet-forum-bounces at r-forge.wu-wien.ac.at [adegenet-forum-bounces at r-forge.wu-wien.ac.at] on behalf of Vinson Doyle [sonofvin at gmail.com]
Sent: 05 July 2011 22:01
To: adegenet-forum at r-forge.wu-wien.ac.at
Subject: [adegenet-forum] read.genepop for haploid data

I am unable to import a haploid dataset using read.genepop.  Here is a look at the first several rows of the dataset:

Locus14F4, Locus10D10, Locus2C1, LocusF9
    POP
9996gjs08211,    260    218    188    248
9997gjs08214,    260    218    188    248
9998gjs08216,    260    218    188    248
9999IMI319418,    260    220    188    248
POP
1002BC1,        318    278    214    284
1004BC3,        318    278    214    286
1005BC4,        249    283    214    285
1006BC5,        000    278    214    284
1007BC6,        320    278    214    284
1008BC7,        320    278    214    284
1009BC8,        320    278    000    000
1010BC,            320    278    214    284
1011BC10,        320    278    000    000
1013BC12,        320    278    214    284
1025BC24,        320    278    000    000
9995glo8248,    324    280    214    284
9994pmap261,    320    278    214    284

If I were to add "000" to a single individual at a single locus, I have no problem importing.  Otherwise, I receive the following message:

Converting data from a Genepop .gen file to a genind object...

File description:
Error in df2genind(X = X, pop = pop, missing = missing, ploidy = 2) :
  2 alleles cannot be coded by a total of 3 characters

Any help would be greatly appreciated.

Thanks,
Vinson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/adegenet-forum/attachments/20110706/21c0dc79/attachment.htm>


More information about the adegenet-forum mailing list