|
63 | 63 | { |
64 | 64 | "cell_type": "code", |
65 | 65 | "execution_count": 3, |
| 66 | + "id": "ae833529", |
| 67 | + "metadata": {}, |
| 68 | + "outputs": [], |
| 69 | + "source": [ |
| 70 | + "B0032_rbs = sbol2.ComponentDefinition('B0032', sbol2.BIOPAX_DNA)\n", |
| 71 | + "B0032_rbs.name = 'B0032_rbs'\n", |
| 72 | + "B0032_rbs.addRole(sbol2.SO_RBS)\n", |
| 73 | + "doc.addComponentDefinition(B0032_rbs)\n", |
| 74 | + "\n", |
| 75 | + "B0015_terminator = sbol2.ComponentDefinition('B0015', sbol2.BIOPAX_DNA)\n", |
| 76 | + "B0015_terminator.name = 'B0015_terminator'\n", |
| 77 | + "B0015_terminator.addRole(sbol2.SO_TERMINATOR)\n", |
| 78 | + "doc.addComponentDefinition(B0015_terminator)" |
| 79 | + ] |
| 80 | + }, |
| 81 | + { |
| 82 | + "cell_type": "code", |
| 83 | + "execution_count": 4, |
66 | 84 | "id": "cell-005", |
67 | 85 | "metadata": {}, |
68 | 86 | "outputs": [], |
|
90 | 108 | "doc.addComponentDefinition(pR)" |
91 | 109 | ] |
92 | 110 | }, |
| 111 | + { |
| 112 | + "cell_type": "code", |
| 113 | + "execution_count": 8, |
| 114 | + "id": "cedd52b6", |
| 115 | + "metadata": {}, |
| 116 | + "outputs": [], |
| 117 | + "source": [ |
| 118 | + "# The toggle switch's behavior is defined by two protein pools\n", |
| 119 | + "LacI_protein = sbol2.ComponentDefinition('LacI_protein', sbol2.BIOPAX_PROTEIN)\n", |
| 120 | + "LacI_protein.name = 'LacI Protein'\n", |
| 121 | + "LacI_protein.addRole('http://identifiers.org/ncit/NCIT:C17207') # 'Transcriptional factor'\n", |
| 122 | + "doc.addComponentDefinition(LacI_protein)\n", |
| 123 | + "\n", |
| 124 | + "cI_protein = sbol2.ComponentDefinition('cI_protein', sbol2.BIOPAX_PROTEIN)\n", |
| 125 | + "cI_protein.name = 'Lambda cI Protein'\n", |
| 126 | + "cI_protein.addRole('http://identifiers.org/ncit/NCIT:C17208') # 'Transcriptional factor'\n", |
| 127 | + "doc.addComponentDefinition(cI_protein) " |
| 128 | + ] |
| 129 | + }, |
93 | 130 | { |
94 | 131 | "cell_type": "markdown", |
95 | | - "id": "cell-006", |
| 132 | + "id": "cell-008", |
96 | 133 | "metadata": {}, |
97 | 134 | "source": [ |
98 | | - "## Define the Inverter Modules (Lower-Level Subsystems)\n", |
99 | | - "\n", |
100 | | - "A toggle switch is composed of two inverters. We define each as a `ModuleDefinition`. Each inverter has an input (the repressor protein), a regulated promoter, and an output (the protein it produces). We also add `Interaction` objects to specify the biological function: repression.\n", |
| 135 | + "## Define the Toggle Switch Module (Higher-Level Circuit)\n", |
101 | 136 | "\n", |
102 | | - "- **LacI Inverter**: Takes LacI as input to repress the pLac promoter, which produces the cI protein.\n", |
103 | | - "- **cI Inverter**: Takes cI as input to repress the pR promoter, which produces the LacI protein." |
| 137 | + "This `ModuleDefinition` represents the complete genetic toggle switch. From this high-level perspective, we only care about the two key players: the LacI protein and the cI protein." |
104 | 138 | ] |
105 | 139 | }, |
106 | 140 | { |
107 | 141 | "cell_type": "code", |
108 | | - "execution_count": 4, |
109 | | - "id": "cell-007", |
| 142 | + "execution_count": 10, |
| 143 | + "id": "cell-009", |
110 | 144 | "metadata": {}, |
111 | 145 | "outputs": [], |
112 | 146 | "source": [ |
113 | | - "# 1. LacI Inverter Module (LacI represses production of cI)\n", |
114 | | - "lacI_inverter_md = sbol2.ModuleDefinition('LacI_Inverter')\n", |
115 | | - "\n", |
116 | | - "# Functional Components of the LacI inverter\n", |
117 | | - "lacI_tf_fc = lacI_inverter_md.functionalComponents.create('laci_transcription_factor')\n", |
118 | | - "lacI_tf_fc.definition = lacI_cds\n", |
119 | | - "lacI_tf_fc.access = sbol2.SBOL_ACCESS_PUBLIC\n", |
120 | | - "lacI_tf_fc.direction = sbol2.SBOL_DIRECTION_IN\n", |
121 | | - "\n", |
122 | | - "pLac_fc = lacI_inverter_md.functionalComponents.create('pLac_promoter')\n", |
123 | | - "pLac_fc.definition = pLac\n", |
124 | | - "pLac.access = sbol2.SBOL_ACCESS_PRIVATE\n", |
125 | | - "\n", |
126 | | - "cI_gene_product_fc = lacI_inverter_md.functionalComponents.create('cI_gene_product')\n", |
127 | | - "cI_gene_product_fc.definition = cI_cds\n", |
128 | | - "cI_gene_product_fc.access = sbol2.SBOL_ACCESS_PUBLIC\n", |
129 | | - "cI_gene_product_fc.direction = sbol2.SBOL_DIRECTION_OUT\n", |
130 | | - "\n", |
131 | | - "\n", |
132 | | - "\n", |
133 | | - "# 2. cI Inverter Module (cI represses production of LacI)\n", |
134 | | - "cI_inverter_md = sbol2.ModuleDefinition('cI_Inverter')\n", |
| 147 | + "toggle_md = sbol2.ModuleDefinition('toggle_switch')\n", |
135 | 148 | "\n", |
136 | | - "# Functional Components of the cI inverter\n", |
137 | | - "cI_tf_fc = cI_inverter_md.functionalComponents.create('cI_transcription_factor')\n", |
138 | | - "cI_tf_fc.definition = cI_cds\n", |
139 | | - "cI_tf_fc.access = sbol2.SBOL_ACCESS_PUBLIC\n", |
140 | | - "cI_tf_fc.direction = sbol2.SBOL_DIRECTION_IN\n", |
| 149 | + "# create functional components by calling.using protein ComponentDefinitions\n", |
141 | 150 | "\n", |
142 | | - "pR_fc = cI_inverter_md.functionalComponents.create('pR_promoter')\n", |
143 | | - "pR_fc.definition = pR\n", |
144 | | - "pR_fc.access = sbol2.SBOL_ACCESS_PRIVATE\n", |
| 151 | + "lacI_prot_fc = toggle_md.functionalComponents.create('LacI_protein_toggle')\n", |
| 152 | + "lacI_prot_fc.definition = LacI_protein\n", |
| 153 | + "lacI_prot_fc.direction = sbol2.SBOL_DIRECTION_IN_OUT\n", |
145 | 154 | "\n", |
146 | | - "lacI_gene_product_fc = cI_inverter_md.functionalComponents.create('LacI_gene_product')\n", |
147 | | - "lacI_gene_product_fc.definition = lacI_cds\n", |
148 | | - "lacI_gene_product_fc.access = sbol2.SBOL_ACCESS_PUBLIC\n", |
149 | | - "lacI_gene_product_fc.direction = sbol2.SBOL_DIRECTION_OUT" |
| 155 | + "cI_prot_fc = toggle_md.functionalComponents.create('cI_protein_toggle')\n", |
| 156 | + "cI_prot_fc.definition = cI_protein\n", |
| 157 | + "cI_prot_fc.direction = sbol2.SBOL_DIRECTION_IN_OUT" |
150 | 158 | ] |
151 | 159 | }, |
152 | 160 | { |
153 | 161 | "cell_type": "markdown", |
154 | | - "id": "cell-008", |
| 162 | + "id": "cell-006", |
155 | 163 | "metadata": {}, |
156 | 164 | "source": [ |
157 | | - "## Define the Toggle Switch Module (Higher-Level Circuit)\n", |
| 165 | + "## Define the Inverter Modules (Lower-Level Subsystems)\n", |
158 | 166 | "\n", |
159 | | - "This `ModuleDefinition` represents the complete genetic toggle switch. From this high-level perspective, we only care about the two key players: the LacI protein and the cI protein." |
| 167 | + "A toggle switch is composed of two inverters. We define each as a `ModuleDefinition`. Each inverter has an input (the repressor protein), a regulated promoter, and an output (the protein it produces). We also add `Interaction` objects to specify the biological function: repression.\n", |
| 168 | + "\n", |
| 169 | + "- **LacI Inverter**: Takes LacI as input to repress the pLac promoter, which produces the cI protein.\n", |
| 170 | + "- **cI Inverter**: Takes cI as input to repress the pR promoter, which produces the LacI protein." |
160 | 171 | ] |
161 | 172 | }, |
162 | 173 | { |
163 | 174 | "cell_type": "code", |
164 | | - "execution_count": 5, |
165 | | - "id": "cell-009", |
| 175 | + "execution_count": 24, |
| 176 | + "id": "cell-007", |
166 | 177 | "metadata": {}, |
167 | 178 | "outputs": [], |
168 | 179 | "source": [ |
169 | | - "toggle_md = sbol2.ModuleDefinition('toggle_switch')\n", |
| 180 | + "# 1. LacI Inverter Module (LacI represses production of cI)\n", |
| 181 | + "lacI_inverter_md = sbol2.ModuleDefinition('LacI_Inverter')\n", |
170 | 182 | "\n", |
171 | | - "# The toggle switch's behavior is defined by two protein pools\n", |
172 | | - "lacI_prot_fc = toggle_md.functionalComponents.create('LacI_protein')\n", |
173 | | - "lacI_prot_fc.definition = lacI_cds\n", |
| 183 | + "lacI_inverter_plac_comp = sbol2.component.Component('pLac_promoter', pLac.identity)\n", |
| 184 | + "lacI_inverter_b0032_rbs = sbol2.component.Component('B0032_rbs', B0032_rbs.identity)\n", |
| 185 | + "lacI_inverter_cI_cds = sbol2.component.Component('cI_cds', cI_cds.identity)\n", |
| 186 | + "lacI_inverter_b0015_terminator = sbol2.component.Component('B0015_terminator', B0015_terminator.identity)\n", |
| 187 | + "\n", |
| 188 | + "# LacI Inverter Transcriptional Unit Component Definition\n", |
| 189 | + "lacI_engineered_region = sbol2.ComponentDefinition('LacI_Engineered_Region', sbol2.BIOPAX_DNA)\n", |
| 190 | + "lacI_engineered_region.name = 'LacI Engineered Region'\n", |
| 191 | + "lacI_engineered_region.addRole('http://identifiers.org/so/SO:0000804') \n", |
| 192 | + "lacI_engineered_region.components.add(lacI_inverter_plac_comp)\n", |
| 193 | + "lacI_engineered_region.components.add(lacI_inverter_b0032_rbs)\n", |
| 194 | + "lacI_engineered_region.components.add(lacI_inverter_cI_cds)\n", |
| 195 | + "lacI_engineered_region.components.add(lacI_inverter_b0015_terminator)\n", |
| 196 | + "doc.addComponentDefinition(lacI_engineered_region)\n", |
| 197 | + "\n", |
| 198 | + "# LacI Inverter Proteins\n", |
| 199 | + "lacI_prot_fc_lacI_inverter = lacI_inverter_md.functionalComponents.create('LacI_protein_LacI_inverter')\n", |
| 200 | + "lacI_prot_fc_lacI_inverter.definition = LacI_protein\n", |
| 201 | + "lacI_prot_fc_lacI_inverter.direction = sbol2.SBOL_DIRECTION_IN_OUT\n", |
| 202 | + "\n", |
| 203 | + "cI_prot_fc_lacI_inverter = lacI_inverter_md.functionalComponents.create('cI_protein_LacI_inverter')\n", |
| 204 | + "cI_prot_fc_lacI_inverter.definition = cI_protein\n", |
| 205 | + "cI_prot_fc_lacI_inverter.direction = sbol2.SBOL_DIRECTION_IN_OUT\n", |
| 206 | + "\n", |
| 207 | + "\n", |
| 208 | + "# 2. cI Inverter Module (cI represses production of LacI)\n", |
| 209 | + "cI_inverter_md = sbol2.ModuleDefinition('cI_Inverter')\n", |
| 210 | + "\n", |
| 211 | + "cI_inverter_pR_comp = sbol2.component.Component('pR_promoter', pR.identity)\n", |
| 212 | + "cI_inverter_b0032_rbs = sbol2.component.Component('B0032_rbs', B0032_rbs.identity)\n", |
| 213 | + "cI_inverter_lacI_cds = sbol2.component.Component('lacI_cds', lacI_cds.identity)\n", |
| 214 | + "cI_inverter_b0015_terminator = sbol2.component.Component('B0015_terminator', B0015_terminator.identity) \n", |
| 215 | + "\n", |
| 216 | + "# cI Inverter Transcriptional Unit Component Definition\n", |
| 217 | + "cI_engineered_region = sbol2.ComponentDefinition('cI_Engineered_Region', sbol2.BIOPAX_DNA)\n", |
| 218 | + "cI_engineered_region.name = 'cI Engineered Region'\n", |
| 219 | + "cI_engineered_region.addRole('http://identifiers.org/so/SO:0000804') \n", |
| 220 | + "cI_engineered_region.components.add(cI_inverter_pR_comp)\n", |
| 221 | + "cI_engineered_region.components.add(cI_inverter_b0032_rbs)\n", |
| 222 | + "cI_engineered_region.components.add(cI_inverter_lacI_cds)\n", |
| 223 | + "cI_engineered_region.components.add(cI_inverter_b0015_terminator)\n", |
| 224 | + "doc.addComponentDefinition(cI_engineered_region)\n", |
| 225 | + "\n", |
| 226 | + "# cI Inverter Proteins\n", |
| 227 | + "lacI_prot_fc = cI_inverter_md.functionalComponents.create('LacI_protein_cI_inverter')\n", |
| 228 | + "lacI_prot_fc.definition = LacI_protein\n", |
174 | 229 | "lacI_prot_fc.direction = sbol2.SBOL_DIRECTION_IN_OUT\n", |
175 | 230 | "\n", |
176 | | - "cI_prot_fc = toggle_md.functionalComponents.create('cI_protein')\n", |
177 | | - "cI_prot_fc.definition = cI_cds\n", |
178 | | - "cI_prot_fc.direction = sbol2.SBOL_DIRECTION_IN_OUT" |
| 231 | + "cI_prot_fc = cI_inverter_md.functionalComponents.create('cI_protein_cI_inverter')\n", |
| 232 | + "cI_prot_fc.definition = cI_protein\n", |
| 233 | + "cI_prot_fc.direction = sbol2.SBOL_DIRECTION_IN_OUT " |
179 | 234 | ] |
180 | 235 | }, |
181 | 236 | { |
|
190 | 245 | }, |
191 | 246 | { |
192 | 247 | "cell_type": "code", |
193 | | - "execution_count": 6, |
| 248 | + "execution_count": 25, |
194 | 249 | "id": "cell-010b", |
195 | 250 | "metadata": {}, |
196 | 251 | "outputs": [], |
|
206 | 261 | }, |
207 | 262 | { |
208 | 263 | "cell_type": "code", |
209 | | - "execution_count": 7, |
| 264 | + "execution_count": null, |
210 | 265 | "id": "9cdcd7c0-e419-4106-b7f3-7c8aba06fd7e", |
211 | 266 | "metadata": {}, |
212 | 267 | "outputs": [], |
|
263 | 318 | }, |
264 | 319 | { |
265 | 320 | "cell_type": "code", |
266 | | - "execution_count": 8, |
| 321 | + "execution_count": null, |
267 | 322 | "id": "cell-012", |
268 | 323 | "metadata": {}, |
269 | 324 | "outputs": [], |
|
305 | 360 | }, |
306 | 361 | { |
307 | 362 | "cell_type": "code", |
308 | | - "execution_count": 9, |
| 363 | + "execution_count": null, |
309 | 364 | "id": "cell-014", |
310 | 365 | "metadata": {}, |
311 | 366 | "outputs": [ |
|
334 | 389 | ], |
335 | 390 | "metadata": { |
336 | 391 | "kernelspec": { |
337 | | - "display_name": "Python 3 (ipykernel)", |
| 392 | + "display_name": "GLLDB", |
338 | 393 | "language": "python", |
339 | 394 | "name": "python3" |
340 | 395 | }, |
|
348 | 403 | "name": "python", |
349 | 404 | "nbconvert_exporter": "python", |
350 | 405 | "pygments_lexer": "ipython3", |
351 | | - "version": "3.13.5" |
| 406 | + "version": "3.9.19" |
352 | 407 | } |
353 | 408 | }, |
354 | 409 | "nbformat": 4, |
|
0 commit comments