Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,68 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Instruction from Wanwan Feng
|
| 2 |
+
# 🚀 VCC Processing Workflow
|
| 3 |
+
|
| 4 |
+
## **Step 1 — Generate Embeddings for All Input Files**
|
| 5 |
+
```python
|
| 6 |
+
import os
|
| 7 |
+
os.environ['MPLBACKEND'] = 'Agg'
|
| 8 |
+
|
| 9 |
+
# 1. Files to process
|
| 10 |
+
FILENAMES_TO_PROCESS = [
|
| 11 |
+
"competition_train.h5",
|
| 12 |
+
"jurkat.h5",
|
| 13 |
+
"k562.h5",
|
| 14 |
+
"k562_gwps.h5",
|
| 15 |
+
"rpe1.h5",
|
| 16 |
+
"competition_val_template.h5ad",
|
| 17 |
+
"hepg2.h5"
|
| 18 |
+
]
|
| 19 |
+
|
| 20 |
+
# 2. Model & directory configuration
|
| 21 |
+
model_folder = "Path/to/VCC/arcinstitute/SE-600M/"
|
| 22 |
+
checkpoint_path = "Path/to/VCC/arcinstitute/SE-600M/se600m_epoch16.ckpt"
|
| 23 |
+
input_dir = "./competition_support_set"
|
| 24 |
+
output_dir = "./vci_pretrain"
|
| 25 |
+
|
| 26 |
+
# 3. Create output directory
|
| 27 |
+
os.makedirs(output_dir, exist_ok=True)
|
| 28 |
+
|
| 29 |
+
# 4. Loop over files
|
| 30 |
+
for filename in FILENAMES_TO_PROCESS:
|
| 31 |
+
input_path = os.path.join(input_dir, filename)
|
| 32 |
+
output_path = os.path.join(output_dir, filename)
|
| 33 |
+
|
| 34 |
+
if os.path.exists(output_path):
|
| 35 |
+
print(f"✅ Skipping {filename}, already exists.")
|
| 36 |
+
continue
|
| 37 |
+
|
| 38 |
+
print(f"🚀 Processing {filename} ...")
|
| 39 |
+
!state emb transform --model-folder {model_folder} --checkpoint {checkpoint_path} --input {input_path} --output {output_path}
|
| 40 |
+
print(f"✅ Finished {filename}\n")
|
| 41 |
+
```
|
| 42 |
+
|
| 43 |
+
---
|
| 44 |
+
|
| 45 |
+
## **Step 2 — Train Model**
|
| 46 |
+
```bash
|
| 47 |
+
state tx train data.kwargs.toml_config_path="vci_pretrain/starter.toml" data.kwargs.embed_key="X_state" data.kwargs.num_workers=4 data.kwargs.batch_col="batch_var" data.kwargs.pert_col="target_gene" data.kwargs.cell_type_key="cell_type" data.kwargs.control_pert="non-targeting" data.kwargs.perturbation_features_file="vci_pretrain/ESM2_pert_features.pt" training.max_steps=8000 training.ckpt_every_n_steps=1000 model=tahoe_sm wandb.tags="[first_run]" output_dir="competition_state" name="first_run"
|
| 48 |
+
```
|
| 49 |
+
|
| 50 |
+
---
|
| 51 |
+
|
| 52 |
+
## **Step 3 — Run Inference on Validation Data**
|
| 53 |
+
```bash
|
| 54 |
+
state tx infer --embed_key X_state --output "competition_se/prediction.h5ad" --model_dir "competition_se/first_run" --checkpoint "competition_se/first_run/checkpoints/last.ckpt" --adata "vci_pretrain/competition_val_template.h5ad" --pert_col "target_gene"
|
| 55 |
+
```
|
| 56 |
+
|
| 57 |
+
---
|
| 58 |
+
|
| 59 |
+
## **Leaderboard Result**
|
| 60 |
+
### That's it! You can now upload the vcc file to the leaderboard. We hope contestants will improve significantly on this baseline.For reference, after 8000 steps of training, this model generated the following unnormalized scores:
|
| 61 |
+
|
| 62 |
+
DE Score: 0.183
|
| 63 |
+
|
| 64 |
+
MAE Score: 0.334
|
| 65 |
+
|
| 66 |
+
Perturbation Score: 0.579
|
| 67 |
+
|
| 68 |
+
And the following normalized overall score: 0.072
|