How to form network using tanimoto distance
1
0
Entering edit mode
6.2 years ago
swap • 0

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?

R pathway network • 1.3k views
ADD COMMENT
1
Entering edit mode
6.2 years ago

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")
ADD COMMENT

Login before adding your answer.

Traffic: 3051 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

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

Powered by the version 2.3.6