How to form network using tanimoto distance
Hi, I have data like this
column-1 Column-2 Similarity_dist
chemical-1 chemical-2 0.6
chemical-1 chemical-3 0.1
chemical-1 chemical-4 0.7
chemical-1 chemical-5 0.3
chemical-2 chemical-1 0.05
chemical-2 chemical-3 0.65
chemical-2 chemical-4 0.75
chemical-2 chemical-5 0.4
. . such hundered rows. Now I filtered them with similarity cutoff of 0.5, and my data looks like
column-1 Column-2 Similarity_dist
chemical-1 chemical-2 0.6
chemical-1 chemical-4 0.7
chemical-2 chemical-3 0.65
chemical-2 chemical-4 0.75
. .
I want to find interaction network among these chemicals. Does anyone knows method in R by which I can use chemicals as nodes and distances as edges and then form network? Any other suggestion? Any code?
• 1,704 views
•
link
1 answer
Your data is basically an adjacency matrix in edge list format which you can read in R with the igraph package using the read_graph() function or by reading it in a data frame first and converting to an igraph object, something like:
G.data <- read.table("myData.txt")
G <- graph_from_data_frame(G.data, directed = FALSE)
or
G <-read_graph("myData.txt",format="ncol")
• 0 views
•
link
Log in to answer this question.