Skip to content

Commit

Permalink
idk what i did tbh
Browse files Browse the repository at this point in the history
  • Loading branch information
SamCox822 committed Feb 22, 2024
1 parent e05111c commit ff0bcb8
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions mdagent/tools/base_tools/preprocess_tools/pdb_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -1416,6 +1416,8 @@ def molname2smiles(
except ValueError:
print("The requested value is not in the expected format.")
# remove salts
except Exception as e:
print(f"An error occurred: {e}")
return Chem.CanonSmiles(self.largest_mol(smi))

def smiles2name(self, smi: str) -> str:
Expand Down Expand Up @@ -1452,7 +1454,7 @@ def small_molecule_pdb(self, mol_str: str, path_registry) -> str:
mol_name = mol_str
try: # only if needed
m = Chem.AddHs(m)
except Exception: # TODO: we should be more specific here
except Exception:
pass
Chem.AllChem.EmbedMolecule(m)
file_name = f"files/pdb/{mol_name}.pdb"
Expand All @@ -1465,11 +1467,7 @@ def small_molecule_pdb(self, mol_str: str, path_registry) -> str:
return (
f"PDB file for {mol_str} successfully created and saved to {file_name}."
)
except Exception: # TODO: we should be more specific here
print(
"There was an error getting pdb. Please input a single molecule name."
f"{mol_str},{mol_name}, {smi}"
)
except Exception:
return (
"There was an error getting pdb. Please input a single molecule name."
)
Expand Down

0 comments on commit ff0bcb8

Please sign in to comment.