[adegenet-forum] tetraploid DAPC

Jessica Perez Alquicira perezalquicira at gmail.com
Tue Jan 3 18:02:04 CET 2017


Dear Thibaut, I have this file format (including 149 samples, pop number, 8
loci with four alleles)
Buen137,1,04/07/04/07,11/13/11/13,05/07/05/07,06/19/21/06,
05/06/05/06,03/03/03/03,03/05/03/05,07/07/07/07

I am doing the following things:
obj<-read.csv("testCSV.csv",header=FALSE)
obj2 <- df2genind(obj, sep = "/", ind.names = TRUE, loc.names = FALSE, pop
= TRUE, ploidy = 4, type = c("codom"))

And I am getting this error:
Error in `rownames<-`(`*tmp*`, value = "TRUE") :
  length of 'dimnames' [1] not equal to array extent

Not sure what to do, any help?
Thanks so much for your support


2017-01-02 10:04 GMT-06:00 Thibaut Jombart <thibautjombart at gmail.com>:

> Dear Jessica,
>
> as you might have noted from the doc of read.structure, the function only
> work with diploid data. Tetraploid data are no problem in adegenet, but
> you'll need to get them in differently. I would suggest the following
> workflow:
>
> 1) get your data in a txt/csv file in a format where data at each locus
> are coded as character strings where alleles are separated by a given
> symbol (e.g. "-", or "/")
> 001-010-001-002
>
> 2) read them into R using read.table or read.csv
>
> 3) use df2genind to convert data into a genind object
>
> The basics tutorial should help with this last step:
> https://github.com/thibautjombart/adegenet/wiki/Tutorials
>
> Best
> Thibaut
>
>
> --
> Dr Thibaut Jombart
> Lecturer, Department of Infectious Disease Epidemiology, Imperial College
> London
> Head of RECON: repidemicsconsortium.org
> sites.google.com/site/thibautjombart/
> github.com/thibautjombart
> Twitter: @TeebzR <http://twitter.com/TeebzR>
> +44(0)20 7594 3658
>
> On 30 November 2016 at 13:28, Jessica Perez Alquicira <
> perezalquicira at gmail.com> wrote:
>
>> Hi, I would like to do a dapc on tetraploid data. My file format is in
>> structure.
>> I have not find this information in the manual. Could you please let me
>> know how could I do that.
>>
>> Best
>>
>> _______________________________________________
>> adegenet-forum mailing list
>> adegenet-forum at lists.r-forge.r-project.org
>> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo
>> /adegenet-forum
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/adegenet-forum/attachments/20170103/6d8b8cd7/attachment.html>


More information about the adegenet-forum mailing list