-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Polymer from PQR #285
base: develop
Are you sure you want to change the base?
Polymer from PQR #285
Conversation
passed from all upper functions
Python Usage at 29b1464 Input: from meeko import Polymer
from meeko import ResidueChemTemplates
from meeko import MoleculePreparation
from meeko import PDBQTWriterLegacy
pqr_fn = "1FAS_dry.pqr"
templates = ResidueChemTemplates.create_from_defaults()
with open(pqr_fn, "r") as f:
pqr_string = f.read()
mk_prep = MoleculePreparation(charge_model="read", charge_atom_prop="PQRCharge")
pol1 = Polymer.from_pqr_string(pqr_string, templates, mk_prep)
pdbqt_name1 = "1FAS_charge_from_pqr.pdbqt"
pdbqt_rigid = PDBQTWriterLegacy.write_from_polymer(pol1)[0]
with open(pdbqt_name1, "w") as f:
f.write(pdbqt_rigid)
mk_prep = MoleculePreparation()
pol2 = Polymer.from_pqr_string(pqr_string, templates, mk_prep)
pdbqt_name2 = "1FAS_charge_default.pdbqt"
pdbqt_rigid = PDBQTWriterLegacy.write_from_polymer(pol2)[0]
with open(pdbqt_name2, "w") as f:
f.write(pdbqt_rigid) Output: |
This PR provides useful ways to import alternate charge models for receptor and/or prepared receptor file with assigned protonation states from PDB2PQR. The most recent change added option Description in help message
Example usage 1: Parsing PQR[input]
[output] Example usage 2: Using alternate charge model[input]
|
This is for #264. PQR is a file format similar to PDB and contains Q (charge) and R (radius). The major programs that uses PQR are PDB2PQR and APBS. Being able to parse PQR would allow us to directly get the computed charges for Polymers with available models in PDB2PQR (PARSE, AMBER, etc.).
This PR is adapted from the PQR parser in PDB2PQR and the existing (RDKit-based) method in Meeko to create Polymer from PDB. Specifically, the partial charge will be first parsed into atoms in a monomer's
raw_rdkit_mol
. Next, to transfer it to the monomer'spadded_mol
andmolsetup
, aget_atomprop_from_raw
option is added to functionmonomer.parameterize
. This needs to be a dict, with keys of atom property name and values of corresponding default values. This additional function may be re-used to pass on other properties. Radius from PQR is also parsed, but currently not transferred toraw_rdkit_mol
,padded_mol
ormolsetup
.If more people find it useful, we can add option
--read_pqr
, and expose option--charge_model
tomk_prepare_receptor.py
. Might need #277 to merge first before further edits on the command line scripts.