core.alignment.Aligned

core.alignment.Aligned(data, moltype, name=None, annotation_db=None)

A single sequence in an alignment.

Notes

This is a wrapper around a AlignedDataView. This class performs any complementing needed. It can be cast directly to a string or numpy array, e.g. numpy.array(<aligned instance>) returns a numpy unsigned 8-bit integer array.

Attributes

Name Description
annotation_db the annotation database for the collection
gapped_seq Returns Sequence object, including gaps.
seq the ungapped sequence.

Methods

Name Description
from_map_and_aligned_data_view Creates an Aligned instance from an indel map and AlignedDataView.
from_map_and_seq Creates an Aligned instance from an indel map and a Sequence.
gap_vector Returns gap_vector of positions.
make_feature returns a feature, not written into annotation_db
parent_coordinates returns seqid, start, stop, strand on the parent sequence
replace_annotation_db public interface to assigning the annotation_db

from_map_and_aligned_data_view

core.alignment.Aligned.from_map_and_aligned_data_view(indel_map, seq)

Creates an Aligned instance from an indel map and AlignedDataView.

from_map_and_seq

core.alignment.Aligned.from_map_and_seq(indel_map, seq)

Creates an Aligned instance from an indel map and a Sequence.

gap_vector

core.alignment.Aligned.gap_vector()

Returns gap_vector of positions.

make_feature

core.alignment.Aligned.make_feature(feature, alignment)

returns a feature, not written into annotation_db

parent_coordinates

core.alignment.Aligned.parent_coordinates(seq_coords=False, apply_offset=False)

returns seqid, start, stop, strand on the parent sequence

Parameters

Name Type Description Default
seq_coords bool if True, the coordinates for the unaligned sequence False
apply_offset bool if True and seq_coords, adds annotation offset from parent False

replace_annotation_db

core.alignment.Aligned.replace_annotation_db(value, check=True)

public interface to assigning the annotation_db

Parameters

Name Type Description Default
value AnnotationDbABC | list[AnnotationDbABC] | None the annotation db instance required
check bool whether to check value supports the feature interface True

Notes

The check can be very expensive, so if you’re confident set it to False