Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to understand the RDKit Aromatizer node and the comparison to 0 to determine success #108

Open
TraceLD opened this issue Apr 26, 2022 · 4 comments

Comments

@TraceLD
Copy link

TraceLD commented Apr 26, 2022

I'm trying to understand an existing RDKit-based KNIME workflow and having used RDKit in Python previously I can't understand the RDKit Aromatizer node. It calls .setAromaticity(temp) where temp is a RDKit molecule and then compares the result to 0 to determine success but what is happening here? SetAromaticity in the C++ API which the Java KNIME is wrapping returns void and in Python it returns None. What does the comparison to 0 do here?

Line I'm referencing:

@TraceLD TraceLD changed the title Trying to understand the RDKit Aromatizer node Trying to understand the RDKit Aromatizer node and the comparison to 0 to determine success Apr 26, 2022
@greglandrum
Copy link
Member

@TraceLD : the C++ setAromaticity() call which is being used by the KNIME node (the KNIME node actually uses the Java wrapper around this call) is this one:
https://github.com/rdkit/rdkit/blob/f0cf0b0f202b469726a4aa86c4b14022f3ac7067/Code/GraphMol/MolOps.h#L552

@TraceLD
Copy link
Author

TraceLD commented Apr 26, 2022

@TraceLD : the C++ setAromaticity() call which is being used by the KNIME node (the KNIME node actually uses the Java wrapper around this call) is this one: https://github.com/rdkit/rdkit/blob/f0cf0b0f202b469726a4aa86c4b14022f3ac7067/Code/GraphMol/MolOps.h#L552

I see, why does it then seemingly get wrapped in Python into a function that returns None? https://www.rdkit.org/docs/source/rdkit.Chem.rdmolops.html#rdkit.Chem.rdmolops.SetAromaticity

@greglandrum
Copy link
Member

I see, why does it then seemingly get wrapped in Python into a function that returns None? https://www.rdkit.org/docs/source/rdkit.Chem.rdmolops.html#rdkit.Chem.rdmolops.SetAromaticity

The Python wrappers and Java wrappers are created with different technologies and don't have a one-to-one mapping

@TraceLD
Copy link
Author

TraceLD commented Apr 26, 2022

The Python wrappers and Java wrappers are created with different technologies and don't have a one-to-one mapping

I suppose what I'm asking then is if there's a way to determine if SetAromaticity succeeded in Python akin to how it's done in KNIME, since for the same input in KNIME I get like 200 failures, whereas in Python I don't get anything since SetAromaticity just returns None and modifies the Mol in place (and there's no warning/exception either)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants