Giter VIP home page Giter VIP logo

phylogram's Introduction

phylogram

DOI CRAN_Status_Badge Build Status codecov Project Status License: GPL v3 DOI ORCiD


The phylogram R package is a tool for for developing phylogenetic trees as deeply-nested lists known as "dendrogram" objects. It provides functions for conversion between "dendrogram" and "phylo" class objects, as well as several tools for command-line tree manipulation and import/export via Newick parenthetic text. This improves accessibility to the comprehensive range of object-specific analytical and tree-visualization functions found across a wide array of bioinformatic R packages.

Installation

To download phylogram from CRAN and load the package, run

install.packages("phylogram")
library("phylogram")

To download the latest development version from GitHub, run:

devtools::install_github("ropensci/phylogram", build_vignettes = TRUE) 
library("phylogram")

Example: reading and writing trees

Consider the simple example of a tree with three members named "A", "B" and "C", where "B" and "C" are more closely related to eachother than they are to "A". An unweighted Newick string for this tree would be "(A,(B,C));". This text can be imported as a dendrogram object using the read.dendrogram function as follows:

library("phylogram")
newick <- "(A,(B,C));"
x <- read.dendrogram(text = newick)
plot(x)

The following command writes the object back to the console in Newick format without edge weights:

write.dendrogram(x, edges = FALSE)

The syntax is similar when reading and writing text files, except that the text argument is replaced by file and a valid file path is passed to the function.

To convert the dendrogram to a "phylo" object, run

y <- as.phylo(x)

These and more examples are available in the package vignette. To view the vignette, run vignette("phylogram-vignette") or access it directly from CRAN.

Help

An overview of the package with links to the function documentation can be found by running

?phylogram

If you experience a problem using this package please either raise it as an issue on GitHub or post it on the phylogram google group.

Acknowledgements

This software was developed at Victoria University of Wellington with funding from a Rutherford Foundation Postdoctoral Research Fellowship award from the Royal Society of New Zealand.

ropensci_footer

phylogram's People

Contributors

shaunpwilkinson avatar

Stargazers

Ellen S Cameron avatar Zeke Marshall avatar Biopig avatar jiaxin Yu avatar MARinE Data Science avatar  avatar Watal M. Iwasaki avatar Matthew Nitschke avatar mark padgham avatar  avatar Michael Krabbe Borregaard avatar

Watchers

James Cloos avatar Tiago Andrade Borges Santos avatar Konrad Neugebauer avatar Michael Krabbe Borregaard avatar  avatar  avatar Katie Stevens avatar  avatar

phylogram's Issues

Phylogenetic tree using numerical dataset

How to make phylogenetic tree using following type of dataset. I have 71 samples and 3003 row in the input file. Can you, please suggest any way to get the tree using phylogram.

example file:
4 11
Sample1 11 - - - - 89 678 9 2 3 55
Sample2 11 8 7 6 5 - - 78 765 9 -
Sample3 12 - - - - 45 786 - - -
Sample4 23 8 8 7 - - - 6 5 5-

Node and branch coloring

Hi,

Thank you for making this nice package.
I am wondering how to add nodes to plot ? also It would be nice to be able to cut the tree into k clusters and color them without coloring the labels. Is that possible?

Best

tree topology doesn't match with output from dendroscope ??

Hello,

I created three phylogenetic tree using three different methods, now I want to compare the topology of my three trees using phylogram r package, here is my codes and output:

# read dendrogram
dend1 <- read.dendrogram("tree1.newick")
dend2 <- read.dendrogram("tree2.newick")
dend3 <- read.dendrogram("tree3.newick")
# ladderizing
dend1 <- ladder(dend1, decreasing = TRUE)
dend2 <- ladder(dend2, decreasing = TRUE)
dend3 <- ladder(dend3, decreasing = TRUE)
# tanglegram two trees
dndlist <- dendextend::dendlist(dend1, dend2)
dendextend::tanglegram(dndlist, fast = FALSE, margin_inner = 5)

dndlist <- dendextend::dendlist(dend2, dend3)
dendextend::tanglegram(dndlist, fast = FALSE, margin_inner = 5)

The output of two tanglegram look like this:
Screen Shot 2020-09-26 at 4 30 59 PM

Screen Shot 2020-09-26 at 4 31 15 PM

However, I did same tanglegram analysis of above tree pairs in dendroscope, the outputs show the topology of my trees agree with each other, here is how they look like:
Screen Shot 2020-09-26 at 4 33 34 PM

Screen Shot 2020-09-26 at 4 34 06 PM

Can anyone have any recommendation on how to modify my codes so I can have the same output as from dendroscope??

Thank you so much.

Best,
LC

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.