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

Mmtf #111

Merged
merged 21 commits into from Jan 5, 2023
Merged

Mmtf #111

merged 21 commits into from Jan 5, 2023

Conversation

a-r-j
Copy link
Contributor

@a-r-j a-r-j commented Sep 27, 2022

Description

Adds support for reading MMTF files. MMTF is cool because:

  1. it's lightweight (can fit the whole pdb in 7gb on disk(!!!))
  2. it's fast!

There's also plenty of metadata in the MMTF file I'm not parsing in - it's essentially recreating a df object that behaves like PandasPdb. This can be done later, I suppose, but I'm opting for speed here. The MMTF is available with:

from rich import inspect
from biopandas.mmtf import PandasMmtf

p = PandasMmtf().fetch_mmtf("3eiy")

inspect(p.mmtf)

I've also exposed some primitive functions for users who want the df, biopandas utils be damned.

from biopandas.mmtf import fetch_mmtf, parse_mmtf

fetch_mmtf("4hhb")
parse_mmtf("tests/data/3eiy.mmtf")

Speed

Screenshot 2022-09-27 at 19 17 01

Related issues or pull requests

N/A

Pull Request Checklist

  • Added a note about the modification or contribution to the ./docs/sources/CHANGELOG.md file (if applicable)
  • Added appropriate unit test functions in the ./biopandas/*/tests directories (if applicable)
  • Modify documentation in the corresponding Jupyter Notebook under biopandas/docs/sources/ (if applicable)
  • Ran PYTHONPATH='.' pytest ./biopandas -sv and make sure that all unit tests pass (for small modifications, it might be sufficient to only run the specific test file, e.g., PYTHONPATH='.' pytest ./biopandas/classifier/tests/test_stacking_cv_classifier.py -sv)
  • Checked for style issues by running flake8 ./biopandas

@rasbt
Copy link
Member

rasbt commented Sep 28, 2022

Wow this is cool stuff. I actually also really like the idea of having fetch_* and parse_* functions!

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@a-r-j
Copy link
Contributor Author

a-r-j commented Jan 5, 2023

This should be good to go now. I added a tutorial notebook but I'm not sure how the docs are built for biopandas & whether the remaining md files are autogenerated.

@rasbt
Copy link
Member

rasbt commented Jan 5, 2023

Wow very cool. I haven't worked with MMTF's yet, thanks a lot for this PR. And no worries, I can take care of the docs. Probably will make a new release tonight or on the weekend.
(If you are interested, we should maybe move biopandas into it's own org biopandas/biopandas so that you can become a maintainer as well)

@rasbt rasbt merged commit 11362ec into BioPandas:main Jan 5, 2023
@a-r-j
Copy link
Contributor Author

a-r-j commented Jan 8, 2023

Wow very cool. I haven't worked with MMTF's yet, thanks a lot for this PR. And no worries, I can take care of the docs. Probably will make a new release tonight or on the weekend. (If you are interested, we should maybe move biopandas into it's own org biopandas/biopandas so that you can become a maintainer as well)

I'd be very happy to become a maintainer 🥳

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

Successfully merging this pull request may close these issues.

None yet

2 participants