bx.align.core module
Classes that represent alignments between multiple sequences.
- class bx.align.core.Alignment(score: int | float | str = 0, attributes: dict[str, Any] | None = None, species_to_lengths: dict[str | None, str | dict[str, int] | int] | None = None)
Bases:
object- remove_all_gap_columns() None
Remove any columns containing only gaps from alignment components, text of components is modified IN PLACE.
- slice_by_component(component_index: int | str | Component, start: int, end: int) Alignment
Return a slice of the alignment, corresponding to an coordinate interval in a specific component.
- component_index is one of
an integer offset into the components list a string indicating the src of the desired component a component
start and end are relative to the + strand, regardless of the component’s strand.
- class bx.align.core.Component(src: str = '', start: int = 0, size: int = 0, strand: Literal['+', '-', '?'] | None = None, src_size: int | None = None, text: str | None = '')
Bases:
object- coord_to_col(pos: int) int
Return the alignment column index corresponding to coordinate pos.
pos is relative to the + strand, regardless of the component’s strand.
- bx.align.core.get_indexed(format: Literal['maf', 'axt', 'lav'], filename: str, index_filename: str | None = None, keep_open: bool = False, species_to_lengths: dict[str | None, str | dict[str, int] | int] | None = None) bx.align.maf.MAFIndexedAccess | bx.align.axt.Indexed
- bx.align.core.get_reader(format: Literal['maf', 'axt', 'lav'], infile: IO[str], species_to_lengths: dict[str | None, str | dict[str, int] | int] | None = None) bx.align.maf.Reader | bx.align.axt.Reader | bx.align.lav.Reader
- bx.align.core.get_writer(format: Literal['maf', 'axt', 'lav'], outfile: IO[str], attributes: dict[str, Any] | None = None) bx.align.maf.Writer | bx.align.axt.Writer | bx.align.lav.Writer