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

feat: add molecules info to python #20

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

pilatmartin
Copy link

Adds Molecules::info to python bindings.

Usage
Properties can be accessed directly:

molecules = Molecules("/path/to/file")
info = molecules.info()
print(info.total_atoms) # 29874

Or the result can be converted to a dict that can be serialized:

info.to_dict()

Example output (receptor.pdb from acc2 examples)

{
    "total_molecules": 1,
    "total_atoms": 29874,
    "atom_type_counts": [
      {
        "symbol": "N",
        "count": 2386
      },
      {
        "symbol": "C",
        "count": 9738
      },
      {
        "symbol": "O",
        "count": 2723
      },
      {
        "symbol": "H",
        "count": 14950
      },
      {
        "symbol": "S",
        "count": 77
      }
    ]
}

@pilatmartin pilatmartin changed the title feat: add msinfo to python feat: add ms info to python Jan 10, 2025
@pilatmartin pilatmartin changed the title feat: add ms info to python feat: add molecules info to python Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant