scastlara / minineedle Goto Github PK
View Code? Open in Web Editor NEWNeedleman-Wunsch and Smith-Waterman algorithms in python
License: GNU General Public License v3.0
Needleman-Wunsch and Smith-Waterman algorithms in python
License: GNU General Public License v3.0
nvm
They are not very good, they could actually use generics.
title.
When debugging using Pycharm, the objects in the current context are displayed in the debugger window, which calls their str method.
The thing is the str method itself calls the align method, filling the _alseq1 and _alseq2 attributes.
So when we call the self.align manually, both attributes are filled a second time, which creates a bug.
We could make sure the attributes are empty by assigning them to empty lists at the beginning of the _trace_back_alignment method:
def _trace_back_alignment(self, irow: int, jcol: int) -> None:
# FIX
self._alseq1, self._alseq2 = [], []
# !FIX
while True:
if self._pmatrix[irow][jcol] == "diag":
self._alseq1.append(self.seq1[jcol - 1])
self._alseq2.append(self.seq2[irow - 1])
if self.seq1[jcol - 1] == self.seq2[irow - 1]:
self._identity += 1
irow -= 1
jcol -= 1
elif self._pmatrix[irow][jcol] == "up":
self._alseq1.append(Gap(self._gap_character))
self._alseq2.append(self.seq2[irow - 1])
irow -= 1
elif self._pmatrix[irow][jcol] == "left":
self._alseq1.append(self.seq1[jcol - 1])
self._alseq2.append(Gap(self._gap_character))
jcol -= 1
else:
break
self._alseq1 = list(reversed(self._alseq1))
self._alseq2 = list(reversed(self._alseq2))
self._identity = (self._identity / len(self._alseq1)) * 100
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.