Skip to content

[WIP] Update ablation runner to support additional Tox21 assays - #1

Draft
SupravoCoder with Copilot wants to merge 1 commit into
mainfrom
copilot/update-ablation-runner-multiple-assays
Draft

[WIP] Update ablation runner to support additional Tox21 assays#1
SupravoCoder with Copilot wants to merge 1 commit into
mainfrom
copilot/update-ablation-runner-multiple-assays

Conversation

Copilot AI commented Jul 5, 2026

Copy link
Copy Markdown

Thanks for asking me to work on this. I will get started on it and keep this PR's description up to date as I form a plan and make progress.

Update the ablation runner so it can generate ablation results for the other 6 Tox21 assays in the repository, not just the default NR.AhR assay. The current script src/ablation/run_ablation.py already accepts an --assay argument and loads assay-specific files named S_<assay>_tr.csv and S_<assay>_te.csv, but it only runs a single assay per invocation and writes outputs into a shared results directory. Improve the workflow so it is easy to produce ablation results for the six additional Tox21 assays similar to the existing NR.AhR ablation results.

Requirements:

  • Preserve the existing single-assay behavior for --assay.
  • Add a convenient way to run the ablation pipeline across multiple assays in one invocation, or otherwise provide an ergonomic and reproducible mechanism for generating ablation results for the 6 other Tox21 assays.
  • Ensure outputs are organized per assay so results do not overwrite each other.
  • Keep the existing ablation metrics and LaTeX/table generation behavior.
  • If needed, update documentation or usage comments so it is clear how to run ablations for all supported Tox21 assays.
  • The supported assays should include the remaining Tox21 assays beyond NR.AhR, such as NR.AR, NR.AR-LBD, NR.ARE, NR.Aromatase, NR.ER, and NR.ER-LBD.

The following is the prior conversation context from the user's chat exploration (may be truncated):

User: from where did we get the ablation results for the nr ahr assay

Assistant: The NR-AhR ablation results come from the repo’s ablation pipeline, specifically src/ablation/run_ablation.py, which loads the NR-AhR train/test CSVs, runs the model variants under 5-fold stratified CV, and exports the summary table. The paper/LaTeX table is generated from that same output in paper/main_filled.tex and src/ablation/results/paper_table.tex. The key source files are:

load_data(data_root: str, assay: str = "NR.AhR"):
    train_path = os.path.join(data_root, f"S_{assay}_tr.csv")
    test_path  = os.path.join(data_root, f"S_{assay}_te.csv")

    raw = pd.read_csv(train_path).values
    y_full = (raw[:, -1] == 1).astype(int)
    X_raw  = np.maximum(raw[:, :-1], 0)            # clip SMOTE negatives

    raw_te = pd.read_csv(test_path).values
    y_test = (raw_te[:, -1] == 1).astype(int)
    X_test = np.maximum(raw_te[:, :-1], 0)
\caption{Ablation results on Tox21 NR-AhR (5-fold Stratified CV, mean $\pm$ std).}
...
Single MLP & 0.9030 $\pm$ 0.0108 & 0.6265 $\pm$ 0.0503 & ...
\caption{Main ablation results on Tox21 NR-AhR (5-fold Stratified CV, mean $\pm$ std).}

So if you’re asking “where did we get them?”: from the NR-AhR training/test CSVs in data/, processed by run_ablation.py, then summarized into the paper tables.

If you want, I can also trace the exact script path that generates the ablation CSVs and identify which metric file contains the final NR-AhR numbers.

User: i want it for other 6 tox 21 assays similary the ablation results

Assistant: Yes — the same ablation pipeline supports the other Tox21 assays too.

Use the --assay flag in src/ablation/run_ablation.py:

python src/ablation/run_ablation.py --assay NR.AR
python src/ablation/run_ablation.py --assay NR.AR-LBD
python src/ablation/run_ablation.py --assay NR.ARE
python src/ablation/run_ablation.py --assay NR.Aromatase
python src/ablation/run_ablation.py --assay NR.ER
python src/ablation/run_ablation.py --assay NR.ER-LBD

The script reads assay-specific files here:

train_path = os.path.join(data_root, f"S_{assay}_tr.csv")
test_path  = os.path.join(data_root, f"S_{assay}_te.csv")

So for each assay, it expects matching S_<assay>_tr.csv and S_<assay>_te.csv files in data/.

A couple of notes:

  • The default assay is NR.AhR.
  • The current script writes results to src/ablation/results/, so if you run multiple assays, you’ll want to rename or move the outputs between runs to avoid overwriting.
  • The ablation table format is the same: ROC-AUC, PR-AUC, F1, MCC, ECE, Brier.

If you want, I can also help you make this script automatically loop over all 6 NR assays and save each assay’s ablation results into separate folders.

User: yes

Assistant: I’m waiting for your confirmation to continue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants