graphein icon indicating copy to clipboard operation
graphein copied to clipboard

Add num_heavy_atoms as node features

Open chris-clem opened this issue 5 months ago • 1 comments

Is your feature request related to a problem? Please describe. There are already a lot of nice molecule node features, but I was missing the number of heavy atoms as a node feature.

Describe the solution you'd like Something like the following would be great:

def num_heavy_atoms(n: str, d: Dict[str, Any]) -> int:
    num_heavy_atoms = len(
        [x.GetSymbol() for x in d["rdmol_atom"].GetNeighbors() if x.GetSymbol() != "H"]
    )
    d["num_heavy_atoms"] = num_heavy_atoms
    return num_heavy_atoms

Happy to open a PR for it

chris-clem avatar Jun 18 '25 09:06 chris-clem