Skip to content

Proginski/treeHM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

treeHM.R

This script plots a circular phylogenetic tree with heatmap annotation.

Usage

Command line:

Rscript treeHM.R --tree data/test/test_tree.nwk --data data/test/test_heatmap_values.tsv --output data/test/test_output.pdf
  • "-t", "--tree": Newick tree file
  • "-d", "--data": TSV file, first column = leaves (matching tree tip labels), next columns = heatmap values
  • "-o", "--output": Output PDF file (default: treeHM.pdf)

As a function in R:

source("treeHM.R")
tree <- ape::read.tree("tree.nwk")
hm_data <- read.table("data.tsv", header=TRUE, sep="\t", row.names=1, check.names=FALSE)
pdf("output.pdf", paper="A4")
print(create_hm_tree(tree, hm_data))
dev.off()

Example Output

Example Output

Requirements

  • R packages: ape, ggtree, ggplot2, ggnewscale, optparse

Features

  • Warns about missing leaves and missing values.
  • Supports both discrete and continuous heatmap columns.
  • Output is always A4-sized PDF.

About

Plot a circular phylogenetic tree with heatmap annotation.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages