Opposite partial charge interaction #273
lanselibai
started this conversation in
General
Replies: 1 comment 1 reply
-
|
Hi, Was this code-snippet AI-generated? Not sure where that prolif.interactions.OppCharge = OppChargeProLIF knows you're adding a new distance-based interaction as soon as you use Anyway, ProLIF uses RDKit molecules under-the-hood in the interactions, so the Here's some code based on that (untested) from math import prod
class OppCharge(Distance):
def __init__(self, distance=4.5):
super().__init__(lig_pattern="*", prot_pattern="*", distance=distance)
@staticmethod
def get_charges(metadata, lig_res, prot_res):
return [
res.GetAtomWithIdx(metadata["indices"][component][0]).GetDoubleProp(
"_MDAnalysis_charge"
)
for (res, component) in [(lig_res, "ligand"), (prot_res, "protein")]
]
def detect(self, lig_res, prot_res):
for metadata in super().detect(lig_res, prot_res):
charges = self.get_charges(metadata, lig_res, prot_res)
if prod(charges) < 0:
metadata["charges"] = {"ligand": charges[0], "protein": charges[1]}
yield metadata |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am interested in identifying the opposite charge interactions between two atoms (e.g. within 0.45 nm) from ligand and protein. It looks like
AnionicandCationicinteractions only consider fully charged residues like -NH3+, COO-.The
atom.chargecontains the partial charge of an atom. How to include this in theplf?I think I got it work by using the code below
Beta Was this translation helpful? Give feedback.
All reactions