steineggerlab / foldcomp

Compressing protein structures effectively with torsion angles
GNU General Public License v3.0
145 stars 14 forks source link

Get not compressed data and reconstruction #11

Closed hhaootian closed 1 year ago

hhaootian commented 1 year ago

First of all, very nice work! From my understanding, the workflow is PDB -> internal coordinates -> compress -> decompress -> reconstruction. I'm wondering how can I use the existing APIs to skip the compress -> decompress step, and just have internal coordinates -> reconstruction. Thanks!

khb7840 commented 1 year ago

In C++ lib, we have NeRF module for conducting reconstruction with inner coordinates. The inner coordinates are calculated in Foldcomp::preprocess so after calling that method the inner coordinates (angles) are stored in Foldcomp instance. I think we can develop an API to access the inner coordinates directly.

hhaootian commented 1 year ago

I'm not familiar with C++ binding with Python. I played around with the Python APIs. I found out that currently it's not something like we need to first have an instance of foldcomp class storing all the intermediate data, but instead all functions are static. Is it easy in terms of implementation that we can do something like:

foldcomp = foldcomp.Foldcomp()
foldcomp.preprocess(PDB_FILE)
print(foldcomp.inner_coordinates)
# use inner coordinates to reconstruct 3d structure
new_structure = foldcomp.reconstruct()
hhaootian commented 1 year ago

I found a Matlab script for NeRF: https://github.com/gtamazian/PROMPT/blob/master/restorecoords.m. What's the main difference between this script and foldcomp package?

martin-steinegger commented 1 year ago

There are plenty of NeRF implementations in all kinds of languages. NeRF is just one part of foldcomp how to reconstruct the structures. Additionally, foldcomp performs forward/backward averaging and anchors to reduce reconstruction error. Also, our format to store protein structures is optimized to require minimal bits.