-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgene.py
42 lines (37 loc) · 1.49 KB
/
gene.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env python3
class Gene:
def __init__(self,FeatureLine,id_):
#Starts a gene object
fl=FeatureLine.get()
#This dictionary of futile change this to variables instead. Or is it better to store this way.
self.gene=dict([["name",str(fl["attribute"]["ID"])+" | "+str(fl["attribute"]["product"])], #GFF
["start",int(fl["start"])], #GFF
["end",int(fl["end"])], #GFF
["exons",[]], #GFF
["introns",[]], #GFF
["cds",[]], #GFF
["start_codon",[]], #GFF
["stop_codon",[]], #GFF
["score",fl["score"]], #GFF
["frame",fl["frame"]], #GFF
["strand",fl["strand"]], #GFF
["id",id_], #NODE - The unique node id - For gephi
["upstream",None], #EDGE - The upstream gene object neighbour
["downstream", None], #EDGE - The downstream gene object neighbour
["hasPrecursor",[]], #EDGE - The precursor object
["targeted",[]], #EDGE - The miRNAs that target it
["acc",None], #This is the EST accession
["product",fl["attribute"]["product"]] #Extracted from Attribute in featureline
])
self.name=self.gene["name"]
self.start=self.gene["start"]
self.end=self.gene["end"]
self.targeted=self.gene["targeted"]
def get(self):
return self.gene
def addExon(self,featureLine):
name=""
class Exon:
#Not implemented
def __init__(self,featureLine):
name=""