title: creating a list of possible modifications of a sequence
body: <p>I am not very experienced with Python and my script gives the following error: </p>
  
  <pre><code>"invalid syntax in line 4"
  </code></pre>
  
  <p>I don't see the reason, maybe someone can help.</p>
  
  <p>I'm trying to create a list of all possible modifications of a sequence ( like <code>SEQWKST</code>). If the letter is <code>"S"</code>, the modification would be <code>"phos"</code> . If the letter is <code>"K"</code> there are three possible modifications: <code>"dimeth"</code> <code>"meth"</code> and <code>"ac"</code></p>
  
  <p>I want to create a list with the possible modifications and their positions </p>
  
  <pre><code>(eg:
  1,phos
  4,ac
  4,meth
  4,meth...)
  </code></pre>
  
  <hr>
  
  <pre><code>#!/bin/python
  
  def createPTM (SEQWKST):
      PTMlist = []
      pos = 0
      for N in SEQWKST:
          pos += 1
          if N == "Y":
              PTM = phos
              PTM_list.extend(pos,PTM)
          elif N=="S":
              PTM = phos
              PTMlist.extend(pos,PTM) 
          elif N=="T":
              PTM = phos
              PTMlist.extend(pos,PTM)     
          elif N=="R":
              PTM = meth
              PTM_2 = dimeth
              PTMlist.extend(pos,PTM)
              PTMlist.extend(pos,PTM_2)
          elif N=="K":
              PTM = meth
              PTM_2 = dimeth
              PTM_3 = ac
              PTMlist.extend(pos,PTM)
              PTMlist.extend(pos,PTM_2)
              PTMlist.extend(pos,PTM_3)       
      return PTM_list
      print PTM_list      
  </code></pre>