MsaViz Class
MsaViz
MsaViz(
msa: str | Path | MSA,
*,
format: str = "fasta",
color_scheme: str | None = None,
start: int = 1,
end: int | None = None,
wrap_length: int | None = None,
wrap_space_size: float = 3.0,
show_label: bool = True,
label_type: str = "id",
show_seq_char: bool = True,
show_grid: bool = False,
show_count: bool = False,
show_consensus: bool = False,
consensus_color: str = "#1f77b4",
consensus_size: float = 2.0,
sort: bool = False
)
Multiple Sequence Alignment Visualization
PARAMETER | DESCRIPTION |
---|---|
msa |
MSA file, URL MSA file, MSA object
TYPE:
|
format |
Alignment file format (e.g.
TYPE:
|
color_scheme |
Color scheme. If None,
TYPE:
|
start |
Start position of visualization (one-based coordinates)
TYPE:
|
end |
End position of visualization (one-based coordinates)
TYPE:
|
wrap_length |
Wrap sequence length. If None, no wrapping sequence.
TYPE:
|
wrap_space_size |
Space size between wrap MSA plot area
TYPE:
|
show_label |
If True, show label
TYPE:
|
label_type |
Label type (
TYPE:
|
show_seq_char |
If True, show sequence character
TYPE:
|
show_grid |
If True, show grid
TYPE:
|
show_count |
If True, show seq char count without gap on right side
TYPE:
|
show_consensus |
If True, show consensus sequence
TYPE:
|
consensus_color |
Consensus identity bar color
TYPE:
|
consensus_size |
Consensus identity bar height size
TYPE:
|
sort |
Sort MSA order by NJ tree constructed from MSA distance matrix
TYPE:
|
available_color_schemes
staticmethod
Get available color schemes
RETURNS | DESCRIPTION |
---|---|
color_scheme_names
|
Available color schemes
TYPE:
|
set_plot_params
set_plot_params(
*,
ticks_interval: int | None = 10,
x_unit_size: float = 0.14,
y_unit_size: float = 0.2,
grid_color: str = "lightgrey",
show_consensus_char: bool = True,
identity_color: str = "#A3A5FF",
identity_color_min_thr: float = 30
) -> None
Set plot parameters to adjust figure appearence in detail
PARAMETER | DESCRIPTION |
---|---|
ticks_interval |
Ticks interval. If None, ticks interval is not displayed.
TYPE:
|
x_unit_size |
X-axis unit size of seq char rectangle
TYPE:
|
y_unit_size |
Y-axis unit size of seq char rectangle
TYPE:
|
grid_color |
Grid color
TYPE:
|
show_consensus_char |
If True, show consensus character
TYPE:
|
identity_color |
Base color for
TYPE:
|
identity_color_min_thr |
Min identity color threshold for
TYPE:
|
set_custom_color_scheme
Set user-defined custom color scheme (Overwrite color scheme setting)
PARAMETER | DESCRIPTION |
---|---|
color_scheme |
Custom color scheme dict (e.g.
TYPE:
|
set_custom_color_func
Set user-defined custom color func (Overwrite all other color setting)
User can change the color of each residue specified by the row and column position of the MSA.
PARAMETER | DESCRIPTION |
---|---|
custom_color_func |
Custom color function.
TYPE:
|
set_highlight_pos
Set user-defined highlight MSA positions
PARAMETER | DESCRIPTION |
---|---|
positions |
Highlight positions. int and tuple range mixture positions can be specified.
(e.g. If
TYPE:
|
set_highlight_pos_by_ident_thr
Set highlight MSA positions by consensus identity threshold
PARAMETER | DESCRIPTION |
---|---|
min_thr |
Min identity threshold for highlight position selection
TYPE:
|
max_thr |
Max identity threshold for highlight position selection
TYPE:
|
add_markers
add_markers(
positions: list[tuple[int, int] | int],
marker: str = "v",
color: str = "black",
size: float = 6,
) -> None
Add markers on specified positions
PARAMETER | DESCRIPTION |
---|---|
positions |
Marker positions. int and tuple range mixture positions can be specified.
(e.g. If
TYPE:
|
marker |
Marker type of matplotlib. See https://matplotlib.org/stable/api/markers_api.html for details.
TYPE:
|
color |
Marker color
TYPE:
|
size |
Marker size
TYPE:
|
add_text_annotation
add_text_annotation(
range: tuple[int, int],
text: str,
*,
text_color: str = "black",
text_size: float = 10,
range_color: str = "black"
) -> None
Add text annotation in specified range
PARAMETER | DESCRIPTION |
---|---|
range |
Annotation start-end range tuple
TYPE:
|
text |
Annotation text
TYPE:
|
text_color |
Text color
TYPE:
|
text_size |
Text size
TYPE:
|
range_color |
Annotation range line color
TYPE:
|
plotfig
Plot figure
PARAMETER | DESCRIPTION |
---|---|
dpi |
Figure DPI
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
fig
|
Figure
TYPE:
|