Fetching data with BCIF instead of MMTF?
Opened this issue · 2 comments
dominiquesydow commented
Hello :)
With MMTF replaced now with BCIF (see announcement here), do you know the equivalent to the following code for the BCIF API?
import mmtf
mmtf.fetch(pdbid)
Thanks!
piehld commented
Hi @dominiquesydow,
There are a few options that I can share:
- The way I actually recommend working with BCIF (both reading and writing) is using our
rcsb.utils.io
package, which is a wrapper forpy-mmcif
, since it lets you easily switch between format types without having to import different modules. TheREADME.md
there offers some general examples on its usage: https://github.com/rcsb/py-rcsb_utils_io (in which, for the case of reading BCIF, you would usefmt="bcif"
). - If you specifically want to use
py-mmcif
, though, you can take a look at thetestBinaryCifReader.py
file, e.g.: https://github.com/rcsb/py-mmcif/blob/f7c5f1498d687115a72618d79f176b7af26f5ea7/mmcif/tests/testBinaryCifReader.py#L91-L92. (Also note that there is atestBinaryCifWriter.py
file next to that one.)
Please let me know if you'd like more details or need any help with either of the above options. I can certainly elaborate as needed. Hope this helps as a start at least!
dominiquesydow commented
Hi @piehld,
Many thanks for your quick help!
I will try this out later this week and come back here if I get stuck.
Leaving it up to you if you'd like to close this issue as solved already.
Leaving it open could be nice for visibility in case others also still use the mmtf
package and are in search of alternatives.
Many thanks again!