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

2015-11-02 Thread Rob Lanfear
Hi Jake,

Weighing in late here, and just with an opinion on your last question.

In my opinion, it is unlikely that the mutation probability per generation
would change very rapidly. On the assumption that it is already somewhere
near some limit (e.g. the drift barrier that Lynch proposed, or some other
limit), then a rapid change would require the fixation of some alleles of
large effect, which is unlikely.

However, the mutation rate per year could change relatively rapidly, e.g.
because the generation time can change with demography. (E.g., higher
offspring survival leads to a shorter generation time, all else being
equal).

Finally, I think it's highly likely that demographic fluctuations influence
the substitution rate, independently of the mutation rate, via their
influence on the strength of genetic drift. Pretty much all the theoretical
and empirical results point in that direction, for non-neutral mutations.

Cheers,

Rob

On 19 October 2015 at 03:04, Jacob Berv 
wrote:

> Yes, this has come up in my reading…but there do seem to be situations
> where ’nearly neutral’ substitutions can be negatively or positively
> associated with population size:
>
> From Lanfear 2014 Population size and the rate of evolution:
>
> "Putting aside variation in the mutation rate, we largely expect the total
> rate of evolution to be negatively correlated with Ne if slightly
> deleterious mutations dominate evolution, and to be positively correlated
> with Ne if advantageous mutations dominate evolution.”
> "On the other hand, any process that leads to an association between Ne
> and mutation rates will cause a similar association between Ne and neutral
> and effectively neutral substitution rates. These processes could include
> effects such as the evolution of mutation rates, and the co-variation of Ne
> with life-history traits such as generation time”
>
> I think I need to read more about how to simulate these different kinds of
> demographic scenarios.
>
> I suppose the question is, what is the more likely null hypothesis? That
> mutation rates can change extremely rapidly? Or that demographic
> fluctuations (pop size, generation time) can induce changes in the
> detectable substitution rate among lineages.
>
> Jake
>
>
>
> > On Oct 17, 2015, at 11:21 PM, Liam J. Revell 
> wrote:
> >
> > 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/ <
> http://nimbios.org/postdocs/>
> >>> Calendar: http://www.brianomeara.info/calendars/omeara <
> http://www.brianomeara.info/calendars/omeara>
> >>> On Sat, Oct 17, 2015 at 10:12 PM, Jacob Berv <
> 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
>  <
> https://github.com/dereneaton/simLoci <
> https://github.com/dereneaton/

Re: [R-sig-phylo] Adding random branches to tree recursively

2015-11-02 Thread Juan Antonio Balbuena

  
  
Thank you very much Liam,
You are always so helpful.

 I tried you code and get this warning:

Warning message:
In bind.tree(tree, tip, where = where, position = pp) :
 one tree has no branch lengths, they have been ignored

After adding edge.length= runif(1), it is working as it should.

All the best

Juan


El 30/10/2015 a las 18:16, Liam J.
  Revell escribió:

Hola
  Juan.
  
  
  position is distance below the specified node (or tip) so it has
  to be less than the the length of the edge to which the tip is
  being added or else you will get an error. You could modify as
  follows:
  
  
  node<-which(tree$tip.label==tip.name)
  
  tree<-bind.tip(tree,where=node,position=
  
  runif(n=1)*tree$edge.length[which(tree$edge[,2]==node)])
  
  
  and iterate it over the tips you want to add.
  
  
  - 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/30/2015 1:03 PM, Juan Antonio Balbuena wrote:
  
  Hello

I need to add branches to a tree at different, predefined tips.
For

instance:


th <- rtree(10)


I have an object HP_sim$nameH with the taxa names:


HP_sim$nameH
  

[1] "H1" "H2" "H3" "H4" "H5" "H6" "H7" "H8" "H9" "H10"


then

th$tip.label <- HP_sim$nameH


In a second object, I have the tips where the branches should be
added:


HP_sim$fai
  

[1] 1 4 7 9 10


(That is at H1, H4, H7, H9 and H10)


Now I wrote this syntax (where n.fai = 5):


for (i in 1:n.fai) th <- bind.tip(th,
HP_sim$nameH[HP_sim$fai[i]],

  where =

which(th$tip.label==HP_sim$nameH[HP_sim$fai[i]]), edge.length=
runif(1),

position=runif(1))


However, it doesn't work and get this error:


Error in bind.tree(tree, tip, where = where, position = pp) :
'position'

is larger than the branch length


Any help would be very much appreciated.


Thank you very much for your attention


Juan A. Balbuena








--


Dr. Juan A. Balbuena

Cavanilles Institute of Biodiversity and Evolutionary Biology

University of Valencia http://www.uv.es/~balbuena



P.O. Box 22085

http://www.uv.es/cophylpaco

46071 Valencia, Spain

e-mail: j.a.balbu...@uv.es tel.
+34 963 543

658    fax +34 963 543 733



*NOTE!*For shipments by EXPRESS COURIER use the following street
address:

C/ Catedrático José Beltrán 2, 46980 Paterna (Valencia), Spain.






___

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/


  
  
  


-- 
  
  

  Dr.
Juan
A. Balbuena 
Cavanilles Institute of Biodiversity and Evolutionary
Biology 
University of
Valencia           
           
           
        http://www.uv.es/~balbuena

P.O. Box
22085           
           
           
           
    http://www.uv.es/cophylpaco
46071 Valencia,
Spain

e-mail: j.a.balbu...@uv.es   
tel.
+34 963 543 658    fax +34 963 543 733 
 
NOTE! For shipments by EXPRESS COURIER use
  the following street
  address: 
  C/ Catedrático José Beltrán 2, 46980 Paterna (Valencia),
  Spain. 
  ++

Re: [R-sig-phylo] Error message when running gls with estimated lambda

2015-11-02 Thread Antonella Soro
dear all,

like kari allen in june 2011, i am trying to "to run Pagels GLS in R and I have 
consistently encountered
an error message (see script and error message below). When I fix the
lambda value to 0 or 1, I do get a result, but when I let lambda vary
(ie. set "fixed=F" instead of "fixed=T"), I get an error message. Any ideas?
"

> pagel.data<-corPagel(1,phy=gls.phylo1,fixed=FALSE)
> pagel.gls8<-gls(Gst~log.Body_size+Diet+Behavior+Max_Geo+He,correlation=pagel.data,data=data,na.action=na.exclude,
>  method="ML")

Error in corFactor.corStruct(object) : 
  NA/NaN/Inf in foreign function call (arg 1)

i could not find any answer to kari's post.

any help is very much appreciated

thank you very much

antonella


***

Dr. Antonella Soro
Institut f�r Biologie / Allgemeine Zoologie
Martin-Luther-Universit�t Halle-Wittenberg
Hoher Weg 8
D-06120 Halle (Saale)
Germany

t: 0049 345 55 26 504
f: 0049 345 55 27 428






[[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/