Drug-Disease-ADR Visualization
Overview
This app visualizes a knowledge graph with three node types (drug / disease / adr). The graph is centered around a user-selected node and displays related edges with a pred_score edge weight.
How to Use
- In the sidebar, choose Center node type (Disease / Drug / ADR).
- In Center node, search and select a node (only nodes of the selected type are shown).
- Adjust the two edge score filters as needed:
- Drug-Disease: pred_score ≥
- Drug-ADR: pred_score ≥
- Open “Main page” to view the Knowledge Graph and the Downloadable Table, and download the filtered edges as CSV.
Edge Construction and Filtering
Edges are constructed in two groups (Drug–Disease and Drug–ADR). Each group is first reduced to top 50 by pred_score (descending), then filtered again by the corresponding sidebar threshold.
-
When
center_type = drug- Start from outgoing edges where
from ∈ center_node. - Split into two groups:
- Drug–Disease: edges with
tobeing a disease node - Drug–ADR: edges with
tobeing an adr node
- Drug–Disease: edges with
- For each group: keep top 50 by
pred_score.
- Start from outgoing edges where
-
When
center_type ≠ drug(disease or adr)- Step 1 (primary group):
edges1 = edges where to ∈ center_node, keep top 50 bypred_score.- Extract
top_drugs = unique(edges1$from).
- Step 2 (secondary group from top drugs):
edges2 = edges where from ∈ top_drugs.- If
center_type = disease, restrictedges2$toto adr nodes. - If
center_type = adr, restrictedges2$toto disease nodes. - Keep top 50 by
pred_score.
- Group assignment:
- If
center_type = disease: Drug–Disease =edges1, Drug–ADR =edges2. - If
center_type = adr: Drug–ADR =edges1, Drug–Disease =edges2.
- If
- Step 1 (primary group):
The final displayed edge set is the union of both filtered groups.
Table and Download
The Downloadable Table shows the filtered edges:
from: source nodeto: target nodetype: target node type (drug / disease / adr)pred_score: edge weight
Visual Encoding
- Node shapes
- Drug: dot
- Disease: square
- ADR: triangle
- Center node: star
- Node colors
- Drug: green
- Disease: blue
- ADR: orange
- Edge colors
pred_score > 0: bluepred_score < 0: magenta- Missing/other: gray