Last active
March 13, 2021 00:59
-
-
Save dpgoldenberg/ce38c65814fb65e8229b09a0111f03b0 to your computer and use it in GitHub Desktop.
Simulation of Biol 3515/Chem 3515 Experiment 4, part A
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Gist title |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| code_dict = {'0GXY02':{'pip_sigma':0.015,'abs_sigma':0.001,'e_conc':2.0780933743000794e-05,'kcat':12.479059780623182,'km':8.563436439963315e-05,'ki':1.2818504047186639e-05,'i_type':'n'}, | |
| 'DD0371':{'pip_sigma':0.015,'abs_sigma':0.001,'e_conc':2.943933934989462e-05,'kcat':9.174417463278722,'km':4.777372487256253e-05,'ki':2.0921044815624033e-05,'i_type':'n'}, | |
| 'X5FX87':{'pip_sigma':0.015,'abs_sigma':0.001,'e_conc':2.95266826439055e-05,'kcat':11.789268600290177,'km':5.58468122174051e-05,'ki':3.1855951319526476e-05,'i_type':'u'}, | |
| 'FG188G':{'pip_sigma':0.015,'abs_sigma':0.001,'e_conc':2.285031188273903e-05,'kcat':13.047612493354922,'km':7.177787853319616e-05,'ki':2.2387336355080515e-05,'i_type':'c'}, | |
| '34P10Q':{'pip_sigma':0.015,'abs_sigma':0.001,'e_conc':2.722682984532362e-05,'kcat':8.145189509187809,'km':6.57837365279514e-05,'ki':2.4766261675168723e-05,'i_type':'u'}, | |
| 'Y4N6KZ':{'pip_sigma':0.015,'abs_sigma':0.001,'e_conc':2.8906484201970237e-05,'kcat':13.614464085817126,'km':5.4379228053721865e-05,'ki':2.8526273760851988e-05,'i_type':'n'}, | |
| 'W5XM03':{'pip_sigma':0.015,'abs_sigma':0.001,'e_conc':1.9115719982294164e-05,'kcat':10.075765236194103,'km':3.320531258425417e-05,'ki':1.788466321473838e-05,'i_type':'u'}, | |
| '9V51PV':{'pip_sigma':0.015,'abs_sigma':0.001,'e_conc':2.2972895706886008e-05,'kcat':14.253426350877806,'km':8.949671739010028e-05,'ki':2.242595915972425e-05,'i_type':'u'}, | |
| '942913':{'pip_sigma':0.015,'abs_sigma':0.001,'e_conc':2.0249547380195524e-05,'kcat':11.135081432311162,'km':7.07376899404837e-05,'ki':1.530979579819587e-05,'i_type':'n'}, | |
| 'N898UN':{'pip_sigma':0.015,'abs_sigma':0.001,'e_conc':2.8674877368836247e-05,'kcat':10.097357504977413,'km':6.59893141525897e-05,'ki':1.6104691193010986e-05,'i_type':'c'}, | |
| 'H4CGP6':{'pip_sigma':0.015,'abs_sigma':0.001,'e_conc':2.4074717025273083e-05,'kcat':10.86527728039156,'km':4.0295083099196564e-05,'ki':1.8838579326954804e-05,'i_type':'u'}, | |
| '13KE9N':{'pip_sigma':0.015,'abs_sigma':0.001,'e_conc':2.0654600749048573e-05,'kcat':14.476740111724716,'km':4.664199652900124e-05,'ki':3.565278871613589e-05,'i_type':'c'}, | |
| '31PQ53':{'pip_sigma':0.015,'abs_sigma':0.001,'e_conc':2.264345369791618e-05,'kcat':6.560328970813622,'km':3.930321207228756e-05,'ki':1.7996658903832847e-05,'i_type':'c'}, | |
| 'KK644G':{'pip_sigma':0.015,'abs_sigma':0.001,'e_conc':1.9346499463477278e-05,'kcat':8.322469408595582,'km':4.5568979770163385e-05,'ki':2.786600023760229e-05,'i_type':'n'}, | |
| '2TNA45':{'pip_sigma':0.015,'abs_sigma':0.001,'e_conc':1.9246819164209123e-05,'kcat':5.953190657380047,'km':3.994947194229087e-05,'ki':3.118850349923123e-05,'i_type':'n'}, | |
| 'N6AADQ':{'pip_sigma':0.015,'abs_sigma':0.001,'e_conc':1.8630368266346355e-05,'kcat':8.425285215458262,'km':8.304450919324063e-05,'ki':3.275462952212665e-05,'i_type':'n'}, | |
| 'SV22HX':{'pip_sigma':0.015,'abs_sigma':0.001,'e_conc':2.7310317193021016e-05,'kcat':11.54988636685996,'km':5.4691251633663635e-05,'ki':1.4258000433727466e-05,'i_type':'n'}, | |
| 'VS8S0J':{'pip_sigma':0.015,'abs_sigma':0.001,'e_conc':2.1921188687159537e-05,'kcat':11.169575003686369,'km':6.197424343338799e-05,'ki':3.4772457082954824e-05,'i_type':'u'}, | |
| '4U2RCD':{'pip_sigma':0.015,'abs_sigma':0.001,'e_conc':1.876088862624062e-05,'kcat':11.746442846771568,'km':5.739471754772193e-05,'ki':2.7617474463042558e-05,'i_type':'n'}, | |
| 'ZCRTWU':{'pip_sigma':0.015,'abs_sigma':0.001,'e_conc':1.9224581361271966e-05,'kcat':5.076806311887225,'km':3.228842227365505e-05,'ki':2.641539836528339e-05,'i_type':'n'}, | |
| '7182Y1':{'pip_sigma':0.015,'abs_sigma':0.001,'e_conc':2.47216027558941e-05,'kcat':8.241979108276192,'km':6.0074402918688364e-05,'ki':2.9141558444201385e-05,'i_type':'c'}, | |
| 'W8Y4P3':{'pip_sigma':0.015,'abs_sigma':0.001,'e_conc':2.7782485501855382e-05,'kcat':10.195874314801054,'km':3.488329626913995e-05,'ki':2.6688208538208135e-05,'i_type':'u'}, | |
| 'J9PWB4':{'pip_sigma':0.015,'abs_sigma':0.001,'e_conc':2.475736161044849e-05,'kcat':6.754889828781962,'km':8.773579280310646e-05,'ki':3.7817954389229254e-05,'i_type':'u'}, | |
| '43479S':{'pip_sigma':0.015,'abs_sigma':0.001,'e_conc':2.6621708935755493e-05,'kcat':13.144983394351692,'km':5.9336652102587744e-05,'ki':1.2109968155410305e-05,'i_type':'c'}, | |
| 'MYX1AX':{'pip_sigma':0.015,'abs_sigma':0.001,'e_conc':1.6766972738830726e-05,'kcat':12.914367456489144,'km':4.940114234055595e-05,'ki':2.3969134784314207e-05,'i_type':'c'}, | |
| 'S0E0YV':{'pip_sigma':0.015,'abs_sigma':0.001,'e_conc':2.7032357040088922e-05,'kcat':10.957824559421038,'km':3.289894725028064e-05,'ki':3.7799881099811013e-05,'i_type':'u'}, | |
| 'DFKPU9':{'pip_sigma':0.015,'abs_sigma':0.001,'e_conc':1.723282359923739e-05,'kcat':7.466998500516203,'km':6.51627417368447e-05,'ki':3.141311275224014e-05,'i_type':'n'}, | |
| '9RFXYW':{'pip_sigma':0.015,'abs_sigma':0.001,'e_conc':2.5000509553011084e-05,'kcat':6.705684564747556,'km':5.8051980187978164e-05,'ki':3.193666437729011e-05,'i_type':'n'}, | |
| '88PTV8':{'pip_sigma':0.015,'abs_sigma':0.001,'e_conc':2.4524217499362522e-05,'kcat':5.011219927285401,'km':8.251030817940819e-05,'ki':3.075851375645226e-05,'i_type':'n'}, | |
| 'H0X54M':{'pip_sigma':0.015,'abs_sigma':0.001,'e_conc':2.4139816960349272e-05,'kcat':6.589695629876994,'km':6.600131868852241e-05,'ki':1.31444625377903e-05,'i_type':'u'}, | |
| 'KD1K2N':{'pip_sigma':0.015,'abs_sigma':0.001,'e_conc':1.7172667254962533e-05,'kcat':10.800375363792174,'km':4.161401188579533e-05,'ki':1.6146814125369517e-05,'i_type':'n'}, | |
| '23W0N6':{'pip_sigma':0.015,'abs_sigma':0.001,'e_conc':1.922648717519026e-05,'kcat':10.434092819204855,'km':8.777019172064786e-05,'ki':3.765713498947328e-05,'i_type':'n'}, | |
| 'GQ5P11':{'pip_sigma':0.015,'abs_sigma':0.001,'e_conc':2.7288023178577137e-05,'kcat':8.027464722293182,'km':8.77400879268201e-05,'ki':3.871522144226405e-05,'i_type':'c'}, | |
| '597J70':{'pip_sigma':0.015,'abs_sigma':0.001,'e_conc':1.912745303888913e-05,'kcat':10.458568211196791,'km':4.246737812426825e-05,'ki':2.2091709053964623e-05,'i_type':'c'}, | |
| '77YE98':{'pip_sigma':0.015,'abs_sigma':0.001,'e_conc':1.6706669601780035e-05,'kcat':7.330432197837356,'km':8.891603561232728e-05,'ki':2.385063694003913e-05,'i_type':'n'}, | |
| '994A4U':{'pip_sigma':0.015,'abs_sigma':0.001,'e_conc':2.8895005256200494e-05,'kcat':5.174640178640072,'km':5.320770050272746e-05,'ki':3.484928283677721e-05,'i_type':'c'}, | |
| '22NZ8S':{'pip_sigma':0.015,'abs_sigma':0.001,'e_conc':2.1267935215025052e-05,'kcat':9.340617525524213,'km':8.084998120581375e-05,'ki':1.9846990411649675e-05,'i_type':'c'}, | |
| '33VZHV':{'pip_sigma':0.015,'abs_sigma':0.001,'e_conc':2.588140524849908e-05,'kcat':11.929996897914258,'km':4.824483178683697e-05,'ki':1.7953941761962762e-05,'i_type':'n'}, | |
| 'YD34E7':{'pip_sigma':0.015,'abs_sigma':0.001,'e_conc':2.1705054520364497e-05,'kcat':10.27610221982453,'km':3.781178868193927e-05,'ki':3.679368703360593e-05,'i_type':'u'}, | |
| 'B4EV54':{'pip_sigma':0.015,'abs_sigma':0.001,'e_conc':2.0354460994888705e-05,'kcat':7.021725135847429,'km':5.7035565773548506e-05,'ki':3.4492201250642305e-05,'i_type':'c'}, | |
| 'QXQEA0':{'pip_sigma':0.015,'abs_sigma':0.001,'e_conc':2.3323423105185772e-05,'kcat':6.929654495543255,'km':3.181108783085965e-05,'ki':1.329762648384744e-05,'i_type':'u'}, | |
| 'RCE9Z2':{'pip_sigma':0.015,'abs_sigma':0.001,'e_conc':2.01296550430366e-05,'kcat':13.410636428482128,'km':6.436577355205234e-05,'ki':2.9553712571334308e-05,'i_type':'u'}, | |
| 'W382SW':{'pip_sigma':0.015,'abs_sigma':0.001,'e_conc':1.774481028180708e-05,'kcat':12.769638907644534,'km':7.359061292718445e-05,'ki':2.857701690770212e-05,'i_type':'c'}, | |
| 'Y1UUUA':{'pip_sigma':0.015,'abs_sigma':0.001,'e_conc':2.0828543359469805e-05,'kcat':6.72929920464161,'km':8.86483930276227e-05,'ki':2.8642829571428845e-05,'i_type':'n'}, | |
| '240125':{'pip_sigma':0.015,'abs_sigma':0.001,'e_conc':2.7918021956761915e-05,'kcat':5.844744273832838,'km':4.588117735847368e-05,'ki':1.1957994609795895e-05,'i_type':'u'}, | |
| '0P20E8':{'pip_sigma':0.015,'abs_sigma':0.001,'e_conc':1.9706742739803737e-05,'kcat':11.3167024699186,'km':8.655867671649303e-05,'ki':3.677451188680347e-05,'i_type':'c'}, | |
| 'CTZKSB':{'pip_sigma':0.015,'abs_sigma':0.001,'e_conc':2.6678519754892104e-05,'kcat':14.698116904941546,'km':7.633417818129455e-05,'ki':2.3006367565448628e-05,'i_type':'n'}, | |
| 'K60820':{'pip_sigma':0.015,'abs_sigma':0.001,'e_conc':1.7891470882886813e-05,'kcat':5.1724040679813585,'km':8.540103081102389e-05,'ki':1.5968880094004856e-05,'i_type':'u'}, | |
| 'WE21H5':{'pip_sigma':0.015,'abs_sigma':0.001,'e_conc':1.8244941876266545e-05,'kcat':9.019636410141747,'km':8.204223957035615e-05,'ki':2.1798577252831622e-05,'i_type':'n'}, | |
| 'N180MF':{'pip_sigma':0.015,'abs_sigma':0.001,'e_conc':2.3419204687993863e-05,'kcat':7.10770397148994,'km':5.528682797277228e-05,'ki':1.8279751160378784e-05,'i_type':'u'}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: exp_4a_sim | |
| channels: | |
| - conda-forge | |
| - defaults | |
| - conda-forge/label/broken | |
| dependencies: | |
| - python=3.8.3 | |
| - numpy=1.19.2 | |
| - scipy = 1.5.2 | |
| - matplotlib=3.3.2 | |
| - ipython=7.19.0 | |
| - ipywidgets=7.5.1 | |
| - voila=0.2.6 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## Module for import into Jupyter for simulation of Experiment 4, Part A | |
| ## Reversible Enzyme Inhibition | |
| ## in Biology 3515/Chem 3515 at the University of Utah, Spring 2021 | |
| ## https://goldenberg.biology.utah.edu/courses/biol3515/ | |
| ## David P. Goldenberg, January 2021 | |
| ## [email protected] | |
| import random as rand | |
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| import ipywidgets as widgets | |
| from IPython.display import display, HTML | |
| from time import sleep, time | |
| import threading | |
| from scipy.integrate import solve_ivp | |
| import functools | |
| from scipy.stats import linregress | |
| from code_dict_exp4a import code_dict | |
| codes = list(code_dict) | |
| ##----------Global Parameters--------------------## | |
| # delay time while filling the absorbance table | |
| # Use 0 for testing and 0.2 for production to make the simulation run about | |
| # 5-x the actual speed. | |
| t_sleep = 0.2 | |
| abs_read = 0.0 # for kin run | |
| zero_set = 0.0 # for kin run | |
| # Total time and number of steps for abs reading to settle | |
| t_tot = 2 | |
| steps = 25 | |
| # Title for graph | |
| graph_title = 'Experiment 4, Part A' | |
| display(HTML("<style>div.output_scroll { height: 400ex; }</style>")) | |
| ##----------------Classes----------------------## | |
| class Tube(): | |
| '''Tube class for putting stuff in''' | |
| def __init__(self,vol=0.0,vol_n=0,max_vol=1.0,conc={}): | |
| self.vol = vol # actual volume | |
| self.vol_n= vol_n # nominal volume, reflecting pipette settings, vs actual delivered volumes | |
| self.max_vol = max_vol # max volume of tube | |
| self.conc = conc # concentrations of compounds | |
| class Cuvette(): | |
| '''Cuvette class, like Tube but with additional | |
| attributes for sample name and reactions start time, t0''' | |
| def __init__(self): | |
| self.vol = 0.0 | |
| self.vol_n = 0.0 | |
| self.conc = {} | |
| self.t0 =0.0 | |
| class VolTable(widgets.HTML): | |
| def __init__(self,tube_dict,head): | |
| super().__init__( | |
| value='', | |
| layout=widgets.Layout(width='250px')) | |
| self.tube_dict = tube_dict | |
| self.head = head | |
| self.update() | |
| def update(self): | |
| '''function to update the table of tube or cuvette volumes''' | |
| html_str = ''' | |
| <style> | |
| table, th, td { | |
| border: 1px solid black; | |
| } | |
| th, td { | |
| padding: 5px; | |
| } | |
| table, {border-collapse: collapse;} | |
| </style> | |
| <table> | |
| <tr>''' | |
| html_str += f'<th style="width:100px"> {self.head} </th>' | |
| html_str += '''<th style="width:100px"> Volume (μL)</th></tr>''' | |
| for tube in self.tube_dict: | |
| vol = self.tube_dict[tube].vol_n | |
| html_str += f'<tr><td>{tube}</td><td>{vol:.0f} </td></tr>\n' | |
| html_str += '</table>' | |
| self.value=html_str | |
| class AbsTable(widgets.HTML): | |
| def __init__(self,cuv_dict,t_int,t_tot): | |
| super().__init__( | |
| value='', | |
| layout=widgets.Layout(width='600px')) | |
| self.cuv_dict = cuv_dict | |
| self.t_int = t_int | |
| self.t_tot = t_tot | |
| self.abs_data = [] | |
| self.n_meas = int(t_tot/t_int)+1 | |
| self.n_cuv = len(self.cuv_dict) | |
| self.refresh() | |
| self.update() | |
| def refresh(self): | |
| self.abs_data=[['Time (min)']] | |
| for cuv in self.cuv_dict: | |
| self.abs_data[0].append('Cuvette ' + str(cuv)) | |
| for i in range(self.n_meas): | |
| t = i*self.t_int | |
| self.abs_data.append([t]+[None]*self.n_cuv) | |
| self.update() | |
| def update(self): | |
| html_str = ''' | |
| <style> | |
| table, th, td { | |
| border: 1px solid black; | |
| } | |
| th, td { | |
| padding: 5px; | |
| } | |
| table, {border-collapse: collapse;} | |
| </style> | |
| <table> | |
| <tr> | |
| <th style="width:100px"> Time (min) </th>''' | |
| for i in range(self.n_cuv): | |
| html_str += f'<th style="width:100px"> {self.abs_data[0][i+1]} </th>' | |
| html_str += '</tr>\n' | |
| for i in range(self.n_meas): | |
| html_str += f'<tr><td> {self.abs_data[i+1][0]}</td>' | |
| for j in range(self.n_cuv): | |
| if self.abs_data[i+1][j+1] != None: | |
| html_str += f'<td>{self.abs_data[i+1][j+1]:0.3f}</td>' | |
| else: | |
| html_str += '<td></td>' | |
| html_str += '</tr>\n' | |
| html_str += '</table>' | |
| self.value=html_str | |
| class RegTable(widgets.HTML): | |
| def __init__(self,reg_results): | |
| super().__init__( | |
| value='', | |
| layout=widgets.Layout(width='500px')) | |
| self.reg_results = reg_results | |
| self.update() | |
| def update(self): | |
| '''function to update the table of results from linear regression''' | |
| n_cuv = len(self.reg_results) | |
| html_str = ''' | |
| <style> | |
| table, th, td { | |
| border: 1px solid black; | |
| } | |
| th, td { | |
| padding: 5px; | |
| } | |
| table, {border-collapse: collapse;} | |
| </style> | |
| <table> | |
| <tr>''' | |
| html_str += '''<th style="width:100px"> Cuvette </th>''' | |
| html_str += '''<th style="width:100px"> Rate (min<sup>-1</sup>) </th>''' | |
| html_str += '''<th style="width:100px"> A<sub>0</sub> </th>''' | |
| html_str += '''<th style="width:100px"> R<sup>2</sup> </th></tr>''' | |
| for cuv in range(n_cuv): | |
| html_str += f'<tr><td> {cuv+1}</td>' | |
| slope = self.reg_results[cuv].slope | |
| html_str += f'<td>{slope:.4f}</td>' | |
| a0 = self.reg_results[cuv].intercept | |
| html_str += f'<td>{a0:.4f}</td>' | |
| rsq = self.reg_results[cuv].rvalue**2 | |
| html_str += f'<td>{rsq:.3f}</td></tr>' | |
| html_str += '</table>' | |
| self.value=html_str | |
| ##----------Setup Dictionaries-----------------------## | |
| # This has to come after Cuvette class is defined | |
| conc_dict = {'trypsin':0.0,'tris':0.0, 'cacl':0.0,'substr':0.0, 'inhib':0.0, 'prod':0.0} | |
| cuv_dict = {} | |
| for n in range(1,7): | |
| cuv_dict[n] = Cuvette() | |
| cuv_dict[n].conc = conc_dict.copy() | |
| solns_dict1={} # used to store stock solution concentrations | |
| # for trypsin dilution | |
| # trypsin concentration is set when code is read or changed | |
| solns_dict1['trypsin'] =0.0 | |
| solns_dict1['cacl'] = 20.0*1e-3 # M | |
| solns_dict2={} # used to store stock solution concentrations | |
| # for cuvettes | |
| # trypsin concentration is set when code is read or changed | |
| solns_dict2['trypsin'] =0.0 | |
| solns_dict2['cacl'] = 20.0*1e-3 # M | |
| solns_dict2['substr'] = 2.0*1e-3 # M | |
| solns_dict2['inhib'] = 1.0*1e-3 # M | |
| solns_dict2['tris'] = 0.2 # M | |
| ##--------------Tube for trypsin dilution ----------# | |
| trypsin_dil = Tube() | |
| trypsin_dil.conc = {'trypsin':0.0} | |
| #########---------Widgets and Their Functions --------------######## | |
| style = {'description_width': 'initial'} | |
| ##----------------Pipettes -----------------------## | |
| # Used for multiple parts of experiment | |
| # The deliver button is specific to each part | |
| def on_pipette_ch(change): | |
| '''Function to changes volume parameters when pipette is changed.''' | |
| pip_vol.max = 1000.0 | |
| if pipette.value == 1000.0: | |
| pip_vol.min = 200.0 | |
| pip_vol.max = 1000.0 | |
| pip_vol.step = 10.0 | |
| elif pipette.value == 200.0: | |
| pip_vol.min = 20.0 | |
| pip_vol.max = 200.0 | |
| pip_vol.step = 1.0 | |
| elif pipette.value == 20.0: | |
| pip_vol.min = 1.0 | |
| pip_vol.max = 20.0 | |
| pip_vol.step = 0.1 | |
| pip_vol.value = pip_vol.max | |
| pipette = widgets.Dropdown( | |
| # Choose pipette size | |
| options = [('P1000',1000.0),('P200',200.0),('P20',20.0)], | |
| description = 'Pipette:', | |
| style=style, | |
| layout=widgets.Layout(width='150px',margin='0px 0px 0px 50px') | |
| ) | |
| pipette.observe(on_pipette_ch,names=['value']) | |
| pip_vol = widgets.BoundedFloatText( | |
| # Pipette volume setting | |
| value = 1000.0, | |
| min = 200.0, | |
| max = 1000.0, | |
| step = 10.0, | |
| description = 'Volume set (uL):', | |
| style = style, | |
| layout=widgets.Layout(width='200px',margin='0px 0px 0px 50px') | |
| ) | |
| def pip_deliver(soln_widget, soln_dict, tube_widget,tube_dict): | |
| tube_list = list(tube_dict) | |
| conc_list = list(tube_dict[tube_list[0]].conc) | |
| pip_sigma = code_dict[lab_code.value]['pip_sigma'] | |
| # get pipette err from normal distr | |
| err_pipette = pipette.value*rand.normalvariate(0,pip_sigma) | |
| # calculate delivered volume | |
| vol = pip_vol.value+err_pipette | |
| # save old volume and calculate new | |
| vol_old = tube_dict[tube_widget.value].vol | |
| vol_new = vol_old + vol | |
| tube_list = list(tube_dict) | |
| reag_list = list(tube_dict[tube_list[0]].conc) | |
| incr = {} | |
| for reag in reag_list: | |
| incr[reag]=0.0 | |
| # calculate increment in solute amount (mg, moles,etc) | |
| for reag in reag_list: | |
| if reag == soln_widget.value: | |
| incr[reag] = vol*soln_dict[reag] | |
| if 'trypsin' == soln_widget.value: | |
| # special provision for trypsin solution containing 20 mM CaCl2 | |
| incr['cacl'] =vol*0.02 | |
| # update concentrations | |
| for reag in reag_list: | |
| conc_old = tube_dict[tube_widget.value].conc[reag] | |
| conc_new = (conc_old*vol_old + incr[reag])/vol_new | |
| tube_dict[tube_widget.value].conc[reag] = conc_new | |
| #update volumes | |
| tube_dict[tube_widget.value].vol = vol_new | |
| tube_dict[tube_widget.value].vol_n += pip_vol.value | |
| ##----------------Lab Code Entry ------------------## | |
| def on_code_ch(value): | |
| '''Respond to change in the code entered in the code box''' | |
| if lab_code.value != '' and lab_code.value not in codes: | |
| code_warn.value = '<span style="color:red;">Invalid code</span>' | |
| else: | |
| solns_dict1['trypsin'] = code_dict[lab_code.value]['e_conc']/500.0 | |
| code_warn.value ='' | |
| deliver_butt1.button_style = 'success' | |
| deliver_butt1.description='Pipette!' | |
| deliver_butt2.button_style = 'success' | |
| deliver_butt2.description='Pipette!' | |
| run_butt.button_style = 'success' | |
| run_butt.description='Run!' | |
| code_label = widgets.HTML( | |
| value = ''' <h3>Lab code: </h3>''' | |
| ) | |
| lab_code = widgets.Text( | |
| # text-entry widget to enter lab code | |
| value = '', | |
| placeholder='', | |
| #description = 'Lab code', | |
| layout=widgets.Layout(width='100px',margin='20px 0px 0px 15px') | |
| ) | |
| lab_code.observe(on_code_ch,names=['value']) | |
| code_warn = widgets.HTML( | |
| # warning when invalid lab code is entered | |
| value = '', | |
| layout=widgets.Layout(width='200px',margin='15px 50px 15px 0px') | |
| ) | |
| row_code = widgets.HBox([code_label,lab_code,code_warn]) | |
| ##--------------- Trypsin Dilution---------------------## | |
| def trypsin_vol_table_update(vol): | |
| '''function to update dilute trypsin volume HTML widget''' | |
| html_str = ''' | |
| <style> | |
| table, th, td { | |
| border: 1px solid black; | |
| } | |
| th, td { | |
| padding: 5px; | |
| } | |
| table, {border-collapse: collapse;} | |
| </style> | |
| <table> | |
| <tr> | |
| <th style="width:150px"> Dilute Trypsin Volume </th> | |
| ''' | |
| html_str += f'<td style="width:100px">{vol:.0f} μL</td></tr>' | |
| trypsin_vol_table.value=html_str | |
| def deliver1(change): | |
| '''function for deliver button for bsa dilution''' | |
| # check for valid lab code | |
| if lab_code.value not in codes: | |
| deliver_butt1.description='Enter valid lab code' | |
| deliver_butt1.button_style = 'warning' | |
| return | |
| trypsin_conc = code_dict[lab_code.value]['e_conc']/10.0 | |
| pip_sigma = code_dict[lab_code.value]['pip_sigma'] | |
| # get pipette err from normal distr | |
| err_pipette = pipette.value*rand.normalvariate(0,pip_sigma) | |
| # calculate delivered volume | |
| vol = pip_vol.value+err_pipette | |
| # save old volume and calculate new | |
| vol_old = trypsin_dil.vol | |
| vol_new = vol_old + vol | |
| # calculate increment to amount of trypsin in tube | |
| trypsin_incr = 0 | |
| if solns_widget1.value == 'trypsin': | |
| trypsin_incr = trypsin_conc*vol | |
| # update concentration | |
| conc_old = trypsin_dil.conc['trypsin'] | |
| trypsin_dil.conc['trypsin'] = (conc_old*vol_old + trypsin_incr)/vol_new | |
| # update volume and nominal volume of dilute trypsin solution | |
| trypsin_dil.vol = vol_new | |
| trypsin_dil.vol_n += pip_vol.value | |
| trypsin_vol_table_update(trypsin_dil.vol_n) | |
| # update concentration in solns_dict2 | |
| solns_dict2['trypsin'] = trypsin_dil.conc['trypsin'] | |
| def empty1(change): | |
| trypsin_dil.vol = 0.0 | |
| trypsin_dil.vol_n =0.0 | |
| trypsin_dil.conc['trypsin']=0.0 | |
| trypsin_vol_table_update(0.0) | |
| solns_widget1 = widgets.RadioButtons( | |
| # solutions for making dilute bsa | |
| options=[ ('20 mM CaCl2','cacl'), | |
| ('Trypsin (~0.05 mg/mL)','trypsin')], | |
| description='Solutions' | |
| ) | |
| empty_butt1 = widgets.Button( | |
| # button to empty tube for bsa dilution | |
| description = 'Empty', | |
| button_style = 'danger', | |
| ) | |
| empty_butt1.on_click(empty1) | |
| trypsin_vol_table = widgets.HTML( | |
| # display volume of the dilute trypsin solution | |
| value = '' | |
| ) | |
| deliver_butt1 = widgets.Button( | |
| # Button to deliver volume for trypsin dilution | |
| description = 'Pipette!', | |
| button_style = 'success', | |
| ) | |
| deliver_butt1.on_click(deliver1) | |
| trypsin_vol_table_update(0) | |
| row_trypsin_dil = widgets.HBox([solns_widget1,empty_butt1,trypsin_vol_table]) | |
| row_pip1 = widgets.HBox([deliver_butt1,pipette,pip_vol]) | |
| box_trypsin_dil=widgets.VBox([row_trypsin_dil,row_pip1]) | |
| ##----------------Set Up Cuvettes ----------------## | |
| def deliver2(change): | |
| if lab_code.value not in codes: | |
| deliver_butt2.description='Enter valid lab code' | |
| deliver_butt2.button_style = 'warning' | |
| return | |
| pip_deliver(solns_widget2, solns_dict2, cuv_widget, cuv_dict) | |
| c_trypsin = cuv_dict[cuv_widget.value].conc['trypsin'] | |
| c_substr = cuv_dict[cuv_widget.value].conc['substr'] | |
| if c_trypsin >0 and c_substr >0: | |
| cuv_dict[cuv_widget.value].t0 = time() | |
| cuv_vol_table.update() | |
| def empty_cuv(change): | |
| cuv = cuv_dict[cuv_widget.value] | |
| for conc in cuv.conc: | |
| cuv.conc[conc]=0.0 | |
| cuv.vol = 0.0 | |
| cuv.vol_n = 0.0 | |
| cuv.t0=0.0 | |
| cuv_vol_table.update() | |
| solns_widget2 = widgets.RadioButtons( | |
| # solutions for cuvettes for part A | |
| options =[('H20','H2O'), ('0.2 M Tris-Cl, pH 8','tris'), ('20 mM CaCl2','cacl'), | |
| ('2 mM substrate','substr'),('1 mM inhibitor','inhib'),('Dilute trypsin','trypsin')], | |
| description='Solutions', | |
| layout=widgets.Layout(width='30%',margin='0px 0px 0px 0px') | |
| ) | |
| cuv_widget = widgets.RadioButtons( | |
| # Cuvettes for part A | |
| options=[1,2,3,4,5,6], | |
| description = 'Cuvettes:' | |
| ) | |
| empty_cuv_butt = widgets.Button( | |
| # button to empty cuvettes for part A | |
| description = 'Empty', | |
| button_style = 'danger', | |
| ) | |
| empty_cuv_butt.on_click(empty_cuv) | |
| cuv_vol_table = VolTable(cuv_dict,'Cuvette') | |
| deliver_butt2 = widgets.Button( | |
| # Button to deliver volume for BSA dilution | |
| description = 'Pipette!', | |
| button_style = 'success', | |
| ) | |
| deliver_butt2.on_click(deliver2) | |
| cuvVb=widgets.VBox([cuv_widget,empty_cuv_butt], | |
| layout=widgets.Layout(width='40%',margin='0px 0px 0px 00px')) | |
| row_cuv = widgets.HBox([solns_widget2,cuvVb,cuv_vol_table]) | |
| row_pip = widgets.HBox([deliver_butt2,pipette,pip_vol], | |
| layout=widgets.Layout(margin='15px 0px 0px 0px')) | |
| box_cuv = widgets.VBox([row_cuv,row_pip]) | |
| ##---------------Kinetic Run --------------------=## | |
| def mm_de(t,y,km,vmax): | |
| s_conc = y[0] | |
| p_conc = y[1] | |
| dp_conc = vmax*s_conc/(km+s_conc) | |
| ds_conc = -dp_conc | |
| return [ds_conc,dp_conc] | |
| def kin_sim(cuv_dict,t_tot): | |
| # simulation is run for twice t_tot, to allow for starting delay | |
| # and continued absorbance readings after the run | |
| pts = int(2*t_tot*60) | |
| kin_sols = [] | |
| km = code_dict[lab_code.value]['km'] | |
| kcat = code_dict[lab_code.value]['kcat'] | |
| ki = code_dict[lab_code.value]['ki'] | |
| i_type = code_dict[lab_code.value]['i_type'] | |
| for cuv in cuv_dict: | |
| s_conc = cuv_dict[cuv].conc['substr'] | |
| p_conc = 0.0 | |
| e_conc =cuv_dict[cuv].conc['trypsin'] | |
| i_conc = cuv_dict[cuv].conc['inhib'] | |
| if cuv_dict[cuv].conc['tris'] < 0.09: | |
| # activity is reduced if tris concentration isn't adequate | |
| kcat *= 0.5 | |
| if cuv_dict[cuv].conc['cacl'] < 0.0009: | |
| # some of the enzyme is lost if CaCl2 concentration isn't adequate | |
| e_conc *= 0.5 | |
| vmax = e_conc*kcat | |
| vmaxpr = vmax | |
| kmpr = km | |
| if i_conc > 0.0 and ki > 0: | |
| if i_type == 'c': | |
| kmpr = km*(1+i_conc/ki) | |
| elif i_type == 'n': | |
| vmaxpr = vmax/(1+i_conc/ki) | |
| elif i_type == 'u': | |
| vmaxpr = vmax/(1+i_conc/ki) | |
| kmpr = km/(1+i_conc/ki) | |
| v = vmaxpr*s_conc/(s_conc+kmpr) | |
| kin_sols.append(solve_ivp(mm_de,[0.0,float(pts)],[s_conc,p_conc], | |
| args=[kmpr,vmaxpr],t_eval=np.linspace(0.0,float(pts),pts+1))) | |
| # return kcat to its original value | |
| kcat=code_dict[lab_code.value]['kcat'] | |
| return kin_sols | |
| def kin_run(abs_table,change): | |
| if lab_code.value not in codes: | |
| run_butt.description='Enter valid lab code' | |
| run_butt.button_style = 'warning' | |
| return | |
| run_butt.disabled = True | |
| abs_sigma = code_dict[lab_code.value]['abs_sigma'] | |
| abs_table.refresh() | |
| if wl.value == '402 nm': | |
| ext_coef=0.9e4 | |
| elif wl.value == '405 nm': | |
| ext_coef=1e4 | |
| else: | |
| ext_coef=0.0 | |
| t_int = abs_table.t_int | |
| t_tot = abs_table.t_tot | |
| n_cuv = abs_table.n_cuv | |
| n_meas = abs_table.n_meas | |
| cuv_dict = abs_table.cuv_dict | |
| abs_data = abs_table.abs_data | |
| # a bit to introduce some variation from run to run, | |
| # as might arise from loss of enzyme activity | |
| e_var = 0.95 + 0.1 * rand.random() | |
| for cuv in cuv_dict: | |
| cuv_dict[cuv].conc['trypsin'] *= e_var | |
| kin_sols = kin_sim(cuv_dict,t_tot) | |
| sleep(1) | |
| cuv_int =int(60*t_int/n_cuv) | |
| delay_t = [] | |
| for cuv in cuv_dict: | |
| if cuv_dict[cuv].t0 > 0: | |
| delay = int(time()-cuv_dict[cuv].t0) | |
| delay_t.append(delay) | |
| else: | |
| delay_t.append(0) | |
| t=0 | |
| tcuv=0 | |
| meas = 1 | |
| cuv = 1 | |
| cuv_show(cuv) | |
| abs_start = abs_read-zero_set | |
| pts_total = int((t_tot+t_int)*60+cuv_int) | |
| for i in range(pts_total): | |
| sleep(t_sleep) | |
| read_t = t + delay_t[cuv-1] | |
| absorb = kin_sols[cuv-1].y[1][read_t]*ext_coef + abs_start | |
| abs_show(absorb) | |
| if tcuv>=cuv_int: | |
| err = rand.normalvariate(0,abs_sigma) | |
| abs_data[meas][cuv] = absorb + err | |
| abs_table.update() | |
| if cuv < n_cuv: | |
| cuv+=1 | |
| else: | |
| cuv=1 | |
| meas +=1 | |
| cuv_show(cuv) | |
| tcuv=0 | |
| tcuv+=1 | |
| t += 1 | |
| make_plot(abs_table.abs_data) | |
| reset_butt.disabled = False | |
| def make_plot(abs_data): | |
| global reg_table | |
| prop_cycle = plt.rcParams['axes.prop_cycle'] | |
| colors = prop_cycle.by_key()['color'] | |
| colors.pop(2) # remove green | |
| #colors.pop(4) # remove brown | |
| #colors.pop(5) # remove grey | |
| plot_data = [[]] | |
| n_meas = abs_table.n_meas | |
| n_cuv = abs_table.n_cuv | |
| abs_data = abs_table.abs_data | |
| for j in range(n_meas): | |
| plot_data[0].append(abs_data[j+1][0]) | |
| for i in range(n_cuv): | |
| plot_data.append([]) | |
| for j in range(n_meas): | |
| plot_data[i+1].append(abs_data[j+1][i+1]) | |
| plot_data = np.array(plot_data) | |
| reg_results = [] | |
| for i in range(n_cuv): | |
| reg = linregress(plot_data[0],plot_data[i+1]) | |
| reg_results.append(reg) | |
| reg_x = np.array([0.0,plot_data[0,-1]]) | |
| fig = plt.figure(figsize=(7.5,5)) | |
| ax= fig.add_subplot(1,1,1) | |
| for i in range(n_cuv): | |
| reg_yint = reg_results[i].intercept | |
| reg_slope = reg_results[i].slope | |
| reg_y = reg_x*reg_slope+reg_yint | |
| ax.plot(plot_data[0],plot_data[i+1],'o',color=colors[i]) | |
| ax.plot(reg_x,reg_y,color=colors[i], label =f'Cuvette {i+1}') | |
| ax.set_title(graph_title,fontsize=18) | |
| ax.set_xlabel('Time (min)',fontsize=14) | |
| ylabel_str = 'Absorbance at ' + wl.value | |
| ax.set_ylabel(ylabel_str,fontsize=14) | |
| data_min = plot_data.min() | |
| if data_min < 0.0: | |
| ax.set_ylim(data_min,) | |
| else: | |
| ax.set_ylim(0,) | |
| ax.set_xlim(0,) | |
| ax.legend() | |
| # Important note: close the plot so that it doesn't automatically | |
| # display in Jupyter. Otherwise, it will never go away! | |
| # display the fig in Output widget, which can be made to go away! | |
| plt.close() | |
| with fig_output: | |
| display(fig) | |
| reg_table = RegTable(reg_results) | |
| # Important note 2: In order for the regression table (an HTML widget | |
| # created within this function) to appear in voila, it has to be put | |
| # in an output widget declared globally. | |
| with reg_table_output: | |
| display(reg_table) | |
| def cuv_show(cuv): | |
| '''function to display the cuvette number in the cuv_display HTML widget''' | |
| cuv_displ.value=f'<h2>Cuvette:<span style="color:red;">\ | |
| {cuv} </span></h2>' | |
| def on_wl_ch(value): | |
| '''Respond to change in the wavelength widget''' | |
| h2O_abs = {'260 nm':0.14,'280 nm':0.3, '402 nm':0.4, '405 nm':0.6,'595 nm':0.8} | |
| absorb=h2O_abs[wl.value] | |
| abs_update(absorb) | |
| def zero(change): | |
| '''Respond to the Zero button''' | |
| global zero_set | |
| zero_set = abs_read | |
| abs_update(abs_read) | |
| def damp_sin(t,nu,tau): | |
| '''damped sine function to simulate settling | |
| of absorbance reading. Input arguments: | |
| t: time | |
| nu: sine-function frequency | |
| tau: exponential-decay time constant | |
| ''' | |
| d_sin = np.exp(-t/tau)*np.sin(t*nu*2*np.pi) | |
| return d_sin | |
| def abs_update(absorb): | |
| '''function to set global abs_read2 variable and | |
| Updates absorbance display, with settling time | |
| Input arguments: | |
| absb: settled absorbance value | |
| global variables used: | |
| t_tot: total time for reading to settle | |
| steps: number of times to update display | |
| as it settles. | |
| ''' | |
| global abs_read | |
| displ_absb = absorb - zero_set | |
| tau = 0.2*t_tot | |
| nu = 5/t_tot | |
| for i in range(steps+1): | |
| t = t_tot*i/steps | |
| abs_d = displ_absb*(1+damp_sin(t,nu,tau)) | |
| sleep(t_tot/steps) | |
| abs_show(abs_d) | |
| abs_read = absorb | |
| def abs_show(absorb): | |
| '''function to displays variable in the spec_dislp HTML widget''' | |
| if absorb < -0.03: | |
| spec_displ.value='<h2> Abs: <span style="color:red;"> Err </span></h2>' | |
| else: | |
| spec_displ.value='<h2> Abs: <span style="color:red;"> \ | |
| {:.3f}'.format(absorb) + '</span></h2>' | |
| def cuv_reset(cuv_dict): | |
| '''Reset volumes, concentrations and t0 in all of the cuvettes in cuv_dict''' | |
| for cuv in cuv_dict: | |
| cuv_dict[cuv].vol = 0.0 | |
| cuv_dict[cuv].vol_n = 0.0 | |
| for c in cuv_dict[cuv].conc: | |
| cuv_dict[cuv].conc[c] = 0.0 | |
| cuv_dict[cuv].t0=0.0 | |
| def on_reset(change): | |
| abs_table.refresh() | |
| reg_table.close() | |
| fig_output.clear_output() | |
| #cuv_reset(cuv_dict) | |
| cuv_vol_table.update() | |
| # reset clock on cuvettes so that a run can be restarted without risk | |
| # of running out of time points. | |
| for cuv in cuv_dict: | |
| cuv_dict[cuv].t0=0.0 | |
| run_butt.disabled = False | |
| reset_butt.disabled = True | |
| abs_table = AbsTable(cuv_dict, 1.5,10.5) | |
| wl = widgets.Dropdown( | |
| # Dropdown to select wavelength for spectrophotometer | |
| options = [('260 nm'),('280 nm'),('402 nm'),('405 nm'),('595 nm')], | |
| description = 'Wavelength:', | |
| style = style, | |
| layout=widgets.Layout(width='200px',margin='0px 0px 20px 0px') | |
| ) | |
| wl.observe(on_wl_ch,names=['value']) | |
| zero_butt = widgets.Button( | |
| # button to zero absorbance display | |
| description = 'Zero', | |
| button_style = 'success', | |
| layout=widgets.Layout(margin='0px 0px 0px 20px') | |
| ) | |
| zero_butt.on_click(zero) | |
| run_butt = widgets.Button( | |
| # Button to start simulated kinetics run | |
| description = 'Run!', | |
| button_style = 'success', | |
| layout=widgets.Layout(margin='0px 0px 0px 0px') | |
| ) | |
| run_butt.on_click(functools.partial(kin_run,abs_table)) | |
| cuv_displ=widgets.HTML( | |
| # cuvette number display | |
| value='1', | |
| layout=widgets.Layout(margin='-15px 0px 0px 20px') | |
| ) | |
| spec_displ = widgets.HTML( | |
| # spectrophotometer display | |
| value='0.0', | |
| layout=widgets.Layout(width='140px',margin='-15px 0px 0px 20px') | |
| ) | |
| reset_butt = widgets.Button( | |
| # button to reset kinetic simulation | |
| description ='Reset', | |
| button_style = 'danger', | |
| disabled = True, | |
| layout=widgets.Layout(margin='0px 0px 0px 20px') | |
| ) | |
| reset_butt.on_click(on_reset) | |
| abs_show(0) | |
| cuv_show(1) | |
| row_spec1 = widgets.HBox([wl,zero_butt]) | |
| row_spec2 = widgets.HBox([run_butt, cuv_displ, spec_displ, reset_butt]) | |
| fig_output = widgets.Output(layout={'border': '1px solid black','width':'500px'}) | |
| reg_table_output=widgets.Output() | |
| ##----------------Other Functions -----------------------## | |
| def test_cuv(group): | |
| # A function for quickly setting up cuvettes for testing | |
| # for cuvettes in Exp 4, Part A | |
| # lab_code.value='0GXY02' | |
| e_stock = code_dict[lab_code.value]['e_conc']/500.0 | |
| s_stock = 0.002 | |
| i_stock = 0.001 | |
| for cuv in cuv_dict: | |
| cuv_dict[cuv].vol = 800.0 | |
| cuv_dict[cuv].vol_n = 800.0 | |
| cuv_dict[cuv].conc['cacl']=2e-4 | |
| cuv_dict[cuv].conc['tris']=0.4 | |
| cuv_dict[cuv].conc['trypsin']=(80.0/800)*e_stock | |
| cuv_dict[cuv].t0 = time() | |
| cuv_dict[1].conc['substr']= (20.0/800)*s_stock | |
| cuv_dict[2].conc['substr']= (40.0/800)*s_stock | |
| cuv_dict[3].conc['substr']= (60.0/800)*s_stock | |
| cuv_dict[4].conc['substr']= (80.0/800)*s_stock | |
| cuv_dict[5].conc['substr']= (120.0/800)*s_stock | |
| cuv_dict[6].conc['substr']= (160.0/800)*s_stock | |
| if group == 1: | |
| for cuv in cuv_dict: | |
| cuv_dict[cuv].conc['inhib'] = 0.0 | |
| if group == 2: | |
| for cuv in cuv_dict: | |
| cuv_dict[cuv].conc['inhib'] = (12.0/800.0)*i_stock | |
| if group == 3: | |
| for cuv in cuv_dict: | |
| cuv_dict[cuv].conc['inhib'] = (24.0/800.0)*i_stock | |
| if group == 4: | |
| for cuv in cuv_dict: | |
| cuv_dict[cuv].conc['inhib'] = (48.0/800.0)*i_stock | |
| cuv_vol_table.update() | |
| ##-------------- Decorative and Informational Widgets ----------------------# | |
| hrule = widgets.HTML( | |
| # general purpose horizontal rule | |
| value ='<hr border-width:6px, color:black>') | |
| header_html = """ | |
| <h2> Biology 3515/Chemistry 3515 | |
| <br> | |
| Biological Chemistry Laboratory | |
| <br> | |
| University of Utah </h2> | |
| <h3> Spring 2021 </h3> | |
| <h3> Experiment 4, Part A: Reversible Enzyme Inhibition</h3> | |
| <p style="font-size:16px"> | |
| This web page simulates the procedures to be carried out in Part A of Experiment 4. The first step of this experiment is to dilute the trypsin stock, with an approximate concentration of 0.05 mg/mL, to give an appropriate reaction rate. The dilution factor for this step is the same as the one that you calculated for Part D of Experiment 4. | |
| <br><br> | |
| For this part of the experiment, you will do four kinetic runs, each with 6 cuvettes containing the same concentration of enzyme and different concentrations of substrate. Each set will use a different inhibitor concentration, from 0 to 60 μM. | |
| <br><br> | |
| The cuvettes should be set up with all of the reagents except the diluted trypsin, which is added last to start the reactions, just before starting the kinetic run on the spectrophotometer. | |
| <br><br> | |
| The kinetic run is carried out as in the previous parts of the experiment, and as would be done in the lab using the program MacSpec to control the spectrophotometer and record the data automatically. As with MacSpec, the simulation will output a table of absorbance values recorded at time intervals and make a plot of the data. The program also prints a table of data from least-squares fit of the data to a straight line. | |
| <br><br> | |
| The graph displayed can be readily copied for use in another program or saved to your computer by right-clicking on the image and choosing the appropriate image. The data in tables cannot be directly saved to a file, but they can be selected using the mouse and copied for use in another program. The rows and columns can be directly copied into the data table of SciDAVis or a spreadsheet. | |
| <br><br> | |
| As in the earlier experiment simulations, a set of radio buttons is used to select solutions to pipette from and the tubes or cuvettes to be pipetted into. Tables are used to show the nominal volumes in the tubes as reagents are added. | |
| <br><br> | |
| The simulation of the kinetic run is sped up by a factor of about 5-fold from what the real experiment takes. | |
| <br><br> | |
| Like the previous experiments, this simulations requires a lab code to function, and your group should use the same code assigned earlier. If you do not have an assigned code, but want to experiment with this simulation, use the code "0GXY02". | |
| """ | |
| header = widgets.HTML( | |
| value=header_html | |
| ) | |
| footer = widgets.HTML( | |
| value=''' | |
| <hr border-width:6px, color:black> | |
| David P. Goldenberg, February 2021<br> | |
| <a href="mailto:[email protected]" target="new">[email protected]</a><br> | |
| School of Biological Sciences, University of Utah<br> | |
| Salt Lake City, Utah 8412-0840<br> | |
| <a href="https://goldenberg.biology.utah.edu/courses/biol3515/index.shtml" | |
| target="new">https://goldenberg.biology.utah.edu/courses/biol3550.</a> | |
| ''') | |
| d1header = widgets.HTML( | |
| # header for part B, part 1 | |
| value = '<h2> 1. Trypsin dilution </h2>' | |
| ) | |
| d2header = widgets.HTML( | |
| # header for part B, part 1 | |
| value = '<h2> 2. Cuvette setup </h2>' | |
| ) | |
| d3header = widgets.HTML( | |
| # header for part B, part 2 | |
| value = '<h2> 3. Kinetic run</h2>' | |
| ) | |
| ##-------------Display everything------------------## | |
| #lab_code.value='0GXY02' | |
| cuv_show(1) | |
| abs_show(0) | |
| display(header) | |
| display(hrule) | |
| display(row_code) | |
| display(hrule) | |
| display(d1header) | |
| display(box_trypsin_dil) | |
| display(hrule) | |
| display(d2header) | |
| display(box_cuv) | |
| display(hrule) | |
| display(d3header) | |
| display(row_spec1) | |
| display(row_spec2) | |
| display(abs_table) | |
| display(fig_output) | |
| display(reg_table_output) | |
| display(footer) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment