# 04_QUEST_OPEN_TARGETS

Congratulations on reaching the final, open-ended quest! In the previous steps, we reproduced the core analysis from the SCimilarity paper and extended it to new datasets. Now, we're transitioning from pure data analysis to **Competitive Intelligence and Translational Strategy**.

---

## 1. Background and Goals

**Objective:** Extract actionable competitive intelligence for key targets identified for Type 2 Diabetes by querying the Open Targets database and structuring the results into an interactive visual dashboard.

**Deliverables:**
1. A Python script (`src/fetch_clinical_intelligence.py`) that uses the Open Targets GraphQL API to fetch drug pipeline and evidence data.
2. An interactive HTML dashboard (`web/clinical_landscape.html`) featuring a drug pipeline breakdown and a target-disease evidence summary.

## 2. Tech Stack and Project Structure

**Tooling Approaches:**
- **Direct API querying:** Using `requests` and Python to query the Open Targets GraphQL API.
- **Visualizations:** `plotly` for interactive charts and `pandas` for data structuring.

## 3. Inputs & Target Selection

**Targets Chosen:**
- **GLP1R:** Glucagon-like peptide 1 receptor. Primary target for modern GLP-1 agonists (e.g., semaglutide).
- **GIPR:** Gastric inhibitory polypeptide receptor. Target for dual agonists (e.g., tirzepatide).
- **SGLT2 (SLC5A2):** Sodium-glucose cotransporter 2. Highly established target for flozin drugs (e.g., empagliflozin).
- **SLC30A8:** Zinc transporter 8. Target with strong genetic evidence (GWAS) for T2D risk/protection.

**Research Questions:**
- What is the clinical development status (Phase I-IV) for drugs targeting these genes in Type 2 Diabetes?
- What are the primary evidence sources (Genetics, Drugs, Literature) supporting these targets for T2D?
- Which target has the most "white space" (genetic evidence but few/no approved drugs)?

## 4. Outputs

The resulting HTML report will include:
*   **Pipeline Overview:** A stacked bar chart showing the number of drugs per clinical phase for each target.
*   **Evidence Scoring:** A heatmap visualizing the strength of evidence from various sources (Genetic Association, Known Drug, Affects Pathway, etc.) provided by Open Targets.
*   **Drug Table:** A searchable list of the top drugs, their highest phase, and their mechanism of action.

## 5. Implementation Strategy

### Connecting to APIs
The script will send GraphQL queries to `https://api.platform.opentargets.org/api/v4/graphql` to retrieve the `associatedDiseases` and `knownDrugs` for the selected Gene IDs.

### Data Processing
We will aggregate the `drugId` and `maximumClinicalPhase` fields to count drugs per phase for the "Type 2 Diabetes" (EFO_0001360) indication.

### Visualizations & Report Generation
We will use Plotly to generate interactive HTML divs for the charts and embed them into a stylized Bootstrap-based HTML template.

## 6. Open Exploration

Following the completion of the T2D landscape, we can explore using these same methods for the Muscle/DMD targets identified in Quest 3.
copyright: © 2026 Sonia Timberlake & Ryan Bellmore
license: Proprietary - Authorized Workshop Participants Only
distribution_allowed: false
