original_docstring: Identify disulfide bonds based on proximity and add them to the
          Topology.
  
          Parameters
          ----------
          positions : list
              The list of atomic positions based on which to identify bonded atoms
          
docstring: Identify disulfide bonds based on proximity and add them to the
  Topology.
  
  Parameters
  
  positions : list
  The list of atomic positions based on which to identify bonded atoms
docstring_tokens: Identify disulfide bonds based on proximity and add them to the Topology . Parameters positions : list The list of atomic positions based on which to identify bonded atoms
code: def createDisulfideBonds(self, positions):
          """Identify disulfide bonds based on proximity and add them to the
          Topology.
  
          Parameters
          ----------
          positions : list
              The list of atomic positions based on which to identify bonded atoms
          """
          def isCyx(res):
              names = [atom.name for atom in res._atoms]
              return 'SG' in names and 'HG' not in names
  
          cyx_sg_list = []
          for res in self.residues():
              is_cyx = False
              if res.name == 'CYX':
                  is_cyx = True
              elif res.name == 'CYS' and isCyx(res):
                  is_cyx = True
  
              if is_cyx:
                  atomNames = [atom.name for atom in res._atoms]
                  sg = res._atoms[atomNames.index('SG')]
                  cyx_sg_list.append(sg)
  
          for i in range(len(cyx_sg_list)):
              sg1 = cyx_sg_list[i]
              pos1 = positions[sg1.index]
              for j in range(i):
                  sg2 = cyx_sg_list[j]
                  pos2 = positions[sg2.index]
                  delta = [x-y for (x, y) in zip(pos1, pos2)]
                  distance = sqrt(delta[0]*delta[0] + delta[1]
                                  * delta[1] + delta[2]*delta[2])
                  if distance < 0.23*nanometers:
                      self.addBond(sg1, sg2)
code_tokens: def createDisulfideBonds ( self , positions ) : def isCyx ( res ) : names = [ atom . name for atom in res . _atoms ] return 'SG' in names and 'HG' not in names cyx_sg_list = [ ] for res in self . residues ( ) : is_cyx = False if res . name == 'CYX' : is_cyx = True elif res . name == 'CYS' and isCyx ( res ) : is_cyx = True if is_cyx : atomNames = [ atom . name for atom in res . _atoms ] sg = res . _atoms [ atomNames . index ( 'SG' ) ] cyx_sg_list . append ( sg ) for i in range ( len ( cyx_sg_list ) ) : sg1 = cyx_sg_list [ i ] pos1 = positions [ sg1 . index ] for j in range ( i ) : sg2 = cyx_sg_list [ j ] pos2 = positions [ sg2 . index ] delta = [ x - y for ( x , y ) in zip ( pos1 , pos2 ) ] distance = sqrt ( delta [ 0 ] * delta [ 0 ] + delta [ 1 ] * delta [ 1 ] + delta [ 2 ] * delta [ 2 ] ) if distance < 0.23 * nanometers : self . addBond ( sg1 , sg2 )
short_docstring: Identify disulfide bonds based on proximity and add them to the
  Topology.
short_docstring_tokens: Identify disulfide bonds based on proximity and add them to the Topology .
comment: """Identify disulfide bonds based on proximity and add them to the
          Topology.
  
          Parameters
          ----------
          positions : list
              The list of atomic positions based on which to identify bonded atoms
          """