Re: [R-sig-phylo] Calculating Asymmetry in Speciation Across a Phylogeny

2024-07-25 Thread Nick Matzke
Sounds like a problem where tree balance statistics could give you a first take? I see there is a brand new R package, I think providing a lot of methods beyond what is available in e.g. the ape package: https://cran.r-project.org/web/packages/treebalance/index.html Cheers, Nick On Thu, Jul 25,

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 e

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

2015-10-16 Thread Nick Matzke
s from the > root. A better solution may now exist in another R package. I'd have > to investigate (although maybe someone on the list can suggest one). > > The second thought I have is that there might be alternative functions > that do something lie timeSliceTree in another R

[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, death=0

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

2015-04-26 Thread Nick Matzke
ll, Assistant 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 4/26/2015 6:37 PM, Nick Matzke wrote: > >> Hi all, >> >> In FigTree, there i

[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

[R-sig-phylo] phylobase::descendants issue

2013-04-26 Thread Nick Matzke
Hi all, Not sure if this is a bug, but I noticed weird behavior when loading a tree with APE and then converting to phylo4 to do descendants() -- not all the tips are produced. Example: library(ape) library(phylobase) trstr = "P_hawaiiensis_WaikamoiL1:0.9656850499,P_mauiensis_Eke:

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

2012-04-30 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 Lib

Re: [R-sig-phylo] solving multichotomies

2012-03-20 Thread Nick Matzke
multi2di() randomly resolves polytomies, if that's what you mean... On 3/20/12 7:17 PM, Jordan Golubov wrote: Does anyone know what method is used to solve multichotomies in ape? ___ R-sig-phylo mailing list R-sig-phylo@r-project.org https://sta

Re: [R-sig-phylo] problem updating phylobase

2011-10-29 Thread Nick Matzke
the latest version of Rcpp? Thanks, -- François On Fri, 2011-10-28 at 16:58 -0700, Nick Matzke wrote: Hi all, I've had phylobase installed and functioning for awhile, but I get a weird error while installing phylobase 0.6.2, despite the fact that it looks like all the files compile s

[R-sig-phylo] problem updating phylobase

2011-10-28 Thread Nick Matzke
Hi all, I've had phylobase installed and functioning for awhile, but I get a weird error while installing phylobase 0.6.2, despite the fact that it looks like all the files compile successfully and something weird happens while building phylobase.so. Any advice would be *much* appreciated..

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

2011-09-19 Thread Nick Matzke
racter is or is not informative. Hope this helps. Leandro 2011/9/17 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 o

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 output

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

2011-09-14 Thread Nick Matzke
_change = tmp_edge2[,2]-length(tr2$tip.label) tr2$node.label[nodenums_to_change] = 1:tr2$Nnode plot(tr2) nodelabels(tr2$node.label) = On 9/14/11 7:30 PM, Nick Matzke wrote: Thanks...here's the code. However, it looks like the output I am processing does not actually come wit

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 ..

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

2011-09-14 Thread Nick Matzke
Hi all, To display the node reconstructions from another program in APE, I need to label my internal nodes as they would be labeled in a post-order tree traversal. Is there an easy way/function to do this somewhere, or do I have to write my own tree-traversing functions? Cheers, Nick --

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 8/10

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 timepoi

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] 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 sma

Re: [R-sig-phylo] nodes and taxa depth II

2011-06-27 Thread Nick Matzke
Looks like this is solved, but: Awhile ago I decided it would be handy to extract/display all kinds of information from a tree in a table format, with a row for each node. Two of the columns are height above the root and depth beneath the highest tip. It has become the function prt() (print

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, r

[R-sig-phylo] TreeRogue 0.2 (was Re: TreeRogue (was re: tree thievery))

2011-05-13 Thread Nick Matzke
process x, y coordinates into a Newick-format tree ###### # by Nick Matzke # Copyright 2010-infinity # mat...@berkeley.edu # 10/27/2010 # # Please link/cite if you use this, email me if you have # thoughts/improvements/corrections. # ##

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

2011-05-13 Thread Nick Matzke
the tree was created based on maximum likelihood? Thanks though! Meche On Thu, May 12, 2011 at 4:23 PM, Nick Matzkewrote: 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 N

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
uot; for ancestral character estimation, 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 wrote: Hi Nick,

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

2011-03-24 Thread Nick Matzke
metimes throws messages about memory errors 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 cru

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

2011-03-21 Thread Nick Matzke
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 character estimation. But while trying it out I noticed a very weird result that I can't explain...basically when I run ace on my raw trait values, I get the same sized confidence i

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

2011-03-07 Thread Nick Matzke
ptim to have a bit more 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 po

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

[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] 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 Chamberl

Re: [R-sig-phylo] replacement for "chronogram"

2011-02-11 Thread Nick Matzke
Thanks! Nick On 2/11/11 2:11 AM, Emmanuel Paradis wrote: Hi Nick, See chronopl(): it implements Sanderson's PL method which is the same than (or at least close to) NPRS when lambda = 0. Emmanuel Nick Matzke wrote on 10/02/2011 15:15: Hi all, So I'm TAing a lab on APE and R. I

[R-sig-phylo] replacement for "chronogram"

2011-02-10 Thread Nick Matzke
Hi all, So I'm TAing a lab on APE and R. It uses the chronogram function to make an ultrametric tree (yes, we will do this more rigorously with other methods in later labs). However, the new version of APE, which everyone but me has, no longer has chronogram. Has it been moved to another

Re: [R-sig-phylo] Model-Selection vs. Finding Models that "Fit Well"

2011-01-20 Thread Nick Matzke
If one is interested in absolute goodness of fit, rather than model comparison (which model fits best, which might not be useful if you are worried that all your models are horrible), wouldn't cross-validation be a good technique? I.e. leave out one tip, calculate the model and the estimated n

[R-sig-phylo] TreeRogue (was re: tree thievery)

2010-10-28 Thread Nick Matzke
ue 0.1: TreeThief-like tree grabbing using x,y # coordinates digitized from an image of a phylogenetic tree. ## # GOAL: to process x, y coordinates into a Newick-format tree ###### # by Nic

Re: [R-sig-phylo] sequence/character simulation on a phylogeny in R

2010-06-17 Thread Nick Matzke
Hi again -- it looks like geiger's sim.char is good for #2, but other suggestions welcome... Cheers! Nick Nick Matzke wrote: Hi all, What are people's suggestions for the best R packages for: (a) simulating sequence evolution on a phylogeny under different models (b) simulatin

[R-sig-phylo] sequence/character simulation on a phylogeny in R

2010-06-17 Thread Nick Matzke
Hi all, What are people's suggestions for the best R packages for: (a) simulating sequence evolution on a phylogeny under different models (b) simulating discrete character evolution (if such exists; I am aware of APE's evolve.phylo but that is for continuous traits). Cheers! Nick -- ==

[R-sig-phylo] Bremer/Bootstrap/Credibility

2010-05-11 Thread Nick Matzke
Hi, This must be a pretty easy question, but I can't seem to find an answer. Let's say I have three Newick trees, one with Bremer supports, one with bootstrap values, and one with Bayesian bipartition credibilities. It is common for papers to display all three on the branches well-supported

Re: [R-sig-phylo] I need help with phylosor...

2009-02-17 Thread Nick Matzke
Marten Winter wrote: Heja, I'm new here, so if this question is totally mad or non-sense, please excuse but say at which point :O) I try to calculate phylo betadiversity somehow. I have a supertree with arrtificial branchlengths and I have regional species lists. I'd like to use phylosor,