[adegenet-forum] Per locus pairwise Fst

Jombart, Thibaut t.jombart at imperial.ac.uk
Sat Sep 13 20:22:21 CEST 2014


On non-windows systems, mclapply can be used to get a nice speedup, but really the first thing to do is use a function which does computations in a more optimal way. 

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 Vojtěch Zeisek [vojta at trapa.cz]
Sent: 13 September 2014 18:47
To: adegenet-forum at lists.r-forge.r-project.org
Subject: Re: [adegenet-forum] Per locus pairwise Fst

Hello,
R is basically single threaded. Some packages/functions implement
parallelisation and if not, You can do it yourself. As You use function from
apply family, it should be easy, although I don't have solution right
available in my pocket. There are also several possibilities and it might
require some testing to find out the best solution for You task and equipment.
See http://www.r-bloggers.com/parallel-computing-in-r/ and details about
mentioned functions on http://cran.r-project.org/ When You google for parallel
computing in R, You get many links...
Good luck!
Vojtěch

Dne Pá 12. září 2014 13:31:46, Vikram Chhatre napsal(a):
> I am revisiting this topic due to some technical problems.
>
> The task at hand is to estimate pairwise Fst matrices for each locus
> separately.
>
> # Genind object is stored in:
> gen100_genind
>
> # Use seploc to separate loci:
> gen100_seploc <- seploc(gen100_genind, truenames=TRUE, res.type=c('genind',
> 'matrix')
>
> # Calculate pairwise Fst:
> gen100_perLocusPWFst <- lapply(gen100_seploc, pairwise.fst,
> res.type=c('dist', 'matrix'), trunames=TRUE)
>
> For a data set consisting of 30 populations, 20 individuals each, 1000 loci
> and 2 alleles per locus (1.2 million data points), it takes up to 6 hours
> to estimate the pairwise Fst matrix with this method.
>
> Is there any way to speed this up?  Should I look into any other packages?
>
> Many thanks for your time and help.
> Vikram
>
> On Mon, Jul 14, 2014 at 9:16 AM, Vikram Chhatre <crypticlineage at gmail.com>
>
> wrote:
> > Perfect!  Thank you for both solutions.
> >
> > V
> >
> > On Mon, Jul 14, 2014 at 9:13 AM, Jombart, Thibaut <
> >
> > t.jombart at imperial.ac.uk> wrote:
> >> Hi there,
> >>
> >> you can use seploc to separate loci, and lapply over the resulting list
> >> using your prefered fst function.
> >>
> >> 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 Vikram
> >> Chhatre [crypticlineage at gmail.com]
> >> Sent: 14 July 2014 14:01
> >> To: adegenet-forum at lists.r-forge.r-project.org
> >> Subject: [adegenet-forum] Per locus pairwise Fst
> >>
> >> Good morning.
> >>
> >> I would like to estimate per locus pairwise Fst for populations, but it
> >> appears that Adegenet only estimates this over all loci (i.e. single
> >> matrix).  What I would like is one matrix per locus.  Has anyone modified
> >> the functions or know of alternative programs that can do this?
> >>
> >> Thanks
> >> Vikram
--
Vojtěch Zeisek
http://trapa.cz/en/

Department of Botany, Faculty of Science
Charles University in Prague
Benátská 2, Prague, 12801, CZ
http://botany.natur.cuni.cz/en/

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

Czech Republic


More information about the adegenet-forum mailing list