# 2 # import scipy, scipy.integrate, scipy.optimize, pylab, copy # class HillRepressilator: def __init__(self, alpha=216., alpha0=0.216, beta=5., n=2., K_m=scipy.log(2.)/120., K_p=scipy.log(2.)/600., T=20., K_b=1600., y0=[0.1,0.2,0.3,0.,0.,0.]): """Initiate a HillRepressilator (i.e., a Repressilator where the protein-DNA interaction is subsumed in a simple Hill function). Initialize instance parameters based on the input parameters (e.g., self.alpha = alpha). Also store the bare parameters (K_m, K_p, T, K_b) so that you can convert from scaled times and concentrations back to bare times and concentrations if desired. """ pass @staticmethod def dydt(y,t,alpha,n,alpha0,beta): """Define the right-hand-side of the Repressilator equations for use with scipy.integrate.odeint. Since this needs to be called as if it were a standalone function, and not an instance method (which would implicitly assume the first argument is the instance self), we declare this as a staticmethod so that self is not passed as an implicit argument. Alternatively, one could define dydt outside the HillRepressilator class, but this is cleaner.""" pass def run(self, T, dT=None, nT=100, times=None): """Run the Repressilator for the specified amount of time T, returning output either for fixed time step dT, or over a specified number of timesteps nT, or for a specified array of times. Store the trajectory returned by odeint in the instance variable self.traj, concatenating the result to the existing self.traj if a previous trajectory had been created.""" pass def find_steady_state(self,alpha=None, n=None, alpha0=None): """Return the steady-state concentration of mRNAs and proteins (i.e., an array of length 6) for the specified parameters alpha, n, alpha0. Use scipy.optimize.fsolve.""" pass def in_steady_state(self): """Return True or False indicating whether the current state of the system is in the steady-state. Do this by evaluating the instantaneous time derivative of the equations of motion and checking whether the vector norm of the instantaneous velocity is sufficiently small (e.g., smaller than 1.0e-3).""" pass def rescale_trajectory(self): """Return a scaled trajectory from the data contained in the self.traj variable. This undoes the scaling transformation into natural units, producing a 6-component trajectory containing raw molecular concentrations.""" pass def plot(self, show_proteins=True, show_mRNAs=False, rescaled=True): """Plot the trajectory of the Repressilator, optionally showing either the protein concentrations or the mRNA concentrations, in either dimensionless or rescaled units.""" pass @staticmethod def f(beta, X): pass def find_unstable_beta(self, alpha): pass def plot_phase_boundary(self): pass def compute_phase_diagram(self): pass def plot_phase_diagram(self, ph_diag): pass # # Copyright (C) Cornell University # All rights reserved. # Apache License, Version 2.0