Consensus sequence help in python
<p>I am noobie to python and I am having difficulty getting this scoring function to work.  The objective of my program is to make a t x n matrix and find a consensus sequence.  </p>

<p>I keep getting a error TypeError: 'int' object is not subscriptable.  </p>

<p>Any help would be appreciated.</p>

<pre><code>  def Score(s, i, l, dna):
    t = len(dna) # t = number of dna sequences

    # Step 1: Extract the alignment corresponding to starting positions in s

    alignment = []
    for j in range(0, i):
        alignment.append(dna[j][s[j]:s[j]+l])

    # Step 2: Create the corresponding profile matrix

    profile = [[],[],[],[]]      # prepare an empty 4 x l profile matrix first
    for j in range(0, 4):
        profile[j] = [0] * l

    for c in range(0, l):        # for each column number c
        for r in range(0, i):     # for each row number r in column c
            if alignment[r][c] == 'a':
                profile[0][c] = profile[0][c] + 1
            elif alignment[r][c] == 't':
                profile[1][c] = profile[1][c] + 1
            elif alignment[r][c] == 'g':
                profile[2][c] = profile[2][c] + 1
            else:
                profile[3][c] = profile[3][c] + 1


    # Step 3: Compute the score from the profile matrix

    score = 0
    for c in range(0, l):
        score = score + max([profile[0][c], profile[1][c], profile[2][c], profile[3][c]])

    return score
</code></pre>
