[adegenet-forum] Converting genind object to genlight object
Julian Wittische
jwittische at gmail.com
Thu Mar 17 04:51:58 CET 2016
Hello fellow *adegenet* users and contributors,
I would like to know if the way I converted a genind object to a genlight
object is the proper way, and why does the genlight object is more than
twice as big as the genind object, when the genlight-class purpose is among
others, to have a more efficient storage.
Is this discrepancy a signal I am doing something wrong?
I took only the allele count numbers of the second allele as suggested in
the " Formal "genlight-class" R documentation.
Code:
OMOgenind<-df2genind(OMOloc,ploidy=2,sep=",",NA.char="-9",type="codom",ind.names=make.unique(as.character(OMO[,1]),sep="sec"));
OMOgen<-OMOgenind at tab[,-seq(2,dim(OMOloc)[2],2),drop=FALSE]; # I take only
the second column (allele) for each locus.
OMOgenlight<-new("genlight",gen=OMOgen,ploidy=2,ind.names=make.unique(as.character(OMO[,1]),sep="sec"));
Output:
Have a nice day and thank you in advance,
Julian Wittische
PhD student
Université de Montréal
PS: I found issues with using the NA.char argument in df2genind() in the
previous version and found a lengthy custom fix so thank you very much for
fixing it in 2.0.1.
This email has been sent from a virus-free computer protected by Avast.
www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
<#DDB4FAA8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/adegenet-forum/attachments/20160316/ef3b4718/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Capture.PNG
Type: image/png
Size: 26052 bytes
Desc: not available
URL: <http://lists.r-forge.r-project.org/pipermail/adegenet-forum/attachments/20160316/ef3b4718/attachment-0001.png>
More information about the adegenet-forum
mailing list