def _check_regulate_activity(self, stmt): """Check a RegulateActivity statement.""" logger.info('Checking stmt: %s' % stmt) # FIXME Currently this will match rules with the corresponding monomer # pattern from the Activation/Inhibition statement, which will nearly # always have no state conditions on it. In future, this statement foo # should also match rules in which 1) the agent is in its active form, # or 2) the agent is tagged as the enzyme in a rule of the appropriate # activity (e.g., a phosphorylation rule) FIXME subj_mp = pa.get_monomer_pattern(self.model, stmt.subj) target_polarity = 1 if stmt.is_activation else -1 # This may fail, since there may be no rule in the model activating the # object, and the object may not have an "active" site of the # appropriate type obj_obs_name = pa.get_agent_rule_str(stmt.obj) + '_obs' try: obj_site_pattern = pa.get_site_pattern(stmt.obj) obj_site_pattern.update({stmt.obj_activity: 'active'}) obj_monomer = self.model.monomers[stmt.obj.name] obj_mp = obj_monomer(**obj_site_pattern) except Exception as e: logger.info("Could not create obj monomer pattern: %s" % e) return False obj_obs = Observable(obj_obs_name, obj_mp, _export=False) return self._find_im_paths(subj_mp, obj_obs, target_polarity)
def _check_regulate_amount(self, stmt, max_paths, max_path_length): """Check a RegulateAmount statement.""" logger.info('Checking stmt: %s' % stmt) subj_mp = pa.get_monomer_pattern(self.model, stmt.subj) target_polarity = 1 if isinstance(stmt, IncreaseAmount) else -1 obs_names = self.stmt_to_obs[stmt] for obs_name in obs_names: return self._find_im_paths(subj_mp, obs_name, target_polarity, max_paths, max_path_length)
def _check_regulate_activity(self, stmt, max_paths, max_path_length): """Check a RegulateActivity statement.""" logger.info('Checking stmt: %s' % stmt) # FIXME Currently this will match rules with the corresponding monomer # pattern from the Activation/Inhibition statement, which will nearly # always have no state conditions on it. In future, this statement foo # should also match rules in which 1) the agent is in its active form, # or 2) the agent is tagged as the enzyme in a rule of the appropriate # activity (e.g., a phosphorylation rule) FIXME subj_mp = pa.get_monomer_pattern(self.model, stmt.subj) target_polarity = 1 if stmt.is_activation else -1 # This may fail, since there may be no rule in the model activating the # object, and the object may not have an "active" site of the # appropriate type obs_names = self.stmt_to_obs[stmt] for obs_name in obs_names: return self._find_im_paths(subj_mp, obs_name, target_polarity, max_paths, max_path_length)