def get_mrna_dict(model): mrna_dict = dict() # Generate a mRNA dict for x in nt_sequences.index: try: the_gene = model.genes.get_by_id(x) except KeyError: model.genes += [cobra.Gene(id=x)] the_gene = model.genes.get_by_id(x) # Try to get half life from Bernstein et al. try: t_half = bernstein_ecoli_deg_rates.loc[x.upper()]['medium, min.1'] #M9 medium # Mean half life of mrna is 5 minutes in ecoli # tau = t_0.5 /ln(2) # kdeg = 1/tau [min^-1] * [min/h] this_kdeg_mrna = (60 * np.log(2) / t_half) except KeyError: if x in rrna_genes: this_kdeg_mrna = kdeg_rib # Same as ribosome else: this_kdeg_mrna = kdeg_mrna # Average value of 5 mins if np.isnan(this_kdeg_mrna): this_kdeg_mrna = kdeg_mrna # Average value of 5 mins new_mrna = mRNA(x, kdeg = this_kdeg_mrna, gene_id = the_gene.id) mrna_dict[x] = new_mrna return mrna_dict
new_enzyme.notes['EC'] = this_ec aggregated_coupling_dict[x.id].append(new_enzyme) # 1/0 coupling_dict.update(aggregated_coupling_dict) mrna_dict = dict() # Generate a mRNA dict for x in nt_sequences.index: try: the_gene = ecoli.genes.get_by_id(x) except KeyError: ecoli.add_genes([cobra.Gene(id=x)]) the_gene = ecoli.genes.get_by_id(x) # Try to get half life from Bernstein et al. try: t_half = bernstein_ecoli_deg_rates.loc[x.upper()]['medium, min.1'] #M9 medium # Mean half life of mrna is 5 minutes in ecoli # tau = t_0.5 /ln(2) # kdeg = 1-exp(1hr/tau) this_kdeg_mrna = 1 - np.exp(-60 * np.log(2) / t_half) except KeyError: this_kdeg_mrna = kdeg_mrna # Average value of 5 mins if np.isnan(this_kdeg_mrna): this_kdeg_mrna = kdeg_mrna # Average value of 5 mins