ensembl.vep.models package#

Data Models.

Subpackages#

Submodules#

ensembl.vep.models.custom_feature module#

CustomFeature class.

class ensembl.vep.models.custom_feature.CustomFeature(*, start, end, strand, slice=None, record=dict())[source]#

Bases: Feature

Represent one record retrieved from a custom annotation track.

Variables:

record (dict[str, object]) – Source-native fields for this feature.

record: dict[str, object]#

ensembl.vep.models.feature module#

Feature class.

class ensembl.vep.models.feature.Feature(*, start, end, strand, slice=None)[source]#

Bases: UnsafeSetterMixin

Represents a genomic feature in a specific locus.

Variables:
  • start (int) – Start position relative to slice (1-based, inclusive).

  • end (int) – End position relative to slice (1-based, inclusive).

  • strand (Strand) – Feature orientation relative to slice.

  • slice (Slice | None) – Slice object describing the feature context.

  • seq – Associated biological sequence.

end: int#
feature_slice()[source]#

Returns a slice that covers the area of this feature.

The feature start will be at 1 on the returned slice, and it will have the length of this feature. If the feature has no attached slice, a warning will be logged and None will be returned.

Return type:

Slice | None

Returns:

A Slice object covering the feature area, or None if the feature has no attached slice.

property length: int#

Public accessor for the _length.

Returns:

The length of the feature.

overlaps(other)[source]#

Checks if this feature overlaps with another feature.

Parameters:

other (Feature) – Another feature to check overlap with.

Return type:

bool | None

Returns:

True if overlaps, False if not, None if slices are missing.

property seq: str | None#

Public accessor for the _seq.

Returns:

The associated biological sequence, or None if unavailable.

property seq_region_end: int | None#

Public accessor for the _seq_region_end.

Returns:

The end position in the sequence region, or None if the feature has no attached slice.

property seq_region_start: int | None#

Public accessor for the _seq_region_start.

Returns:

The start position in the sequence region, or None if the feature has no attached slice.

property seq_region_strand: Strand | None#

Public accessor for the _seq_region_strand.

Returns:

The strand in the sequence region, or None if the feature has no attached slice.

slice: Slice | None#
start: int#
strand: Strand#
transfer(_genomic_slice)[source]#

Transfers the feature to a new slice.

Parameters:

_genomic_slice (Slice) – The slice to transfer to. If None, uses current slice.

Return type:

Feature | None

Returns:

The transferred feature or None if transfer is not possible.

transform(coord_system)[source]#

Transforms the feature to a new coordinate system.

Parameters:

coord_system (CoordSystem) – The coordinate system to transform to.

Return type:

Feature | None

Returns:

The transformed feature or None if transformation is not possible.