Skip to content

Commit 919e46d

Browse files
committed
Add stripped cell line name to GDSC2 metadata and update L1000 pairing logic
1 parent 20beaef commit 919e46d

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

src/fmharness/data/loaders/gdsc2_sarcoma.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,10 @@ def load_gdsc2_sarcoma(
222222
metadata={
223223
"cosmic_id": int(row["COSMICID"]),
224224
"ccle_name": maybe_str(row.get("CCLEName")),
225+
# DepMap-canonical stripped name (e.g. "A375"); the cell-line
226+
# namespace L1000 wells are keyed on, so cross-dataset joins
227+
# (build_l1000_gdsc_pairs) line up on name rather than ACH id.
228+
"stripped_cell_line_name": maybe_str(row.get("StrippedCellLineName")),
225229
"sanger_model_id": maybe_str(row.get("SangerModelID")),
226230
},
227231
)

src/fmharness/l1000.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,11 +320,19 @@ def build_l1000_gdsc_pairs(
320320
l1000_dir / "GSE92742_Broad_LINCS_inst_info.txt.gz", sep="\t", low_memory=False
321321
)
322322
gene = pd.read_csv(l1000_dir / "GSE92742_Broad_LINCS_gene_info.txt.gz", sep="\t")
323-
xg, dg = build_sample_design(load_tranche("gdscv2", repo), "all", "auc", drug_key="pubchem_cid")
323+
gb = load_tranche("gdscv2", repo)
324+
xg, dg = build_sample_design(gb, "all", "auc", drug_key="pubchem_cid")
324325
gdr = pd.read_csv(repo / "data/raw/coderdata/gdscv2_drugs.tsv.gz", sep="\t")
325326
_, pert2drug = drug_pert_maps(gdr, pert)
326327

327-
gcell = {_norm(c): str(c) for c in xg.index}
328+
# GDSC2 samples are keyed by DepMap ModelID (ACH-...); L1000 wells are keyed by
329+
# cell-line name (e.g. "A375"). Map each ACH id to its stripped cell-line name so
330+
# the cohorts join on the shared name namespace -- xg.index is ACH ids, so a
331+
# direct name match would be empty.
332+
ach2name = {
333+
str(p.patient_id): str(p.metadata.get("stripped_cell_line_name") or "") for p in gb.patients
334+
}
335+
gcell = {_norm(ach2name[str(c)]): str(c) for c in xg.index if ach2name.get(str(c))}
328336
lcell = {_norm(c): str(c) for c in inst["cell_id"].unique()}
329337
shared = set(gcell) & set(lcell)
330338
l_ids = [lcell[k] for k in shared]

0 commit comments

Comments
 (0)