base module

class mavis.annotate.base.BioInterval(reference_object, start, end=None, name=None, seq=None, data=None, strand=None)[source]

Bases: object

Parameters:
  • reference_object – the object this interval is on
  • start (int) start of the interval (inclusive) –
  • end (int) – end of the interval (inclusive)
  • name – optional
  • seq (str) – the seq relating to this interval

Example

>>> b = BioInterval('1', 12572784, 12578898, 'q22.2')
>>> b[0]
12572784
>>> b[1]
12578898
__len__()[source]

Example

>>> b = BioInterval('1', 12572784, 12578898, 'q22.2')
>>> len(b)
6115
end

int – the end position

get_chr()[source]

pulls chromosome information from the current object, or follows reference objects until the chromosome is found

Returns:the chromosome of this or any of its reference objects
Return type:str
Raises:AttributeError – raised if the chromosome is not set on this or any of its reference objects
get_seq(reference_genome=None, ignore_cache=False)[source]

get the sequence for the current annotation object

Raises:NotImplementedError – abstract method
get_strand()[source]

pulls strand information from the current object, or follows reference objects until the strand is found

Returns:the strand of this or any of its reference objects
Return type:STRAND
Raises:AttributeError – raised if the strand is not set on this or any of its reference objects
is_reverse

True if the gene is on the reverse/negative strand.

Raises:AttributeError – if the strand is not specified
key()[source]

tuple: a tuple representing the items expected to be unique. for hashing and comparing

start

int – the start position

to_dict()[source]

creates a dictionary representing the current object

Returns:the dictionary of attribute values
Return type:dict by str
class mavis.annotate.base.ReferenceName[source]

Bases: str

Class for reference sequence names. Ensures that hg19/hg38 chromosome names match.

Example

>>> ReferenceName('chr1') == ReferenceName('1')
True