Re: [R-sig-phylo] estimate ancestral state with OUwie models

2018-06-12 Thread Nick Matzke
It's a shame there aren't awards for great threads, because this is one! The minor twist I would throw in is that it's difficult to make universal generalizations about the quality of ancestral state estimation. If one is interested in the ancestral state value at node N, it might be reasonably

Re: [R-sig-phylo] dist.nodes crashing with big trees

2015-10-16 Thread Nick Matzke
e in another R package. Off the top > of my head, I recall that Nick Matzke had a similar, 'chainsaw' > function, which you can find here and appears not to call dist.nodes: > > https://stat.ethz.ch/pipermail/r-sig-phylo/2011-July/001483.html > > Again, maybe someone on the list knows o

[R-sig-phylo] issue in ape's rphylo (and workaround)

2015-10-04 Thread Nick Matzke
Hi all, I have been hitting intermittent problems using trees generated by ape::rphylo. Here is a reproducible example. library(ape) sessionInfo() # Simulate a tree with e.g. 5 species nspecies = 5 set.seed(123465) tr_wFossils = rphylo(n=nspecies, birth=0.3,

[R-sig-phylo] Plot phylogeny with increasing or decreasing node ages?

2015-04-26 Thread Nick Matzke
Hi all, In FigTree, there is an option (Left menu-Trees-Order nodes-increasing, or decreasing) to plot trees and order them such that the higher nodes/tips in the tree plot at the top or bottom of the plot. Does anything like this exist for plotting trees in R? Or do I have to hunt-n-peck and

Re: [R-sig-phylo] Plot phylogeny with increasing or decreasing node ages?

2015-04-26 Thread Nick Matzke
of Biology University of Massachusetts Boston web: http://faculty.umb.edu/liam.revell/ email: liam.rev...@umb.edu blog: http://blog.phytools.org On 4/26/2015 6:37 PM, Nick Matzke wrote: Hi all, In FigTree, there is an option (Left menu-Trees-Order nodes-increasing, or decreasing) to plot

Re: [R-sig-phylo] read.dna warnings and pitfalls

2012-05-01 Thread Nick Matzke
I have written several custom mutations of various data-reading functions to get around some of the common limitations and to read e.g. ambiguous characters in morphology datasets. But wouldn't the best solution in the long run be to implement the equivalent of readseq and/or the Nexus Class

Re: [R-sig-phylo] Show Informative Sites?

2011-09-17 Thread Nick Matzke
All sites are informative under likelihood, but I assume you mean parsimony-informative, in which case all you have to do is count which sites are either (a) uniform or (b) uniform except for differences found only in a single species. Probably easiest if you convert the read.nexus.data

Re: [R-sig-phylo] post-order tree traversal

2011-09-14 Thread Nick Matzke
Thanks...here's the code. However, it looks like the output I am processing does not actually come with post-order labeling. I.e., in the 2nd plot below: node 1 should be labeled 1 node 10 should be labeled 2 node 2 should be labeled 3 node 14 should be labeled 4 node 3 should be labeled 5

Re: [R-sig-phylo] LTT plot non-ultrametric trees

2011-08-11 Thread Nick Matzke
Somewhere I wrote a function that samples at a series of user-set timepoints and counts the # of lineages crossing each timepoint -- this is pretty flexible, allows for increases/decreases in diversity etc., let me know if the other options aren't working for you I can dig it up... On

Re: [R-sig-phylo] cut a tree in a given time interval

2011-07-14 Thread Nick Matzke
On 7/14/11 2:45 AM, ppi...@uniroma3.it wrote: Thankyou NIck, now...I have an error when running it: Oops. Apologies, this stuff is in-house code, I haven't organized it. Add these to the text file... === get_daughters - function(nodenum, t) { daughter_edgenums =

Re: [R-sig-phylo] cut a tree in a given time interval

