mavis.annotate.genomic
class mavis.annotate.genomic.Template
inherits BioInterval
class mavis.annotate.genomic.IntergenicRegion
inherits BioInterval
mavis.annotate.genomic.IntergenicRegion.key()
see :func:structural_variant.annotate.base.BioInterval.key
def key(self):
mavis.annotate.genomic.IntergenicRegion.chr()
returns the name of the chromosome that this region resides on
@property
def chr(self):
Args
- self
mavis.annotate.genomic.IntergenicRegion.to_dict()
see :func:structural_variant.annotate.base.BioInterval.to_dict
def to_dict(self):
class mavis.annotate.genomic.Gene
inherits BioInterval
mavis.annotate.genomic.Gene.transcript_priority()
prioritizes transcripts from 0 to n-1 based on best transcript flag and then alphanumeric name sort
def transcript_priority(self, transcript):
Args
- transcript
Warning
Lower number means higher priority. This is to make sort work by default
mavis.annotate.genomic.Gene.transcripts()
List[PreTranscript] list of unspliced transcripts
@property
def transcripts(self):
Args
- self
mavis.annotate.genomic.Gene.translations()
List[mavis.annotate.protein.Translation] list of translations
@property
def translations(self):
Args
- self
mavis.annotate.genomic.Gene.chr()
returns the name of the chromosome that this gene resides on
@property
def chr(self):
Args
- self
mavis.annotate.genomic.Gene.key()
see :func:structural_variant.annotate.base.BioInterval.key
def key(self):
mavis.annotate.genomic.Gene.get_seq()
gene sequence is always given wrt to the positive forward strand regardless of gene strand
def get_seq(self, reference_genome, ignore_cache=False):
Args
- reference_genome (
Dict[str,Bio.SeqRecord]
): dict of reference sequence by - ignore_cache (
bool
): if True then stored sequences will be ignored and the function will attempt to retrieve the sequence using the positions and the input reference_genome
Returns
str
: the sequence of the gene
mavis.annotate.genomic.Gene.spliced_transcripts()
List[Transcript]: list of transcripts
@property
def spliced_transcripts(self):
Args
- self
mavis.annotate.genomic.Gene.to_dict()
see :func:structural_variant.annotate.base.BioInterval.to_dict
def to_dict(self):
class mavis.annotate.genomic.Exon
inherits BioInterval
mavis.annotate.genomic.Exon.transcript()
PreTranscript: the transcript this exon belongs to
@property
def transcript(self):
Args
- self
mavis.annotate.genomic.Exon.donor_splice_site()
mavis.interval.Interval: the genomic range describing the splice site
@property
def donor_splice_site(self):
Args
- self
mavis.annotate.genomic.Exon.acceptor_splice_site()
mavis.interval.Interval: the genomic range describing the splice site
@property
def acceptor_splice_site(self):
Args
- self
mavis.annotate.genomic.Exon.donor()
int
: returns the genomic exonic position of the donor splice site
@property
def donor(self):
Args
- self
mavis.annotate.genomic.Exon.acceptor()
int
: returns the genomic exonic position of the acceptor splice site
@property
def acceptor(self):
Args
- self
class mavis.annotate.genomic.PreTranscript
inherits BioInterval
mavis.annotate.genomic.PreTranscript.__init__()
creates a new transcript object
def __init__(
self,
exons,
gene=None,
name=None,
strand=None,
spliced_transcripts=None,
seq=None,
is_best_transcript=False,
):
Args
- exons (
List[Exon]
): list of Exon that make up the transcript - gene (
Gene
): the gene this transcript belongs to - name (
str
): name of the transcript - strand (
STRAND
): strand the transcript is on, defaults to the strand of the Gene if not specified - spliced_transcripts
- seq (
str
): unspliced cDNA seq - is_best_transcript
mavis.annotate.genomic.PreTranscript.generate_splicing_patterns()
returns a list of splice sites to be connected as a splicing pattern
def generate_splicing_patterns(self):
Returns
List[SplicingPattern]
: List of positions to be spliced together
mavis.annotate.genomic.PreTranscript.gene()
Gene: the gene this transcript belongs to
@property
def gene(self):
Args
- self
mavis.annotate.genomic.PreTranscript.convert_genomic_to_nearest_cdna()
converts a genomic position to its cdna equivalent or (if intronic) the nearest cdna and shift
def convert_genomic_to_nearest_cdna(
self, pos, splicing_pattern, stick_direction=None, allow_outside=True
):
Args
- pos (
int
): the genomic position - splicing_pattern (
SplicingPattern
): the splicing pattern - stick_direction
- allow_outside
Returns
Tuple[int,int]
: the exonic cdna position and the intronic shift
mavis.annotate.genomic.PreTranscript.exon_number()
exon numbering is based on the direction of translation
def exon_number(self, exon):
Args
- exon (
Exon
): the exon to be numbered
Returns
int
: the exon number (1 based)
Raises
AttributeError
: if the strand is not given or the exon does not belong to the transcript
mavis.annotate.genomic.PreTranscript.translations()
List[mavis.annotate.protein.Translation]: list of translations associated with this transcript
@property
def translations(self):
Args
- self
mavis.annotate.genomic.PreTranscript.transcripts()
List[Transcript]: list of spliced transcripts
@property
def transcripts(self):
Args
- self
class mavis.annotate.genomic.Transcript
inherits BioInterval
mavis.annotate.genomic.Transcript.__init__()
splicing pattern is given in genomic coordinates
def __init__(self, pre_transcript, splicing_patt, seq=None, translations=None):
Args
- pre_transcript (
PreTranscript
): the unspliced transcript - splicing_patt (
List[int]
): the list of splicing positions - seq (
str
): the cdna sequence
mavis.annotate.genomic.Transcript.unspliced_transcript()
PreTranscript: the unspliced transcript this splice variant belongs to
@property
def unspliced_transcript(self):
Args
- self