[adegenet-forum] Resampling loci from a large genlight

Jombart, Thibaut t.jombart at imperial.ac.uk
Thu Oct 29 18:54:02 CET 2015


Hi David,

yes, the conversion from genlight to genind is still on the TODO list. The reason for this not existing so far is that I designed genlights to be used when genind objects cannot - ie. when the RAM would explode to store data as genind.

Cheers
Thibaut




________________________________
From: adegenet-forum-bounces at lists.r-forge.r-project.org [adegenet-forum-bounces at lists.r-forge.r-project.org] on behalf of David Dayan [snook91901 at gmail.com]
Sent: 22 October 2015 17:34
To: adegenet-forum at lists.r-forge.r-project.org
Subject: [adegenet-forum] Resampling loci from a large genlight

Hi all,

I'm looking to sample loci from a single population in a large genlight object (13850 loci, 872 diploid individuals), and convert this genlight information to a genind object (to use across other packages/adegenet functions).

Simulated example (calculating He using the Hs() function from 100 sampled loci):

> simdata<-glSim(10,500, ploidy=2)
> pop(simdata)<-rep(c("a","b"),5)
> Hs(df2genind(as.data.frame(seppop(simdata)$a[,sample(1:500, 100)]),sep="/t",ploidy=2))

This is problematic because the df2genind(as.data.frame(genlight)) method doesn't seem to work for diploid data (see below).

> sim2sampled_genind<-df2genind(as.data.frame(seppop(simdata)$a[,sample(1:500, 100)]),sep="/t",ploidy=2)
> head(sim2sampled_genind at tab)

This produces a genind that stores data as binary and therefore cannot represent my actual data (diploid + missing data).

I realize that starting from a genind object and using the @tab slot will solve this, but resampling from a genind this size is exceptionally slow and my ultimate goal is to work this script into a bootstrapping procedure:

So, (a) any advice on converting genlight to genind for diploid data? or (b) is there a better way to sample loci for bootstrapping that is computationally efficient/fast?

Thanks,

David Dayan
Rosenstiel School of Marine and Atmospheric Science
University of Miami


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/adegenet-forum/attachments/20151029/550ccbb7/attachment.html>


More information about the adegenet-forum mailing list