title: Pymol - detecting collisions between rotating peptides
body: <p>I have tripeptid(leu-lys-trp) opened in Pymol, and a script, that rotates peptides leu and trp around central peptide - lys.</p>
  
  <pre><code>from pymol import stored
  from time import sleep
  
  #select leu AA
  cmd.select("LEU-sel","/leu///LEU")
  #select trp AA
  cmd.select("TRP","/leu///TRP")
  #create selection of atom which i need to rotate around
  cmd.select("TRPlys", "/leu///LYS`3/C")
  xyz = cmd.get_model("TRPlys", 1).get_coord_list()
  
  trp_con = []
  cmd.iterate_state(1, "TRPlys","trp_con.append((x,y,z))")
  
  print trp_con
  i = 0
  for i in range(0,100):
      cmd.rotate(xyz[0], 1, "TRP",0,1, None, trp_con[0])
      cmd.refresh()
      sleep(0.1)
  </code></pre>
  
  <p>I need to stop the rotation if there occur any collision between atoms of those peptides.</p>
  
  <p>Is there any tool in pymol, that would make collision detection easier?</p>