NeRFpy: A Python implementation and extension of Natural Extension Reference Frame.
Using pip
to install:
# for release (stable) version
pip install nerfpy
# for the latest version
pip install git+https://github.com/smu-tao-group/nerfpy.git
For high level usage, use NERF class to interact with PDB (read, reconstruct and write). There are also utility functions for low level usage.
# interact with PDB file
from nerfpy import NERF
nerf = NERF()
nerf.read_pdb(PDB_PATH)
nerf.reconstruct()
nerf.save_pdb(NEW_PDB_PATH)
# use your own coordinates (n * 3)
from nerf.utils import (
calc_r_from_coords,
calc_alpha_from_coords,
calc_psi_from_coords,
reconstruct_from_internal_coords
)
r = calc_r_from_coords(COORDS)
alpha = calc_alpha_from_coords(COORDS)
psi = calc_psi_from_coords(COORDS)
reconstructed_coords = reconstruct_from_internal_coords(r, alpha, psi)
Apache-2.0 license