Re: [R-sig-phylo] simulate Ne changes on a given phylogeny

2015-10-17 Thread Liam J. Revell

Hi Jacob.

Can I add the somewhat boring & probably obvious comment that under the 
neutral theory of molecular evolution the substitution rate is 
independent of the effective population size?


All the best, Liam

Liam J. Revell, Associate Professor of Biology
University of Massachusetts Boston
web: http://faculty.umb.edu/liam.revell/
email: liam.rev...@umb.edu
blog: http://blog.phytools.org

On 10/17/2015 11:01 PM, Jacob Berv wrote:

Hmmm that seems somewhat indirect but might work… I’ll look into that.

To give you more information - I’m actually trying to come up with a way to 
test the idea that substitution rate shifts detected with a relaxed molecular 
clock (BEAST) may be driven by changes in effective population size. Simulating 
data for particular scenarios, and then running that simulated data through 
BEAST could be a useful way to test some explicit hypotheses I’m interested in. 
But I have to simulate the data first.

Jake



On Oct 17, 2015, at 10:40 PM, Brian O'Meara  wrote:

Dick Hudson's ms software can simulate gene trees along a species tree or 
network with migration, changing population size, etc. The package phyclust can 
call ms. You could then just simulate nucleotides on these gene trees.

Best,
Brian

___
Brian O'Meara
Associate Professor
Dept. of Ecology & Evolutionary Biology
U. of Tennessee, Knoxville
http://www.brianomeara.info 

Postdoc collaborators wanted: http://nimbios.org/postdocs/ 

Calendar: http://www.brianomeara.info/calendars/omeara 

On Sat, Oct 17, 2015 at 10:12 PM, Jacob Berv mailto:jakeberv.r.sig.ph...@gmail.com>> wrote:
Dear R-sig-phylo,

I have a somewhat general simulation question and I was hoping someone on here 
might have some insight.

I’m trying to figure out if it’s possible to simulate nucleotide sequence data (an arbitrary 
number of neutral loci under a multi species coalescent model), on an ultrametric input topology 
(where tips represent species), with user defined changes in effective population size at the 
start and end of a particular internal branch. In my searching I’ve come across some software by 
Deren Eaton (https://github.com/dereneaton/simLoci  
>) that 
looks like it might do what I want - but I’m not sure. It looks like I can specify migration 
events between taxa, but perhaps not population size changes on internal branches. There are many 
other applications for simulating sequence data but I am not familiar with any of them. Any 
thoughts would be appreciated!

Thanks,

Jacob Berv

Ph.D. Student
Lovette Lab
Cornell Laboratory of Ornithology


 [[alternative HTML version deleted]]

___
R-sig-phylo mailing list - R-sig-phylo@r-project.org 

https://stat.ethz.ch/mailman/listinfo/r-sig-phylo 

Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/ 



Jacob Berv

Ph.D. Student
Lovette Lab
Cornell Laboratory of Ornithology


[[alternative HTML version deleted]]

___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/



___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

Re: [R-sig-phylo] simulate Ne changes on a given phylogeny

2015-10-17 Thread Jacob Berv
Hmmm that seems somewhat indirect but might work… I’ll look into that.

To give you more information - I’m actually trying to come up with a way to 
test the idea that substitution rate shifts detected with a relaxed molecular 
clock (BEAST) may be driven by changes in effective population size. Simulating 
data for particular scenarios, and then running that simulated data through 
BEAST could be a useful way to test some explicit hypotheses I’m interested in. 
But I have to simulate the data first.

Jake


