mkt.databases.plot.SequenceAlignment

class mkt.databases.plot.SequenceAlignment(list_sequences: list[str], list_ids: list[str], dict_colors: dict[str, str], font_size: int = 9, plot_width: int = 800, plot_height: int = None, bool_top: bool = True, bool_reverse: bool = True, bool_gridplot: bool = True)[source]

Bases: object

Class for sequence alignment plot.

__init__(*args: Any, **kwargs: Any) None

Methods

__eq__(other)

Return self==value.

__post_init__()

create_coldatasource()

generate_bottom_plot()

Generate sequence alignment plot adapted from https://dmnfarrell.github.io/bioinformatics/bokeh-sequence-aligner.

generate_gridplot()

Generate sequence alignment gridplot.

generate_top_plot()

Generate sequence alignment plot adapted from https://dmnfarrell.github.io/bioinformatics/bokeh-sequence-aligner.

get_colors(list_str, dict_colors)

Get colors for residue in a given sequence.

show_plot()

Show sequence alignment plot via Bokeh in separate window.

Attributes

__dataclass_fields__

__dataclass_params__

__match_args__

__pydantic_config__

bool_gridplot

Use gridplot or not.

bool_reverse

Reverse the sequence or not.

bool_top

Show entire sequence view on top or not (no text, with zoom).

font_size

Font size for alignment.

plot_height

Height of the plot; default None and will full-page heuristic.

plot_width

Width of the plot.

list_sequences

List of sequences to show in aligner.

list_ids

List of sequence IDs.

dict_colors

Dictionary of colors for each sequence.

bool_gridplot: bool = True

Use gridplot or not.

bool_reverse: bool = True

Reverse the sequence or not.

bool_top: bool = True

Show entire sequence view on top or not (no text, with zoom).

create_coldatasource()[source]
dict_colors: dict[str, str]

Dictionary of colors for each sequence.

font_size: int = 9

Font size for alignment.

generate_bottom_plot() None[source]

Generate sequence alignment plot adapted from https://dmnfarrell.github.io/bioinformatics/bokeh-sequence-aligner.

generate_gridplot() None[source]

Generate sequence alignment gridplot.

generate_top_plot() None[source]

Generate sequence alignment plot adapted from https://dmnfarrell.github.io/bioinformatics/bokeh-sequence-aligner.

static get_colors(list_str: str, dict_colors: dict[str, str]) list[str][source]

Get colors for residue in a given sequence.

Parameters:
  • list_str (str) – List of residues in a sequence.

  • dict_colors (dict[str, str]) – Dictionary of colors for each residue.

Returns:

List of colors for each residue.

Return type:

list[str]

list_ids: list[str]

List of sequence IDs.

list_sequences: list[str]

List of sequences to show in aligner.

plot_height: int = None

Height of the plot; default None and will full-page heuristic.

plot_width: int = 800

Width of the plot.

show_plot() None[source]

Show sequence alignment plot via Bokeh in separate window.