ribesstefano commited on
Commit
dcdef4a
·
1 Parent(s): 42d3d55

Fixed minor bug when returning predictions

Browse files
protac_degradation_predictor/protac_degradation_predictor.py CHANGED
@@ -31,6 +31,7 @@ def get_protac_active_proba(
31
  target_uniprot (str | List[str]): The Uniprot ID of the target protein.
32
  cell_line (str | List[str]): The cell line identifier.
33
  device (str): The device to run the model on.
 
34
 
35
  Returns:
36
  Dict[str, np.ndarray]: The predictions of the model.
@@ -98,8 +99,7 @@ def get_protac_active_proba(
98
  preds = np.array(list(preds.values()))
99
  mean_preds = np.mean(preds, axis=0)
100
  # Return a single value if not list as input
101
- preds = preds if isinstance(protac_smiles, list) else preds[0]
102
- means_preds = mean_preds if isinstance(protac_smiles, list) else mean_preds[0]
103
 
104
  return {
105
  'preds': preds,
 
31
  target_uniprot (str | List[str]): The Uniprot ID of the target protein.
32
  cell_line (str | List[str]): The cell line identifier.
33
  device (str): The device to run the model on.
34
+ use_models_from_cv (bool): Whether to use the models from cross-validation.
35
 
36
  Returns:
37
  Dict[str, np.ndarray]: The predictions of the model.
 
99
  preds = np.array(list(preds.values()))
100
  mean_preds = np.mean(preds, axis=0)
101
  # Return a single value if not list as input
102
+ mean_preds = mean_preds if isinstance(protac_smiles, list) else mean_preds[0]
 
103
 
104
  return {
105
  'preds': preds,