0

i want to cluster the protein interaction database, into sub cluster and for that I used Hierarchical Clustering in R. But i get warning message which i can't understand and cluster would not created. My code and Database are as below:

Database:

         trpD             trpB
         serB             sdaA
         pabA             trpA
         pabB             trpA
         pabA             pabB
         serB             glyA
         serB             trpB
         trpC             trpA
         ilvA             trpA
         serB             ilvA
         trpB             trpA
         pabB             trpB
         trpE             trpC
         trpC             trpB
         trpE             trpB
         pabB             trpC
         sdaA             trpB
         pabA             trpD
         trpE             trpD
         pabA             trpC
         sdaA             trpA
         serB             trpA
         pabA             trpE
         ilvA             glyA
         pabB             trpD
         trpD             trpC
         ilvA             trpB
         glyA             trpA
         glyA             trpB
         pabA             trpB
         trpE             trpA
         glyA             sdaA
         trpD             trpA

here traA interact with trpB, serB interact with sdaA and so on... now i want to cluster them.My code is:

rm(list=ls())  
options(max.print = 10000000)

library(igraph) # load package igraph
library(combinat)
library(e1071)
library(maptree)

read_database <- read.table("C:/Users/Priyanka/Desktop/text_summary.txt",             header=TRUE, comment.char = "") 
read_database

data_frame <- data.frame (read_database$V1, read_database$V2)
data_frame

dim(data_frame)

d_euclidian <- dist(read_database, method = "euclidean")
d_euclidian

I got the warning: Warning message: In dist(data_frame, method = "euclidean") : NAs introduced by coercion

can any one help? And also can any one tell me about other technique for clustering PPI. And can i use K means clustering here? If yes than How??? Please help..

Thanks...

  • I don't think this uses igraph or maptree, etc. Can you make a minimal example? – Gabor Csardi Jul 27 '15 at 18:43
  • This is the minimal example of my dataset. You can take any 6 or 7 from this. I really don't know how clustering would be perform on biological data. So i need help on this. Because i have unweighted network and all are string kind of database. So i really don't have an idea about this. Please help. Thanks – priyanka nimavat Jul 28 '15 at 05:58
  • 1
    Welcome to SO. "Minimal example" also means cutting the fat in your code, making it easier for readers to see what you are doing. For example, you don't use anything from Gabor's igraph but load that package. Furthermore, from what I see, you don't have any data to build an euclidean distance matrix and perform a hierarchical clustering. – lukeA Jul 28 '15 at 21:51

1 Answers1

1

Here's an example using a clustering algorithm from igraph:

df <- read.table(sep = ";", text = "trpD;trpB
serB;sdaA
pabA;trpA
pabB;trpA
pabA;pabB
serB;glyA
serB;trpB
trpC;trpA
ilvA;trpA
serB;ilvA
trpB;trpA
pabB;trpB
trpE;trpC
trpC;trpB
trpE;trpB
pabB;trpC
sdaA;trpB
pabA;trpD
trpE;trpD
pabA;trpC
sdaA;trpA
serB;trpA
pabA;trpE
ilvA;glyA
pabB;trpD
trpD;trpC
ilvA;trpB
glyA;trpA
glyA;trpB
pabA;trpB
trpE;trpA
glyA;sdaA
trpD;trpA")
library(igraph)
set.seed(1)
g <- graph.data.frame(df, directed = F)
groups <- membership(cluster_louvain(g))
communities <- communities(cluster_louvain(g))
plot.igraph(g, mark.groups = communities)

enter image description here

lukeA
  • 53,097
  • 5
  • 97
  • 100
  • Thanks. Here what is cluster_louvain ? It gives an error. Is it an Function? Because the error says " could not find function cluster_louvain ". Thanks. – priyanka nimavat Jul 29 '15 at 05:25
  • 1
    You probably need to update the `igraph` package. The function is part of it. – lukeA Jul 29 '15 at 08:27
  • Cool. If it helps you with your problem, you can check the answer and mark the question as solved. (The same goes for your previous questions; some seem to be solved but are still open.) – lukeA Jul 29 '15 at 10:31