Re: [R-sig-phylo] Bug in reorder.phylo() (related to cleaning phylo objects)

2015-06-16 Thread Emmanuel Paradis
_ Brian O'Meara Assistant Professor Dept. of Ecology & Evolutionary Biology U. of Tennessee, Knoxville http://www.brianomeara.info Postdoc collaborators wanted: http://nimbios.org/postdocs/ Calendar: http://www.brianomeara.info/calendars/omeara On Mon, Jun 15, 2015 at 11:29 AM

Re: [R-sig-phylo] Missing States in ML Reconstruction of Discrete Ancestral States (phytools, ape)

2015-06-18 Thread Emmanuel Paradis
Hi David & Liam. You can fit a model with unobserved states with ace() because it considers the levels of 'x', not the observed states. You may set the levels of x with the function of the same name: > x <- factor(sample(2, size = 30, replace = TRUE)) > levels(x) <- LETTERS[1:3] > table(x) x

Re: [R-sig-phylo] collapse.singles() can be confused by node numbering (Was: Bug in reorder.phylo() (related to cleaning phylo objects))

2015-06-18 Thread Emmanuel Paradis
<-1+phy$edge[phy$edge>10] #let's jumble the node IDs a little phy$edge[phy$edge==12]<-0 phy$edge[phy$edge==13]<-12 phy$edge[phy$edge==0]<-13 phy$edge<-rbind(phy$edge,c(11,13)) storage.mode(phy$edge)<-"integer" checkValidPhylo(phy) #let's try collapsing nodes phy1<-colla

Re: [R-sig-phylo] Margin Artifact in plot.phylo with Very Long Tip Labels, despite show.tip.label=FALSE

