bio.align

Source code: bio/align.seq

type bio.align.SubMat

Substitution matrix for amino acid alignment

Magic methods:

__init__(d: dict[tuple[str, str], int])

Creates a SubMat from a dictionary mapping amino acid pairs to score values.

__str__()
extension CIGAR

Properties:

qlen
rlen

Magic methods:

__init__()
__len__()
__eq__(other: CIGAR)
__ne__(other: CIGAR)
__copy__()
__bool__()
__init__(cigar: str)
__getitem__(idx: int)
__iter__()
__str__()
__reversed__()
extension Alignment

Properties:

cigar
score

Magic methods:

__init__()
__init__(cigar: str, score: int)
__bool__()
extension seq

Magic methods:

__matmul__(other: seq)

Performs Smith-Waterman alignment against another sequence. Mismatch and gap costs are 1 (Levenshtein distance).

Methods:

align(other: seq, a: int = 2, b: int = 4, ambig: int = 0, gapo: int = 4, gape: int = 2, gapo2: int = - 1, gape2: int = - 1, bandwidth: int = - 1, zdrop: int = - 1, end_bonus: int = 0, score_only: bool = False, right: bool = False, generic_sc: bool = False, approx_max: bool = False, approx_drop: bool = False, ext_only: bool = False, rev_cigar: bool = False, splice: bool = False, splice_fwd: bool = False, splice_rev: bool = False, splice_flank: bool = False)

Performs Smith-Waterman alignment against another sequence.

  • a: match score

  • b: mismatch score

  • ambig: ambiguous (i.e. N) match score

  • gapo: gap open cost

  • gape: gap extension cost

  • gapo2: 2nd gap open cost for dual gap cost function

  • gape2: 2nd gap extension cost for dual gap cost function

  • bandwidth: bandwidth for DP alignment

  • zdrop: off-diagonal drop-off to stop extension

  • end_bonus: score bonus for reaching end of DP matrix

  • score_only: if true, don’t compute CIGAR

  • right: if true, right-align gaps

  • approx_max: if true, approximate max

  • approx_drop: if true, approximate Z-drop

  • rev_cigar: if true, reverse CIGAR in output

  • ext_only: if true, perform extension alignment

  • splice: if true, perform spliced alignment

extension pseq

Magic methods:

__matmul__(other: pseq)

Performs Smith-Waterman alignment against another sequence. Uses Blosum-62, gap open cost 11 and gap extend cost 1.

Methods:

align(other: pseq, mat: SubMat, gapo: int = 4, gape: int = 2, gapo2: int = - 1, gape2: int = - 1, bandwidth: int = - 1, zdrop: int = - 1, end_bonus: int = 0, score_only: bool = False, right: bool = False, generic_sc: bool = False, approx_max: bool = False, approx_drop: bool = False, ext_only: bool = False, rev_cigar: bool = False)

Performs Smith-Waterman alignment against another sequence.

  • mat: score matrix

  • gapo: gap open cost

  • gape: gap extension cost

  • gapo2: 2nd gap open cost for dual gap cost function

  • gape2: 2nd gap extension cost for dual gap cost function

  • bandwidth: bandwidth for DP alignment

  • zdrop: off-diagonal drop-off to stop extension

  • end_bonus: score bonus for reaching end of DP matrix

  • score_only: if true, don’t compute CIGAR

  • right: if true, right-align gaps

  • approx_max: if true, approximate max

  • approx_drop: if true, approximate Z-drop

  • rev_cigar: if true, reverse CIGAR in output

  • ext_only: if true, perform extension alignment

type bio.align.InterAlignParams
type bio.align.SeqPair

Magic methods:

__init__(id: int, len1: int, len2: int, flags: int)