-
Notifications
You must be signed in to change notification settings - Fork 1
pySBOL2 MapsTo object tutorial #46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| "source": [ | ||
| "# MapsTo in pySBOL2\n", | ||
| "\n", | ||
| "The `MapsTo` class in the Synthetic Biology Open Language (SBOL) is used to explicitly state that two `ComponentInstance` objects, often from different levels of design hierarchy, represent the same biological entity. It is most often used when `ModuleDefinition` and `ComponentDefinition` objects are composed using `Module` and `ComponentInstance` objects.\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Give an intuitive example of what this means - why would you want to do this, biologically?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For example, to design a genetic "toggle switch" ModuleDefinition we can compose two mutually repressing transcriptional units as its Modules. The transcriptional units ModuleDefinition might be one where its promoter is repressed by the cI transcription factor (TF) protein ComponentInstance and its CDS codes for the LacI TF protein ComponentInstance. And the the other where its prmoter is repressed by LacI and its CDS codes for cI.
In this context we would like to know that the proteins expressed by each transcriptional unit is the one repressing the other. To do this we "map" LacI and ci ComponentInstance from one ModuleDefinition to the other.
| "- `remote`: Refers to the `ComponentInstance` in the lower-level design. The referenced instance must have `access=\"public\"`.\n", | ||
| "- `refinement`: Specifies how to interpret the relationship between the local and remote instances using a URI. For example: `http://sbols.org/v2#useRemote`.\n", | ||
| "\n", | ||
| "This example demonstrates linking a `FunctionalComponent` in a high-level toggle switch module to one in a lower-level LacI inverter using a `MapsTo` object. We will:\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, we need to explain what this means biologically
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We think the example will provide enought link between the biology and its representation.
| "id": "cell-004", | ||
| "metadata": {}, | ||
| "source": [ | ||
| "Creating a MapsTo Object" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Say what we're actually doing, biologically
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@GeneCodeSavvy TBI
| "source": [ | ||
| "# Create lower-level ModuleDefinition\n", | ||
| "inverter_md = sbol2.ModuleDefinition('laci_inverter')\n", | ||
| "tf_fc = inverter_md.functionalComponents.create('TF')\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is TF?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now included in the example
| "tf_fc = inverter_md.functionalComponents.create('TF')\n", | ||
| "tf_fc.definition = tf_fc\n", | ||
| "tf_fc.access = sbol2.SBOL_ACCESS_PUBLIC\n", | ||
| "tf_fc.direction = sbol2.SBOL_DIRECTION_IN_OUT\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this in/out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@GeneCodeSavvy TBI give readable and explicit names
| "# Create lower-level ModuleDefinition\n", | ||
| "inverter_md = sbol2.ModuleDefinition('laci_inverter')\n", | ||
| "tf_fc = inverter_md.functionalComponents.create('TF')\n", | ||
| "tf_fc.definition = tf_fc\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is incorrect, and it shouldn't be letting us get away with this. This should be pointing at a ComponentDefinition.
| "# Create higher-level ModuleDefinition\n", | ||
| "toggle_md = sbol2.ModuleDefinition('toggle_switch')\n", | ||
| "laci_fc = toggle_md.functionalComponents.create('LacI')\n", | ||
| "laci_fc.definition = laci_fc\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is incorrect, and it shouldn't be letting us get away with this. This should be pointing at a ComponentDefinition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@GeneCodeSavvy create a ComponentDefinition for each object that needs it, then create the functionalComponents pointing to them.
| "\n", | ||
| "# Create higher-level ModuleDefinition\n", | ||
| "toggle_md = sbol2.ModuleDefinition('toggle_switch')\n", | ||
| "laci_fc = toggle_md.functionalComponents.create('LacI')\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Explain what this is for, biologically: why do we need this here if it is private and not interacting with anything?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@GeneCodeSavvy TBI
| "mod = toggle_md.modules.create('laci_inverter_instance')\n", | ||
| "mod.definition = inverter_md.identity\n", | ||
| "\n", | ||
| "# Create the MapsTo\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Explain what this means, intuitively.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@GeneCodeSavvy TBI
| "outputs": [], | ||
| "source": [ | ||
| "# Validate the document\n", | ||
| "report = doc.validate()\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you do something with the contents of the document to show it's correct and useful besides just validate it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you have any idea in how to do it? We can use it as input fora model (like iBioSim)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking something like starting with LacI and tracing the Interactions to show that the linkages go around in a circle.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@GeneCodeSavvy please implement this idea so we can review it in the 1o1
|
I have considered all the comments and added more biological context overall, with the help of @Gonza10V explanation. |
| "gene_out = laci_inverter_md.functionalComponents.create('output_gene')\n", | ||
| "gene_out.definition = cI_cds.identity\n", | ||
| "gene_out.access = sbol2.SBOL_ACCESS_PUBLIC\n", | ||
| "gene_out.direction = sbol2.SBOL_DIRECTION_OUT\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This ModuleDefinition is incomplete without the Interaction objects that link the Promoter to the TF to the output gene.
As such, you should either add the two Interaction objects (my preference) or should add a comment saying that they have been omitted for simplicity.
Same for the other inverter ModuleDefinition
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay I will include it.
| "source": [ | ||
| "# Map 1: LacI protein is the input to the LacI inverter\n", | ||
| "map1 = laci_inverter_instance.mapsTos.create('map_laci_in')\n", | ||
| "map1.refinement = sbol2.SBOL_REFINEMENT_USE_REMOTE\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the others have their refinement values set as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, missed this.
Updated.
| "outputs": [], | ||
| "source": [ | ||
| "# Validate the document\n", | ||
| "report = doc.validate()\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking something like starting with LacI and tracing the Interactions to show that the linkages go around in a circle.
Co-authored-by: Jacob Beal <jakebeal@gmail.com>
| "outputs": [], | ||
| "source": [ | ||
| "# Validate the document\n", | ||
| "report = doc.validate()\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@GeneCodeSavvy please implement this idea so we can review it in the 1o1
007e0c8 to
7a2f6ad
Compare
5ab2589 to
2523b19
Compare
Solves #22