[R-sig-genetics] Microsatellite data query: Data frame to genind conversion using adegent in R

Vojtěch Zeisek vojta at trapa.cz
Fri Dec 9 14:54:49 CET 2016


Hi,
thank You. :-) alleles2loci looks good, I could incorporate it into next 
version of the slides (they are still far from being perfect).
Yours,
V.

Dne pátek 9. prosince 2016 14:36:40 CET, Emmanuel Paradis napsal(a):
> Hi Vojtěch,
> 
> Great slides! The function alleles2loci in pegas can be helpful here: it
> does the operation suggested by Thibaut for all columns at once and you
> can specify the ploidy level. There is a small example in the help page
> and a worked example (with some complications) in the vignette:
> 
> vignette("ReadingFiles")
> 
> If there are no complication in the file (i.e., only the alleles are
> stores in the tabular file), then alleles2loci could be applied directly
> to the output of read.csv or read.delim.
> 
> HTH
> 
> Best,
> 
> Emmanuel
> 
> Le 09/12/2016 à 12:50, Vojtěch Zeisek a écrit :
> > Dne pátek 9. prosince 2016 11:33:21 CET, Bhuller, Ravneet napsal(a):
> >> Hello R-sig-genetics community members,
> >> 
> >> I am using microsatellite data for the first time. It is in csv format.
> >> Individual ids (1314 in total) are in the first column of the file (a
> >> snapshot attached below) and the allelic information of each loci (17
> >> loci)
> >> 
> >>  is in duplicate columns.
> >> 
> >> [cid:F92F6AA3-0C16-4642-843F-476A5B1D6839 at nhm.ac.uk]
> >> 
> >> When I convert this data.frame into genind object using adegent, it is
> >> considering first column as a locus and calculates number of loci as 35
> >> (see below): [cid:423CE768-65F3-4B01-9E38-63CA0FD5ABF1 at nhm.ac.uk]
> >> 
> >> Please if anyone can guide me what is going wrong here. The actual number
> >> of loci is 17 and first column is not a locus.
> > 
> > Hi,
> > it is well documented in the Adegent basics tutorial. Mine shortened
> > version is in https://trapa.cz/en/course-molecular-data-r-2016 (see PDF
> > attachment down the page from slide 42).
> > HTH,
> > V.
-- 
Vojtěch Zeisek
https://trapa.cz/en/

Department of Botany
Faculty of Science, Charles University
Benátská 433/2, Prague, 12801, CZ
https://www.natur.cuni.cz/biology/botany/

Institute of Botany, Academy of Sciences
Zámek 1, Průhonice, 25243, CZ
http://www.ibot.cas.cz/en/

Czech Republic
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <https://stat.ethz.ch/pipermail/r-sig-genetics/attachments/20161209/f109c9b4/attachment-0001.bin>


More information about the R-sig-genetics mailing list