Skip to content

Commit

Permalink
Simplify inference analysis script
Browse files Browse the repository at this point in the history
  • Loading branch information
amorehead committed Jun 2, 2024
1 parent 9e1ff60 commit e2e9c5e
Showing 1 changed file with 6 additions and 16 deletions.
22 changes: 6 additions & 16 deletions src/analysis/inference_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,25 +507,15 @@ def create_mol_table(
else None
)
if mol_table["mol_pred"].isna().sum() > 0:
if cfg.method in ["diffdock", "fabind", "dynamicbind", "vina", "tulip"]:
logger.warning(
f"Skipping imputing missing (relaxed) predictions for {mol_table['mol_pred'].isna().sum()} molecules regarding the following conditioning inputs: {mol_table[mol_table['mol_pred'].isna()]['mol_cond'].tolist()}."
)
mol_table = mol_table.dropna(subset=["mol_pred"])
else:
raise ValueError(
f"After imputing missing (relaxed) predictions, still missing predictions for {mol_table['mol_pred'].isna().sum()} molecules regarding the following conditioning inputs: {mol_table[mol_table['mol_pred'].isna()]['mol_cond'].tolist()}."
)
else:
if cfg.method in ["diffdock", "fabind", "dynamicbind", "vina", "tulip"]:
logger.warning(
f"Skipping missing predictions for {mol_table['mol_pred'].isna().sum()} molecules regarding the following conditioning inputs: {mol_table[mol_table['mol_pred'].isna()]['mol_cond'].tolist()}."
f"Skipping imputing missing (relaxed) predictions for {mol_table['mol_pred'].isna().sum()} molecules regarding the following conditioning inputs: {mol_table[mol_table['mol_pred'].isna()]['mol_cond'].tolist()}."
)
mol_table = mol_table.dropna(subset=["mol_pred"])
else:
raise ValueError(
f"Missing predictions for {mol_table['mol_pred'].isna().sum()} molecules regarding the following conditioning inputs: {mol_table[mol_table['mol_pred'].isna()]['mol_cond'].tolist()}."
)
else:
logger.warning(
f"Skipping missing predictions for {mol_table['mol_pred'].isna().sum()} molecules regarding the following conditioning inputs: {mol_table[mol_table['mol_pred'].isna()]['mol_cond'].tolist()}."
)
mol_table = mol_table.dropna(subset=["mol_pred"])

if cfg.dataset == "casp15":
mol_table.reset_index(drop=True, inplace=True)
Expand Down

0 comments on commit e2e9c5e

Please sign in to comment.