Created
July 17, 2022 19:14
-
-
Save alisterburt/bfed02f356aa3df2fcd6089f7d668434 to your computer and use it in GitHub Desktop.
Read PDB/mmCIF coords using gemmi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import gemmi | |
| import numpy as np | |
| pdb = '4v6x-ribo.cif' | |
| structure = gemmi.read_structure(pdb) | |
| model = structure[0] # assumes one model in the file | |
| ca_coords = np.array([ | |
| [cra.atom.pos.x, cra.atom.pos.y, cra.atom.pos.z] | |
| for cra in model.all() | |
| if cra.atom.name =='CA' | |
| ]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment