Fri Oct 19 15:24:36 2018: Whole Cell E. coli simulation at /home/ggsun/Projects/wcEcoli/out/manual {'Arguments': {'d_period_division': False, 'generations': 1, 'growth_rate_noise': False, 'length_sec': 10800, 'mass_distribution': True, 'seed': 0, 'sim_dir': None, 'sim_path': '/home/ggsun/Projects/wcEcoli/out/manual', 'timestep_max': 0.9, 'timestep_safety_frac': 1.3, 'timestep_update_freq': 5, 'translation_supply': True, 'trna_charging': False, 'variant': ['wildtype', '0', '0'], 'verbose': False}} Fri Oct 19 15:24:36 2018: Creating sim_data for Variant: wildtype, Index: 0 Variant short name: wildtype Fri Oct 19 15:24:37 2018: Running simulation Time (s) Dry mass Dry mass Protein RNA Small mol Expected (fg) fold change fold change fold change fold change fold change ======== ======== =========== =========== =========== =========== =========== 0.00 402.98 1.000 1.000 1.000 1.000 1.000 Timer unit: 1e-06 s Total time: 0.003418 s File: /home/ggsun/Projects/wcEcoli/models/ecoli/processes/rna_degradation.py Function: calculateRequest at line 150 Line # Hits Time Per Hit % Time Line Contents ============================================================== 150 @line_profile 151 def calculateRequest(self): 152 153 # Compute factor that convert counts into concentration, and vice versa 154 1 109.0 109.0 3.2 cell_mass = self.readFromListener("Mass", "cellMass") * units.fg 155 1 23.0 23.0 0.7 cell_volume = cell_mass / self.cellDensity 156 1 38.0 38.0 1.1 countsToMolar = 1 / (self.nAvogadro * cell_volume) 157 158 # Get total counts of RNAs including rRNAs and charged tRNAs 159 1 17.0 17.0 0.5 rna_counts = self.rnas.total().copy() 160 1 16.0 16.0 0.5 rna_counts[self.rrsaIdx] += self.ribosome30S.total() 161 1 23.0 23.0 0.7 rna_counts[[self.rrlaIdx, self.rrfaIdx]] += self.ribosome50S.total() 162 1 8.0 8.0 0.2 rna_counts[[self.rrlaIdx, self.rrfaIdx, self.rrsaIdx]] += self.activeRibosomes.total() 163 1 204.0 204.0 6.0 rna_counts[self.isTRna] += self.charged_trna.total() 164 165 # Get counts of endoRNases 166 1 6.0 6.0 0.2 endornase_counts = self.endoRnases.total().copy() 167 1 125.0 125.0 3.7 total_kcat_endornase = units.dot(self.KcatEndoRNases, endornase_counts) 168 169 # Calculate the fraction of active endoRNases for each RNA based on 170 # Michaelis-Menten kinetics 171 1 2.0 2.0 0.1 if self.EndoRNaseCoop: 172 frac_endornase_saturated = ( 173 1 56.0 56.0 1.6 countsToMolar * rna_counts / self.Km / ( 174 1 554.0 554.0 16.2 1 + units.sum((countsToMolar * rna_counts) / self.Km)) 175 ).asNumber() 176 else: 177 frac_endornase_saturated = ( 178 countsToMolar * rna_counts / (self.Km + ( 179 countsToMolar * rna_counts)) 180 ).asNumber() 181 182 # Calculate difference in degradation rates from first-order decay 183 # and the number of EndoRNases per one molecule of RNA 184 1 17.0 17.0 0.5 total_endornase_counts = np.sum(endornase_counts) 185 1 1.0 1.0 0.0 diff_relative_first_order_decay = units.sum( 186 1 31.0 31.0 0.9 units.abs(self.rnaDegRates * rna_counts - 187 1 160.0 160.0 4.7 total_kcat_endornase * frac_endornase_saturated) 188 ) 189 1 18.0 18.0 0.5 endornase_per_rna = total_endornase_counts.astype(np.float) / np.sum(rna_counts) 190 191 1 2.0 2.0 0.1 self.writeToListener("RnaDegradationListener", 192 1 1.0 1.0 0.0 "FractionActiveEndoRNases", 193 1 41.0 41.0 1.2 np.sum(frac_endornase_saturated) 194 ) 195 1 1.0 1.0 0.0 self.writeToListener("RnaDegradationListener", 196 1 2.0 2.0 0.1 "DiffRelativeFirstOrderDecay", 197 1 30.0 30.0 0.9 diff_relative_first_order_decay.asNumber() 198 ) 199 1 2.0 2.0 0.1 self.writeToListener( 200 1 1.0 1.0 0.0 "RnaDegradationListener", 201 1 1.0 1.0 0.0 "FractEndoRRnaCounts", 202 1 8.0 8.0 0.2 endornase_per_rna) 203 204 1 1.0 1.0 0.0 if self.EndoRNaseFunc: 205 # Dissect RNAse specificity into mRNA, tRNA, and rRNA 206 1 127.0 127.0 3.7 mrna_specificity = np.dot(frac_endornase_saturated, self.isMRna) 207 1 72.0 72.0 2.1 trna_specificity = np.dot(frac_endornase_saturated, self.isTRna) 208 1 40.0 40.0 1.2 rrna_specificity = np.dot(frac_endornase_saturated, self.isRRna) 209 210 1 3.0 3.0 0.1 n_total_mrnas_to_degrade = self._calculate_total_n_to_degrade( 211 1 2.0 2.0 0.1 mrna_specificity, 212 1 186.0 186.0 5.4 total_kcat_endornase 213 ) 214 1 2.0 2.0 0.1 n_total_trnas_to_degrade = self._calculate_total_n_to_degrade( 215 1 2.0 2.0 0.1 trna_specificity, 216 1 114.0 114.0 3.3 total_kcat_endornase 217 ) 218 1 2.0 2.0 0.1 n_total_rrnas_to_degrade = self._calculate_total_n_to_degrade( 219 1 2.0 2.0 0.1 rrna_specificity, 220 1 102.0 102.0 3.0 total_kcat_endornase 221 ) 222 223 # Compute RNAse specificity 224 1 39.0 39.0 1.1 rna_specificity = frac_endornase_saturated / np.sum(frac_endornase_saturated) 225 226 # Boolean variable that tracks existence of each RNA 227 1 12.0 12.0 0.4 rna_exists = rna_counts.astype(np.bool) 228 229 # Compute degradation probabilities of each RNA: for mRNAs, this 230 # is based on the specificity of each mRNA. For tRNAs and rRNAs, 231 # this is distributed evenly. 232 1 254.0 254.0 7.4 mrna_deg_probs = 1. / np.dot(rna_specificity, self.isMRna * rna_exists) * rna_specificity * self.isMRna * rna_exists 233 1 164.0 164.0 4.8 trna_deg_probs = 1. / np.sum(self.isTRna * rna_exists) * self.isTRna * rna_exists 234 1 153.0 153.0 4.5 rrna_deg_probs = 1. / np.sum(self.isRRna * rna_exists) * self.isRRna * rna_exists 235 236 # Mask RNA counts into each class of RNAs 237 1 51.0 51.0 1.5 mrna_counts = rna_counts * self.isMRna 238 1 50.0 50.0 1.5 trna_counts = rna_counts * self.isTRna 239 1 48.0 48.0 1.4 rrna_counts = rna_counts * self.isRRna 240 241 # Determine number of individual RNAs to be degraded for each class 242 # of RNA. 243 1 4.0 4.0 0.1 n_mrnas_to_degrade = self._get_rnas_to_degrade( 244 1 325.0 325.0 9.5 n_total_mrnas_to_degrade, mrna_deg_probs, mrna_counts 245 ) 246 247 1 2.0 2.0 0.1 n_trnas_to_degrade = self._get_rnas_to_degrade( 248 1 38.0 38.0 1.1 n_total_trnas_to_degrade, trna_deg_probs, trna_counts 249 ) 250 251 1 2.0 2.0 0.1 n_rrnas_to_degrade = self._get_rnas_to_degrade( 252 1 30.0 30.0 0.9 n_total_rrnas_to_degrade, rrna_deg_probs, rrna_counts 253 ) 254 255 1 13.0 13.0 0.4 n_rnas_to_degrade = n_mrnas_to_degrade + n_trnas_to_degrade + n_rrnas_to_degrade 256 257 # First order decay with non-functional EndoRNase activity 258 # Determine mRNAs to be degraded by sampling a Poisson distribution 259 # (Kdeg * RNA) 260 else: 261 n_rnas_to_degrade = np.fmin( 262 self.randomState.poisson( 263 (self.rnaDegRates * rna_counts).asNumber() 264 ), 265 self.rnas.total() 266 ) 267 268 1 25.0 25.0 0.7 self.rnas.requestIs(n_rnas_to_degrade) 269 1 7.0 7.0 0.2 self.endoRnases.requestAll() 270 1 6.0 6.0 0.2 self.exoRnases.requestAll() 271 1 6.0 6.0 0.2 self.fragmentBases.requestAll() 272 273 # Calculate the amount of water required for total RNA hydrolysis by 274 # endo and exonucleases. Assuming complete hydrolysis for now. Note 275 # that one additional water molecule is needed for each RNA to 276 # hydrolyze the 5' diphosphate. 277 1 19.0 19.0 0.6 waterForNewRnas = np.dot(n_rnas_to_degrade, self.rna_lengths) 278 1 11.0 11.0 0.3 waterForLeftOverFragments = self.fragmentBases.total().sum() 279 1 7.0 7.0 0.2 self.h2o.requestIs(waterForNewRnas + waterForLeftOverFragments) 0.20 403.07 1.000 1.000 1.000 1.000 1.000 Timer unit: 1e-06 s Total time: 0.00211 s File: /home/ggsun/Projects/wcEcoli/models/ecoli/processes/rna_degradation.py Function: calculateRequest at line 150 Line # Hits Time Per Hit % Time Line Contents ============================================================== 150 @line_profile 151 def calculateRequest(self): 152 153 # Compute factor that convert counts into concentration, and vice versa 154 1 68.0 68.0 3.2 cell_mass = self.readFromListener("Mass", "cellMass") * units.fg 155 1 15.0 15.0 0.7 cell_volume = cell_mass / self.cellDensity 156 1 29.0 29.0 1.4 countsToMolar = 1 / (self.nAvogadro * cell_volume) 157 158 # Get total counts of RNAs including rRNAs and charged tRNAs 159 1 12.0 12.0 0.6 rna_counts = self.rnas.total().copy() 160 1 10.0 10.0 0.5 rna_counts[self.rrsaIdx] += self.ribosome30S.total() 161 1 15.0 15.0 0.7 rna_counts[[self.rrlaIdx, self.rrfaIdx]] += self.ribosome50S.total() 162 1 8.0 8.0 0.4 rna_counts[[self.rrlaIdx, self.rrfaIdx, self.rrsaIdx]] += self.activeRibosomes.total() 163 1 154.0 154.0 7.3 rna_counts[self.isTRna] += self.charged_trna.total() 164 165 # Get counts of endoRNases 166 1 4.0 4.0 0.2 endornase_counts = self.endoRnases.total().copy() 167 1 74.0 74.0 3.5 total_kcat_endornase = units.dot(self.KcatEndoRNases, endornase_counts) 168 169 # Calculate the fraction of active endoRNases for each RNA based on 170 # Michaelis-Menten kinetics 171 1 1.0 1.0 0.0 if self.EndoRNaseCoop: 172 frac_endornase_saturated = ( 173 1 49.0 49.0 2.3 countsToMolar * rna_counts / self.Km / ( 174 1 443.0 443.0 21.0 1 + units.sum((countsToMolar * rna_counts) / self.Km)) 175 ).asNumber() 176 else: 177 frac_endornase_saturated = ( 178 countsToMolar * rna_counts / (self.Km + ( 179 countsToMolar * rna_counts)) 180 ).asNumber() 181 182 # Calculate difference in degradation rates from first-order decay 183 # and the number of EndoRNases per one molecule of RNA 184 1 10.0 10.0 0.5 total_endornase_counts = np.sum(endornase_counts) 185 1 1.0 1.0 0.0 diff_relative_first_order_decay = units.sum( 186 1 24.0 24.0 1.1 units.abs(self.rnaDegRates * rna_counts - 187 1 124.0 124.0 5.9 total_kcat_endornase * frac_endornase_saturated) 188 ) 189 1 16.0 16.0 0.8 endornase_per_rna = total_endornase_counts.astype(np.float) / np.sum(rna_counts) 190 191 1 2.0 2.0 0.1 self.writeToListener("RnaDegradationListener", 192 1 1.0 1.0 0.0 "FractionActiveEndoRNases", 193 1 27.0 27.0 1.3 np.sum(frac_endornase_saturated) 194 ) 195 1 1.0 1.0 0.0 self.writeToListener("RnaDegradationListener", 196 1 2.0 2.0 0.1 "DiffRelativeFirstOrderDecay", 197 1 24.0 24.0 1.1 diff_relative_first_order_decay.asNumber() 198 ) 199 1 1.0 1.0 0.0 self.writeToListener( 200 1 1.0 1.0 0.0 "RnaDegradationListener", 201 1 1.0 1.0 0.0 "FractEndoRRnaCounts", 202 1 8.0 8.0 0.4 endornase_per_rna) 203 204 1 2.0 2.0 0.1 if self.EndoRNaseFunc: 205 # Dissect RNAse specificity into mRNA, tRNA, and rRNA 206 1 76.0 76.0 3.6 mrna_specificity = np.dot(frac_endornase_saturated, self.isMRna) 207 1 32.0 32.0 1.5 trna_specificity = np.dot(frac_endornase_saturated, self.isTRna) 208 1 23.0 23.0 1.1 rrna_specificity = np.dot(frac_endornase_saturated, self.isRRna) 209 210 1 1.0 1.0 0.0 n_total_mrnas_to_degrade = self._calculate_total_n_to_degrade( 211 1 1.0 1.0 0.0 mrna_specificity, 212 1 87.0 87.0 4.1 total_kcat_endornase 213 ) 214 1 1.0 1.0 0.0 n_total_trnas_to_degrade = self._calculate_total_n_to_degrade( 215 1 1.0 1.0 0.0 trna_specificity, 216 1 62.0 62.0 2.9 total_kcat_endornase 217 ) 218 1 1.0 1.0 0.0 n_total_rrnas_to_degrade = self._calculate_total_n_to_degrade( 219 1 1.0 1.0 0.0 rrna_specificity, 220 1 59.0 59.0 2.8 total_kcat_endornase 221 ) 222 223 # Compute RNAse specificity 224 1 20.0 20.0 0.9 rna_specificity = frac_endornase_saturated / np.sum(frac_endornase_saturated) 225 226 # Boolean variable that tracks existence of each RNA 227 1 7.0 7.0 0.3 rna_exists = rna_counts.astype(np.bool) 228 229 # Compute degradation probabilities of each RNA: for mRNAs, this 230 # is based on the specificity of each mRNA. For tRNAs and rRNAs, 231 # this is distributed evenly. 232 1 110.0 110.0 5.2 mrna_deg_probs = 1. / np.dot(rna_specificity, self.isMRna * rna_exists) * rna_specificity * self.isMRna * rna_exists 233 1 78.0 78.0 3.7 trna_deg_probs = 1. / np.sum(self.isTRna * rna_exists) * self.isTRna * rna_exists 234 1 74.0 74.0 3.5 rrna_deg_probs = 1. / np.sum(self.isRRna * rna_exists) * self.isRRna * rna_exists 235 236 # Mask RNA counts into each class of RNAs 237 1 24.0 24.0 1.1 mrna_counts = rna_counts * self.isMRna 238 1 23.0 23.0 1.1 trna_counts = rna_counts * self.isTRna 239 1 24.0 24.0 1.1 rrna_counts = rna_counts * self.isRRna 240 241 # Determine number of individual RNAs to be degraded for each class 242 # of RNA. 243 1 2.0 2.0 0.1 n_mrnas_to_degrade = self._get_rnas_to_degrade( 244 1 164.0 164.0 7.8 n_total_mrnas_to_degrade, mrna_deg_probs, mrna_counts 245 ) 246 247 1 2.0 2.0 0.1 n_trnas_to_degrade = self._get_rnas_to_degrade( 248 1 25.0 25.0 1.2 n_total_trnas_to_degrade, trna_deg_probs, trna_counts 249 ) 250 251 1 2.0 2.0 0.1 n_rrnas_to_degrade = self._get_rnas_to_degrade( 252 1 23.0 23.0 1.1 n_total_rrnas_to_degrade, rrna_deg_probs, rrna_counts 253 ) 254 255 1 8.0 8.0 0.4 n_rnas_to_degrade = n_mrnas_to_degrade + n_trnas_to_degrade + n_rrnas_to_degrade 256 257 # First order decay with non-functional EndoRNase activity 258 # Determine mRNAs to be degraded by sampling a Poisson distribution 259 # (Kdeg * RNA) 260 else: 261 n_rnas_to_degrade = np.fmin( 262 self.randomState.poisson( 263 (self.rnaDegRates * rna_counts).asNumber() 264 ), 265 self.rnas.total() 266 ) 267 268 1 9.0 9.0 0.4 self.rnas.requestIs(n_rnas_to_degrade) 269 1 4.0 4.0 0.2 self.endoRnases.requestAll() 270 1 3.0 3.0 0.1 self.exoRnases.requestAll() 271 1 3.0 3.0 0.1 self.fragmentBases.requestAll() 272 273 # Calculate the amount of water required for total RNA hydrolysis by 274 # endo and exonucleases. Assuming complete hydrolysis for now. Note 275 # that one additional water molecule is needed for each RNA to 276 # hydrolyze the 5' diphosphate. 277 1 13.0 13.0 0.6 waterForNewRnas = np.dot(n_rnas_to_degrade, self.rna_lengths) 278 1 7.0 7.0 0.3 waterForLeftOverFragments = self.fragmentBases.total().sum() 279 1 13.0 13.0 0.6 self.h2o.requestIs(waterForNewRnas + waterForLeftOverFragments) 0.40 403.12 1.000 1.000 1.000 1.001 1.000 Timer unit: 1e-06 s Total time: 0.002335 s File: /home/ggsun/Projects/wcEcoli/models/ecoli/processes/rna_degradation.py Function: calculateRequest at line 150 Line # Hits Time Per Hit % Time Line Contents ============================================================== 150 @line_profile 151 def calculateRequest(self): 152 153 # Compute factor that convert counts into concentration, and vice versa 154 1 68.0 68.0 2.9 cell_mass = self.readFromListener("Mass", "cellMass") * units.fg 155 1 15.0 15.0 0.6 cell_volume = cell_mass / self.cellDensity 156 1 29.0 29.0 1.2 countsToMolar = 1 / (self.nAvogadro * cell_volume) 157 158 # Get total counts of RNAs including rRNAs and charged tRNAs 159 1 12.0 12.0 0.5 rna_counts = self.rnas.total().copy() 160 1 11.0 11.0 0.5 rna_counts[self.rrsaIdx] += self.ribosome30S.total() 161 1 14.0 14.0 0.6 rna_counts[[self.rrlaIdx, self.rrfaIdx]] += self.ribosome50S.total() 162 1 8.0 8.0 0.3 rna_counts[[self.rrlaIdx, self.rrfaIdx, self.rrsaIdx]] += self.activeRibosomes.total() 163 1 153.0 153.0 6.6 rna_counts[self.isTRna] += self.charged_trna.total() 164 165 # Get counts of endoRNases 166 1 3.0 3.0 0.1 endornase_counts = self.endoRnases.total().copy() 167 1 72.0 72.0 3.1 total_kcat_endornase = units.dot(self.KcatEndoRNases, endornase_counts) 168 169 # Calculate the fraction of active endoRNases for each RNA based on 170 # Michaelis-Menten kinetics 171 1 2.0 2.0 0.1 if self.EndoRNaseCoop: 172 frac_endornase_saturated = ( 173 1 50.0 50.0 2.1 countsToMolar * rna_counts / self.Km / ( 174 1 445.0 445.0 19.1 1 + units.sum((countsToMolar * rna_counts) / self.Km)) 175 ).asNumber() 176 else: 177 frac_endornase_saturated = ( 178 countsToMolar * rna_counts / (self.Km + ( 179 countsToMolar * rna_counts)) 180 ).asNumber() 181 182 # Calculate difference in degradation rates from first-order decay 183 # and the number of EndoRNases per one molecule of RNA 184 1 10.0 10.0 0.4 total_endornase_counts = np.sum(endornase_counts) 185 1 1.0 1.0 0.0 diff_relative_first_order_decay = units.sum( 186 1 24.0 24.0 1.0 units.abs(self.rnaDegRates * rna_counts - 187 1 126.0 126.0 5.4 total_kcat_endornase * frac_endornase_saturated) 188 ) 189 1 15.0 15.0 0.6 endornase_per_rna = total_endornase_counts.astype(np.float) / np.sum(rna_counts) 190 191 1 2.0 2.0 0.1 self.writeToListener("RnaDegradationListener", 192 1 1.0 1.0 0.0 "FractionActiveEndoRNases", 193 1 25.0 25.0 1.1 np.sum(frac_endornase_saturated) 194 ) 195 1 1.0 1.0 0.0 self.writeToListener("RnaDegradationListener", 196 1 1.0 1.0 0.0 "DiffRelativeFirstOrderDecay", 197 1 21.0 21.0 0.9 diff_relative_first_order_decay.asNumber() 198 ) 199 1 1.0 1.0 0.0 self.writeToListener( 200 1 1.0 1.0 0.0 "RnaDegradationListener", 201 1 1.0 1.0 0.0 "FractEndoRRnaCounts", 202 1 6.0 6.0 0.3 endornase_per_rna) 203 204 1 2.0 2.0 0.1 if self.EndoRNaseFunc: 205 # Dissect RNAse specificity into mRNA, tRNA, and rRNA 206 1 93.0 93.0 4.0 mrna_specificity = np.dot(frac_endornase_saturated, self.isMRna) 207 1 40.0 40.0 1.7 trna_specificity = np.dot(frac_endornase_saturated, self.isTRna) 208 1 24.0 24.0 1.0 rrna_specificity = np.dot(frac_endornase_saturated, self.isRRna) 209 210 1 2.0 2.0 0.1 n_total_mrnas_to_degrade = self._calculate_total_n_to_degrade( 211 1 1.0 1.0 0.0 mrna_specificity, 212 1 94.0 94.0 4.0 total_kcat_endornase 213 ) 214 1 1.0 1.0 0.0 n_total_trnas_to_degrade = self._calculate_total_n_to_degrade( 215 1 1.0 1.0 0.0 trna_specificity, 216 1 68.0 68.0 2.9 total_kcat_endornase 217 ) 218 1 2.0 2.0 0.1 n_total_rrnas_to_degrade = self._calculate_total_n_to_degrade( 219 1 1.0 1.0 0.0 rrna_specificity, 220 1 71.0 71.0 3.0 total_kcat_endornase 221 ) 222 223 # Compute RNAse specificity 224 1 28.0 28.0 1.2 rna_specificity = frac_endornase_saturated / np.sum(frac_endornase_saturated) 225 226 # Boolean variable that tracks existence of each RNA 227 1 8.0 8.0 0.3 rna_exists = rna_counts.astype(np.bool) 228 229 # Compute degradation probabilities of each RNA: for mRNAs, this 230 # is based on the specificity of each mRNA. For tRNAs and rRNAs, 231 # this is distributed evenly. 232 1 168.0 168.0 7.2 mrna_deg_probs = 1. / np.dot(rna_specificity, self.isMRna * rna_exists) * rna_specificity * self.isMRna * rna_exists 233 1 87.0 87.0 3.7 trna_deg_probs = 1. / np.sum(self.isTRna * rna_exists) * self.isTRna * rna_exists 234 1 76.0 76.0 3.3 rrna_deg_probs = 1. / np.sum(self.isRRna * rna_exists) * self.isRRna * rna_exists 235 236 # Mask RNA counts into each class of RNAs 237 1 25.0 25.0 1.1 mrna_counts = rna_counts * self.isMRna 238 1 25.0 25.0 1.1 trna_counts = rna_counts * self.isTRna 239 1 25.0 25.0 1.1 rrna_counts = rna_counts * self.isRRna 240 241 # Determine number of individual RNAs to be degraded for each class 242 # of RNA. 243 1 2.0 2.0 0.1 n_mrnas_to_degrade = self._get_rnas_to_degrade( 244 1 269.0 269.0 11.5 n_total_mrnas_to_degrade, mrna_deg_probs, mrna_counts 245 ) 246 247 1 1.0 1.0 0.0 n_trnas_to_degrade = self._get_rnas_to_degrade( 248 1 26.0 26.0 1.1 n_total_trnas_to_degrade, trna_deg_probs, trna_counts 249 ) 250 251 1 1.0 1.0 0.0 n_rrnas_to_degrade = self._get_rnas_to_degrade( 252 1 24.0 24.0 1.0 n_total_rrnas_to_degrade, rrna_deg_probs, rrna_counts 253 ) 254 255 1 9.0 9.0 0.4 n_rnas_to_degrade = n_mrnas_to_degrade + n_trnas_to_degrade + n_rrnas_to_degrade 256 257 # First order decay with non-functional EndoRNase activity 258 # Determine mRNAs to be degraded by sampling a Poisson distribution 259 # (Kdeg * RNA) 260 else: 261 n_rnas_to_degrade = np.fmin( 262 self.randomState.poisson( 263 (self.rnaDegRates * rna_counts).asNumber() 264 ), 265 self.rnas.total() 266 ) 267 268 1 7.0 7.0 0.3 self.rnas.requestIs(n_rnas_to_degrade) 269 1 4.0 4.0 0.2 self.endoRnases.requestAll() 270 1 4.0 4.0 0.2 self.exoRnases.requestAll() 271 1 4.0 4.0 0.2 self.fragmentBases.requestAll() 272 273 # Calculate the amount of water required for total RNA hydrolysis by 274 # endo and exonucleases. Assuming complete hydrolysis for now. Note 275 # that one additional water molecule is needed for each RNA to 276 # hydrolyze the 5' diphosphate. 277 1 13.0 13.0 0.6 waterForNewRnas = np.dot(n_rnas_to_degrade, self.rna_lengths) 278 1 7.0 7.0 0.3 waterForLeftOverFragments = self.fragmentBases.total().sum() 279 1 4.0 4.0 0.2 self.h2o.requestIs(waterForNewRnas + waterForLeftOverFragments) Warning: numerical instability (primal simplex, phase II) 0.60 403.17 1.000 1.000 1.000 1.001 1.000 Timer unit: 1e-06 s Total time: 0.001961 s File: /home/ggsun/Projects/wcEcoli/models/ecoli/processes/rna_degradation.py Function: calculateRequest at line 150 Line # Hits Time Per Hit % Time Line Contents ============================================================== 150 @line_profile 151 def calculateRequest(self): 152 153 # Compute factor that convert counts into concentration, and vice versa 154 1 69.0 69.0 3.5 cell_mass = self.readFromListener("Mass", "cellMass") * units.fg 155 1 16.0 16.0 0.8 cell_volume = cell_mass / self.cellDensity 156 1 29.0 29.0 1.5 countsToMolar = 1 / (self.nAvogadro * cell_volume) 157 158 # Get total counts of RNAs including rRNAs and charged tRNAs 159 1 13.0 13.0 0.7 rna_counts = self.rnas.total().copy() 160 1 10.0 10.0 0.5 rna_counts[self.rrsaIdx] += self.ribosome30S.total() 161 1 15.0 15.0 0.8 rna_counts[[self.rrlaIdx, self.rrfaIdx]] += self.ribosome50S.total() 162 1 9.0 9.0 0.5 rna_counts[[self.rrlaIdx, self.rrfaIdx, self.rrsaIdx]] += self.activeRibosomes.total() 163 1 149.0 149.0 7.6 rna_counts[self.isTRna] += self.charged_trna.total() 164 165 # Get counts of endoRNases 166 1 4.0 4.0 0.2 endornase_counts = self.endoRnases.total().copy() 167 1 72.0 72.0 3.7 total_kcat_endornase = units.dot(self.KcatEndoRNases, endornase_counts) 168 169 # Calculate the fraction of active endoRNases for each RNA based on 170 # Michaelis-Menten kinetics 171 1 2.0 2.0 0.1 if self.EndoRNaseCoop: 172 frac_endornase_saturated = ( 173 1 38.0 38.0 1.9 countsToMolar * rna_counts / self.Km / ( 174 1 411.0 411.0 21.0 1 + units.sum((countsToMolar * rna_counts) / self.Km)) 175 ).asNumber() 176 else: 177 frac_endornase_saturated = ( 178 countsToMolar * rna_counts / (self.Km + ( 179 countsToMolar * rna_counts)) 180 ).asNumber() 181 182 # Calculate difference in degradation rates from first-order decay 183 # and the number of EndoRNases per one molecule of RNA 184 1 10.0 10.0 0.5 total_endornase_counts = np.sum(endornase_counts) 185 1 1.0 1.0 0.1 diff_relative_first_order_decay = units.sum( 186 1 22.0 22.0 1.1 units.abs(self.rnaDegRates * rna_counts - 187 1 116.0 116.0 5.9 total_kcat_endornase * frac_endornase_saturated) 188 ) 189 1 15.0 15.0 0.8 endornase_per_rna = total_endornase_counts.astype(np.float) / np.sum(rna_counts) 190 191 1 1.0 1.0 0.1 self.writeToListener("RnaDegradationListener", 192 1 1.0 1.0 0.1 "FractionActiveEndoRNases", 193 1 26.0 26.0 1.3 np.sum(frac_endornase_saturated) 194 ) 195 1 1.0 1.0 0.1 self.writeToListener("RnaDegradationListener", 196 1 1.0 1.0 0.1 "DiffRelativeFirstOrderDecay", 197 1 22.0 22.0 1.1 diff_relative_first_order_decay.asNumber() 198 ) 199 1 1.0 1.0 0.1 self.writeToListener( 200 1 1.0 1.0 0.1 "RnaDegradationListener", 201 1 1.0 1.0 0.1 "FractEndoRRnaCounts", 202 1 7.0 7.0 0.4 endornase_per_rna) 203 204 1 2.0 2.0 0.1 if self.EndoRNaseFunc: 205 # Dissect RNAse specificity into mRNA, tRNA, and rRNA 206 1 70.0 70.0 3.6 mrna_specificity = np.dot(frac_endornase_saturated, self.isMRna) 207 1 29.0 29.0 1.5 trna_specificity = np.dot(frac_endornase_saturated, self.isTRna) 208 1 21.0 21.0 1.1 rrna_specificity = np.dot(frac_endornase_saturated, self.isRRna) 209 210 1 2.0 2.0 0.1 n_total_mrnas_to_degrade = self._calculate_total_n_to_degrade( 211 1 1.0 1.0 0.1 mrna_specificity, 212 1 91.0 91.0 4.6 total_kcat_endornase 213 ) 214 1 1.0 1.0 0.1 n_total_trnas_to_degrade = self._calculate_total_n_to_degrade( 215 1 1.0 1.0 0.1 trna_specificity, 216 1 57.0 57.0 2.9 total_kcat_endornase 217 ) 218 1 1.0 1.0 0.1 n_total_rrnas_to_degrade = self._calculate_total_n_to_degrade( 219 1 1.0 1.0 0.1 rrna_specificity, 220 1 54.0 54.0 2.8 total_kcat_endornase 221 ) 222 223 # Compute RNAse specificity 224 1 19.0 19.0 1.0 rna_specificity = frac_endornase_saturated / np.sum(frac_endornase_saturated) 225 226 # Boolean variable that tracks existence of each RNA 227 1 6.0 6.0 0.3 rna_exists = rna_counts.astype(np.bool) 228 229 # Compute degradation probabilities of each RNA: for mRNAs, this 230 # is based on the specificity of each mRNA. For tRNAs and rRNAs, 231 # this is distributed evenly. 232 1 87.0 87.0 4.4 mrna_deg_probs = 1. / np.dot(rna_specificity, self.isMRna * rna_exists) * rna_specificity * self.isMRna * rna_exists 233 1 75.0 75.0 3.8 trna_deg_probs = 1. / np.sum(self.isTRna * rna_exists) * self.isTRna * rna_exists 234 1 71.0 71.0 3.6 rrna_deg_probs = 1. / np.sum(self.isRRna * rna_exists) * self.isRRna * rna_exists 235 236 # Mask RNA counts into each class of RNAs 237 1 23.0 23.0 1.2 mrna_counts = rna_counts * self.isMRna 238 1 23.0 23.0 1.2 trna_counts = rna_counts * self.isTRna 239 1 23.0 23.0 1.2 rrna_counts = rna_counts * self.isRRna 240 241 # Determine number of individual RNAs to be degraded for each class 242 # of RNA. 243 1 2.0 2.0 0.1 n_mrnas_to_degrade = self._get_rnas_to_degrade( 244 1 143.0 143.0 7.3 n_total_mrnas_to_degrade, mrna_deg_probs, mrna_counts 245 ) 246 247 1 1.0 1.0 0.1 n_trnas_to_degrade = self._get_rnas_to_degrade( 248 1 22.0 22.0 1.1 n_total_trnas_to_degrade, trna_deg_probs, trna_counts 249 ) 250 251 1 1.0 1.0 0.1 n_rrnas_to_degrade = self._get_rnas_to_degrade( 252 1 22.0 22.0 1.1 n_total_rrnas_to_degrade, rrna_deg_probs, rrna_counts 253 ) 254 255 1 8.0 8.0 0.4 n_rnas_to_degrade = n_mrnas_to_degrade + n_trnas_to_degrade + n_rrnas_to_degrade 256 257 # First order decay with non-functional EndoRNase activity 258 # Determine mRNAs to be degraded by sampling a Poisson distribution 259 # (Kdeg * RNA) 260 else: 261 n_rnas_to_degrade = np.fmin( 262 self.randomState.poisson( 263 (self.rnaDegRates * rna_counts).asNumber() 264 ), 265 self.rnas.total() 266 ) 267 268 1 7.0 7.0 0.4 self.rnas.requestIs(n_rnas_to_degrade) 269 1 4.0 4.0 0.2 self.endoRnases.requestAll() 270 1 4.0 4.0 0.2 self.exoRnases.requestAll() 271 1 4.0 4.0 0.2 self.fragmentBases.requestAll() 272 273 # Calculate the amount of water required for total RNA hydrolysis by 274 # endo and exonucleases. Assuming complete hydrolysis for now. Note 275 # that one additional water molecule is needed for each RNA to 276 # hydrolyze the 5' diphosphate. 277 1 12.0 12.0 0.6 waterForNewRnas = np.dot(n_rnas_to_degrade, self.rna_lengths) 278 1 6.0 6.0 0.3 waterForLeftOverFragments = self.fragmentBases.total().sum() 279 1 4.0 4.0 0.2 self.h2o.requestIs(waterForNewRnas + waterForLeftOverFragments)