Skip to content

Local sequence alignment by the Smith-Waterman algorithm #2

@savitOS

Description

@savitOS

Hi there,

From what I understood, for negative numbers, you should record the score as 0. So, the first row and the first column should be zero.

I wasn't the best approach, but I changed mat[I][0] and mat[0][j] to = 0 in def local_alignment(self).

    # fill in the vertival border values
    # with gap opening penalty scores
    for i in range(1, len(q) + 1):
        if i == 0:
            mat[i][0] = self.GAP_OP
        else:
            mat[i][0] = 0  #mat[i - 1][0] + self.GAP_EX**
        trace_mat[i][0] = (i - 1, 0)

    for j in range(1, len(q) + 1):
        if j == 0:
            mat[0][j] = self.GAP_OP
        else:
            mat[0][j] = 0  #mat[0][j - 1] + self.GAP_EX**
        trace_mat[0][j] = (0, j - 1)

I hope this helps ;)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions