cogent3.core.alignment.Aligned#
- class Aligned(data: AlignedDataViewABC, moltype: c3_moltype.MolType[str], name: str | None = None, annotation_db: AnnotationDbABC | list[AnnotationDbABC] | None = None)#
A single sequence in an alignment.
- Attributes:
annotation_dbthe annotation database for the collection
- data
gapped_seqReturns Sequence object, including gaps.
- map
- moltype
- name
seqthe ungapped sequence.
Methods
annotate_matches_to(pattern, biotype, name)Adds an annotation at sequence positions matching pattern.
from_map_and_aligned_data_view(indel_map, seq)Creates an Aligned instance from an indel map and AlignedDataView.
from_map_and_seq(indel_map, seq)Creates an Aligned instance from an indel map and a Sequence.
gap_vector()Returns gap_vector of positions.
make_feature(feature, alignment)returns a feature, not written into annotation_db
parent_coordinates([seq_coords, apply_offset])returns seqid, start, stop, strand on the parent sequence
replace_annotation_db(value[, check])public interface to assigning the annotation_db
slice_with_map
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.