2015-06-22 Thread Emmanuel Paradis
Hi, David: thanks for the report. Liam: thanks for the fix. I modified it slightly: if (is.character(alp)) { tmp <- max(xx.tips) if (show.tip.label) tmp <- tmp * 1.5 } else { I did the same correction a few lines below in the function for the y-limit with non-horizont

Re: [R-sig-phylo] simulating a labile trait

2015-07-11 Thread Emmanuel Paradis
Hi Glenn & Ted, An overview of phylogeny data simulation can be found in the chapter included in Garamszegi's book "Modern Phylogenetic Comparative Methods". There is an accompanying page on the book's web site: http://www.mpcm-evolution.org/practice/online-practical-material-chapter-13 This

Re: [R-sig-phylo] sorry for the wrong link in the previous email Re: boxplots next to phylogeny

2015-07-15 Thread Emmanuel Paradis
Hi Martin. I've modified phydataplot() so that it accepts style = "boxplot" and style = "dotchart" too. The version is on GH: https://github.com/emmanuelparadis/phydataplot The "boxplot" feature requires a data matrix with rownames eventually matching the tip labels. Best, Emmanuel Le 15

Re: [R-sig-phylo] boxplots next to phylogeny

2015-07-15 Thread Emmanuel Paradis
messages: 1: In min(o$out) : no non-missing arguments to min; returning Inf 2: In max(o$out) : no non-missing arguments to max; returning -Inf ​I wonder what goes wrong. Best, Martin​ On 15 July 2015 at 16:29, Emmanuel Paradis mailto:emmanuel.para...@ird.fr>> wrote: Hi Martin. I

Re: [R-sig-phylo] Different Lambda estimations

2015-07-17 Thread Emmanuel Paradis
Hi Sérgio, In phytools, lambda is constrained to be positive, not in ape. A negative value of lambda is the consequence of closely related species being more dissimilar than expected under phylogenetic dependence (lambda = 1) or under independence (lambda = 0). This can be interpreted biologi

Re: [R-sig-phylo] Bug in ape: dropping tips from a ladderized tree (still) randomly shuffles the node labels

2015-07-25 Thread Emmanuel Paradis
Hi David, Here is a fix for drop.tip (line numbers refer to the source file drop.tip.R): 229,231c229,230 < ## executed from right to left, so newNb is modified before phy$edge: < phy$edge[sndcol, 2] <- newNb[phy$edge[sndcol, 2]] <- < (n + 2):(n + phy$Nnode) --- > newNb[sort

Re: [R-sig-phylo] ANOVA type II with gls()

2015-07-25 Thread Emmanuel Paradis
Hi Sérgio, If by "anova SS II" you mean "testing an effect while including other significant effect(s) in the model", then this is usually done with the generic function drop1, but there is no method drop1.gls in nlme. So you have to do it by hand, eg: m1 <- gls(y ~ a + b + x, m2 <- gls

Re: [R-sig-phylo] Bug in ape: dropping tips from a ladderized tree (still) randomly shuffles the node labels

2015-07-25 Thread Emmanuel Paradis
NodeLabels(tree,tree1) testNodeLabels(tree,tree2) testNodeLabels(tree,tree3) testNodeLabels(tree,tree3,plot=TRUE) ######## Additionally, could you send the full revised source file? I have to admit, I always get lost looking for ape's newest source files

Re: [R-sig-phylo] Bug in ape: dropping tips from a ladderized tree (still) randomly shuffles the node labels

2015-07-28 Thread Emmanuel Paradis
Hi David, I've conducted more tests and the bug was really in drop.tip and sometimes apparent without calling ladderize. The fix seems to work well. I have built ape 3.3-0.6 which is available on ape-package.ird.fr as source package. Best, Emmanuel Le 25/07/2015 19:33, Emmanuel Para

Re: [R-sig-phylo] Plotting error edgelabels in phylogeny type="fan"

2015-07-31 Thread Emmanuel Paradis
Hi Klaus. Thanks for the fix. In ape now. Cheers, Emmanuel Le 30/07/2015 22:45, Klaus Schliep a écrit : Dear Julia, this function should fix your problem and Emmanuel may can include it into edgelables function: edgeLabelsFan <- function (text, edge, adj = c(0.5, 0.5), frame = "rect", pch =

Re: [R-sig-phylo] simulating rate shifts

2015-07-31 Thread Emmanuel Paradis
Hi Eric, See the function rTraitCont in ape: the parameters of the BM or OU model can be branch-specific, so it's easy to specify a change in parameter(s) at a given node. There's an example there: http://www.mpcm-evolution.org/practice/online-practical-material-chapter-13/chapter-13-2-traits

Re: [R-sig-phylo] Plotting rooted tree with bootstrap values (ape/phangorn)

2015-08-31 Thread Emmanuel Paradis
Hi Kamila & Klaus, Another solution could be to use nodelabels(), eg: plot(nrooted) nodelabels(text = b$BP) See the examples in ?nodelabels for some ways to format the labels. Best, Emmanuel Le 31/08/2015 15:57, Klaus Schliep a écrit : Dear Kamila, plotBS checks if trees are rooted or not

Re: [R-sig-phylo] ape package gives 'Error in FI[i]:LA[i] : NA/NaN argument'

2015-09-13 Thread Emmanuel Paradis
STA.R"; Best, Emmanuel Le 10/09/2015 16:49, Uwe Menzel a écrit : Emmanuel Paradis writes: Hi Matt, This is because this accession number does not point to the sequence. For this particular one, you could use: seq1 <- read.GenBank("U00096.3") Best, Emmanuel Le 27/02/20

Re: [R-sig-phylo] using chronos() from the ape package for large bacterial phylogeny

2015-09-23 Thread Emmanuel Paradis
Hi Fabian, If the goal is to get an ultrametric tree from your sequences, and not really date the divergences among them, you may consider using a UPGMA tree. Another solution is to use chronoMPL in ape which implements the mean path length method; the advantage of this one is that it takes th

[R-sig-phylo] next release of ape

2015-09-27 Thread Emmanuel Paradis
Dear all, The next release of ape is ready: http://ape-package.ird.fr/NEWS The testing version 3.3-0.8 is available from the above site as source and as a Windows binary: http://ape-package.ird.fr/ape_installation.html#versions I'm planning to submit to CRAN within 3 or 4 weeks. Best, Emm

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

2015-10-04 Thread Emmanuel Paradis
Hi Nick, This bug is fixed in the current testing version: http://ape-package.ird.fr/NEWS Best, Emmanuel Le 04/10/2015 10:55, Nick Matzke a écrit : Hi all, I have been hitting intermittent problems using trees generated by ape::rphylo. Here is a reproducible example. #

Re: [R-sig-phylo] output of phangorn::midpoint is not compatible with ape::ladderize?

2015-10-04 Thread Emmanuel Paradis
Hi Klaus, Le 04/10/2015 18:59, Klaus Schliep a écrit : Dear Guangchuang & Emmanuel, it seems ladderize assumes that trees are in "cladewise" order, but midpoint returns a tree in "postorder". Emmanuel can you include a phy <- reorder(phy) Yes. Thanks indeed. Best, Emmanuel in ladderize. T

Re: [R-sig-phylo] branching time to branch length (eg. mcmctree)

2015-10-28 Thread Emmanuel Paradis
Hi Tristan, See compute.brtime in ape. Cheers, Emmanuel Le 28/10/2015 15:31, Tristan Lefebure a écrit : Greetings all, Does anyone know a way to transform branching times into branch length of a chronogram. Like the inverse function of ape::branching.time() ? say you have a chronogram named

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

2015-11-04 Thread Emmanuel Paradis
Hi Antonella, It could be that the optimization procedure of the log-likelihood fails with your data, or that this procedure tries some values of lambda that return an error in your situation. You may try to fit successive models with different values of lambda, and select the model with the

Re: [R-sig-phylo] next release of ape

2015-11-18 Thread Emmanuel Paradis
isible new features are in the graphical functions (see the last examples in ?phydataplot), a function to view alignments (alview), three functions to manage taxa labels (?label2table), and a function to code indels (?DNAbin2indel). Best, Emmanuel Le 27/09/2015 11:13, Emmanuel Paradis a écrit :

Re: [R-sig-phylo] Plotting sampled-ancestor trees in R

2015-12-08 Thread Emmanuel Paradis
Hi Jo & Roger, edgelabels() has the option 'date' which helps to annotate the branches of a tree: set.seed(1) tx <- rcoal(3) plot(tx) axisPhylo() edgelabels(edge = 1, date = 1, pch = 19, col = "red") Best, Emmanuel Le 08/12/2015 16:32, Joseph Brown a écrit : Roger, Are you looking for som

Re: [R-sig-phylo] Bug report in ape::root

2015-12-13 Thread Emmanuel Paradis
Hi Liam, This seems to be solved with fix(root) and deleting this line (line 99, or line 204 in R/root.R in the souce package): for (j in 1:Nclade) { and the matching "}" a few lines below. Many thanks for the report. All the best, Emmanuel Le 13/12/2015 07:58, Liam J. Revell a éc

Re: [R-sig-phylo] extract parent-child from newick

2016-01-13 Thread Emmanuel Paradis
Hi Lev, After reading the tree: alllabels <- c(tree$tip.label, tree$node.label) will give you a vector of labels matching the integers in tree$edge. So you may do something like: parent <- alllabels[tree$edge[, 1]] child <- alllabels[tree$edge[, 2]] cbind(parent, child) Best, Emmanuel Le

Re: [R-sig-phylo] getBtimes vs. branching.times

2016-01-13 Thread Emmanuel Paradis
To pile a little bit more after David's message, ape has the function ltt.plot.coords which does the same thing than phytools::ltt but with different options, including 'tol' which specifies the tolerance for considering a tree as ultrametric or not. Best, Emmanuel Le 13/01/2016 03:29, Liam

Re: [R-sig-phylo] getBtimes vs. branching.times

2016-01-18 Thread Emmanuel Paradis
question, a very simple one again. I have two newick trees, identical topology. In one I have branch lengths, in the other I have node names. I would like a tree with both. How do I do this? Thanks in advance! -- Lev Yampolsky Professor Department of Biological Sciences East Tennessee State Uni

Re: [R-sig-phylo] Problem with bootstraping microstallite NJ tree

2016-01-21 Thread Emmanuel Paradis
Hi Vojtěch, The trouble comes from boot.phylo() which resamples the columns of the data matrix with replacement: this may result in a bootstrap sample without population column and loci2genind() doesn't like it. The trick is to delete this column from the original "loci" object, and then reas

Re: [R-sig-phylo] Warnings when calculating beta in apTreeshape

2016-02-02 Thread Emmanuel Paradis
Hi Pedro, It's an issue in the design of the package. The condition tests should be something like: if (inherits(phylo, "treeshape")) if (inherits(phylo, "phylo")) But if the output makes sense, you should not worry about it since, apparently, this is just to transform the tree in

Re: [R-sig-phylo] Convert Node Labels to Edge Labels

2016-02-02 Thread Emmanuel Paradis
Hi Will, This issue comes out from time to time (last time for me during a workshop last week). So I just wrote a function to do that: drawSupportOnEdges <- function(value, ...) { lastPP <- get("last_plot.phylo", envir = .PlotPhyloEnv) n <- lastPP$Ntip m <- lastPP$Nnode if (len

Re: [R-sig-phylo] Pairwise Distances

2016-02-19 Thread Emmanuel Paradis
Hi Pedro, Suppose all the DNA sequences are in a single matrix, say X, and you have a vector (or factor) identifying the species of each sequence, say SPECIES. So: length(SPECIES) == nrow(X) is TRUE. What you can do is to first compute all pairwise (raw) distances: D <- dist.dna(X, "n") an

[R-sig-phylo] new testing version of ape

2016-02-22 Thread Emmanuel Paradis
Dear all, A new testing version of ape (3.4-0.3) is available. It includes three main new features: - A new data class, "AAbin", to store amino acid sequences; there are eleven new functions to generate and manipulate them including translation from DNA. - The function checkAlignment does

Re: [R-sig-phylo] new testing version of ape

2016-02-26 Thread Emmanuel Paradis
tps://sites.google.com/site/thibautjombart/ https://github.com/thibautjombart Twitter: @TeebzR <https://twitter.com/TeebzR> On 22 February 2016 at 09:16, Emmanuel Paradis mailto:emmanuel.para...@ird.fr>> wrote: > Dear all, > > A new testin

Re: [R-sig-phylo] standard error (NaN) in model ARD

2016-03-04 Thread Emmanuel Paradis
Hi Felipe, You didn't tell us what function you used: I assumed it was ace() in ape. Often, the fact that SEs cannot be computed by ace() means that the model is a poor fit and that a simpler model is better. You said that the LRT is significant (did you use anova() on the outputs of ace?), so

Re: [R-sig-phylo] How to use categorical vectors in package ape for phylogenetic independent contrasts

2016-03-04 Thread Emmanuel Paradis
Hi Kate, You can compute PICs for a categorical variable in the same way than you enter it in a linear model, that is by first computing its "contrasts" (this is different from the "P-I-Contrasts", though both have some conceptual similarities). The easiest way to do it is to use the function

Re: [R-sig-phylo] Hi all.

2016-04-02 Thread Emmanuel Paradis
Hi Christian, It is difficult to see what's going wrong with your problem. Do you use a recent version of PhyML? From what I remember about Windows (in case you use this OS), the filename extensions (here .txt) are not displayed by the file explorer. If PhyML has run correctly, you should ha

Re: [R-sig-phylo] [Bug] root.R: object 'fuseRoot' not found

2016-04-02 Thread Emmanuel Paradis
Hi Fan, The code of root() was simplified in ape 3.4, so this needs to be checked carefully. Can you send me this tree (privately)? Cheers, Emmanuel Le 01/04/2016 18:49, Li, Fan a écrit : Hi all, I'm using the latest ape version (v3.4) under R 3.2.3 Patched. When I try to root an unrooted

Re: [R-sig-phylo] estimating the evolutionary rate of a continous trait

2016-04-20 Thread Emmanuel Paradis
Hi Manabu & Belinda, In fact, the (homogeneous) OU process makes the data look like with no phylogenetic correlation since the covariance between species decreases exponentially with time and the value of alpha. I think the two situations (a trait not evolving on a phylogeny and following a no

Re: [R-sig-phylo] Error in trees[[i]] : subscript out of bounds

2016-05-23 Thread Emmanuel Paradis
Liam is probably right: there seems to be something missing in the NEXUS file. The Newick file from the same site can also be read with read.tree. Emmanuel Le 23/05/2016 18:21, Liam J. Revell a écrit : It looks like the NEXUS file might be badly conformed. You could try: obj<-scan(file="Tim

Re: [R-sig-phylo] Error in trees[[i]] : subscript out of bounds

2016-05-24 Thread Emmanuel Paradis
ee. I tried with read.tree but the errors persisted. When I used another tree, everything worked fine, so I guess I'll just use that one. Once again, thank you. Sérgio. 2016-05-23 20:55 GMT+01:00 Emmanuel Paradis mailto:emmanuel.para...@ird.fr>>: Liam is probably right: there seems to

Re: [R-sig-phylo] root tree in ape 3.4 vs 3.2

2016-05-25 Thread Emmanuel Paradis
Hi Tomas, It's fixed in ape 3.5 (on CRAN since yesterday). Best, Emmanuel Le 25/05/2016 21:24, Tomas Fer a écrit : Dear colleagues, I want to ask why this function (see below) is working under ape 3.2. but produce an error in ape 3.4. I am trying to read newick-formated file and than root it

Re: [R-sig-phylo] identify duplicate topologies and add corresponding values

2016-05-30 Thread Emmanuel Paradis
Hi John, Something like this does what you are looking for: z <- tapply(X[, 1], X[, 2], sum) To have it in a matrix-like layout (similar to X): data.frame(z, names(z)) Best, Emmanuel Le 30/05/2016 18:13, John Denton a écrit : Hi all, I have a two-column matrix, containing trees in one col

Re: [R-sig-phylo] chronos ape package does it return confidence intervals too?

2016-06-29 Thread Emmanuel Paradis
quick answer: no It's work in progress. Best, Emmanuel Le 29/06/2016 07:46, Chris Buddenhagen a écrit : Just this quick question Chris Buddenhagen cbuddenha...@gmail.com [[alternative HTML version deleted]] ___ R-sig-phylo mailing li

Re: [R-sig-phylo] Adjust position of tip labels in plot.phylo

2016-07-01 Thread Emmanuel Paradis
Hi Kamila, The vectors x and y extracted by Liam are ordered in the same way than the tip labels of the tree (say its names is 'phy'); for instance, the followings should do the same output than plot(phy): plot(phy, show.tip.label = FALSE) obj <- get("last_plot.phylo", envir = .PlotPhyloEnv)

Re: [R-sig-phylo] Adjust position of tip labels in plot.phylo

2016-07-01 Thread Emmanuel Paradis
There is a small bug actually: label.offset is ignored with type = "unrooted" (unless lab4ut = "axial"). This is now fixed. Best, Emmanuel Le 01/07/2016 09:37, Emmanuel Paradis a écrit : Hi Kamila, The vectors x and y extracted by Liam are ordered in the same way than t

Re: [R-sig-phylo] get divergence date for all tips on a chronogram

2016-07-04 Thread Emmanuel Paradis
It seems you are looking for branching.times(). Cheers, Emmanuel Le 05/07/2016 06:39, Chris Buddenhagen a écrit : Does anyone know how to get the divergence dates the mrca for all tips on a chronogram? I thought I was onto something when I found mrca in the ape package, but it returns the mrc

Re: [R-sig-phylo] Bug report for CDF.birth.death.R

2016-07-06 Thread Emmanuel Paradis
Dear Niko, Many thanks for this. Best, Emmanuel Le 05/07/2016 07:16, Niko Yasui a écrit : Dear Emmanuel & list, There seems to be a small bug on line 582, in function 'rphylo'. The parameters passed to function 'Foo' are switched compared to how the Foo functions are defined and how they are

Re: [R-sig-phylo] Chronos function in ape

2016-07-07 Thread Emmanuel Paradis
Hi Marco, chronos uses specific models for the variation in substitution rates among branches and I'm not sure whether these models apply to your data. Maybe you can use chronos with model = "clock" if you can assume that drift is constant throughout your tree. HTH Emmanuel Le 06/07/2016 1

Re: [R-sig-phylo] Ultrametric tree not recognized

2016-08-17 Thread Emmanuel Paradis
Hi Klaus, The default is: is.ultrametric(phy, tol = .Machine$double.eps^0.5). According to ?.Machine this value does not depend on the machine precision. On my laptop, it gives: R> .Machine$double.eps^0.5 [1] 1.490116e-08 Best, Emmanuel Le 16/08/2016 à 18:15, Klaus Schliep a écrit : We sh

Re: [R-sig-phylo] Ultrametric tree not recognized

2016-08-19 Thread Emmanuel Paradis
aus On Wed, Aug 17, 2016 at 3:04 AM, Emmanuel Paradis mailto:emmanuel.para...@ird.fr>> wrote: Hi Klaus, The default is: is.ultrametric(phy, tol = .Machine$double.eps^0.5). According to ?.Machine this value does not depend on the machine precision. On my laptop, it gi

Re: [R-sig-phylo] How to contribute?

2016-08-29 Thread Emmanuel Paradis
ould like to try to contribute to ape. Where can I find how to do so? Sure, I've searched the ape homepage ( http://ape-package.ird.fr/ ) and checked if Emmanuel Paradis has a GitHub hosting the ape code (as he does with pegas), but I could not find a place where the code is hosted,

Re: [R-sig-phylo] ape: chronos

2016-09-05 Thread Emmanuel Paradis
Hi Daniel, Thank you for your report. It's not very clear how or why the penalized likelihood becomes NA (maybe a log of a negative number is calculated somewhere). chronos() is still under progress and I take good note of your fix. Best, Emmanuel Le 05/09/2016 à 10:27, Daniel Lang a écrit

Re: [R-sig-phylo] suset DNAbin

2016-09-05 Thread Emmanuel Paradis
Hi Dan, You don't need to convert to character to manipulate DNAbin objects: in fact, woodmouse is a just matrix like others. R> dim(woodmouse) [1] 15 965 R> is.matrix(woodmouse) [1] TRUE R> dimnames(woodmouse) [[1]] [1] "No305" "No304" "No306" "No0906S" "No0908S" "No0909S" "No0910S"

Re: [R-sig-phylo] ape - nj, mvr questions

2016-09-09 Thread Emmanuel Paradis
Hi Shai, Le 06/09/2016 à 10:32, Shai Tal a écrit : I am currently using ape package to construct genetic trees for my research, and i am using nj() and mvr() functions 1.i was wondering if there is a way, to create the genetic tree, assuming that one of the samples, might be an inner node of th

[R-sig-phylo] ape functions to become generic

2016-10-03 Thread Emmanuel Paradis
Dear all, We are planning to introduce a substantial change in ape: several functions operating on "phylo" objects will be made generic with methods for "phylo" and "multiPhylo" objects. The motivation is to make things simpler when working with lists of trees. For instance, for a list of tre

Re: [R-sig-phylo] ape functions to become generic

2016-10-04 Thread Emmanuel Paradis
the ape authors) for continuing to maintain and improve ape. Cheers, -Dave On Mon, Oct 3, 2016 at 8:51 AM, Emmanuel Paradis wrote: Dear all, We are planning to introduce a substantial change in ape: several functions operating on "phylo" objects will be made generic with methods fo

Re: [R-sig-phylo] Truncate x-axis in phydataplot barplots

2016-10-17 Thread Emmanuel Paradis
Hi Marian, You can limit the space available to the whole figure when plotting the tree (this is when the size of the plot is fixed). For example, tr <- rcoal(10) x <- 1:10 plot(tr, x.lim = 5) phydataplot(x, tr) This is equivalent to playing with xlim and/or ylim in barplot(). You can also p

Re: [R-sig-phylo] fatal error plotting trees

2016-10-29 Thread Emmanuel Paradis
Hi, This kind of issue was reported some time ago and there is an item in ape's FAQ: http://ape-package.ird.fr/ape_faq.html#Bayestrees But your situation seems a bit different. You may also check the tree with checkValidPhylo() to have a diagnostic of what's wrong. Best, Emmanuel Le 28/1

Re: [R-sig-phylo] Making ultrametric trees

2016-10-29 Thread Emmanuel Paradis
Dear Shinichi, A fast solution is provided by the function chronoMPL in ape; it does not require calibration points (see the references in the help page of this function for the assumptions). The function chronos (also in ape) is another possibility but it needs at least one calibration point

Re: [R-sig-phylo] Making ultrametric trees

2016-10-29 Thread Emmanuel Paradis
orrelation matrix obtained directly from vcv [i.e. vcv(nonultrametric_tree, cor=T)]. Could you enlighten me about differences and why chronoMPL method might be preferred? Best wishes and thanks in advance. Shinichi On Sat, Oct 29, 2016 at 8:50 PM, Emmanuel Paradis mailto:emmanuel.para...@ird.

Re: [R-sig-phylo] Making ultrametric trees

2016-10-31 Thread Emmanuel Paradis
termined by the genes used to estimate the tree, given differences in substitution rates among genes. I do think its important to bear in mind. Cheers Alejandro Alejandro Gonzalez Voyer Instituto de Ecologia UNAM > On Oct 29, 2016, at 2

[R-sig-phylo] pre-release of ape 4.0

2016-11-10 Thread Emmanuel Paradis
Dear all, The new version of ape is ready to be sent to CRAN. The list of new features is quite long: http://ape-package.ird.fr/NEWS This includes a fix to read.GenBank() to work with the new settings on NCBI's servers. A testing version of ape (3.5-0.10) is available for Windows and as a

Re: [R-sig-phylo] error when using function read.GenBank in ape

2016-11-11 Thread Emmanuel Paradis
Hi Eduardo & Ting-Wen, ape 4.0 is not yet released. The available version is 3.5-0.10 and, you are right Eduardo, it fixes this issue. The instructions to install this new version of ape is here: http://ape-package.ird.fr/ape_installation.html#versions The issue (not really a bug, strictly s

Re: [R-sig-phylo] concatenating loci with different taxa

2016-11-18 Thread Emmanuel Paradis
Dear Karla, First, I suggest you manage your alignment files in FASTA rather than in NEXUS: this is much more efficient in practice. You may read an alignment in a NEXUS file using read.nexus.data() in ape, then convert it in "DNAbin" class with as.DNAbin(). The cbind() funtion in ape allows

Re: [R-sig-phylo] error when using function read.GenBank in ape

2016-11-21 Thread Emmanuel Paradis
pdate directly from Ape's website... Sincerely, V. Dne sobota 12. listopadu 2016 13:16:47 CET, Eduardo Ascarrunz napsal(a): Hi Emmanuel, Right! Sorry I misspoke. Best, Eduardo 2016-11-11 23:32 GMT+01:00 Emmanuel Paradis : Hi Eduardo & Ting-Wen, ape 4.0 is not yet released. The avai

Re: [R-sig-phylo] error when using function read.GenBank in ape

2016-11-21 Thread Emmanuel Paradis
scarrunz napsal(a): Hi Emmanuel, Right! Sorry I misspoke. Best, Eduardo 2016-11-11 23:32 GMT+01:00 Emmanuel Paradis : Hi Eduardo & Ting-Wen, ape 4.0 is not yet released. The available version is 3.5-0.10 and, you are right Eduardo, it fixes this issue. The instructions to install

Re: [R-sig-phylo] distances between trees

2016-11-24 Thread Emmanuel Paradis
Hi Karla, I cannot answer to your question on comparing trees with different sets of labels, but surely dist.topo() should return an error in this situation. I modified the code to handle this -- it is also much faster (~ 100 times faster when comparing 100 trees with 100 tips). And yes, you

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

2016-12-14 Thread Emmanuel Paradis
Hi Yan, I tried with 10,000 trees each with 1000 tips and it took a bit more than 1 sec: R> tr <- rmtree(1, 1000) R> system.time(a <- .compressTipLabel(tr)) utilisateur système écoulé 1.124 0.036 1.161 And yes the memory footprint is substantially decreased: R>

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

2016-12-14 Thread Emmanuel Paradis
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). Best, Emmanuel Le 14/12/2016 à 16:51, Yan Wong a écrit : On 14 Dec 2016, at 15:33, Joseph W. Brown

Re: [R-sig-phylo] Comparing support values on different trees

2016-12-14 Thread Emmanuel Paradis
Hi Jake, What you describe looks very musch like the Lento method implemented in the function lento() in phangorn. consensusNet(), also in phangorn, implements something similar: the consensus network. prop.part(), in ape, is the function behind the two previous ones. bitsplits() is more eff

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

2016-12-15 Thread Emmanuel Paradis
0.000 2.088 To be compared with my previous message with N=1 and n=1000 which took 20 times less time (~1.2 sec). I guess reading the tree file (either in Newick or in NEXUS) will be much longer than any of these. Best, Emmanuel Le 14/12/2016 à 22:44, Yan Wong a écrit : On

Re: [R-sig-phylo] ape chronos error

2016-12-16 Thread Emmanuel Paradis
Hi Riana, It's difficult to answer your question. Can you send some sample data to reproduce this error? Best, Emmanuel Le 15/12/2016 à 22:58, Riana Rishad Minocher a écrit : Hi, I’m writing with an issue using the chronos function in ape: I have a rooted supertree of 186 taxa (genetic & l

Re: [R-sig-phylo] Comparing support values on different trees

2016-12-16 Thread Emmanuel Paradis
Hi Frank, It seems that you can use the (apparently not used a lot) option from makeNodeLabel(, method = "md5sum") which creates node labels with the MD5SUM algorithm using the tip labels descending from each node (considering the tree as rooted). The result is, for each node, a label that is

Re: [R-sig-phylo] ape chronos error

2016-12-21 Thread Emmanuel Paradis
Following Riana's query, it appeared that the tree she used had no branch lengths. chronos() now check for the presence of branch lengths and returns an explicit error message. Best, Emmanuel Le 16/12/2016 à 18:20, Emmanuel Paradis a écrit : Hi Riana, It's difficult to answer you

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

2016-12-27 Thread Emmanuel Paradis
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: if (FALSE) { save and close. Tell me if you still have problem. Best, Emmanuel Le 27/12/2016 à 21:15

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

2016-12-28 Thread Emmanuel Paradis
og: http://blog.phytools.org On 12/27/2016 5:11 PM, Yan Wong wrote: 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 c

Re: [R-sig-phylo] read.FASTA accept connection

2017-01-03 Thread Emmanuel Paradis
Hi, You can send your contribution directly to me. See this post for a recent discussion on how to contribute to ape: http://www.mail-archive.com/r-sig-phylo@r-project.org/msg04580.htmlra Sure your contribution will be useful. I've just found out that read.FASTA crashes R if the FASTA file i

Re: [R-sig-phylo] read.FASTA accept connection

2017-01-04 Thread Emmanuel Paradis
t;^ +", "", names(res)) # to permit phylosim class(res) <- "DNAbin" res } Le 04/01/2017 à 00:37, Rj Ewing a écrit : Emmanuel, Thanks, I've attached a patch containing the changes. I'm not very familiar with R, so maybe there is a better way to do it.

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

2017-01-04 Thread Emmanuel Paradis
Hi, 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. Best, Emmanuel Le 04/01/2017 à 14:46, Yan Wong a écrit : If I create a test.nex file as follows: #NEXUS BEGIN TREES; TRANSLATE 0 0, 1 1, 2 2,

Re: [R-sig-phylo] Extract all possible clades from a tree

2017-01-06 Thread Emmanuel Paradis
Hi, Klaus is right: extract.clade() fails if the tree has been rooted with resolve.root = TRUE before. I'm going to rewrite the function calling drop.tip (which will be safer). In the meantime, Klaus's function should work for Kamila. Best, Emmanuel Le 06/01/2017 à 05:17, Klaus Schliep a é

Re: [R-sig-phylo] Extract all possible clades from a tree

2017-01-06 Thread Emmanuel Paradis
de <= n) stop("node number must be greater than the number of tips") } if (node == n + 1L) return(phy) keep <- prop.part(phy)[[node - n]] drop.tip(phy, (1:n)[-keep], root.edge = root.edge, rooted = TRUE) } ##########

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

2017-01-16 Thread Emmanuel Paradis
Hi, Klaus: thanks for the fix. There is a development version on ape-package.ird.fr: http://ape-package.ird.fr/ape_installation.html#versions This version is 4.0-0.2. The source as well as a Windows version are avaialble. The list of changes is there: http://ape-package.ird.fr/NEWS Best,

Re: [R-sig-phylo] Enigmatic error with drop.tip

2017-01-23 Thread Emmanuel Paradis
Hi Klaus, Thanks for tracking this. It's fixed. Best, Emmanuel Le 20/01/2017 à 18:41, Klaus Schliep a écrit : Hi Juan, it seems that you trim too many taxa. I can replicate the error message if I trim for example 19 out of a 20 tips of a tree. drop.tip(tree, sample(20, 19)) Error in integer(

Re: [R-sig-phylo] ape - corMartins

2017-01-24 Thread Emmanuel Paradis
Hi Sérgio, It seems your results make good sense. alpha=0 is too far from the "optimum" value (i.e., the value that maximises the log-lik), so the optimisation fails to maximise the log-likelihood with respect to this parameter. It has been written in the literature that it is difficult to es

Re: [R-sig-phylo] HKY GTR distances

2017-02-03 Thread Emmanuel Paradis
Dear Andreas, There is no distance formula for HKY or GTR model. For GTR, Rodrı́guez et al. developed a procedure to calculate a distance (also in Yang's 2006 book). An example is given below with the woodmouse: matlog <- function(x) { tmp <- eigen(X) V <- tmp$vectors U <- diag(lo

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

2017-02-07 Thread Emmanuel Paradis
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 seq_along(phy)) phy[[i]]$root.edge <- 0 Best, Emmanuel Le 07/02/2017 à 13:17, Yan Wong a écrit : Sorry if this is a triv

Re: [R-sig-phylo] Average Aminoacid Identity tree with bootstrap support. Is it possible?

2017-04-07 Thread Emmanuel Paradis
Hi Salvador, You first need to define the variables that would be resampled during the bootstrap procedure. In the case of DNA sequences, this would be the columns (= sites) of the alignment, since they each contribute to the distance calculation (or to the likelihod function if you use ML). S

Re: [R-sig-phylo] ace() Warning message:, In sqrt(1/out$hessian) : NaNs produced

2017-05-18 Thread Emmanuel Paradis
Hi Juan, This warning seems related to the fact that the trait did not evolve according to the specified model (i.e., Brownian motion). I simulated some data with: tr <- rphylo(50, .1, 0) x <- rTraitCont(tr) ace(x, tr)$sigma did not return NA out of 1000 replications. I changed the

Re: [R-sig-phylo] possible bug in the phydataplot in ape package?

2017-05-26 Thread Emmanuel Paradis
Hi Elizabeth, Thanks for the report. Apparently, it's enough to add: if (is.null(p)) p <- 1L after: p <- ncol(x) Best wishes, Emmanuel Le 23/05/2017 à 20:31, Elizabeth Purdom a écrit : Hello, I am writing to the R-sig-phylo mailing list regarding what seems to be a bug in the `ph

Re: [R-sig-phylo] ape package: improvement suggestion in color handling for mosaic in phydataplot?

2017-05-26 Thread Emmanuel Paradis
Elizabeth, Thanks a lot for the detailed account of this problem. I've just made these modifications to the code of phydataplot: 1/ Replaced: lgd <- as.character(ux) with: lgd <- sort(as.character(ux)) 2/ These two lines: conames <- names(co) if (!is.null(conames)) co <- c

Re: [R-sig-phylo] A possible alternate MRCA function to APE's getMRCA

2017-06-10 Thread Emmanuel Paradis
Joseph, Klaus, This is great. I slightly edited the code and renamed the argument 'tips' to 'tip' (as in the original definition). I run on a bunch of random trees and the results are exactly identical with the current version of getMRCA. I'm changing the code in ape now. Cheers, Emmanuel

Re: [R-sig-phylo] [R-sig-eco] GEE and AIC

2008-06-02 Thread Emmanuel Paradis
ix(~ x)[, -1] x1 x2 x3 1 1 0 0 2 1 0 0 3 0 1 0 4 0 1 0 5 0 0 1 6 0 0 1 7 -1 -1 -1 8 -1 -1 -1 model.matrix() is called internally by most regression functions (lm, glm, gee, gls, lme, ...) so the user doesn't have to bother about it, but it's nice to see how it works. -- Emmanue

Re: [R-sig-phylo] [R-sig-eco] GEE and AIC

2008-06-02 Thread Emmanuel Paradis
Le 03.06.2008 03:16, Simon Blomberg a écrit : On Mon, 2008-06-02 at 15:34 +0200, Emmanuel Paradis wrote: [snip] R> model.matrix(~ x)[, -1] x2 x3 x4 1 0 0 0 2 0 0 0 3 1 0 0 4 1 0 0 5 0 1 0 6 0 1 0 7 0 0 1 8 0 0 1 Or even just model.matrix(~ x-1) ... which is

Re: [R-sig-phylo] Beta coefficients in R

2008-06-16 Thread Emmanuel Paradis
Le 16.06.2008 11:13, Alejandro Gonzalez Voyer a écrit : Hello: I was wondering whether the beta coefficients in the GLS analyses in APE are standardized coefficients or not. If not, is there any problem in calculating a standardized regression slope by hand, multiplying the regression slope by t

Re: [R-sig-phylo] Test For Serial Independence

2008-08-04 Thread Emmanuel Paradis
nexus files into Abouheif's program, I'd love to hear from you. It's in ade4. See: library(ade4) ?PI2newick ?phylog EP cheers, John ___ R-sig-phylo mailing list R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-

Re: [R-sig-phylo] Maximum-likelihood tree with continuous characters

2008-08-20 Thread Emmanuel Paradis
R-sig-phylo mailing list R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo -- Emmanuel Paradis IRD, Montpellier, France ph: +33 (0)4 67 16 64 47 fax: +33 (0)4 67 16 64 40 http://ape.mpl.ird.fr/ __

Re: [R-sig-phylo] writing list of trees to file

2008-09-02 Thread Emmanuel Paradis
,"K") newlist <- lapply(phylist, +function(z) { +z$tip.label <- c("G","H","I","J","K") + z +}) write.tree(newlist,file="newlist") Error in write.tree(newlist, file = "newlist") : object "phy" is not of class "phylo"

Re: [R-sig-phylo] writing list of trees to file

2008-09-03 Thread Emmanuel Paradis
nks, Emmanuel. I used lapply because the operation (pruning a bunch of tips from 1000s of trees) took a long time, but for less intensive jobs, it's good to know that the for-loop will not have the effect of discarding the object's attributes. Stacey Quoting Emmanuel Paradis <[EMAIL PRO

Re: [R-sig-phylo] Detecting non-Brownian trait evolution

2008-09-09 Thread Emmanuel Paradis
g-phylo mailing list R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo ___ R-sig-phylo mailing list R-sig-phylo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-phylo -- Emmanuel Paradis IRD, Montpellier, France ph: +33 (0)

<    1   2   3   4   5   6   >