Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,20 @@ opto_benz_1,0.25,0.02,0.44,0.59,0.12
- Zero weights → receptors excluded by LASSO (not predictive)
- Sparse circuits (3-7 receptors) suggest minimal testable hypotheses

**Robustness Analysis:** Two CLI scripts assess circuit robustness. *Ablation* (`lasso_with_ablations.py`) tests necessity by zeroing out receptors and measuring MSE increase. *Focus mode* (`lasso_with_focus_mode.py`) tests sufficiency by refitting LASSO on only the top-N receptors to generate MSE vs N curves.

```bash
# Ablation: test if removing Or22b/Or49a degrades the model
python scripts/lasso_with_ablations.py --door_cache door_cache \
--behavior_csv reaction_rates.csv --condition opto_hex \
--ablate Or22b Or49a --ablation_set_mode single --output_dir ablation_out

# Focus: test if top 1-5 receptors are sufficient
python scripts/lasso_with_focus_mode.py --door_cache door_cache \
--behavior_csv reaction_rates.csv --condition opto_hex \
--topn_list 1 2 3 5 --output_dir focus_out
```

### CLI Usage

```bash
Expand Down
49 changes: 49 additions & 0 deletions docs/BEHAVIORAL_PREDICTION_ANALYSIS.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,55 @@ From the comparison output:

---

## 5.5 Robustness Analysis Scripts

Two scripts assess how stable the LASSO-identified receptor circuits are:

### Ablation Analysis

Test whether the model degrades when specific receptors are ablated (zeroed out):

```bash
conda activate DoOR
python scripts/lasso_with_ablations.py \
--door_cache door_cache \
--behavior_csv /path/to/reaction_rates_summary_unordered.csv \
--condition opto_hex \
--output_dir ablation_results \
--ablate Or22b Or49a \
--ablation_set_mode single
```

**Key arguments:**
- `--ablate`: Receptor(s) to ablate (case-insensitive)
- `--ablation_set_mode`: `single` (ablate each individually) or `all_in_one` (ablate together)
- `--missing_receptor_policy`: `error`, `warn`, or `skip` for unmatched receptors

**Outputs:** `baseline_model.json`, `ablation_summary.csv`, per-ablation folders, `ablation_comparison.png`

### Focus Mode Analysis

Test whether top-N receptors are *sufficient* to maintain model performance:

```bash
conda activate DoOR
python scripts/lasso_with_focus_mode.py \
--door_cache door_cache \
--behavior_csv /path/to/reaction_rates_summary_unordered.csv \
--condition opto_hex \
--output_dir focus_results \
--topn_list 1 2 3 5 10
```

**Key arguments:**
- `--topn_list`: Test subsets of top 1, 2, 3, ... receptors
- `--focus_receptors`: Alternatively, specify exact receptors to include
- `--baseline_select_by`: `abs_weight` (default) or `weight` for ranking

**Outputs:** `baseline_model.json`, `focus_curve.csv`, `focus_curve.png`, per-N folders

---

## 6. Biological Insights

### Top Receptor Candidates for Experimental Validation
Expand Down
Loading
Loading