Electrostatics / pdb2cif

Convert between PDB and CIF formats
Creative Commons Zero v1.0 Universal
1 stars 1 forks source link

Use Gemmi to interconvert between pdb and cif? #1

Open danny305 opened 3 years ago

danny305 commented 3 years ago

Gemmi is an open sourced c++ library with python bindings for working with structural biology data.

I have implemented code to convert a pdb to a cif with gemmi (in python) in the past (screenshot below) and I am pretty sure its probably just as simple to go from cif to pdb.

image

So I am currently finishing up implementing cif functionality (reading and writing) to the freesasa C library with the author of the repository and we just used gemmi for everything. We have freesasa outputting a freesasa cif file where we appended cif blocks specific to freesasa and added 2 additional columns to the _atom_site. block. 1 the freesasa solvent accessibility value and the other for freesasa atomic radii. This is kinda what I was thinking about doing with pdb2pqr....?

sobolevnrm commented 3 years ago

Hi Danny -- thanks for the suggestion. We're trying to favor native Python solutions as much as possible given problems our user base has had in the past with compilers. Even if it duplicates effort a bit, I'd prefer to stick with a native Python solution for this interconversion.

danny305 commented 3 years ago

I agree with that approach and I honestly prefer it. Working with the C++ gemmi api was definitely a learning curve.

However, we can use gemmi 100% in python. Using gemmi in this situation is not much different to using numpy (where everything is implemented in C/C++ and then wrapped with python). Gemmi has a nice python api, python documentation, and can be installed with pip install gemmi, removing all compiler issues.

This can reduce a lot of the low level code duplication. Gemmi cif parser is very robust and I have had zero trouble working with them (I cannot say the same about pdb2pqr cif reading capability--its very finicky, especially with pdb/cif files from the pdb-redo server.)

If you still rather not use gemmi I understand! I am just providing as much information so y'all make the best decision for pdb2pqr.