Top Banner
Tal.Galili@gmail.c om The dendextend R package - JSM 2015
84
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: jsm2015: the dendextend R package

[email protected]

The dendextend R package - JSM 2015

Page 2: jsm2015: the dendextend R package

[email protected]

Talk outline• Motivating example (Iris)

• Getting dendextend

• Functions for extending dendrogram

• Connections to other packages

Page 3: jsm2015: the dendextend R package

[email protected]

Motivating example

Page 4: jsm2015: the dendextend R package

[email protected]

The Iris dataset

Page 5: jsm2015: the dendextend R package

[email protected]

The Iris dataset

Page 6: jsm2015: the dendextend R package

[email protected]

The Iris dataset

Page 7: jsm2015: the dendextend R package

[email protected]

The Iris dataset

Using: gplots::heatmap.2

Page 8: jsm2015: the dendextend R package

[email protected]

Is there a difference between clustering algorithms?

Page 9: jsm2015: the dendextend R package

[email protected]

Why is “complete” different?

Comparing 8 Clustering algorithms onThe Iris dataset

Using: dendlist,cor.dendlist + The corrplot package

Page 10: jsm2015: the dendextend R package

[email protected]

Why is “complete” different?

Using: tanglegram

Page 11: jsm2015: the dendextend R package

[email protected]

Getting dendextend

Page 13: jsm2015: the dendextend R package

[email protected]

Further reading

(includes the example)

Page 14: jsm2015: the dendextend R package

[email protected]

dendextend paper in the bioinformatics journal

Page 15: jsm2015: the dendextend R package

[email protected]

Getting the paper/presentation

Go to: www.R-statistics.comOr: just e-mail me:

Page 16: jsm2015: the dendextend R package

[email protected]

Some useful functions for

extending dendrogram

Page 17: jsm2015: the dendextend R package

[email protected]

Building a dendrogram

Page 18: jsm2015: the dendextend R package

[email protected]

hclust -> dend

Page 19: jsm2015: the dendextend R package

[email protected]

hclust -> dend

Page 20: jsm2015: the dendextend R package

[email protected]

Useful functions• labels• labels_colors• cutree• color_branches• sort• tanglegram• set (!)

Page 31: jsm2015: the dendextend R package

[email protected]

ONE more function

Page 32: jsm2015: the dendextend R package

[email protected]

Using pipes%>%

(but first…)

Page 33: jsm2015: the dendextend R package

[email protected]

hclust -> dend

Page 34: jsm2015: the dendextend R package

[email protected]

hclust + pipes (via magrittr)

Page 35: jsm2015: the dendextend R package

[email protected]

Changing a dendrogram

Page 36: jsm2015: the dendextend R package

[email protected]

The set functionset(dend, what, value)

One function to rule them all!

Page 37: jsm2015: the dendextend R package

[email protected]

The set functionset(dend, what, value)

• dend a dendrogram• what the property to update• value new values to set in the

tree

Page 38: jsm2015: the dendextend R package

[email protected]

The set functionset(dend, what, value)

Type “what"Labels labels, labels_to_character, labels_colors,

labels_cex, labels_to_characterLeaves leaves_pch, leaves_col, leaves_cex, hang_leavesNodes nodes_pch, nodes_col, nodes_cex

Branches branches_lty, branches_col, branches_lwd, branches_k_color, by_labels_branches_lty,

by_labels_branches_col, by_labels_branches_lwd

Page 39: jsm2015: the dendextend R package

[email protected]

A dend exmaple

Page 40: jsm2015: the dendextend R package

[email protected]

Modify labels

Page 43: jsm2015: the dendextend R package

[email protected]

Modify branches

Page 44: jsm2015: the dendextend R package

[email protected]

Modify branches

Page 45: jsm2015: the dendextend R package

[email protected]

Modify nodes

Page 46: jsm2015: the dendextend R package

[email protected]

useful connections

to otherpackages

Page 47: jsm2015: the dendextend R package

[email protected]

circlize

Page 48: jsm2015: the dendextend R package

[email protected]

ggplot2

Page 49: jsm2015: the dendextend R package

[email protected]

ggplot2

Page 50: jsm2015: the dendextend R package

[email protected]

https://plot.ly/~talgalili/6/y-vs-x/

ggplot2 + plot.ly

Page 51: jsm2015: the dendextend R package

[email protected]

gplots::heatmap.2

Page 52: jsm2015: the dendextend R package

[email protected] work with Joe Cheng

d3heatmap

Page 54: jsm2015: the dendextend R package

[email protected]

Credits!

dendextend

This work was supported in part by the European Research Council under EC–EP7 European Research Council grant PSARPS-297519, and also by the HBP project.

Page 55: jsm2015: the dendextend R package

[email protected]

Thank you!for the slides:

R-statistics.com

The dendextend R package

Page 56: jsm2015: the dendextend R package

[email protected]

Exploring a dendrogram

Page 58: jsm2015: the dendextend R package

[email protected]

A dendrogram is a nested list of lists

Page 61: jsm2015: the dendextend R package

[email protected]

Depth- FirstSearch

Page 62: jsm2015: the dendextend R package

[email protected]

Depth- FirstSearch

Page 63: jsm2015: the dendextend R package

[email protected]

Comparing dendrograms

Page 64: jsm2015: the dendextend R package

[email protected]

tanglegram + untangle

Page 65: jsm2015: the dendextend R package

[email protected]

tanglegram + untangle

Page 66: jsm2015: the dendextend R package

[email protected]

“Correlation” measures

Page 67: jsm2015: the dendextend R package

[email protected]

“Correlation” measures

Page 68: jsm2015: the dendextend R package

[email protected]

Rotate branches

Page 70: jsm2015: the dendextend R package

[email protected]

Modify nodes (no code)

Page 74: jsm2015: the dendextend R package

[email protected]

Rotate branches

Page 75: jsm2015: the dendextend R package

[email protected]

Prune branches

Page 76: jsm2015: the dendextend R package

[email protected]

Prune branches

Page 77: jsm2015: the dendextend R package

[email protected]

Add rectangles

Page 78: jsm2015: the dendextend R package

[email protected]

Add rectangles

Page 80: jsm2015: the dendextend R package

[email protected]

dendextendin the wild

Page 81: jsm2015: the dendextend R package

[email protected]

Visually comparing two clustering methods

Page 82: jsm2015: the dendextend R package

[email protected]

A plot from a recent HBP meeting in Lausanne

DendrogramUsing 2 variables

DendrogramUsing all variables

Page 83: jsm2015: the dendextend R package

[email protected]

Visually comparing two phylogenic trees

Page 84: jsm2015: the dendextend R package

[email protected]

The dendextend R package

Thank you!for the slides:

R-statistics.com