Implement Compound CRUD (#22)

Co-authored-by: Tim Lorsbach <tim@lorsba.ch>
Reviewed-on: enviPath/enviPy#22
This commit is contained in:
2025-07-03 07:17:04 +12:00
parent 4e58a1fad7
commit 9323a9f7d7
9 changed files with 472 additions and 40 deletions

View File

@ -70,13 +70,17 @@ class FormatConverter(object):
return Chem.MolFromSmiles(smiles)
@staticmethod
def to_smiles(mol):
return Chem.MolToSmiles(mol)
def to_smiles(mol, canonical=False):
return Chem.MolToSmiles(mol, canonical=canonical)
@staticmethod
def InChIKey(smiles):
return Chem.MolToInchiKey(FormatConverter.from_smiles(smiles))
@staticmethod
def canonicalize(smiles: str):
return FormatConverter.to_smiles(FormatConverter.from_smiles(smiles), canonical=True)
@staticmethod
def maccs(smiles):
mol = Chem.MolFromSmiles(smiles)

View File

@ -36,7 +36,8 @@ def ensure_plugins_installed():
if not is_installed(package_name):
install_wheel(wheel_path)
else:
print(f"Plugin already installed: {package_name}")
# print(f"Plugin already installed: {package_name}")
pass
def discover_plugins(_cls: Type = None) -> Dict[str, Type]: