Bio.Wise.psw module

Run and process output from the Wise2 package tool psw.

Bio.Wise contains modules for running and processing the output of some of the models in the Wise2 package by Ewan Birney available from:

Bio.Wise.psw is for protein Smith-Waterman alignments Bio.Wise.dnal is for Smith-Waterman DNA alignments

exception Bio.Wise.psw.AlignmentColumnFullException

Bases: Exception

Manage exception in the alignment output.

class Bio.Wise.psw.Alignment(iterable=(), /)

Bases: list

Define a container for all alignment Columns, output from running psw.

append(self, column_unit)

Add an alignment Column to Alignment.

class Bio.Wise.psw.AlignmentColumn(column_unit)

Bases: list

Define a container for the units that made the Column.

__init__(self, column_unit)

Initialize the class.


Represent the AlignmentColumn object as a string for debugging.

append(self, column_unit)

Add a unit to the Column.

class Bio.Wise.psw.ColumnUnit(unit, column, kind)

Bases: object

Define a container for the details of each sequence alignment.

__init__(self, unit, column, kind)

Initialize the class.


Represent the ColumnUnit object as a string for debugging.


Parse a line from psw.

>>> print(parse_line("Column 0:"))
>>> parse_line("Unit  0- [  -1-   0] [SEQUENCE]")
ColumnUnit(unit=0, column=0, kind='SEQUENCE')
>>> parse_line("Unit  1- [  85-  86] [SEQUENCE]")
ColumnUnit(unit=1, column=86, kind='SEQUENCE')

Parse a file.


Column 0: Unit 0- [ -1- 0] [SEQUENCE] Unit 1- [ 85- 86] [SEQUENCE]

means that seq1[0] == seq2[86] (0-based)

Bio.Wise.psw.align(pair, scores=None, gap_start=None, gap_extension=None, *args, **keywds)

Align a pair of DNA files using Wise2 psw.


Command line implementation.