[R-sig-phylo] Rooting a tree with a basal polytomy

2017-02-07 Thread Yan Wong
Sorry if this is a trivial question, but I have some (rooted) nexus trees with polytomies at the root. When I read them in using read.nexus() they are treated as unrooted. What’s the easiest way to tell R that they are intended to be rooted, even though the root is a polytomy? There’s no

Re: [R-sig-phylo] Rooting a tree with a basal polytomy

2017-02-07 Thread Yan Wong
Perfect, thanks. Yan On 7 Feb 2017, at 13:40, Emmanuel Paradis wrote: > Hi, > > If you have a single tree (object of class "phylo") > > phy$root.edge <- 0 > > If there are several trees in your NEXUS file (then phy is of class > "multiPhylo"): > > for (i in

Re: [R-sig-phylo] compressTipLabel as an option to read.trees()

2016-12-14 Thread Yan Wong
On 14 Dec 2016, at 15:33, Joseph W. Brown wrote: > I wonder if reading in a Nexus file with a translation table bypasses this > problem? Cheers, If I try read.nexus with a TAXLABELS entry, it still (oddly) results in a multiPhylo structure of the same size as before

Re: [R-sig-phylo] compressTipLabel as an option to read.trees()

2016-12-14 Thread Yan Wong
On 14 Dec 2016, at 21:06, Emmanuel Paradis wrote: > If the trees are in a NEXUS file with a TRANSLATE block, then the output is a > compressed list. So applying .compressTipLabel returns the list unmodified > (which should be almost instantaneous). Ah, I see what I

[R-sig-phylo] compressTipLabel as an option to read.trees()

2016-12-14 Thread Yan Wong
Hi, I’m reading in a large number of newick trees with the same tips, all from a single file. If I do trees<-read.trees() followed by trees <- .compressTipLabel(trees), it reduces the memory footprint well, but takes an age to run. I can’t help thinking this could be sped up during the reading

Re: [R-sig-phylo] multi2di fails on multiPhylo objects

2017-01-13 Thread Yan Wong
On 13 Jan 2017, at 20:37, Klaus Schliep wrote: > Hi Yan, > > it seems we introduced a small bug with making these functions generic. > Replace in the function .multi2di_ape the line > phy <- reorder(phy) > with > phy <- .reorder_ape(phy, "cladewise", FALSE, n,

Re: [R-sig-phylo] multi2di fails on multiPhylo objects

2017-01-13 Thread Yan Wong
Thanks. I think that’s because read_nexus_phylo() doesn’t do .compressTipLabel automatically n <- read_nexus_phylo("tmp.nex") n2 <- .compressTipLabel(n) multi2di(n2) #this causes an error. Unfortunately I need the .compressTipLabel functionality really. Yan On 13 Jan 2017, at 17:06, François

Re: [R-sig-phylo] multi2di fails on multiPhylo objects

2017-01-13 Thread Yan Wong
On 13 Jan 2017, at 20:37, Klaus Schliep wrote: > Hi Yan, > > it seems we introduced a small bug with making these functions generic. > Replace in the function .multi2di_ape the line > phy <- reorder(phy) > with > phy <- .reorder_ape(phy, "cladewise", FALSE, n, 1L)

[R-sig-phylo] multi2di fails on multiPhylo objects

2017-01-13 Thread Yan Wong
If I have a nexus file with multiple trees, and the same tips in each tree, but some trees with polytomies, like this #NEXUS BEGIN TREES; TRANSLATE 1 1, 2 2, 3 3, 4 4; TREE A = (((1,2)5,3)6,4); TREE B = ((1,2,3)6,4); END; Then when I try to resolve both trees using multi2di, I get > n <-

Re: [R-sig-phylo] Tree plotting (and maybe others) are borked when a node label is '0'

2017-01-04 Thread Yan Wong
On 4 Jan 2017, at 16:03, Emmanuel Paradis wrote: > This is a known feature of read.nexus(), see ape's FAQ: > > http://ape-package.ird.fr/ape_faq.html#Bayestrees > > This explains how to fix the problem. Oh, sorry. I should have read the FAQ before posting. If you are

[R-sig-phylo] Force read.nexus() to return a multiPhylo object, even if there is only one tree

2016-12-27 Thread Yan Wong
Hi I’m doing some analysis in which I produce a variable number of phylogenetic trees with the same tips in a nexus file, then import them into R for analysis (these are trees along a genome). The name of each tree is meaningful (it is a position along the genome). However, in a few

Re: [R-sig-phylo] Force read.nexus() to return a multiPhylo object, even if there is only one tree

2016-12-27 Thread Yan Wong
On 27 Dec 2016, at 22:08, Emmanuel Paradis wrote: > Hi Yan, > > Yes, you are right: this modification can be done. In the meantime, you can > fix the code with: > > fix(read.nexus) > > Find this line (#117): > >if (Ntree == 1) { > > and change it to: > >

Re: [R-sig-phylo] Specifying a polytomy at the root with no outgroup

2018-01-20 Thread Yan Wong
; tr <- read.tree(text = "(A,B,(C,D)):0;") > R> is.rooted(tr) > [1] TRUE > > Best, > > Emmanuel > > Le 19/01/2018 à 23:08, Yan Wong a écrit : >> Hi >> I have a set of rooted trees, some of which have polytomies at the root, like >> (A,B,(

[R-sig-phylo] Specifying a polytomy at the root with no outgroup

2018-01-19 Thread Yan Wong
format used in R? Cheers Yan Wong Oxford ___ 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] Multi2di still not generating equiprobable trees

2020-10-19 Thread Yan Wong
Thanks to Emmanuel for adding the equiprob=TRUE option to multi2di. However, I’m not convinced that it’s working correctly - I still get more balanced trees than unbalanced trees in ape 5.4.1 > library(phytools) > library(phangorn) > library(ape) > packageVersion("ape") [1] '5.4.1' > reps <-

[R-sig-phylo] Breaking polytomies such that all topologies are equiprobable

2020-06-26 Thread Yan Wong
in case I’m misunderstanding something. Cheers Yan Wong Big Data Institute, Oxford University ___ 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

Re: [R-sig-phylo] Breaking polytomies such that all topologies are equiprobable

2020-06-27 Thread Yan Wong
This is extremely helpful, thanks Emmanuel. I think it might be useful to note this in the documentation for multi2di (or give a pointer to the description), as it wasn’t obvious to me how to find out this information from within R. Even better would be an option that allowed equiprobable

Re: [R-sig-phylo] Breaking polytomies such that all topologies are equiprobable

2020-06-29 Thread Yan Wong
Thanks very much Martin. I’m glad that I brought this up (I think the documentation should probably make this clearer). Your extra functions, together with the corrected Dendropy code and Emmanuel’s hints, should all be useful for me to check I’m doing it right for larger trees. Cheers Yan >

[R-sig-phylo] Phylogenetic network / ARG representation in ape

2021-05-18 Thread Yan Wong
Dear R-Sig-Phylo, I’m interested in representations of ancestral recombination graphs (ARGs). From my reading of the extended Newick format (G. Cardona et al., 2008), and the ape/evonet documentation, it appears as if the R-base representations of phylogenetic networks don't have a standard

Re: [R-sig-phylo] Phylogenetic network / ARG representation in ape

2021-05-21 Thread Yan Wong
Thank you Emmanuel. That’s very helpful. All the best Yan > On 21 May 2021, at 10:04, Emmanuel Paradis wrote: > > ... > Correct. The "phylo" and "evonet" classes ignore whether the (optional) > vector 'edge.length' represents time, number of mutations/substitions, > accumulated variance,