Re: [R-sig-phylo] Simulate node ages given known topology

2011-04-12 Thread Joe Felsenstein


Gene Hunt said:

Brian Sidlauskas did this in an Evolution paper in 2008 (based on  
Yang and Rannala 1997):


Sidlauskas, Brian L. 2008. Continuous and arrested morphological  
diversification in sister clades of characiform fishes: a  
phylomorphospace approach. Evolution 62(12): 3135-3156.


He had a morphological tree without fossil or molecular branch  
lengths.  The branch lengths were based on rates of speciation,  
extinction and sampling, and so it would be a different approach  
than the coalescent theory, I believe.   I think Brian has R code  
for it; you may want to contact him directly.


In my 2004 book, on pages  570-571 I note the use of a time  
transformation that makes simulation of birth-death processes easy.   
This is based on Bruce Rannala's 1997 work.


If you want to start out with the first fork in the tree at time T  
ago, you want to take your N tip species and choose uniformly from   
2, 3, ..., N-1 to choose the number of those tips that are descended  
from the left branch of the fork.  Say this is called K.   Then you  
need to simulate a birth-death process for K tips (the subtree  
descended from the left fork), and another for N-K tips for the right  
fork.   The result will be a fairly quick algorithm for simulating a  
BD process that has its oldest fork T units of time ago and leads to  
exactly N tips.


If instead you just want the process to start T units of time ago,  
and have the oldest fork occur some time after that (determined by  
the BD process), then that is even easier using the time- 
transformation trick.


I do not know the R packages well enough to know whether one of them  
implements this, but I am sure someone will comment on that.


Joe

Joe Felsenstein, j...@gs.washington.edu
 Dept. of Genome Sciences, Univ. of Washington
 Box 355065, Seattle, WA 98195-5065 USA

___
R-sig-phylo mailing list
R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo


Re: [R-sig-phylo] Simulate node ages given known topology

2011-04-12 Thread Stadler Tanja
Hey Andy,

Simulating the bifurcation times in a tree with n extant species and age t 
(where t is either mrca or the origin of the first species), assuming constant 
speciation and extinction rates (and possibly a sampling probability rho), can 
be done within the R package TreeSim using the function:
sim.bd.taxa.age

Note: the output is a tree with branch length. Therefore, use 
branching.times(tree) for obtaining the bifurcation times. These bifurcation 
times can be put on your constrained tree topology in the following: 

1) sort (or rank) the interior nodes in your tree where each sorting is 
equally likely (the resulting tree is called ranked tree, see eg SempleSteel 
Phylogenetics 2003. For sorting the nodes uniformly at random, you can use the 
shuffle idea introduced in Ford, Matsen, Stadler 2009 Syst Biol). 
2) Then the i-th largest branching time is put on the i-th node in your tree. 

1-2) works as ranked tree and branching time distribution are independent under 
the birth-death process and each ranked tree has equal probability.

Simulating 1) is fairly easy with this shuffle concept, if you have questions 
or need help, let me know!

Best 
Tanja Stadler
___
R-sig-phylo mailing list
R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo


[R-sig-phylo] Running Mesquite.R

2011-04-12 Thread Alanna Maltby
Dear all
 
I am having trouble installing Mesquite for R on both my computers. On my 
laptop I am running Windows 7 32 bit and on my desktop I am running Windows XP 
64 bit. Both have the latest versions of Java (the 64 bit version one on my 
desktop), R and Mesquite installed. I have installed R packages ape and rJava 
as well.
 
On my desktop I have installed Mesquite for R and I can see the R options on 
the menu when I 'Trace Character History', but clicking on them results in the 
error R can't be started. It appears that the JRI library file cannot be 
found. See log for more details. I can see the jri.dll file in the folder 
'lib', but apparently Mesquite can't. Any ideas?
 
On my laptop I can't get Mesquite for R to install. When I try to install it, I 
get the error: Installation was UNSUCCESSFUL; Mesquite will attempt to restore 
any previous versions. Uninstalling and reinstalling Mesquite makes no 
difference.
 
Any thoughts much appreciated - I only need it to work on one of my computers!
 
Best wishes,
 
Alanna
 
 
-
Alanna Maltby
PhD Student - Evolution of Echolocation in Bats
University College London and Institute of Zoology

Tel: 020 7449 6322
Web: www.zsl.org/alannamaltby



The Zoological Society of London is incorporated by Royal Charter
Principal Office England. Company Number RC000749
Registered address: 
Regent's Park, London, England NW1 4RY
Registered Charity in England and Wales no. 208728 

_
This e-mail has been sent in confidence to the named add...{{dropped:20}}

___
R-sig-phylo mailing list
R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo


Re: [R-sig-phylo] Running Mesquite.R

2011-04-12 Thread Hilmar Lapp

Hi Alanna,

I'm afraid I can't help you much on the Mesquite side, and that I  
don't use Windows doesn't help either, but would you mind posting your  
query to the Mesquite users list (which I know Wayne reads)? I could  
do that for you, but then you might miss the answers.


-hilmar

On Apr 12, 2011, at 12:27 PM, Alanna Maltby wrote:


Dear all

I am having trouble installing Mesquite for R on both my computers.  
On my laptop I am running Windows 7 32 bit and on my desktop I am  
running Windows XP 64 bit. Both have the latest versions of Java  
(the 64 bit version one on my desktop), R and Mesquite installed. I  
have installed R packages ape and rJava as well.


On my desktop I have installed Mesquite for R and I can see the R  
options on the menu when I 'Trace Character History', but clicking  
on them results in the error R can't be started. It appears that  
the JRI library file cannot be found. See log for more details. I  
can see the jri.dll file in the folder 'lib', but apparently  
Mesquite can't. Any ideas?


On my laptop I can't get Mesquite for R to install. When I try to  
install it, I get the error: Installation was UNSUCCESSFUL;  
Mesquite will attempt to restore any previous versions.  
Uninstalling and reinstalling Mesquite makes no difference.


Any thoughts much appreciated - I only need it to work on one of my  
computers!


Best wishes,

Alanna


-
Alanna Maltby
PhD Student - Evolution of Echolocation in Bats
University College London and Institute of Zoology

Tel: 020 7449 6322
Web: www.zsl.org/alannamaltby



The Zoological Society of London is incorporated by Royal Charter
Principal Office England. Company Number RC000749
Registered address:
Regent's Park, London, England NW1 4RY
Registered Charity in England and Wales no. 208728

_
This e-mail has been sent in confidence to the named a...{{dropped:15}}


___
R-sig-phylo mailing list
R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo


[R-sig-phylo] Fwd: Simulate node ages given known topology

2011-04-12 Thread Joe Felsenstein


Andy Rominger wrote:


Thanks very much Tanja and Joe,

I think these suggestions for sorting will be very useful; we were  
trying to
do something similar (but very hacker-ish) and with this  
theoretical basis

I'm sure we'll pull it off.

And for BD, the time transformation should be perfect.


It is a very useful tool.   If people cite it, they should
check Bruce Rannala's paper to see if it is there too.
Some closely-related math certainly is.

One thing that computing the transformation for various
values of B and D (birth and death rates, called lambda
and mu in the derivation in my book) is that it gives you
a direct idea of how many groups born at each time
are missing from the tree owing to having gone extinct
before reaching the present day.

J.F.

Joe Felsenstein, j...@gs.washington.edu
 Dept. of Genome Sciences, Univ. of Washington
 Box 355065, Seattle, WA 98195-5065 USA

___
R-sig-phylo mailing list
R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo