Commit 7f2f7acd authored by VIGNET Pierre's avatar VIGNET Pierre
Browse files

Rewrite proper method to get genes in a model (based on the names of entities...)

parent 4cad9121
......@@ -124,15 +124,16 @@ class StaticAnalyzer(object):
def get_gene_places(self):
"""Return gene places
.. note:: We assume that places representing a gene contain
the '_gene' string in the name
:return: List of places.
:rtype: <list <place>>
We assume that all places representing a gene contain the 'gene' string in the name
lpname = []
node_dict = self.model.node_dict
for pname in node_dict.keys():
if string.find(pname, 'gene') > 0:
return lpname
return [place for pname, place in self.model.node_dict.iteritems()
if '_gene' in pname]
def get_statistics(self, sfile=False):
......@@ -155,7 +156,7 @@ class StaticAnalyzer(object):
locations = (
'_gene', '_transMb', '_nucl', '_intToMb', '_cy', '_plasmaMb',
'_exCellRegion', '_ccJct', '_en', '_siteofdouble_strandbreak',
'_membraneraft', 'other',
'_membraneraft', '_rna', 'other',
# Init counter of locations
location_dict = OrderedDict({location: 0 for location in locations})
......@@ -294,18 +295,16 @@ class StaticAnalyzer(object):
Basal activated genes are genes which are activated even if all the places present
in activation condition, are inactivate
node_dict = self.model.node_dict
tvi = TableVisitor(self.reporter)
lg_n = self.get_gene_places()
lgene = []
for gen in lg_n:
lgene = self.get_gene_places()
lbag = []
for gep in lgene:
# If different: maybe the place is not a gene but contains _gene
# in its name...
if len(gep.outgoing_trans) != 1:
pe_visitor = EstimExpVisitor(None) # all variables set to False
trans = gep.outgoing_trans[0] # assume only one transition
trans_val = self.__tr_estim(trans, pe_visitor, tvi.tab_symb)
if trans_val == 1:
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment