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

Request for access to atoms and atom properties #294

Open
baoilleach opened this issue Feb 1, 2023 · 3 comments
Open

Request for access to atoms and atom properties #294

baoilleach opened this issue Feb 1, 2023 · 3 comments

Comments

@baoilleach
Copy link

Hi @ptosco. Any chance of access to the atoms and their properties? Specifically, I am developing an application that does a SMARTS match and then looks at the matching atoms. This works so far, in that I have the atom indices, but I need to be able to access the corresponding atoms, and then the ability to access degree, valence, charge, implicit H count, and whether in a ring. Actually, to be exact, I am implementing the same application across several JS cheminf toolkits, so would like to include RDKit of course!

@ptosco
Copy link

ptosco commented Feb 2, 2023

@baoilleach Hi Noel, currently getters/setters for atom and bond properties are not exposed. I agree they would be useful and it would be good to expose them to JS, together with other bits that several others have asked for (e.g., MCS, R group decomposition). However, as discussed with @greglandrum, before exposing all of that we need to do some work on the CMake build system in order to allow opting in/out different sets of features, otherwise we keep bloating a library which was meant to be lightweight, as the MinimalLib name suggests, with functionality that not everyone would need. Unfortunately at this time I do not have time to work on that, but it is definitely on my radar.

@baoilleach
Copy link
Author

Understood. I'll keep an eye on the project.

@papillot
Copy link

papillot commented Apr 1, 2023

@baoilleach with the mol.get_json() method you have access to an object containing a molecules property with a vector of atoms containing the following (optional) properties:

{
  chg: number;
  /** Implicit Hydrogens count */
  impHs: number;
  isotope: number;
  nRad: number;
  stereo: 'unspecified' | 'cw' | 'ccw' | 'other';
  z: number;
}

So, you could map the atom indices to this vector and get some of the information you are looking for.

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

3 participants