def run(self):
<EOL>def compound_name(id):<EOL><INDENT>if id not in self._model.compounds:<EOL><INDENT>return id<EOL><DEDENT>return self._model.compounds[id].properties.get('<STR_LIT:name>', id)<EOL><DEDENT>def reaction_genes_string(id):<EOL><INDENT>if id not in self._model.reactions:<EOL><INDENT>return '<STR_LIT>'<EOL><DEDENT>return self._model.reactions[id].properties.get('<STR_LIT>', '<STR_LIT>')<EOL><DEDENT>reaction = self._get_objective()<EOL>if not self._mm.has_reaction(reaction):<EOL><INDENT>self.fail(<EOL>'<STR_LIT>'.format(reaction))<EOL><DEDENT>loop_removal = self._get_loop_removal_option()<EOL>if loop_removal == '<STR_LIT:none>':<EOL><INDENT>result = self.run_fba(reaction)<EOL><DEDENT>elif loop_removal == '<STR_LIT>':<EOL><INDENT>result = self.run_fba_minimized(reaction)<EOL><DEDENT>elif loop_removal == '<STR_LIT>':<EOL><INDENT>result = self.run_tfba(reaction)<EOL><DEDENT>optimum = None<EOL>total_reactions = <NUM_LIT:0><EOL>nonzero_reactions = <NUM_LIT:0><EOL>for reaction_id, flux in sorted(result):<EOL><INDENT>total_reactions += <NUM_LIT:1><EOL>if abs(flux) > self._args.epsilon:<EOL><INDENT>nonzero_reactions += <NUM_LIT:1><EOL><DEDENT>if abs(flux) > self._args.epsilon or self._args.all_reactions:<EOL><INDENT>rx = self._mm.get_reaction(reaction_id)<EOL>rx_trans = rx.translated_compounds(compound_name)<EOL>genes = reaction_genes_string(reaction_id)<EOL>print('<STR_LIT>'.format(<EOL>reaction_id, flux, rx_trans, genes))<EOL><DEDENT>if reaction_id == reaction:<EOL><INDENT>optimum = flux<EOL><DEDENT><DEDENT>logger.info('<STR_LIT>'.format(optimum))<EOL>logger.info('<STR_LIT>'.format(<EOL>total_reactions - nonzero_reactions, total_reactions))<EOL>
Run flux analysis command.