Skip to content

Commit 007e0c8

Browse files
committed
remove me
1 parent 7a2f6ad commit 007e0c8

File tree

1 file changed

+77
-0
lines changed

1 file changed

+77
-0
lines changed

examples/sbol2/CreatingSBOL2Objects/MapsTo.ipynb

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@
129129
"gene_out.direction = sbol2.SBOL_DIRECTION_OUT\n",
130130
"\n",
131131
"\n",
132+
"\n",
133+
"\n",
132134
"# 2. cI Inverter Module (cI represses production of LacI)\n",
133135
"ci_inverter_md = sbol2.ModuleDefinition('cI_Inverter')\n",
134136
"\n",
@@ -234,16 +236,19 @@
234236
"\n",
235237
"# Map 2: cI protein is the output of the LacI inverter\n",
236238
"map2 = laci_inverter_instance.mapsTos.create('map_ci_out')\n",
239+
"map2.refinement = sbol2.SBOL_REFINEMENT_USE_REMOTE\n",
237240
"map2.local = ci_fc.identity\n",
238241
"map2.remote = gene_out.identity\n",
239242
"\n",
240243
"# Map 3: cI protein is the input to the cI inverter\n",
241244
"map3 = ci_inverter_instance.mapsTos.create('map_ci_in')\n",
245+
"map3.refinement = sbol2.SBOL_REFINEMENT_USE_LOCAL\n",
242246
"map3.local = ci_fc.identity\n",
243247
"map3.remote = tf_in_2.identity\n",
244248
"\n",
245249
"# Map 4: LacI protein is the output of the cI inverter\n",
246250
"map4 = ci_inverter_instance.mapsTos.create('map_laci_out')\n",
251+
"map3.refinement = sbol2.SBOL_REFINEMENT_USE_LOCAL\n",
247252
"map4.local = laci_fc.identity\n",
248253
"map4.remote = gene_out_2.identity"
249254
]
@@ -277,6 +282,78 @@
277282
"else:\n",
278283
" print(report)"
279284
]
285+
},
286+
{
287+
"cell_type": "markdown",
288+
"id": "08dadc57-f545-4814-bda2-f0603de35a91",
289+
"metadata": {},
290+
"source": [
291+
"## Define the Inverter Modules (Lower-Level Subsystems)\n",
292+
"\n",
293+
"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",
294+
"\n",
295+
"- **LacI Inverter**: Takes LacI as input to repress the pLac promoter, which produces the cI protein.\n",
296+
"- **cI Inverter**: Takes cI as input to repress the pR promoter, which produces the LacI protein."
297+
]
298+
},
299+
{
300+
"cell_type": "code",
301+
"execution_count": 10,
302+
"id": "5f444c97-d461-4db7-9d05-572457b994a3",
303+
"metadata": {},
304+
"outputs": [
305+
{
306+
"data": {
307+
"text/plain": [
308+
"<sbol2.property.OwnedObject at 0x10642a1d0>"
309+
]
310+
},
311+
"execution_count": 10,
312+
"metadata": {},
313+
"output_type": "execute_result"
314+
}
315+
],
316+
"source": [
317+
"# Create the repression interactions for the toggle switch\n",
318+
"# Interaction: LacI represses LacI production\n",
319+
"LacI_represses_pLac_interaction = sbol2.Interaction('LacI_represses_pLac_interaction')\n",
320+
"LacI_represses_pLac_interaction.interaction_type = sbol2.SBO_INHIBITION\n",
321+
"toggle_switch_md.interactions.add(LacI_represses_pLac_interaction)\n",
322+
"\n",
323+
"# Participation: TetR as inhibitor\n",
324+
"tetR_inhibitor_part = LacI_represses_pLac_interaction.participations.create('TetR_inhibitor_part')\n",
325+
"tetR_inhibitor_part.roles = [sbol2.SBO_INHIBITOR]\n",
326+
"tetR_inhibitor_part.participant = tetR_protein_fc_parent.identity # Correct: participant is in toggle_switch_md\n",
327+
"\n",
328+
"# Participation: pLac_promoter as inhibited target\n",
329+
"lacI_target_part = LacI_represses_pLac_interaction.participations.create('LacI_target_part')\n",
330+
"lacI_target_part.roles = [sbol2.SBO_INHIBITED]\n",
331+
"lacI_target_part.participant = pLac_promoter_fc_parent.identity # Correct: participant is in toggle_switch_md\n",
332+
"\n",
333+
"\n",
334+
"# Interaction: LacI represses TetR production\n",
335+
"lacI_represses_tetR_interaction = sbol2.Interaction('LacI_represses_TetR_interaction')\n",
336+
"lacI_represses_tetR_interaction.interaction_type = sbol2.SBO_INHIBITION\n",
337+
"toggle_switch_md.interactions.add(lacI_represses_tetR_interaction)\n",
338+
"\n",
339+
"# Participation: LacI as inhibitor\n",
340+
"lacI_inhibitor_part = lacI_represses_tetR_interaction.participations.create('LacI_inhibitor_part')\n",
341+
"lacI_inhibitor_part.roles = [sbol2.SBO_INHIBITOR]\n",
342+
"lacI_inhibitor_part.participant = lacI_protein_fc_parent.identity # Correct: participant is in toggle_switch_md\n",
343+
"\n",
344+
"# Participation: pTet_promoter as inhibited target\n",
345+
"tetR_target_part = lacI_represses_tetR_interaction.participations.create('TetR_target_part')\n",
346+
"tetR_target_part.roles = [sbol2.SBO_INHIBITED]\n",
347+
"tetR_target_part.participant = pTet_promoter_fc_parent.identity # Correct: participant is in toggle_switch_md"
348+
]
349+
},
350+
{
351+
"cell_type": "code",
352+
"execution_count": null,
353+
"id": "c621aca1-57ef-4752-a47a-0dea6f0bebb6",
354+
"metadata": {},
355+
"outputs": [],
356+
"source": []
280357
}
281358
],
282359
"metadata": {

0 commit comments

Comments
 (0)