@@ -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