Questions tagged [ape-phylo]

Ape is an R package for performing phylogenetic analyses and plotting phylogenetic trees.

78 questions
2
votes
2 answers

How to rotate nodes of phylogeny in R without overlapping?

I'm trying to make nice figures for my phylogenies in R (I'm working my way up to using R for analyses). The trees have been made in Garli and MrBayes. The Garli (maximum likelihood) trees have been behaving with all the typical ape, phytools, and…
Brigette Z
  • 21
  • 4
2
votes
1 answer

expand an R plot to accommodate labels on a cladogram

I've been messing with pin, mar, and oma with this plot but I can't figure out the magic combination that will accommodate the tip labels for the plot produced with the code below. Any advice would be greatly appreciated. library(ape) archosaurs <-…
2
votes
2 answers

Mulitprocessing and rpy2 (with ape)

I ran into this today and can't figure out why. I have several functions chained together that perform some time consuming operations as part of a larger pipeline. I've included these here, pared down to a test example, as best as I could. The…
Chris F.
  • 773
  • 6
  • 15
2
votes
1 answer

How to use as.DNAbin{ape} with DNA sequences stored in a dataframe?

I have a dataframe with loci names in one column and DNA sequences in the other. I'm trying to use as.DNAbin{ape} or similar to create a DNAbin object. Here some example data: x <- structure(c("55548", "43297", "35309", "34468",…
A.Mstt
  • 301
  • 1
  • 3
  • 15
1
vote
0 answers

How do I fix my tree after dropping tip on a phylogenetic tree :0 character label?

After using drop.tip command from the APE package on a phylogenetic tree, I plotted my tree using R and everything looked ok. After exporting the newick file, I found that the tips I dropped ended up dropping just the labels and were replaced by…
1
vote
1 answer

phylotools::sub.taxa.label() error when substituting tree tip label

Please use the File Dropper link for the R project file with data and codes: https://filedropper.com/d/s/O4IkyFWpP54Ttb0yjODMlaUjhITOXR OR https://drive.google.com/drive/folders/1_AHbjNrgeyiGMhbh-StlqakjXmcSDHnM?usp=sharing I have a phylogeny…
Hong
  • 62
  • 6
1
vote
1 answer

Selecting random phylogenetic trees from data set, runing analysis and trying to save results

I want to calculate the Moran index for several random phylogenetic trees from a data set. As the result I want a list of: the values of Moran index calculation and the selected tree for that given calculation of Moran index (at each loop). I need…
Pam
  • 23
  • 5
1
vote
1 answer

How to rotate nodes of a time-calibrated phylogenetic tree to match a particular order in R?

I have a time-calibrated phylogenetic tree from BEAST and I would like to make a figure in which its nodes are rotated to match an arbitrary ordering. The following code works perfectly to plot the tree with the nodes in the order they are in the…
goshawk
  • 73
  • 5
1
vote
2 answers

Get tree from ancestor nodes of cutree groups R

I have a tree and I want to get part of the tree that is ancestors of cutree groups. library(stats) library(ape) tree <- ape::read.tree(text =…
Shubham Gupta
  • 650
  • 6
  • 18
1
vote
1 answer

Circular phylogeny names cut

I'm trying to place a phylogeny at the middle of a composite plot. I however fail to find the proper setting for this, as either the names on top&bottom, or the names on left and right are cut. The only solution I found is reducing cex (size of taxa…
Jasmine
  • 103
  • 2
  • 7
1
vote
2 answers

Is it possible to add taxa to a phylogeny by binding them to sister taxa, rather than nodes?

I am trying to create a tree to calculate phylogenetic signal and conduct a phylogenetic generalized least squares analysis. However, some of my taxa are missing from the literature tree I am using for this analysis, mostly because these were taxa…
user2352714
  • 314
  • 1
  • 15
1
vote
1 answer

Error running PGLS in ape: "no covariate specified"

I just re-visited an old r script to double check my analyses. I'm getting this new error when I try to run PGLS: No covariate specified, species will be taken as ordered in the data frame. To avoid this message, specify a covariate containing the…
1
vote
1 answer

Trying to write data into newick format R

I have a dataset with different levels of branches starting from the top level: stock -> mbranch -> sbranch -> lsbranch. I want to be able to visualize these levels of my data into Newick format. I have different language groups within each stock…
Angie
  • 183
  • 3
  • 13
1
vote
2 answers

Is there a way to reorder tip labels of a phylo object so that they are consistent with another phylo object?

I have two trees that I am trying to compare. One from mrbayes, another from Paup. When I use read.nexus, the resulting phylo objects have differently ordered tip labels, despite the fact that both files have the same nexus taxa block. I've…
evopalaeo
  • 13
  • 3
1
vote
2 answers

Counting phylogenetic tree topologies in R

Given a multiPhylo object in R, what's the simplest way to count the number of duplicate topologies. For instance, if I randomly sample from all 15 possible resolutions of a 4 tip topology: library(ape) library(phytools) m <- do.call(c,…
user2667066
  • 1,867
  • 2
  • 19
  • 30