Python Bindings for lib_tsalign
Python bindings for the template switch aligner. Aligns two DNA sequences while detecting template switches — short-range translocations where a query region is copied from (or aligns to) a different location, possibly on the reverse complement strand.
Installation
Quick start
=
# compact alignment string
# cost, duration, node counts, …
Aligner options
Create an Aligner once and reuse it for many sequences:
=
=
Custom cost configuration
Costs are specified in .tsa format. Use sample_tsa_config/config.tsa
as a starting point and consult the main repository README for a description
of each parameter.
=
=
You can also pass the cost string directly:
=
=
Restricting the alignment range
Use AlignmentRange to align only a window of the input sequences:
=
=
Individual start/limit keyword arguments are also accepted when range is
not provided:
=
Working with alignment operations
alignment.alignments() returns a typed list of (count, op) pairs:
=
# SimpleAlignmentOp — a basic edit in the primary or secondary track
Visualisation
=
# prints ASCII art to stdout
Limiting search resources
=
Accepted sequence types
Any object whose str() representation is a valid DNA string (ACGTN) is
accepted — including Bio.Seq:
=