Implementation of from_alphafold - #5457
Conversation
|
This diverged from #5436 using |
|
Docs need to be updated |
Documentation build overview
14 files changed ·
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #5457 +/- ##
===========================================
+ Coverage 93.87% 93.88% +0.01%
===========================================
Files 182 183 +1
Lines 22510 22650 +140
Branches 3202 3227 +25
===========================================
+ Hits 21131 21266 +135
- Misses 917 921 +4
- Partials 462 463 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Docs are also done here |
orbeckst
left a comment
There was a problem hiding this comment.
Impressive work, nice!
My comments are mostly docs and coding style.
I'll leave the heavy commenting to @BradyAJohnston @yuxuanzhuang @talagayev .
| # for rn | ||
| package/doc/sphinx/build_docs.sh | ||
| testsuite/MDAnalysisTests/fetch/run_tests.sh | ||
| package/MDAnalysis/TEST.py | ||
|
|
There was a problem hiding this comment.
Please remove your private gitignores. Instead add them to your .git/info/exclude file, which is not revision-controlled.
There was a problem hiding this comment.
Is this PR introducing StaticFetcher ?
There was a problem hiding this comment.
Now I am seeing that the main PR is really #5436 – I'll add a quick comment there to send you back here. Sorry.
|
|
||
| Primarily designed to be working with `FAIR`_ | ||
| databases, this method works by sending a request to a web server and | ||
| caching them to a registry.The registry is in the format of a |
| Notes | ||
| ----- | ||
| The download directory can be overridden by setting the environment | ||
| variable ``MDANALYSIS_FETCHER_DATA`` to a valid path. This class uses |
There was a problem hiding this comment.
Check the reST/sphinx markup for an environment variable (maybe :envvar: ?) and use it.
| :mod:`pooch` as a backend for downloading and caching files. The | ||
| cache database is created on demand when ``db_name`` does not | ||
| exist relative to :attr:`cache_path`. | ||
|
|
There was a problem hiding this comment.
might need 2 blank lines.
Always check the rendered docs.
There was a problem hiding this comment.
I checked and it rendered fine, which is good. In the past, double-blank lines were needed.
| ] | ||
|
|
||
| return paths if not isinstance(pdb_ids, str) else paths[0] | ||
| def from_ALPHAFOLD(id, cache_path=None, progressbar=False, file_format="cif"): |
There was a problem hiding this comment.
Why capitalized from_ALPHAFOLD when you refer to it elsewhere as AlphaFold? I'd be consistent and call the function from_AlphaFold().
|
|
||
| Download a single AlphaFold file and convert it to a universe: | ||
|
|
||
| >>> mda.Universe(from_ALPHAFOLD("Q9I1F6"), files_format="pdb") |
| .. versionadded:: 2.11.0 | ||
| """ | ||
|
|
||
| if file_format not in _SUPPORTED_FILE_FORMATS_ALPHAFOLD.keys(): |
There was a problem hiding this comment.
I don't think you need .keys(). in just works with dict keys.
| This suite of functions download structure files from the Research | ||
| Collaboratory for Structural Bioinformatics (RCSB) | ||
| `Protein Data Batabank`_ (PDB). |
There was a problem hiding this comment.
The header only talks about Protein Databank but the AlphaFold fetcher is also in here. Personally, I'd create a separate module for AlphaFold, similar to this one here.
However, if you and your mentors prefer to have it in the same file then please at least update the text here to also talk about the AF database (with link).
| #: Name of the :mod:`pooch` cache directory ``pooch.os_cache(DEFAULT_CACHE_NAME_DOWNLOADER)``; | ||
| #: see :func:`pooch.os_cache` for further details. | ||
| #: Alias to fetchers/DEFAULT_CACHE_NAME_DOWNLOADER | ||
| #: | ||
| #: .. versionadded:: 2.11.0 | ||
| DEFAULT_CACHE_NAME_DOWNLOADER = "MDAnalysis_pdbs" | ||
| #: Maintained for backwards compatiblity | ||
| #: | ||
| from .fetchers import DEFAULT_CACHE_NAME_DOWNLOADER |
There was a problem hiding this comment.
Just remove what you do not want. Given that fetch_PDB had not been released yet (it's not in 2.10.0) you do not need to maintain any compatibility. Just write it as cleanly as you can.
Fixes #5432
Changes made in this Pull Request:
from_alphafoldusingStaticFetcherLLM / AI generated code disclosure
LLMs or other AI-powered tools (beyond simple IDE use cases) were used in this contribution: no
PR Checklist
package/CHANGELOGfile updated?package/AUTHORS? (If it is not, add it!)Developers Certificate of Origin
I certify that I can submit this code contribution as described in the Developer Certificate of Origin, under the MDAnalysis LICENSE.