Hi all,

How to compare the values of two nodes and how can I get the difference between two nodes from a Dendrogram? Is there any method available in R for comparing two nodes?

How To Analyse A Dendrogram In R?

2

Entering edit mode

13.0 years ago

Mkl
▴
100

Hi all,

How to compare the values of two nodes and how can I get the difference between two nodes from a Dendrogram? Is there any method available in R for comparing two nodes?

2

Entering edit mode

13.0 years ago

Khader Shameer
18k

Not an R solution but you can do this type of calculations using BioPerl (look at node depth in Bio::TreeIO module) or ETE (Python).

1

Entering edit mode

13.0 years ago

Egon Willighagen
5.4k

You can identify the point with the identify() method, which actually works for many other plots too. Say, I have a matrix with two columns, and plot the second against the first column, I can then interactively click points with identify() where double click ends the selection. Example code:

```
> plot(h2[,1], h2[,2])
> identify(h2)
[1] 2
> h2[2,]
[1] "93" "95"
```

1

Entering edit mode

13.0 years ago

David Quigley
11k

You probably want the distance between the two nodes as calculated in the distance matrix. Note that the distance matrix is what you're plotting in a dendrogram.

```
d = dist(M)
dd = as.matrix(d)
dd[which(labels(d)=='sample.1'), which(labels(d)=='sample.2')]
```

Similar Posts

Loading Similar Posts

Traffic: 1400 users visited in the last hour

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Exactly the answer I would want to see when I read this question. It is indeed the distance matrix that one needs/uses when plotting/analyzing dendrograms. Thanks, David, for raising this important point.