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

  1. In the sidebar, choose Center node type (Disease / Drug / ADR).
  2. In Center node, search and select a node (only nodes of the selected type are shown).
  3. Adjust the two edge score filters as needed:
    • Drug-Disease: pred_score ≥
    • Drug-ADR: pred_score ≥
  4. 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 to being a disease node
      • Drug–ADR: edges with to being an adr node
    • For each group: keep top 50 by pred_score.
  • When center_type ≠ drug (disease or adr)

    • Step 1 (primary group):
      • edges1 = edges where to ∈ center_node, keep top 50 by pred_score.
      • Extract top_drugs = unique(edges1$from).
    • Step 2 (secondary group from top drugs):
      • edges2 = edges where from ∈ top_drugs.
      • If center_type = disease, restrict edges2$to to adr nodes.
      • If center_type = adr, restrict edges2$to to 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.

The final displayed edge set is the union of both filtered groups.

Table and Download

The Downloadable Table shows the filtered edges:

  • from: source node
  • to: target node
  • type: 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: blue
    • pred_score < 0: magenta
    • Missing/other: gray
Subset of the input CSV following user selection.
Download Filtered CSV