def create_mat_dict(model):
rxns = model.reactions<EOL>mets = model.metabolites<EOL>mat = OrderedDict()<EOL>mat["<STR_LIT>"] = _cell([met_id for met_id in create_mat_metabolite_id(model)])<EOL>mat["<STR_LIT>"] = _cell(mets.list_attr("<STR_LIT:name>"))<EOL>mat["<STR_LIT>"] = _cell([str(m.formula) for m in mets])<EOL>try:<EOL><INDENT>mat["<STR_LIT>"] = array(mets.list_attr("<STR_LIT>")) * <NUM_LIT:1.><EOL><DEDENT>except TypeError:<EOL><INDENT>pass<EOL><DEDENT>mat["<STR_LIT>"] = _cell(model.genes.list_attr("<STR_LIT:id>"))<EOL>rxn_gene = scipy_sparse.dok_matrix((len(model.reactions),<EOL>len(model.genes)))<EOL>if min(rxn_gene.shape) > <NUM_LIT:0>:<EOL><INDENT>for i, reaction in enumerate(model.reactions):<EOL><INDENT>for gene in reaction.genes:<EOL><INDENT>rxn_gene[i, model.genes.index(gene)] = <NUM_LIT:1><EOL><DEDENT><DEDENT>mat["<STR_LIT>"] = rxn_gene<EOL><DEDENT>mat["<STR_LIT>"] = _cell(rxns.list_attr("<STR_LIT>"))<EOL>mat["<STR_LIT>"] = _cell(rxns.list_attr("<STR_LIT:id>"))<EOL>mat["<STR_LIT>"] = _cell(rxns.list_attr("<STR_LIT:name>"))<EOL>mat["<STR_LIT>"] = _cell(rxns.list_attr("<STR_LIT>"))<EOL>stoich_mat = create_stoichiometric_matrix(model)<EOL>mat["<STR_LIT:S>"] = stoich_mat if stoich_mat is not None else [[]]<EOL>mat["<STR_LIT>"] = array(rxns.list_attr("<STR_LIT>")) * <NUM_LIT:1.><EOL>mat["<STR_LIT>"] = array(rxns.list_attr("<STR_LIT>")) * <NUM_LIT:1.><EOL>mat["<STR_LIT:b>"] = array(mets.list_attr("<STR_LIT>")) * <NUM_LIT:1.><EOL>mat["<STR_LIT:c>"] = array(rxns.list_attr("<STR_LIT>")) * <NUM_LIT:1.><EOL>mat["<STR_LIT>"] = array(rxns.list_attr("<STR_LIT>")) * <NUM_LIT:1><EOL>mat["<STR_LIT:description>"] = str(model.id)<EOL>return mat<EOL>
create a dict mapping model attributes to arrays