2011-07-13 Thread Nick Matzke
Oops, left that out. Here it is as text and an attached file. You will have to do library(ape) and maybe library(phangorn) ...ahead of time (hopefully not others...) chainsaw - function(tr, timepoint=10) { # Take a tree and saw it off evenly across a certain

Re: [R-sig-phylo] cut a tree in a given time interval

2011-07-12 Thread Nick Matzke
I wrote a function called chainsaw to do something like this, it saws off all the branches at a particular time point, then you just have to drop.tip on branch tips older than your time period. Would that be helpful? On 7/12/11 3:19 PM, ppi...@uniroma3.it wrote: Hi all, someone knows a

Re: [R-sig-phylo] cut a tree in a given time interval

2011-07-12 Thread Nick Matzke
Here's chainsaw(). It also requires sourcing a few other functions. Please cite me if you use it :-). = chainsaw - function(tr, timepoint=10) { # Take a tree and saw it off evenly across a certain timepoint. # This removes any tips above the

Re: [R-sig-phylo] DNA sequence management for phylogenetics in R

2011-06-27 Thread Nick Matzke
After a fair amount of annoyment involving in shifting back and forth between BioPython and R, I also think it would be useful to have BioPython-like sequence management capabilities in R. It would even be good to be able to do some things like access NCBI genbank records and download them,

Re: [R-sig-phylo] Generating a tree based on a distance matrix?

2011-05-12 Thread Nick Matzke
The APE command NJ (neighbor-joining) will form a tree from a distance matrix, so that's one option. You could do it and then see if you get the same topology from NJ as from your topology tree. The branch lengths will reflect whatever distances were calculated from the data (which might be

Re: [R-sig-phylo] weirdness in confidence intervals returned by ace, pic option

2011-03-24 Thread Nick Matzke
and the like for no apparent reason (not specifically associated with this, though), so it might not even be an APE issue. Cheers! Nick Nick Matzke wrote on 22/03/2011 12:30: Hi all, This isn't crucial to my work at the moment since I am not using the PIC option of ace to do ancestral

Re: [R-sig-phylo] weirdness in confidence intervals returned by ace, pic option

2011-03-24 Thread Nick Matzke
, the width of its CIs vary as you might expect, so I was just surprised when PIC GLS didn't exhibit the same behavior. Cheers, Nick On 3/24/11 12:21 AM, Nick Matzke wrote: On Wed, Mar 23, 2011 at 10:24 PM, Emmanuel Paradis emmanuel.para...@ird.fr wrote: Hi Nick, With method = pic, the CIs

[R-sig-phylo] fitContinuous in geiger: positive log-likelihoods when trait values 1

2011-03-07 Thread Nick Matzke
Hi all, It seems to be a popular week for questions! I am running fitContinuous on a variety of continuous trait data. I am noticing that when the traits are in units where the max is less than 1 (these are not ratio data, though), many of the various models produce log-likelihoods that are

Re: [R-sig-phylo] fitContinuous in geiger: positive log-likelihoods when trait values 1

2011-03-07 Thread Nick Matzke
Doh! Really should have remembered that, likelihoods-can-be-greater-than-1 is likelihood 101... I am still a little puzzled by the dramatically different results between rescaling and not, will try to post an example in a sec... On 3/7/11 12:37 PM, Nick Matzke wrote: Hi all, It seems

Re: [R-sig-phylo] fitContinuous in geiger: positive log-likelihoods when trait values 1

2011-03-07 Thread Nick Matzke
flexibility. ~Dan On Mar 7, 2011, at 4:04 PM, Nick Matzke wrote: Doh! Really should have remembered that, likelihoods-can-be-greater-than-1 is likelihood 101... I am still a little puzzled by the dramatically different results between rescaling and not, will try to post an example in a sec

Re: [R-sig-phylo] Multiple sequence alignment in R?

2011-02-22 Thread Nick Matzke
You can call any command-line thing from R with system(). Typically I use R to write the control file (e.g. for r8s), then do something like... cmdstr = paste(program_name, -options, control_file, output.log, sep= ) system(cmdstr) Cheers! Nick On 2/22/11 5:42 AM, Scott Chamberlain wrote: