From f2fcfe3fc2903de7462c63df8046f107044909b4 Mon Sep 17 00:00:00 2001 From: BenLangmead Date: Fri, 24 Jul 2015 14:52:00 -0400 Subject: [PATCH] make sure column iterator is j --- 3.02_GlobalAlignment.ipynb | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/3.02_GlobalAlignment.ipynb b/3.02_GlobalAlignment.ipynb index fe9c2ee..a400e0a 100644 --- a/3.02_GlobalAlignment.ipynb +++ b/3.02_GlobalAlignment.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 8, + "execution_count": 1, "metadata": { "collapsed": false }, @@ -18,7 +18,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 2, "metadata": { "collapsed": false }, @@ -29,7 +29,7 @@ "0" ] }, - "execution_count": 9, + "execution_count": 2, "metadata": {}, "output_type": "execute_result" } @@ -41,7 +41,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 3, "metadata": { "collapsed": false }, @@ -52,7 +52,7 @@ "2" ] }, - "execution_count": 10, + "execution_count": 3, "metadata": {}, "output_type": "execute_result" } @@ -63,7 +63,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 4, "metadata": { "collapsed": false }, @@ -74,7 +74,7 @@ "4" ] }, - "execution_count": 11, + "execution_count": 4, "metadata": {}, "output_type": "execute_result" } @@ -126,8 +126,8 @@ " D[i][0] = D[i-1][0] + score[alphabet.index(x[i-1])][-1]\n", "\n", " # Initialize first row\n", - " for i in range(1,len(y)+1):\n", - " D[0][i] = D[0][i-1] + score[-1][alphabet.index(y[i-1])]\n", + " for j in range(1,len(y)+1):\n", + " D[0][j] = D[0][j-1] + score[-1][alphabet.index(y[j-1])]\n", " \n", " # Fill rest of the matrix\n", " for i in range(1, len(x)+1):\n",