Skip to content

Commit 81f90b8

Browse files
committed
Merge branch 'hash_missing' into DIPK_fix_genes_for_cs
2 parents 7770e0f + d8e75d4 commit 81f90b8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drevalpy/models/DIPK/dipk.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,14 +263,17 @@ def predict(
263263
:param cell_line_input: input data associated with the cell line
264264
:param drug_input: input data associated with the drug
265265
:return: predicted response values
266-
:raises ValueError: if drug_input is None or if the model is not initialized
266+
:raises ValueError: if drug_input is None or if the model is not initialized or
267+
if the gene expression encoder is not initialized
267268
"""
268269
if drug_input is None:
269270
raise ValueError("DIPK model requires drug features.")
270271
if not isinstance(self.model, Predictor):
271272
raise ValueError("DIPK model not initialized.")
272273

273274
# Encode gene expression data if this has not been done yet (e.g., for cross-study predictions)
275+
if self.gene_expression_encoder is None:
276+
raise ValueError("Gene expression encoder is not initialized.")
274277
random_cell_line = next(iter(cell_line_input.features.keys()))
275278
if (
276279
len(cell_line_input.features[random_cell_line]["gene_expression"])

0 commit comments

Comments
 (0)