00001 import ost as _ost
00002 import ost.geom as _geom
00003
00004 """
00005 Module written by Niklaus Johner (niklaus.johner@a3.epfl.ch) 2012
00006
00007 This module is a flexible rewrite of HBPlus, allowing to calculate hbond
00008 conservation between different structures or over a trajectory.
00009 It uses customizable dictionaries to define donors and acceptors and can
00010 account for equivalent HBonds such as involving for example either oxygen atom
00011 of an Aspartic Acid.
00012 """
00013 __all__=('HBondDonor','HBondAcceptor','BuildCHARMMHBondDonorAcceptorDict','AreHBonded','GetHbondDonorAcceptorList',\
00014 'GetHbondListFromDonorAcceptorLists','GetHbondListFromView','GetHbondListFromTraj','GetHbondListBetweenViews'\
00015 'CalculateHBondScore','AnalyzeHBondScore')
00016
00017
00018 class HBondableAtoms:
00019 def __init__(self,donors=[],acceptors=[]):
00020 self.donors=donors
00021 self.acceptors=acceptors
00022
00023 def BuildCHARMMHBondDonorAcceptorDict():
00024 hb_da_dict={}
00025 bb_donors=[['N','HN']]
00026 bb_acceptors=[['O',['C']]]
00027
00028
00029 hb_da_dict['ALA']=HBondableAtoms(bb_donors,bb_acceptors)
00030 hb_da_dict['GLY']=HBondableAtoms(bb_donors,bb_acceptors)
00031 hb_da_dict['ILE']=HBondableAtoms(bb_donors,bb_acceptors)
00032 hb_da_dict['LEU']=HBondableAtoms(bb_donors,bb_acceptors)
00033 hb_da_dict['PHE']=HBondableAtoms(bb_donors,bb_acceptors)
00034 hb_da_dict['MET']=HBondableAtoms(bb_donors,bb_acceptors)
00035 hb_da_dict['VAL']=HBondableAtoms(bb_donors,bb_acceptors)
00036
00037 hb_da_dict['PRO']=HBondableAtoms([],bb_acceptors)
00038
00039
00040 ne=[['NE','HE']]
00041 cz=[['NH1','HH11'],['NH1','HH12'],['NH2','HH21'],['NH2','HH22']]
00042 hb_da_dict['ARG']=HBondableAtoms(bb_donors+ne+cz,bb_acceptors)
00043 nz=[['NZ','HZ1'],['NZ','HZ2'],['NZ','HZ3']]
00044 hb_da_dict['LYS']=HBondableAtoms(bb_donors+nz,bb_acceptors)
00045 ne1=[['NE1','HE1']]
00046 hb_da_dict['TRP']=HBondableAtoms(bb_donors+ne1,bb_acceptors)
00047 sg=[['SG','HG1']]
00048 hb_da_dict['CYS']=HBondableAtoms(bb_donors+sg,bb_acceptors)
00049
00050
00051 od12=[['OD1',['CG']],['OD2',['CG']]]
00052 hb_da_dict['ASP']=HBondableAtoms(bb_donors,bb_acceptors+od12)
00053 oe12=[['OE1',['CD']],['OE2',['CD']]]
00054 hb_da_dict['GLU']=HBondableAtoms(bb_donors,bb_acceptors+oe12)
00055
00056
00057 od1=[['OD1',['CG']]]
00058 nd2=[['ND2','HD21'],['ND2','HD22']]
00059 hb_da_dict['ASN']=HBondableAtoms(bb_donors+nd2,bb_acceptors+od1)
00060 ne2=[['NE2','HE21'],['NE2','HE22']]
00061 oe1=[['OE1',['CD']]]
00062 hb_da_dict['GLN']=HBondableAtoms(bb_donors+ne2,bb_acceptors+oe1)
00063 og_d=[['OG','HG1']]
00064 og_a=[['OG',['CB']]]
00065 hb_da_dict['SER']=HBondableAtoms(bb_donors+og_d,bb_acceptors+og_a)
00066 og1_d=[['OG1','HG1']]
00067 og1_a=[['OG1',['CB']]]
00068 hb_da_dict['THR']=HBondableAtoms(bb_donors+og1_d,bb_acceptors+og1_a)
00069 oh_d=[['OH','HH']]
00070 oh_a=[['OH',['CZ']]]
00071 hb_da_dict['TYR']=HBondableAtoms(bb_donors+oh_d,bb_acceptors+oh_a)
00072
00073 nd1_d=[['ND1','HD1']]
00074 ne2_a=[['NE2',['CD2','CE1']]]
00075 hb_da_dict['HSD']=HBondableAtoms(bb_donors+nd1_d,bb_acceptors+ne2_a)
00076 ne2_d=[['NE2','HE2']]
00077 nd1_a=[['ND1',['CG','CE1']]]
00078 hb_da_dict['HSE']=HBondableAtoms(bb_donors+ne2_d,bb_acceptors+nd1_a)
00079 hb_da_dict['HSP']=HBondableAtoms(bb_donors+nd1_d+ne2_d,bb_acceptors)
00080
00081 oe12=[['OE1',['CD']],['OE2',['CD']]]
00082 oe2=[['OE2','HE2']]
00083 hb_da_dict['GLUP']=HBondableAtoms(bb_donors+oe2,bb_acceptors+oe12)
00084 od12=[['OD1',['CG']],['OD2',['CG']]]
00085 od2=[['OD2','HD2']]
00086 hb_da_dict['ASPP']=HBondableAtoms(bb_donors+od2,bb_acceptors+od12)
00087 return hb_da_dict
00088
00089 def BuildCHARMMHBondDonorEquivalenceDict():
00090 donor_swap_dict={}
00091 donor_swap_dict['ARG']=[[['NH1','HH11'],['NH1','HH12'],['NH2','HH21'],['NH2','HH22']]]
00092 donor_swap_dict['ASN']=[[['ND2','HD21'],['ND2','HD22']]]
00093 donor_swap_dict['GLN']=[[['NE2','HE21'],['NE2','HE22']]]
00094 donor_swap_dict['LYS']=[[['NZ','HZ1'],['NZ','HZ2'],['NZ','HZ3']]]
00095 return donor_swap_dict
00096
00097 def BuildCHARMMHBondAcceptorEquivalenceDict():
00098 acceptor_swap_dict={}
00099 acceptor_swap_dict['ASP']=[[['OD1',['CG']],['OD2',['CG']]]]
00100 acceptor_swap_dict['GLU']=[[['OE1',['CD']],['OE2',['CD']]]]
00101 return acceptor_swap_dict
00102
00103 def ListEquivalentDonors(donor,donor_swap_dict):
00104 if not donor.heavy_atom.residue.name in donor_swap_dict:return [donor]
00105 donor_list=[donor]
00106 donor_atom_names=[donor.heavy_atom.name,donor.hydrogen.name]
00107 res=donor.heavy_atom.residue
00108 for equivalence_list in donor_swap_dict[donor.heavy_atom.residue.name]:
00109 if not donor_atom_names in equivalence_list:continue
00110 for atom_names in equivalence_list:
00111 if atom_names==donor_atom_names:continue
00112 else:donor_list.append(HBondDonor.FromResidue(res,atom_names[0],atom_names[1]))
00113 return donor_list
00114
00115 def ListEquivalentAcceptors(acceptor,acceptor_swap_dict):
00116 if not acceptor.atom.residue.name in acceptor_swap_dict:return [acceptor]
00117 acceptor_list=[acceptor]
00118 acceptor_atom_names=[acceptor.atom.name,[a.name for a in acceptor.antecedent_list]]
00119 res=acceptor.atom.residue
00120 for equivalence_list in acceptor_swap_dict[acceptor.atom.residue.name]:
00121 if not acceptor_atom_names in equivalence_list:continue
00122 for atom_names in equivalence_list:
00123 if atom_names==acceptor_atom_names:continue
00124 else:acceptor_list.append(HBondAcceptor.FromResidue(res,atom_names[0],atom_names[1]))
00125 return acceptor_list
00126
00127
00128 class HBondDonor:
00129 def __init__(self,donor,hydrogen):
00130 self.heavy_atom=donor
00131 self.hydrogen=hydrogen
00132 def __eq__(self,hbd):
00133 if not isinstance(hbd,HBondDonor):return False
00134 else:return self.heavy_atom==hbd.heavy_atom and self.hydrogen==hbd.hydrogen
00135 def __hash__(self):
00136 return hash((self.heavy_atom,self.hydrogen))
00137 @classmethod
00138 def FromResidue(cls,res,donor_name,hydrogen_name,verbose=True):
00139 _donor=res.FindAtom(donor_name).handle
00140 _hydrogen=res.FindAtom(hydrogen_name).handle
00141 if not _donor.IsValid():
00142 if verbose:print 'Could not find '+donor_name+' in residue '+str(res)
00143 return
00144 if not _hydrogen.IsValid():
00145 if verbose:print 'Could not find '+hydrogen_name+' in residue '+str(res)
00146 return
00147 return cls(_donor,_hydrogen)
00148
00149 def IsHBondedTo(self,acceptor):
00150 return AreHBonded(self,acceptor)
00151
00152
00153 class HBondAcceptor:
00154 def __init__(self,acceptor,antecedent_list):
00155 self.atom=acceptor
00156 self.antecedent_list=antecedent_list
00157 def __eq__(self,hba):
00158 if not isinstance(hba,HBondAcceptor):return False
00159 else:return self.atom==hba.atom
00160 def __hash__(self):
00161 return hash(self.atom)
00162 @classmethod
00163 def FromResidue(cls,res,acceptor_name,antecedent_name_list,verbose=True):
00164 _acceptor=res.FindAtom(acceptor_name).handle
00165 _antecedent_list=_ost.mol.AtomHandleList([res.FindAtom(name).handle for name in antecedent_name_list])
00166 if not _acceptor.IsValid():
00167 if verbose:print 'Could not find '+acceptor_name+' in residue '+str(res)
00168 return
00169 for i,a in enumerate(_antecedent_list):
00170 if not a.IsValid():
00171 if verbose:print 'Could not find '+antecedent_name_list[i]+' in residue '+str(res)
00172 return
00173 return cls(_acceptor,_antecedent_list)
00174
00175 def IsHBondedTo(self,donor):
00176 return AreHBonded(donor,self)
00177
00178 class HBond:
00179 def __init__(self,donor,acceptor):
00180 self.donor=donor
00181 self.acceptor=acceptor
00182 def __eq__(self,hb):
00183 if not isinstance(hb,HBond):return False
00184 else:return self.acceptor==hb.acceptor and self.donor==hb.donor
00185 def __hash__(self):
00186 return hash((self.donor,self.acceptor))
00187 def IsFormed(self):return AreHBonded(self.donor,self.acceptor)
00188 def DonorAcceptorDistance(self):return _geom.Distance(self.donor.heavy_atom.pos,self.acceptor.atom.pos)
00189 def HydrogenAcceptorDistance(self):return _geom.Distance(self.donor.hydrogen.pos,self.acceptor.atom.pos)
00190 def DonorHydrogenAcceptorAngle(self):
00191 dp=self.donor.heavy_atom.pos;ap=self.acceptor.atom.pos;hp=self.donor.hydrogen.pos
00192 return _geom.Angle(dp-hp,ap-hp)
00193 def DonorAcceptorAcceptorAntecedentAngle(self):
00194 dp=self.donor.heavy_atom.pos;ap=self.acceptor.atom.pos
00195 a=min([_geom.Angle(aa.pos-ap,dp-ap) for aa in self.acceptor.antecedent_list])
00196 return a
00197 def HydrogenAcceptorAcceptorAntecedentAngle(self):
00198 hp=self.donor.hydrogen.pos;ap=self.acceptor.atom.pos
00199 a=min([_geom.Angle(aa.pos-ap,hp-ap) for aa in acceptor.antecedent_list])
00200 return a
00201
00202
00203 def AreHBonded(donor,acceptor,da_dist=3.9,ha_dist=2.5,dha_angle=1.57,daaa_angle=1.57,haaa_angle=1.57):
00204 """
00205 determines if a donor/acceptor pair is hydrogen bonded or not
00206 """
00207 dp=donor.heavy_atom.pos
00208 ap=acceptor.atom.pos
00209 if _geom.Distance(dp,ap)>da_dist:return False
00210 hp=donor.hydrogen.pos
00211 if _geom.Distance(hp,ap)>ha_dist:return False
00212 if _geom.Angle(dp-hp,ap-hp)<dha_angle:return False
00213 a=min([_geom.Angle(aa.pos-ap,dp-ap) for aa in acceptor.antecedent_list])
00214 if a<daaa_angle:return False
00215 a=min([_geom.Angle(aa.pos-ap,hp-ap) for aa in acceptor.antecedent_list])
00216 if a<haaa_angle:return False
00217 return True
00218
00219 def GetHbondDonorAcceptorList(eh,hbond_donor_acceptor_dict={},verbose=True):
00220 """
00221 returns a list of hydrogen-bond donors and acceptors from an Entity or EntityView.
00222 It relies on atom names to determine the list of H-bond donors and acceptors.
00223 These names are given in a dictionary, which defaults to CHARMM.
00224 """
00225 if not hbond_donor_acceptor_dict:
00226 print 'Using default CHARMM atom namings'
00227 hbond_donor_acceptor_dict=BuildCHARMMHBondDonorAcceptorDict()
00228 donor_list=[]
00229 acceptor_list=[]
00230 for r in eh.residues:
00231 if not r.name in hbond_donor_acceptor_dict:
00232 print 'donors and acceptors for',r,'are not defined in the dictionary and will not be included'
00233 continue
00234 res_da_dict=hbond_donor_acceptor_dict[r.name]
00235 for acceptor in res_da_dict.acceptors:
00236 a=HBondAcceptor.FromResidue(r,acceptor[0],acceptor[1],verbose)
00237 if not a==None:acceptor_list.append(a)
00238 for donor in res_da_dict.donors:
00239 d=HBondDonor.FromResidue(r,donor[0],donor[1],verbose)
00240 if not d==None:donor_list.append(d)
00241 return [donor_list,acceptor_list]
00242
00243
00244 def GetHbondListFromDonorAcceptorLists(donor_list,acceptor_list):
00245 """
00246 return a list of hydrogen bonds between donors and acceptors from
00247 a list of donors and a list of acceptors.
00248 """
00249 hbond_list=[]
00250 for donor in donor_list:
00251 for acceptor in acceptor_list:
00252 if AreHBonded(donor,acceptor):hbond_list.append(HBond(donor,acceptor))
00253 return hbond_list
00254
00255 def GetHbondListFromView(eh,hbond_donor_acceptor_dict={},verbose=True):
00256 """
00257 return a list of hydrogen bonds from an Entity or EntityView.
00258 if no dictionary for the hbond donors and acceptors is specified
00259 it will use the standard CHARMM names to determine them
00260 """
00261 [donor_list,acceptor_list]=GetHbondDonorAcceptorList(eh,hbond_donor_acceptor_dict,verbose)
00262 hbond_list=[]
00263 for donor in donor_list:
00264 for acceptor in acceptor_list:
00265 if AreHBonded(donor,acceptor):hbond_list.append(HBond(donor,acceptor))
00266 return hbond_list
00267
00268 def GetHbondListFromTraj(t,eh,cutoff=0.7,stride=1,swap=False,donor_swap_dict={},acceptor_swap_dict={},hbond_donor_acceptor_dict={},verbose=True):
00269 """
00270 return a list of hydrogen bonds from an Entity or EntityView that are
00271 present in a fraction of the frames larger than *cutoff*.
00272 if no dictionary for the hbond donors and acceptors is specified
00273 it will use the standard CHARMM names to determine them
00274 """
00275 if swap:
00276 if not donor_swap_dict:
00277 print 'use of standard CHARMM HBond donor swap dictionary'
00278 donor_swap_dict=BuildCHARMMHBondDonorEquivalenceDict()
00279 if not acceptor_swap_dict:
00280 print 'use of standard CHARMM HBond acceptor swap dictionary'
00281 acceptor_swap_dict=BuildCHARMMHBondAcceptorEquivalenceDict()
00282 [donor_list,acceptor_list]=GetHbondDonorAcceptorList(eh,hbond_donor_acceptor_dict,verbose)
00283 hb_list=[]
00284 hb_score=[]
00285 nframes=0
00286 for i in range(0,t.GetFrameCount(),stride):
00287 t.CopyFrame(i)
00288 nframes+=1
00289 hbond_list=GetHbondListFromDonorAcceptorLists(donor_list,acceptor_list)
00290 if swap:
00291 hbond_list=GetEquivalentHBonds(hbond_list,eh,swap,donor_swap_dict,acceptor_swap_dict,verbose)
00292 for hb in hbond_list:
00293 if hb in hbond_list[hbond_list.index(hb)+1:]:hbond_list.pop(hbond_list.index(hb))
00294 for hb in hbond_list:
00295 if hb in hb_list:hb_score[hb_list.index(hb)]+=1
00296 else:
00297 hb_score.append(1)
00298 hb_list.append(hb)
00299 hbond_list=[]
00300 hbond_score=[]
00301 for hb,s in zip(hb_list,hb_score):
00302 if s/float(nframes)>=cutoff:
00303 if swap:hbond_list.append(list(hb)[0])
00304 else:hbond_list.append(hb)
00305 hbond_score.append(s/float(nframes))
00306 return (hbond_list,hbond_score)
00307
00308 def GetHbondListBetweenViews(eh1,eh2,hbond_donor_acceptor_dict={},verbose=True):
00309 """
00310 return the list of hydrogen bonds formed between two Entity or EntityView.
00311 if no dictionary for the hbond donors and acceptors is specified
00312 it will use the standard CHARMM names to determine them
00313 """
00314 [donor_list1,acceptor_list1]=GetHbondDonorAcceptorList(eh1,hbond_donor_acceptor_dict,verbose)
00315 [donor_list2,acceptor_list2]=GetHbondDonorAcceptorList(eh2,hbond_donor_acceptor_dict,verbose)
00316 hbond_list=[]
00317 for donor in donor_list1:
00318 for acceptor in acceptor_list2:
00319 if AreHBonded(donor,acceptor):
00320 hb=HBond(donor,acceptor)
00321 if hb in hbond_list:continue
00322 hbond_list.append(hb)
00323 for donor in donor_list2:
00324 for acceptor in acceptor_list1:
00325 if AreHBonded(donor,acceptor):
00326 hb=HBond(donor,acceptor)
00327 if hb in hbond_list:continue
00328 hbond_list.append(hb)
00329 return hbond_list
00330
00331 def GetEquivalentHBonds(ref_hbond_list,eh,swap=False,donor_swap_dict={},acceptor_swap_dict={},verbose=True):
00332 hbond_list=[]
00333 if not swap:
00334 for hbond in ref_hbond_list:
00335 res1=eh.FindResidue(hbond.donor.heavy_atom.chain.name,hbond.donor.heavy_atom.residue.number.num)
00336 res2=eh.FindResidue(hbond.acceptor.atom.chain.name,hbond.acceptor.atom.residue.number.num)
00337 donor=HBondDonor.FromResidue(res1,hbond.donor.heavy_atom.name,hbond.donor.hydrogen.name,verbose)
00338 acceptor=HBondAcceptor.FromResidue(res2,hbond.acceptor.atom.name,[a.name for a in hbond.acceptor.antecedent_list],verbose)
00339 hbond_list.append(set([HBond(donor,acceptor)]))
00340 else:
00341 if not donor_swap_dict:
00342 print 'use of standard CHARMM HBond donor swap dictionary'
00343 donor_swap_dict=BuildCHARMMHBondDonorEquivalenceDict()
00344 if not acceptor_swap_dict:
00345 print 'use of standard CHARMM HBond acceptor swap dictionary'
00346 acceptor_swap_dict=BuildCHARMMHBondAcceptorEquivalenceDict()
00347 for hbond in ref_hbond_list:
00348 res1=eh.FindResidue(hbond.donor.heavy_atom.chain.name,hbond.donor.heavy_atom.residue.number.num)
00349 res2=eh.FindResidue(hbond.acceptor.atom.chain.name,hbond.acceptor.atom.residue.number.num)
00350 donor=HBondDonor.FromResidue(res1,hbond.donor.heavy_atom.name,hbond.donor.hydrogen.name,verbose)
00351 acceptor=HBondAcceptor.FromResidue(res2,hbond.acceptor.atom.name,[a.name for a in hbond.acceptor.antecedent_list],verbose)
00352 donor_list=ListEquivalentDonors(donor,donor_swap_dict)
00353 acceptor_list=ListEquivalentAcceptors(acceptor,acceptor_swap_dict)
00354 hbond_list.append(set([HBond(d,a) for d in donor_list for a in acceptor_list]))
00355 return hbond_list
00356
00357
00358 def CalculateHBondScore(ref_eh,eh2,ref_eh2=None,hbond_donor_acceptor_dict={},swap=False,donor_swap_dict={},acceptor_swap_dict={},verbose=True):
00359 """
00360 Returns the fraction of H-bonds from ref_eh that are also present in eh2.
00361 If ref_eh2 is specified, it uses as reference the Hbonds between ref_eh and ref_eh2.
00362 This allows to look at H-bonds between specific parts of proteins or so.
00363 Alternatively ref_eh can be a list of H-bonds.
00364 This function relies on atom names to determine the list of H-bond donors and acceptors.
00365 These names are given in a dictionary, which defaults to CHARMM.
00366 If swap is set to True, a dictionary for equivalent donors and one for equivalent acceptors
00367 (defaults to CHARMM) is used to check for equivalent HBonds in eh2.
00368 If swap is set to True, if two equivalent hydrogen bonds are present in the reference entity
00369 (for example both oxygens of ASP H-bonding the same atom), it suffices that on of these bonds is
00370 present in eh2 for both of them to be counted as present in eh2.
00371 """
00372 if ref_eh2:hbond_list1=GetHbondListBetweenViews(ref_eh,ref_eh2,hbond_donor_acceptor_dict,verbose)
00373 elif type(ref_eh)==list:hbond_list1=ref_eh
00374 else:hbond_list1=GetHbondListFromView(ref_eh,hbond_donor_acceptor_dict,verbose)
00375 nbonds=float(len(hbond_list1))
00376 if nbonds==0:
00377 print 'No HBonds in reference view'
00378 return None
00379 hbond_list2=GetEquivalentHBonds(hbond_list1,eh2,swap,donor_swap_dict,acceptor_swap_dict,verbose)
00380 c=0
00381 for hl in hbond_list2:
00382 for hbond in hl:
00383 if HBond(hbond.donor,hbond.acceptor).IsFormed():
00384 c+=1
00385 break
00386 return c/float(len(hbond_list1))
00387
00388
00389 def AnalyzeHBondScore(ref_eh,t,eh2,ref_eh2=None,hbond_donor_acceptor_dict={},swap=False,donor_swap_dict={},acceptor_swap_dict={},first=0,last=-1,stride=1,verbose=True):
00390 """
00391 Returns the same score as CalculateHBondScore, but for a trajectory.
00392 """
00393 if swap:
00394 if not donor_swap_dict:
00395 print 'use of standard CHARMM HBond donor swap dictionary'
00396 donor_swap_dict=BuildCHARMMHBondDonorEquivalenceDict()
00397 if not acceptor_swap_dict:
00398 print 'use of standard CHARMM HBond acceptor swap dictionary'
00399 acceptor_swap_dict=BuildCHARMMHBondAcceptorEquivalenceDict()
00400 if ref_eh2:hbond_list1=GetHbondListBetweenViews(ref_eh,ref_eh2,hbond_donor_acceptor_dict,verbose)
00401 elif type(ref_eh)==list:hbond_list1=ref_eh
00402 else:hbond_list1=GetHbondListFromView(ref_eh,hbond_donor_acceptor_dict,verbose)
00403 nbonds=float(len(hbond_list1))
00404 if nbonds==0:
00405 print 'No HBonds in reference view'
00406 return None
00407 print 'number of hbonds in ref_eh:',nbonds
00408 hbond_list2=GetEquivalentHBonds(hbond_list1,eh2,swap,donor_swap_dict,acceptor_swap_dict,verbose)
00409 if last==-1:last=t.GetFrameCount()
00410 score=FloatList()
00411 for f in range(first,last,stride):
00412 t.CopyFrame(f)
00413 c=0
00414 for hl in hbond_list2:
00415 for hbond in hl:
00416 if hbond.IsFormed():
00417 c+=1
00418 break
00419 score.append(c/nbonds)
00420 return score
00421
00422
00423 def GetHBondListIntersection(ref_hbond_list,ref_eh,hbond_list,swap=False,donor_swap_dict={},acceptor_swap_dict={}):
00424 if swap:
00425 if not donor_swap_dict:
00426 print 'use of standard CHARMM HBond donor swap dictionary'
00427 donor_swap_dict=BuildCHARMMHBondDonorEquivalenceDict()
00428 if not acceptor_swap_dict:
00429 print 'use of standard CHARMM HBond acceptor swap dictionary'
00430 acceptor_swap_dict=BuildCHARMMHBondAcceptorEquivalenceDict()
00431 hbond_list=GetEquivalentHBonds(hbond_list,ref_eh,swap,donor_swap_dict,acceptor_swap_dict)
00432 ref_hbond_list=GetEquivalentHBonds(ref_hbond_list,ref_eh,swap,donor_swap_dict,acceptor_swap_dict)
00433 out_hbond_list=[]
00434 for hb in ref_hbond_list:
00435 if hb in hbond_list:
00436 out_hbond_list.append(hb)
00437 return out_hbond_list
00438
00439
00440
00441
00442
00443