<div dir="ltr">Thank you for all the replies. I have been looking at the pp.fst() function in the Hierfstat package. Does the post-seploc data frame need to be converted into something that Hierfstat understands first? The following doesn't seem to work:<div><br># Use seploc to separate loci:<br>gen100_seploc <- seploc(gen100_genind, truenames=TRUE, res.type=c('genind', 'matrix')<br><br># Load Hierfstat</div><div>library(hierfstat)<br><br># Calculate pairwise Fst:<br>gen100_perLocusPWFst <- lapply(gen100_seploc, pp.fst, diploid=TRUE)</div><div><br></div><div>Error in unique.default(Pop) : unique() applies only to vectors<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Sep 13, 2014 at 2:20 PM, Jombart, Thibaut <span dir="ltr"><<a href="mailto:t.jombart@imperial.ac.uk" target="_blank">t.jombart@imperial.ac.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Hi there,<br>
<br>
yes, this function is not optimized for large datasets. You can use the same approach but using functions from the hierfstat package.<br>
<span class=""><br>
Cheers<br>
Thibaut<br>
________________________________________<br>
From: <a href="mailto:adegenet-forum-bounces@lists.r-forge.r-project.org">adegenet-forum-bounces@lists.r-forge.r-project.org</a> [<a href="mailto:adegenet-forum-bounces@lists.r-forge.r-project.org">adegenet-forum-bounces@lists.r-forge.r-project.org</a>] on behalf of Vikram Chhatre [<a href="mailto:crypticlineage@gmail.com">crypticlineage@gmail.com</a>]<br>
</span>Sent: 12 September 2014 18:31<br>
To: <a href="mailto:adegenet-forum@lists.r-forge.r-project.org">adegenet-forum@lists.r-forge.r-project.org</a><br>
Subject: Re: [adegenet-forum] Per locus pairwise Fst<br>
<span class=""><br>
I am revisiting this topic due to some technical problems.<br>
<br>
The task at hand is to estimate pairwise Fst matrices for each locus separately.<br>
<br>
# Genind object is stored in:<br>
gen100_genind<br>
<br>
# Use seploc to separate loci:<br>
gen100_seploc <- seploc(gen100_genind, truenames=TRUE, res.type=c('genind', 'matrix')<br>
<br>
# Calculate pairwise Fst:<br>
gen100_perLocusPWFst <- lapply(gen100_seploc, pairwise.fst, res.type=c('dist', 'matrix'), trunames=TRUE)<br>
<br>
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.<br>
<br>
Is there any way to speed this up? Should I look into any other packages?<br>
<br>
Many thanks for your time and help.<br>
Vikram<br>
<br>
<br>
<br>
<br>
</span><span class="">On Mon, Jul 14, 2014 at 9:16 AM, Vikram Chhatre <<a href="mailto:crypticlineage@gmail.com">crypticlineage@gmail.com</a><mailto:<a href="mailto:crypticlineage@gmail.com">crypticlineage@gmail.com</a>>> wrote:<br>
Perfect! Thank you for both solutions.<br>
<br>
V<br>
<br>
<br>
</span><span class="">On Mon, Jul 14, 2014 at 9:13 AM, Jombart, Thibaut <<a href="mailto:t.jombart@imperial.ac.uk">t.jombart@imperial.ac.uk</a><mailto:<a href="mailto:t.jombart@imperial.ac.uk">t.jombart@imperial.ac.uk</a>>> wrote:<br>
<br>
Hi there,<br>
<br>
you can use seploc to separate loci, and lapply over the resulting list using your prefered fst function.<br>
<br>
Cheers<br>
Thibaut<br>
________________________________________<br>
</span>From: <a href="mailto:adegenet-forum-bounces@lists.r-forge.r-project.org">adegenet-forum-bounces@lists.r-forge.r-project.org</a><mailto:<a href="mailto:adegenet-forum-bounces@lists.r-forge.r-project.org">adegenet-forum-bounces@lists.r-forge.r-project.org</a>> [<a href="mailto:adegenet-forum-bounces@lists.r-forge.r-project.org">adegenet-forum-bounces@lists.r-forge.r-project.org</a><mailto:<a href="mailto:adegenet-forum-bounces@lists.r-forge.r-project.org">adegenet-forum-bounces@lists.r-forge.r-project.org</a>>] on behalf of Vikram Chhatre [<a href="mailto:crypticlineage@gmail.com">crypticlineage@gmail.com</a><mailto:<a href="mailto:crypticlineage@gmail.com">crypticlineage@gmail.com</a>>]<br>
<span class="">Sent: 14 July 2014 14:01<br>
</span>To: <a href="mailto:adegenet-forum@lists.r-forge.r-project.org">adegenet-forum@lists.r-forge.r-project.org</a><mailto:<a href="mailto:adegenet-forum@lists.r-forge.r-project.org">adegenet-forum@lists.r-forge.r-project.org</a>><br>
<div class="HOEnZb"><div class="h5">Subject: [adegenet-forum] Per locus pairwise Fst<br>
<br>
Good morning.<br>
<br>
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?<br>
<br>
Thanks<br>
Vikram<br>
<br>
<br>
<br>
<br>
</div></div></blockquote></div><br></div>