graphein
graphein copied to clipboard
Add num_heavy_atoms as node features
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