File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff 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" ])
You can’t perform that action at this time.
0 commit comments