> On Oct 17, 2015, at 10:40 PM, Brian O'Meara  wrote:
> 
> Dick Hudson's ms software can simulate gene trees along a species tree or 
> network with migration, changing population size, etc. The package phyclust 
> can call ms. You could then just simulate nucleotides on these gene trees. 
> 
> Best,
> Brian
> 
> ___
> Brian O'Meara
> Associate Professor
> Dept. of Ecology & Evolutionary Biology
> U. of Tennessee, Knoxville
> http://www.brianomeara.info 
> 
> Postdoc collaborators wanted: http://nimbios.org/postdocs/ 
> 
> Calendar: http://www.brianomeara.info/calendars/omeara 
> 
> On Sat, Oct 17, 2015 at 10:12 PM, Jacob Berv  > wrote:
> Dear R-sig-phylo,
> 
> I have a somewhat general simulation question and I was hoping someone on 
> here might have some insight.
> 
> I’m trying to figure out if it’s possible to simulate nucleotide sequence 
> data (an arbitrary number of neutral loci under a multi species coalescent 
> model), on an ultrametric input topology (where tips represent species), with 
> user defined changes in effective population size at the start and end of a 
> particular internal branch. In my searching I’ve come across some software by 
> Deren Eaton (https://github.com/dereneaton/simLoci 
>  
>  >) that looks like it might do what I 
> want - but I’m not sure. It looks like I can specify migration events between 
> taxa, but perhaps not population size changes on internal branches. There are 
> many other applications for simulating sequence data but I am not familiar 
> with any of them. Any thoughts would be appreciated!
> 
> Thanks,
> 
> Jacob Berv
> 
> Ph.D. Student
> Lovette Lab
> Cornell Laboratory of Ornithology
> 
> 
> [[alternative HTML version deleted]]
> 
> ___
> R-sig-phylo mailing list - R-sig-phylo@r-project.org 
> 
> https://stat.ethz.ch/mailman/listinfo/r-sig-phylo 
> 
> Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/ 
> 

Jacob Berv

Ph.D. Student
Lovette Lab
Cornell Laboratory of Ornithology


[[alternative HTML version deleted]]

___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

Re: [R-sig-phylo] simulate Ne changes on a given phylogeny

2015-10-17 Thread Brian O'Meara
Dick Hudson's ms software can simulate gene trees along a species tree or
network with migration, changing population size, etc. The package phyclust
can call ms. You could then just simulate nucleotides on these gene trees.

Best,
Brian

___
Brian O'Meara
Associate Professor
Dept. of Ecology & Evolutionary Biology
U. of Tennessee, Knoxville
http://www.brianomeara.info

Postdoc collaborators wanted: http://nimbios.org/postdocs/
Calendar: http://www.brianomeara.info/calendars/omeara

On Sat, Oct 17, 2015 at 10:12 PM, Jacob Berv  wrote:

