original_docstring: Load an XML file containing definitions of bonds that should be used by createStandardBonds().
  
          The built in residues.xml file containing definitions for standard amino acids and nucleotides is loaded automatically.
          This method can be used to load additional definitions for other residue types.  They will then be used in subsequent
          calls to createStandardBonds().  This is a static method, so it affects subsequent calls on all Topology objects.
          Also note that PDBFile calls createStandardBonds() automatically when a file is loaded, so the newly loaded definitions
          will be used for any PDB file loaded after this is called.
          
docstring: Load an XML file containing definitions of bonds that should be used by createStandardBonds().
  The built in residues.xml file containing definitions for standard amino acids and nucleotides is loaded automatically.
  This method can be used to load additional definitions for other residue types.  They will then be used in subsequent
  calls to createStandardBonds().  This is a static method, so it affects subsequent calls on all Topology objects.
  Also note that PDBFile calls createStandardBonds() automatically when a file is loaded, so the newly loaded definitions
  will be used for any PDB file loaded after this is called.
docstring_tokens: Load an XML file containing definitions of bonds that should be used by createStandardBonds () . The built in residues . xml file containing definitions for standard amino acids and nucleotides is loaded automatically . This method can be used to load additional definitions for other residue types . They will then be used in subsequent calls to createStandardBonds () . This is a static method so it affects subsequent calls on all Topology objects . Also note that PDBFile calls createStandardBonds () automatically when a file is loaded so the newly loaded definitions will be used for any PDB file loaded after this is called .
code: def loadBondDefinitions(ff_file):
          """Load an XML file containing definitions of bonds that should be used by createStandardBonds().
  
          The built in residues.xml file containing definitions for standard amino acids and nucleotides is loaded automatically.
          This method can be used to load additional definitions for other residue types.  They will then be used in subsequent
          calls to createStandardBonds().  This is a static method, so it affects subsequent calls on all Topology objects.
          Also note that PDBFile calls createStandardBonds() automatically when a file is loaded, so the newly loaded definitions
          will be used for any PDB file loaded after this is called.
          """
  
          tree = etree.parse(ff_file)
          element = tree.getroot().find('Residues')
          for residue in element.findall('Residue'):
              bonds = []
              resname = residue.attrib['name']
              l_pdb = False
              if len(resname) >= 3:
                  if resname[-3:] in _standardResidues:
                      l_pdb = True
              MyTopology._standardBonds[resname] = bonds
              for bond in residue.findall('Bond'):
                  atnm1 = bond.attrib['atomName1']
                  atnm2 = bond.attrib['atomName2']
                  if l_pdb:
                      if atnm1 in _atomNameReplacements:
                          atnm1 = _atomNameReplacements[atnm1]
                      if atnm2 in _atomNameReplacements:
                          atnm2 = _atomNameReplacements[atnm2]
  
                  #bonds.append((bond.attrib['from'], bond.attrib['to']))
                  bonds.append((atnm1, atnm2))
  
              exBonds = []
              for bond in residue.findall('ExternalBond'):
                  exBonds.append(bond.attrib['atomName'])
              if l_pdb:
                  # Protein Backbone
                  bonds.append(('C', '+N'))
              elif len(exBonds) == 2:
                  # Nucleic Acids (DNA and RNA) Backbone
                  if exBonds[0] in ['O3', 'P'] and exBonds[1] in ['O3', 'P']:
                      bonds.append(('-O3', 'P'))
code_tokens: def loadBondDefinitions ( ff_file ) : tree = etree . parse ( ff_file ) element = tree . getroot ( ) . find ( 'Residues' ) for residue in element . findall ( 'Residue' ) : bonds = [ ] resname = residue . attrib [ 'name' ] l_pdb = False if len ( resname ) >= 3 : if resname [ - 3 : ] in _standardResidues : l_pdb = True MyTopology . _standardBonds [ resname ] = bonds for bond in residue . findall ( 'Bond' ) : atnm1 = bond . attrib [ 'atomName1' ] atnm2 = bond . attrib [ 'atomName2' ] if l_pdb : if atnm1 in _atomNameReplacements : atnm1 = _atomNameReplacements [ atnm1 ] if atnm2 in _atomNameReplacements : atnm2 = _atomNameReplacements [ atnm2 ] bonds . append ( ( atnm1 , atnm2 ) ) exBonds = [ ] for bond in residue . findall ( 'ExternalBond' ) : exBonds . append ( bond . attrib [ 'atomName' ] ) if l_pdb : bonds . append ( ( 'C' , '+N' ) ) elif len ( exBonds ) == 2 : if exBonds [ 0 ] in [ 'O3' , 'P' ] and exBonds [ 1 ] in [ 'O3' , 'P' ] : bonds . append ( ( '-O3' , 'P' ) )
short_docstring: Load an XML file containing definitions of bonds that should be used by createStandardBonds().
short_docstring_tokens: Load an XML file containing definitions of bonds that should be used by createStandardBonds () .
comment: """Load an XML file containing definitions of bonds that should be used by createStandardBonds().
  
          The built in residues.xml file containing definitions for standard amino acids and nucleotides is loaded automatically.
          This method can be used to load additional definitions for other residue types.  They will then be used in subsequent
          calls to createStandardBonds().  This is a static method, so it affects subsequent calls on all Topology objects.
          Also note that PDBFile calls createStandardBonds() automatically when a file is loaded, so the newly loaded definitions
          will be used for any PDB file loaded after this is called.
          """$SEP$#bonds.append((bond.attrib['from'], bond.attrib['to']))$SEP$# Protein Backbone$SEP$# Nucleic Acids (DNA and RNA) Backbone