ensembl.vep.sources.file.gtf package#

GTF file-backed feature sources.

Submodules#

ensembl.vep.sources.file.gtf.transcript module#

GTF-backed transcript feature source.

class ensembl.vep.sources.file.gtf.transcript.GTFTranscriptSource(*, sequence_source=None, slice_cache=WeakSliceCache(), file_path, reference_region_resolver=None, source_region_resolver=None, transcript_pool=None)[source]#

Bases: GXFTranscriptSource[GTFParser]

Transcript source backed by a GTF file.

Variables:
  • adaptor – The parser adaptor used to stream GTF records.

  • _PARENTS – Mapping of feature types to their parent feature types.

adaptor: GTFParser#
coding_feature_types: ClassVar[frozenset[str]] = frozenset({'cds', 'stop_codon'})#
get_parent_ids(record)[source]#

Return the GTF parent identifiers for a record, if any exist.

Parameters:

record (GTFRecord) – The record to inspect.

Returns:

A tuple of parent identifiers, or an empty tuple when the record has no parent feature.

Return type:

tuple[str, ...]

get_record_id(record)[source]#

Return the GTF record identifier for a record.

GTF stores identifiers in attributes named after the feature type, such as gene_id, transcript_id, or exon_id.

Parameters:

record (GTFRecord) – The record to inspect.

Returns:

The feature-specific identifier.

Return type:

str

transcript_feature_types: ClassVar[frozenset[str]] = frozenset({'transcript'})#