> Dear R-sig-phylo,
>
> I have a somewhat general simulation question and I was hoping someone on
> here might have some insight.
>
> I’m trying to figure out if it’s possible to simulate nucleotide sequence
> data (an arbitrary number of neutral loci under a multi species coalescent
> model), on an ultrametric input topology (where tips represent species),
> with user defined changes in effective population size at the start and end
> of a particular internal branch. In my searching I’ve come across some
> software by Deren Eaton (https://github.com/dereneaton/simLoci <
> https://github.com/dereneaton/simLoci>) that looks like it might do what
> I want - but I’m not sure. It looks like I can specify migration events
> between taxa, but perhaps not population size changes on internal branches.
> There are many other applications for simulating sequence data but I am not
> familiar with any of them. Any thoughts would be appreciated!
>
> Thanks,
>
> Jacob Berv
>
> Ph.D. Student
> Lovette Lab
> Cornell Laboratory of Ornithology
>
>
> [[alternative HTML version deleted]]
>
> ___
> R-sig-phylo mailing list - R-sig-phylo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
> Searchable archive at
> http://www.mail-archive.com/r-sig-phylo@r-project.org/

[[alternative HTML version deleted]]

___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

[R-sig-phylo] simulate Ne changes on a given phylogeny

2015-10-17 Thread Jacob Berv
Dear R-sig-phylo,

I have a somewhat general simulation question and I was hoping someone on here 
might have some insight.

I’m trying to figure out if it’s possible to simulate nucleotide sequence data 
(an arbitrary number of neutral loci under a multi species coalescent model), 
on an ultrametric input topology (where tips represent species), with user 
defined changes in effective population size at the start and end of a 
particular internal branch. In my searching I’ve come across some software by 
Deren Eaton (https://github.com/dereneaton/simLoci 
) that looks like it might do what I 
want - but I’m not sure. It looks like I can specify migration events between 
taxa, but perhaps not population size changes on internal branches. There are 
many other applications for simulating sequence data but I am not familiar with 
any of them. Any thoughts would be appreciated!

Thanks,

Jacob Berv

Ph.D. Student
Lovette Lab
Cornell Laboratory of Ornithology


[[alternative HTML version deleted]]

___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

Re: [R-sig-phylo] Question on pCCA (phyl.cca)

2015-10-17 Thread krzysztofbartoszek
Hi Julien,

You are right that power is a big (and generally still unexplored in the PCM 
context) issue. 
One way to address the question is after estimating the parameters of the 
BM/OU/mvSLOUCH model
you can calculate the covariance/correlation function of the traits, say 
Cov(Y)(t)/Corr(Y)(t) where Y is the 2D vector trait+environment variable. The 
mvSLOUCH package returns these, I guess similar as stationary(model_ou) in 
mvMorph? The of course one can look at the magnitude of the trait+environment 
correlation coefficient.  Regarding power difficult to say, model selection BM 
v OUBM might be difficult if the sample is small. But on the other hand in the 
mvSLOUCH paper Bartoszek et. al. 
(2012) we had a n=33 Cervidae set and a 2dim OU+1dim BM clearly outperformed 
3dim BM (by AICc). If the trait is related to the environment then I would 
hazard that this should be picked up. Estimation of individual parameters in 
the SDE can be a tough thing but from my experience the function Cov(Y)(now) is 
decently estimated. Which makes sense - this is a complex combination of the 
SDE parameters and the ML tries to fit them to the contemporary sample which is 
described by E(Y)(now), 
Cov(Y)(now). In the 1dim OU,BM cases this was studied quite well by us (Serik 
Sagitov) and Cecile Ane et. al. and there seems to be quite a bit of power to 
get at these parameter combinations. 

Another  possibility to look at is at the conditional expectation 
E(trait | environment)(now) - the evolutionary regression or its limit the 
optimal/limiting regression E(trait | environment)(infinity) .

To get significance is not that easy, I guess the best way is a parametric 
bootstrap as you suggest below. But this depends on the pylogeny size, if it 
will not take overly long.

I raised this point because depending on the model i.e. BM/OU/mvSLOUCH the 
design matrix of the regression should be different (Hansen et. al. 2008 
discuss this at length). And the interpretation of the regression parameters 
might be different - e.g. you could have a phylogenetic lag in the estimated 
regression coefficient if the design matrix is just the measured variable.

Best wishes
Krzysztof

> Hi Krzysztof,
> 
> I agree with you that if you want to test explicitly adaptation in a 
> regression framework (i.e. environmental variables as predictors), 
> slouch/mvslouch is more sounding than doing a simple regression ((p)GLS) 
> or multiple regression. 
> I emphasize here that the coefficients of a regression model and the 
> correlations are really distincts. It's because all is about the nature 
> of the variation in the response variable in a regression model (and 
> it's why that changing the variables in a multiple regression assume 
> different nature of errors terms).
> 
> The initial question was on how to obtain the correlations between the 
> traits, and possibly their significance, while CCA provides only the 
> correlation between the traits sets.
> 
> The significance of the correlations computed through multivariate 
> approaches may be impeded by the number of parameters to estimate/sample 
> size (a power issue), but in multiple regression setting if there is 
> correlated independent variables the standard errors will be impacted 
> and thus the p-values (in a more misleading way). 
> It's also true that, as Krzystof pointed out, BM may not be the best 
> evolutionary model for describing the correlation in the residuals.
> However the number of parameters to estimate will be even greater (for 
> OU multivariate model such as in mvSLOUCH), and we may lack power in the 
> significance tests of the correlations, no?
> 
> 
> Julien
> 
> 
> > Date: Sat, 17 Oct 2015 14:09:25 +0200
> > From: krzysztofbartos...@wp.pl
> > To: r-sig-phylo@r-project.org
> > CC: r-sig-phylo@r-project.org
> > Subject: Re: [R-sig-phylo] Question on pCCA (phyl.cca)
> >
> > Hi Sandra, Julien and Liam!
> > One thought that I had is since you have an environmental variable and 
> one supposedly correlated with it is that then the slouch/mvSLOUCH (on 
> CRAN) models could be a possibility? In them you can have the 
> environmental variable(s) evolving as a Brownian motion (i.e. random 
> drift, no selecetion) and then the responding one(s) as an OU whose 
> primary optimum depends on the state of the environment. As far as I 
> followed from the discussion you had either both environment and 
> responding trait
> > following a Brownian motion (meaning there is correlation between them 
> but not adaptation) or both following an OU process (meaning that the 
> environment is trying to adapt to something which might not be justified 
> biologically).
> >
> > Sandra if you think such a setup - a trait adapting to a primary optimum 
> defined by a randomly evolving environment (this is not the same as 
> being correlated with it) is something useful for you I can help you out 
> with using mvSLOUCH.
> >
> > You can have a look a

Re: [R-sig-phylo] Question on pCCA (phyl.cca)

2015-10-17 Thread Julien Clavel
Hi Krzysztof,

I agree with you that if you want to test explicitly adaptation in a regression 
framework (i.e. environmental variables as predictors), slouch/mvslouch is more 
sounding than doing a simple regression ((p)GLS) or multiple regression. 
I emphasize here that the coefficients of a regression model and the 
correlations are really distincts. It's because all is about the nature of the 
variation in the response variable in a regression model (and it's why that 
changing the variables in a multiple regression assume different nature of 
errors terms).

The initial question was on how to obtain the correlations between the traits, 
and possibly their significance, while CCA provides only the correlation 
between the traits sets.

The significance of the correlations computed through multivariate approaches 
may be impeded by the number of parameters to estimate/sample size (a power 
issue), but in multiple regression setting if there is correlated independent 
variables the standard errors will be impacted and thus the p-values (in a more 
misleading way). 
It's also true that, as Krzystof pointed out, BM may not be the best 
evolutionary model for describing the correlation in the residuals.
However the number of parameters to estimate will be even greater (for OU 
multivariate model such as in mvSLOUCH), and we may lack power in the 
significance tests of the correlations, no?


Julien


> Date: Sat, 17 Oct 2015 14:09:25 +0200
> From: krzysztofbartos...@wp.pl
> To: r-sig-phylo@r-project.org
> CC: r-sig-phylo@r-project.org
> Subject: Re: [R-sig-phylo] Question on pCCA (phyl.cca)
>
> Hi Sandra, Julien and Liam!
> One thought that I had is since you have an environmental variable and one 
> supposedly correlated with it is that then the slouch/mvSLOUCH (on CRAN) 
> models could be a possibility? In them you can have the environmental 
> variable(s) evolving as a Brownian motion (i.e. random drift, no selecetion) 
> and then the responding one(s) as an OU whose primary optimum depends on the 
> state of the environment. As far as I followed from the discussion you had 
> either both environment and responding trait
> following a Brownian motion (meaning there is correlation between them but 
> not adaptation) or both following an OU process (meaning that the environment 
> is trying to adapt to something which might not be justified biologically).
>
> Sandra if you think such a setup - a trait adapting to a primary optimum 
> defined by a randomly evolving environment (this is not the same as being 
> correlated with it) is something useful for you I can help you out with using 
> mvSLOUCH.
>
> You can have a look at:
> * Hansen, T.F.,Pienaar,J.,Orzack,S.H.,2008. A comparative method for studying 
> adaptation to a randomly evolving environment.Evolution 62,1965–1977. 
> (for slouch model)
> * Bartoszek, K.,Pienaar,J.,Mostad,P.,Andersson,S.,Hansen,T.F.,2012. A 
> phylogenetic comparative method for studying multivariate adaptation 
> .J.Theor.Biol. 314,204–215. (for mvSLOUCH model)
>
> Best wishes
> Krzysztof
>
> ___
> R-sig-phylo mailing list - R-sig-phylo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
> Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/
  
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/


Re: [R-sig-phylo] Question on pCCA (phyl.cca)

2015-10-17 Thread krzysztofbartoszek
Hi Sandra, Julien and Liam!
One thought that I had is since you have an environmental variable and one 
supposedly correlated with it is that then the slouch/mvSLOUCH (on CRAN) models 
could be a possibility? In them you can have the environmental variable(s) 
evolving as a Brownian motion (i.e. random drift, no selecetion) and then the 
responding one(s) as an OU whose primary optimum depends on the state of the 
environment. As far as I followed from the discussion you had either both 
environment and responding trait 
following a Brownian motion (meaning there is correlation between them but not 
adaptation) or both following an OU process (meaning that the environment is 
trying to adapt to something which might not be justified biologically).

Sandra if you think such a setup - a trait adapting to a primary optimum 
defined by a randomly evolving environment (this is not the same as being 
correlated with it) is something useful for you I can help you out with using 
mvSLOUCH.

You can have a look at:
* Hansen, T.F.,Pienaar,J.,Orzack,S.H.,2008. A comparative method for studying 
adaptation to a randomly evolving environment.Evolution 62,1965–1977. 
(for slouch model)
* Bartoszek, K.,Pienaar,J.,Mostad,P.,Andersson,S.,Hansen,T.F.,2012. A 
phylogenetic comparative method for studying multivariate adaptation 
.J.Theor.Biol. 314,204–215. (for mvSLOUCH model)

Best wishes
Krzysztof

___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/