-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix molsanitize exception error catching * linting * isort on other stuff * add inchitomol element
- Loading branch information
1 parent
8040ebe
commit 69a4577
Showing
6 changed files
with
128 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
"""Classes ment to transform given inchi to a RDKit molecule.""" | ||
|
||
from rdkit import Chem | ||
|
||
from molpipeline.abstract_pipeline_elements.any2mol.string2mol import ( | ||
SimpleStringToMolElement, | ||
) | ||
from molpipeline.utils.molpipeline_types import RDKitMol | ||
|
||
|
||
class InchiToMol(SimpleStringToMolElement): | ||
"""Transforms Inchi to RDKit Mol objects.""" | ||
|
||
def string_to_mol(self, value: str) -> RDKitMol: | ||
"""Transform Inchi string to molecule. | ||
Parameters | ||
---------- | ||
value: str | ||
Inchi string. | ||
Returns | ||
------- | ||
RDKitMol | ||
Rdkit molecule if valid Inchi, else None. | ||
""" | ||
return Chem.MolFromInchi(value) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters