The Align
submodule doesn't appear to contain any such class/function (testing with Py2.7 and Py3) with BioPython 1.70/1.71, though it does appear that there should be such an object according to the docs: https://biopython.org/DIST/docs/api/Bio.Align.PairwiseAlignment-class.html
>>> from Bio import Align
>>> Align.
Align.Alphabet Align.__delattr__( Align.__getattribute__( Align.__package__ Align.__setattr__(
Align.MultipleSeqAlignment( Align.__dict__ Align.__hash__( Align.__path__ Align.__sizeof__(
Align.Seq( Align.__doc__ Align.__init__( Align.__reduce__( Align.__str__(
Align.SeqRecord( Align.__file__ Align.__name__ Align.__reduce_ex__( Align.__subclasshook__(
Align.__class__( Align.__format__( Align.__new__( Align.__repr__( Align.print_function
As Eric suggested, what you might want is Bio.pairwise2
.
Under biopython 1.72, the very latest version in conda, the objects exist. I at least get an error that appears sensible!
>>> import Bio
>>> from Bio import Align
>>> Bio.__version__
'1.72'
>>> Align.
Align.Alphabet Align.SeqRecord( Align.__file__ Align.__new__( Align.__setattr__( Align.sys
Align.MultipleSeqAlignment( Align._RestrictedDict( Align.__format__( Align.__package__ Align.__sizeof__(
Align.PairwiseAligner( Align.__class__( Align.__getattribute__( Align.__path__ Align.__str__(
Align.PairwiseAlignment( Align.__delattr__( Align.__hash__( Align.__reduce__( Align.__subclasshook__(
Align.PairwiseAlignments( Align.__dict__ Align.__init__( Align.__reduce_ex__( Align._aligners
Align.Seq( Align.__doc__ Align.__name__ Align.__repr__( Align.print_function
>>> a = Align.PairwiseAlignment()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: __init__() takes exactly 5 arguments (1 given)
And PairwiseAligner
doen't throw any errors when assigned to variable:
>>> aligner = Align.PairwiseAligner()
>>> aligner
Pairwise aligner, implementing the Needleman-Wunsch, Smith-Waterman, Gotoh, and Waterman-Smith-Beyer global and local alignment algorithms
>>>
In short, I would suggest updating to the bleeding edge version, 1.72. If you're using conda this is fairly straightforward:
conda install -c anaconda biopython
try
Bio.pairwise2
. http://biopython.org/DIST/docs/api/Bio.pairwise2-module.htmlit has not the same functionality
Why? You should move to Python3. I'm facing the same problem with both py2.7.15 and py3+, so I don't know what the problem is.
doesn't work either.