Team:UCSD Software/Documentation

From 2014.igem.org

(Difference between revisions)
 
(80 intermediate revisions not shown)
Line 1: Line 1:
-
Provide detailed API documentation, preferably, automatically built from source code documentation (use tools like doxygen, yard, rdoc, naturaldocs, etc).
 
-
Demonstrate that you followed best practises in software development so that other developers can modify, use and reuse your code. Provide more than one realistic test case. Examples of best practices are automated unit testing and documentation of test coverage, bug tracking facilities, documentation of releases and changes between releases.
 
-
Provide a comprehensive and well-designed User Guide. (Be creative! An instructional video may work as well.)
 
-
 
-
 
{{Team:UCSD Software/CSS}}
{{Team:UCSD Software/CSS}}
<html>
<html>
 +
 +
<head>
<head>
<meta charset="UTF-8">
<meta charset="UTF-8">
Line 15: Line 12:
         <script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
         <script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
         <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
         <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
 +
        <script src="countdown.js"></script>
<Style>
<Style>
 +
 +
 +
 +
video {
 +
margin-top: -110px;
 +
}
 +
.stuck {
.stuck {
     position: fixed;
     position: fixed;
Line 305: Line 310:
}
}
-
#w4 {
 
-
display: none;
 
-
}
 
-
#w5 {
 
-
display: none;
 
-
}
 
-
 
-
#w6 {
 
-
display: none;
 
-
}
 
-
 
-
#w7 {
 
-
display: none;
 
-
}
 
-
 
-
#w8 {
 
-
display: none;
 
-
}
 
-
 
-
#w9 {
 
-
display: none;
 
-
}
 
-
 
-
#w10 {
 
-
display: none;
 
-
}
 
-
 
-
#w11{
 
-
display: none;
 
-
}
 
-
 
-
#w12 {
 
-
display: none;
 
-
}
 
-
 
-
#w13 {
 
-
display: none;
 
-
}
 
-
 
-
#w14 {
 
-
display: none;
 
-
}
 
-
 
-
#w15 {
 
-
display: none;
 
-
}
 
/******************************DEFAULT WIKI SETTINGS CSS: CHANGING IT TO REFLECT OUR OWN PAGE********************
/******************************DEFAULT WIKI SETTINGS CSS: CHANGING IT TO REFLECT OUR OWN PAGE********************
Line 389: Line 348:
background-color: #003D99;//#efefef;//#383838;
background-color: #003D99;//#efefef;//#383838;
border: 0 none;
border: 0 none;
-
height: 14px; // 46 px
+
height: 1px; // 46 px
z-index: 100;
z-index: 100;
top: 0;
top: 0;
Line 401: Line 360:
#top-section-bar { /*-- styling full width bar which hides behind default menu bar (edit, page, history, etc.) --*/
#top-section-bar { /*-- styling full width bar which hides behind default menu bar (edit, page, history, etc.) --*/
-
background-color: #333;
+
background-color: #003D99;//#333;
height: 1px; //DEFAULT 14 PX
height: 1px; //DEFAULT 14 PX
display: none;//block;
display: none;//block;
Line 412: Line 371:
-
 
-
/*#top-section {
 
-
background-color: #333;//#383838;
 
-
border: 0 none;
 
-
height: 46px; // DEFAULT 14 px
 
-
z-index: 100;
 
-
top: 0;
 
-
        //display: none;
 
-
position: fixed;
 
-
width: 2975px;
 
-
left: 50%;
 
-
margin-left: -687px;
 
-
}
 
-
 
-
#top-section-bar {
 
-
background-color: #333;
 
-
height: 1px; //DEFAULT 14 PX
 
-
display: none;//block;
 
-
       
 
-
z-index: 10;
 
-
position: fixed;
 
-
width: 100%;
 
-
top: 0;
 
-
}*/
 
#menubar a:link, #menubar a:active, #menubar a:visited, #menubar a:hover, #menubar:hover { /*-- styling for default menu bar links (edit, page, history, etc.) --*/
#menubar a:link, #menubar a:active, #menubar a:visited, #menubar a:hover, #menubar:hover { /*-- styling for default menu bar links (edit, page, history, etc.) --*/
color: #727272;  
color: #727272;  
Line 448: Line 383:
height: 100%;
height: 100%;
border: 0px;
border: 0px;
-
background-color: transparent;
+
background-color: #efefef;//transparent
margin: 0px;
margin: 0px;
padding: 0px;
padding: 0px;
Line 454: Line 389:
html, body, .wrapper { /*-- changes default wiki settings --*/
html, body, .wrapper { /*-- changes default wiki settings --*/
 +
 +
        height:100%;
width: 100%;  
width: 100%;  
-
height: 100%;
+
background-color: #efefef;//#efefef;//#003D99;//transparent;
-
background-color: #efefef;//#003D99;//transparent;
+
}
}
Line 467: Line 403:
margin-left: auto;  
margin-left: auto;  
margin-right: auto;  
margin-right: auto;  
-
background-color: #transparent;  
+
background-color: #003D99;//transparent
margin-top: 0px;  
margin-top: 0px;  
}
}
Line 476: Line 412:
</head>
</head>
<body>
<body>
-
<!--navbar -->
 
-
 
-
 
-
            <!--<div class="container-fluid">-->
 
-
           
 
          
          
-
            <!-- <nav class="navbar navbar-header nav-justified" role="navigation" id='nav'>
+
          <nav class="navbar nav-justified" role="navigation" id='nav'>
-
                <div class="btn-group  btn-group btn-group-justified">
+
-
                <ul class="nav navbar-nav">
+
-
                    <li><div class="btn btn-lg" id="home">Home</div></li>
+
-
                    <li><div class="btn btn-lg" id="team">Team</div></li>
+
-
 
+
-
                    <li class="dropdown">
+
-
              <div class="btn btn-lg dropdown-toggle" data-toggle="dropdown" id="project">Project <span class="caret"></span></div>
+
-
              <ul class="dropdown-menu" role="menu">
+
-
                <li><a href="#">Database</a></li>
+
-
                <li><a href="#">Traversal algorithms</a></li>
+
-
                <li><a href="#">Web application</a></li>
+
-
                <li><a href="#">Parts</a></li>
+
-
                <li><a href="#">Modeling</a></li>
+
-
              </ul>
+
-
            </li>
+
-
                   
+
-
                    <li><div class="btn btn-lg" id="notebook">Notebook</div></li>
+
-
                    <li><div class="btn btn-lg" id="safety">Safety</div></li>
+
-
                    <li><div class="btn btn-lg" id="achieve">Software Achievements</div></li>
+
-
                    <li><div class="btn btn-lg" id="attributions">Attributions</div></li>
+
-
                    </ul>
+
-
              </div>
+
-
             
+
-
               
+
-
               
+
-
        </nav>-->
+
-
     
+
-
        <!--</div>-->
+
-
 
+
-
 
+
-
 
+
-
       
+
-
          <!--<div class="container-fluid">-->
+
-
           
+
-
 
+
-
       
+
-
            <nav class="navbar navbar-header nav-justified" role="navigation" id='nav'>
+
                 <div class="btn-group  btn-group btn-group-justified">
                 <div class="btn-group  btn-group btn-group-justified">
                     <div class="btn btn-lg " id="home">Home</div>
                     <div class="btn btn-lg " id="home">Home</div>
                     <div class="btn btn-lg " id="team">Team</div>
                     <div class="btn btn-lg " id="team">Team</div>
-
                   
 
                     <div class="btn btn-lg " id="project">Project</div>
                     <div class="btn btn-lg " id="project">Project</div>
-
                      
+
                     <div class="btn btn-lg " id="doc">Documentation</div>
-
                  <div class="btn btn-lg" id="notebook">Notebook</div>
+
                    <div class="btn btn-lg" id="notebook">Notebook</div>
                     <div class="btn btn-lg" id="safety">Safety</div>
                     <div class="btn btn-lg" id="safety">Safety</div>
-
                   
 
                     <div class="btn btn-lg" id="attributions">Sponsors</div>
                     <div class="btn btn-lg" id="attributions">Sponsors</div>
                     <div class="btn btn-lg" id="achieve">Achievements</div>
                     <div class="btn btn-lg" id="achieve">Achievements</div>
 +
                    <div class="btn btn-lg" id="logo"><a href = "https://igem.org/Main_Page"><img src = "http://i.imgur.com/mGHw11P.png?1"></a></div>
                      
                      
               </div>
               </div>
                  
                  
             </nav>
             </nav>
-
     
 
-
        <!--</div>-->
 
-
 
-
 
<div class="jumbotron" >
<div class="jumbotron" >
Line 546: Line 435:
                 <!-- FIXED NAV BAR --- <ul class="nav nav-pills nav-stacked"> -->
                 <!-- FIXED NAV BAR --- <ul class="nav nav-pills nav-stacked"> -->
                 <ul class="nav nav-pills nav-stacked">
                 <ul class="nav nav-pills nav-stacked">
-
                         <li id = "w1click"><a href = "#" class = "list_items"><font size = "4px" color = "#000000" weight="normal">Project Description</font></a></li>
+
                         <li id = "w1click"><a href = "#" class = "list_items"><font size = "4px" color = "#000000" weight="normal">Tutorial</font></a></li>
-
                         <li id = "w5click"><a href = "#" class = "list_items"><font size = "4px" color = "#000000">Database</font></a></li>
+
                         <li id = "w2click"><a href = "#" class = "list_items"><font size = "4px" color = "#000000">API Documentation</font></a></li>
-
                         <li id = "w4click"><a href = "#" class = "list_items"><font size = "4px" color = "#000000">Traversal</font></a></li>
+
                         <li id = "w3click"><a href = "#" class = "list_items"><font size = "4px" color = "#000000">Testing</font></a></li>                          
-
                        <li id = "w3click"><a href = "#" class = "list_items"><font size = "4px" color = "#000000">Web Application</font></a></li>
+
-
                      <li id = "w6click"><a href = "#" class = "list_items"><font size = "4px" color = "#000000">Modeling</font></a></li>
+
-
                      <li id = "w7click"><a href = "#" class = "list_items"><font size = "4px" color = "#000000">Network Analysis</font></a></li>
+
-
                        <li id = "w2click"><a href = "#" class = "list_items"><font size = "4px" color = "#000000">Future Directions</font></a></li>
+
-
                         
+
             </ul>
             </ul>
           </div>
           </div>
-
           <div class = "col-md-9"><h2 class = "text-center">Description</h2>
+
   
 +
           <div class = "col-md-9">
 +
<div id = "w1"><!-- class = "row text-center"-->
-
<div id = "w7">
+
<h2 class = "text-center"><b>Tutorial</b></h3><br><br>
-
 
+
<div class = "row text-center">
-
<h3 class = "text-center"><b>Network Analysis</b></h3>
+
-
 
+
-
Gene circuit design often involves the laborious extension of existing circuitry through the development of new devices.  Device development is a taxing biological endeavor to which SBiDer offers an alternative.  SBIDer facilitates circuit design by integrating knowledge across existing genetic modules.  We provide evidence for an increase in functional motifs relative to the circuitry input into our database by examining common network attributes and executing more sophisticated network analysis.<br><br>
+
-
 
+
-
In analyzing our database, we demonstrated and quantified the increased number of genetic circuits relative to the input circuits. Connectivity served as a preliminary indicator of the increase in potential circuits. We compared the connectivity, measured by “in-degree” and “out-degree,” of the input circuitry to the degree measure of the integrated database.  The increase in degree indicates a combinatorial increase in potential circuits. <br><br>
+
-
 
+
-
<img src = ""><img src = "">
+
-
<br>
+
-
 
+
-
This increase is observed as the rightward shift of the In-Degree(v) and Out-Degree(v) distributions.  The degree comparison between the input circuitry and the database demonstrated an increase in modulators and modulations in the database.  Theoretically, every in-degree increase represents a novel modulation of that node, every out-degree increase represents a novel opportunity for that node to modulate another.  The increase in modulators and modulations is important because every combination of these novel inputs and outputs constitutes a new circuit. Further, each ancestor and descendant of a node increase the count of novel circuits exponentially, as a function of the degree.  In addition to analyzing the connectivity of our network, we implemented network motif analysis techniques in attempt to identify topological motifs.
+
-
 
+
-
<br><br>
+
-
 
+
-
<img src = ""> Topological motifs can map to functional motifs which are the subunits of genetic circuitry [<a href = "http://www.nature.com/nrg/journal/v8/n6/abs/nrg2102.html">Alon, 2007</a>].  We considered this correspondence and applied CytoKavosh [<a href = "http://www.plosone.org/article/info%3Adoi%2F10.1371%2Fjournal.pone.0043287">Masoudi-Nejad et.al., 2012</a>] to identify topological motifs that occurred significantly relative to a random graph. CytoKavosh is a visual implementation of the Kavosh motif finding algorithm [<a href = "http://www.biomedcentral.com/1471-2105/10/318">Kashani, et.al, 2009</a>] constructed on the <a href = "http://www.cytoscape.org/">Cytoscape</a> platform. We report an increase in the number of topological motifs after analysis of the input circuitry.  The bi-fan network motif 1 (Kavosh motif 204) showed a 1.98 fold increase from the input circuitry to the integrated database.  In our most extreme cases, motifs 540 and 16920 (not included in the graph) had a 7.89 and 6.75 fold increase, respectively.  The cumulative increase in fold change across discussed motifs is 24.57.  Increases in the counts of selected motifs are shown below: <br><br>
+
-
<img src = ""> <!-- CAPTION: A display of counts of selected motifs, grouped by motif IDs generated by CytoKavosh -->
 
-
 
-
<br>
 
-
 
-
A comparison of CytoKavosh analyzed motifs between the input circuitry and the databases shows a clear increase in the number of known motifs.  The observed increase in network motifs validates our expectation that integrating related circuits would increase their potential.
 
 +
<video controls="" name="media" style="max-width: 100%; max-height: 100%;" height = "350" width = "350">
 +
<source src="https://static.igem.org/mediawiki/2014/6/6d/SBiDer_Tutorial-_Making_a_Search_Query.mov" type="video/mov">
 +
<source src="https://static.igem.org/mediawiki/2014/7/7c/SBiDer_Tutorial-_Making_a_Search_Query.mp4" type="video/mp4">
 +
</video> &nbsp;&nbsp;&nbsp;&nbsp;
 +
<video controls="" name="media" style="max-width: 100%; max-height: 100%;" height = "350" width = "350">
 +
<source src="https://static.igem.org/mediawiki/2014/8/87/SBiDer_Tutorial-_Using_the_Toolbar.mov" type="video/mov">
 +
<source src="https://static.igem.org/mediawiki/2014/f/f2/SBiDer_Tutorial-_Using_the_Toolbar.mp4" type="video/mp4">
 +
</video>
 +
</div>
</div>
</div>
-
             
 
-
             
 
-
<div id = "w1">
 
-
Genetic circuits are often difficult to engineer, requiring months to design, build, and test each individual genetic device involved in the circuit. SBiDer, a web tool developed by the UCSD Software iGEM team, will leverage existing devices to construct a database with consideration for the function of each device interpreted as boolean logic. The data can be queried by the user through SBiDer's visual interface to explore circuit designs. The displayed circuit's literature reference, characterization data, and images of included devices can be viewed through the built-in table. Basic validation of the circuit performance is also provided within in the interface. SBiDer's web of information can be expanded through user-generated additions to the database to improve the efficiency of the application and the accuracy of the models. <br>
 
-
<h3 class = "text-center">List of definitions for terms used in various sections of this page:</h3>
 
-
<ul>
 
-
<li><b>Nodes</b></li>
 
-
    <ul>
 
-
    <li>Algorithm
 
-
        <ul>
 
-
        <li>Operon node (within the search algorithm): composed of the input transition, operon node (within the Petri Net  model), and output transition</li>
 
-
        <li>Operon node (within the Petri Net model of the network): node where the only information stored is the type of operon
 
-
</li>
 
-
        </ul></li>
 
-
    <li>Web Application
 
-
        <ul>
 
-
        <li>Operon node: A node that contains only the operon description and reference material in contrast to the more complex operon nodes within the search algorithm.</li>
 
-
        <li>Species node: A node that contains only the species information which is similar to its usage in the algorithm.</li>
 
-
        <li>Transition node (see Input Transition and Output Transition): Graphical representation of the Petri Net Transitions.
 
-
</li>
 
-
        </ul></li>
 
-
    </ul>
 
-
<li><b>Input (for search)</b> <ul><li>A set of desired initial species to start the traversal algorithm.</li></ul></li>
 
-
<li><b>Output (for search)</b><ul><li>A set of desired final species produced by the traversal algorithm.</li></ul></li>
+
<div id = "w2">
-
<li><b>Paths</b>: <ul><li>Operon paths:<ul><li>composed of operon nodes as defined within the algorithm representation of the network and species nodes. The network condenses to a directed tree graph from a Petri Net representation.</li></ul></li>
+
<h3 class = "text-center"><b>API Documentation</b></h3>
 +
Download and view the documentation on github <a href='https://github.com/igemsoftware/UCSD-iGEM_2014/tree/master/CircuitNetwork/web/doc'>here</a>. A text version of the documentation is shown below:
 +
<br/>
 +
<pre>
 +
Help on module Gen_Network:
-
<li><b>Petri Net path</b>:<ul><li>The cyclic movement from a place (species) to an input transition to another place (operon) to an output transition to an ultimate place(species). </li></ul></li></ul></li>
+
NAME
 +
    Gen_Network - //Title: SBML Network Generator
-
<li><b>Petri net</b>:<ul><li>Consists of operon nodes, species nodes, and transitions. All logic required to activate an operon is encompassed within the transition. Species nodes always point to an input transition, which points to one operon, which points to a singular output transition, which points to a species node.</li></ul></li>
+
FILE
 +
    /Users/jenhantao/Documents/UCSD_IGEM/CircuitNetwork/web/Gen_Network.py
-
<li><b>Places</b><ul><li>Conditions to be met in order to enable a transition in the Petri Net model.</li></ul></li>
+
DESCRIPTION
 +
    //Description:
 +
        Translate entire network model to SBML and store network file
 +
        in current working directory 
 +
   
 +
    *************************************************
 +
    @author: Fernando Contreras
 +
    @email: f2contre@gmail.com
 +
    @project: SBiDer
 +
    @institution: University of California, San Diego
 +
    *************************************************
-
<li><b>Transitions</b><ul><li>Activated events that allow movement from Place to Place in a Petri Net model.</li></ul></li>
+
FUNCTIONS
 +
    create_whole_network_sbml()
-
<li><b>SBML</b><ul><li>a free and open interchange format for computer models of biological processes, which is based on the XML standard. SBML is useful for models of metabolism, cell signaling, and more. It continues to be evolved and expanded by an international community. </li></ul></li>
+
Help on module SBML_Network:
-
<li><b>SBOL</b><ul><li>Synthetic Biology Open Language Visual is an open source graphical notation that allows the user to communicate sequences of genetic parts visually using a set of standard symbols which represent common features of operons.</li></ul></li>
+
NAME
 +
    SBML_Network - //Title: SBML Network Constructor.
-
<li><b>Plasmids</b><ul><li>The structure of bacterial DNA. Plasmids are circular, closed loops of DNA that contain functioning genes used by the organism.</li></ul></li>
+
FILE
 +
    /Users/jenhantao/Documents/UCSD_IGEM/CircuitNetwork/web/SBML_Network.py
-
<li><b>Species</b><ul><li>are any chemicals and stimuli affecting gene production. Under the sbider Petri net adaptation species are places.</li></ul></li>
+
DESCRIPTION
 +
    //Description:
 +
        Each class generates a corresponding SBML description of the input information
 +
        and appends the information to a list which is then written to file
 +
   
 +
    *************************************************
 +
    @author: Fernando Contreras
 +
    @email: f2contre@gmail.com
 +
    @project: SBiDer
 +
    @institution: University of California, San Diego
 +
    *************************************************
-
<li><b>Input transitions</b><ul><li> are species-regulated regions of the DNA which are formalized into boolean logic operations under the SBiDer Petri net adaptation. </li></ul></li>
+
CLASSES
 +
    CloseModel
 +
    IntermediateStep
 +
    Model
 +
    QualitativeSpecies
 +
    Transitions
 +
   
 +
    class CloseModel
 +
    |  Require class, need to append closing SBML statements for network model
 +
    | 
 +
    |  Methods defined here:
 +
    | 
 +
    |  __init__(self, model_name)
 +
    |      @Parameter:
 +
    |          model_name: model object, instantiated using Model class
 +
   
 +
    class IntermediateStep
 +
    |  Require class, need to append necessary SBML statements for network model
 +
    | 
 +
    |  Methods defined here:
 +
    | 
 +
    |  __init__(self, model_name)
 +
    |      @Parameter:
 +
    |          model_name: model object, instantiated using Model class
 +
   
 +
    class Model
 +
    |  Creates a model object. When instantiated the class appends all the URLs
 +
    |  necessary to understand our network model
 +
    | 
 +
    |  Methods defined here:
 +
    | 
 +
    |  __init__(self, id='SBider_Network')
 +
    | 
 +
    |  writeSBML(self, filename)
 +
    |      @Parameters:
 +
    |          filename: desired file name for network file
 +
    |          type: string
 +
    |     
 +
    |      @Method:
 +
    |          Write SBML formatted network model text file. File is then stored in
 +
    |          the current working directory.
 +
   
 +
    class QualitativeSpecies
 +
    |  Qualitative species, such as operons and chemical species, constructor
 +
    | 
 +
    |  Methods defined here:
 +
    | 
 +
    |  __init__(self, id, compartment, name='NONE', maxLevel='1', constant='false', miriam_id='NONE')
 +
    |      @Parameters:
 +
    |          id: node id
 +
    |          compartment: node compartment, for example, operons belong in the plasmid compartment
 +
    |          name: node name, default=NONE because operons don't have a name
 +
    |          maxLevel: node threshold, default = 1 because a logic model was implemented
 +
    |          constant: denotes node passivity, if constant = True then the node does not interact with
 +
    |          network. Thus, the node does not transfer information.
 +
    |          miriam_id: Minimal Information Required in the Annotation of Models id. This allows for
 +
    |          a standarized citation of literature references
 +
    |     
 +
    |      @Method:
 +
    |          Translate all the inputed information to SBML and append to list
 +
    | 
 +
    |  appendToQualSpecies(self, model_name)
 +
   
 +
    class Transitions
 +
    |  Input and output transition constructor; transitions denote the operon's input
 +
    |  and output reaction in our network.
 +
    | 
 +
    |  Methods defined here:
 +
    | 
 +
    |  input_transition(self, model_name, trans_id, input_id_boolean_tuple, operon_id, trans_logic)
 +
    |      @Parameters:
 +
    |          node_name: name of node object, instantiated using the Node class
 +
    |          trans_id: transition id
 +
    |          input_id_boolean_tuple: tuple of the form (input chemical species, repressor boolean)
 +
    |              input chemical species: chemical species involved in reaction
 +
    |              repressor boolean: denotes whether a chemical species is a repressor (True or False)
 +
    |              Can input a list if multiple operators are involved, such is the case for an AND gate
 +
    |          operon_id: operon id
 +
    |          trans_logic: transition logic denotes the Boolean logic of a reaction ('AND', 'OR', 'NOT')
 +
    |         
 +
    |      @Method:
 +
    |          Translate all the inputed information to SBML and append to list
 +
    | 
 +
    |  output_transition(self, model_name, trans_id, output_id, operon_id)
 +
    |      @Parameters:
 +
    |          node_name: name of node object, instantiated using the Node class
 +
    |          trans_id: transition id
 +
    |          output_id: single variable input which denotes the id of an operon's output
 +
    |          operon_id: operon id
 +
    |         
 +
    |      @Method:
 +
    |          Translate all the inputed information to SBML and append to list
-
<li><b>Operons</b><ul><li>are a set of genes that are regulated by DNA sequences known as cis or trans regulating elements.</li></ul></li>
 
-
<li><b>Output transitions</b><ul><li>are the process of operons producing RNA or protein products.  </li></ul></li>
+
Help on module SBML_Nodes:
-
</ul>
+
 +
NAME
 +
    SBML_Nodes - //Title: SBML Node Constructor.
 +
FILE
 +
    /Users/jenhantao/Documents/UCSD_IGEM/CircuitNetwork/web/SBML_Nodes.py
 +
DESCRIPTION
 +
    //Description:
 +
        Each class generates a corresponding SBML description of the input information.
 +
   
 +
    *************************************************
 +
    @author: Fernando Contreras
 +
    @email: f2contre@gmail.com
 +
    @project: SBiDer
 +
    @institution: University of California, San Diego
 +
    *************************************************
-
</div>
+
CLASSES
 +
    Nodes
 +
    QualitativeSpecies
 +
    Transitions
 +
   
 +
    class Nodes
 +
    |  Place, passive component of Petri Net model, and transition, active component
 +
    |  of Petri Net model, file constructor.When instantiated, a qualitative species
 +
    |  list and a transitions list are created. Data is then stored according to
 +
    |  SBML standards.
 +
    | 
 +
    |  Methods defined here:
 +
    | 
 +
    |  __init__(self)
 +
    |      Instantiate qualitative species and transitions list objects
 +
    | 
 +
    |  writeQualSpecies(self, filename)
 +
    |      @Parameters: filename
 +
    |          type: string
 +
    |          description: desired file name for a particular qualitative species
 +
    |          SBML text file(i.e. operon or chemical species)
 +
    |      @Method:
 +
    |          Write SBML text file for a qualitative species stored in the qualitative
 +
    |          species list object. File is then stored in the current working directory.
 +
    | 
 +
    |  writeTransition(self, filename)
 +
    |      @Parameters: filename
 +
    |          type: string
 +
    |          description: desired file name for a particular transition SBML text
 +
    |          file(i.e. input transition or output transition)
 +
    |      @Method:
 +
    |          Write SBML text file for a transition stored in the transition list
 +
    |          object. File is then stored in the current working directory.
 +
   
 +
    class QualitativeSpecies
 +
    |  Qualitative species, such as operons and chemical species, constructor
 +
    | 
 +
    |  Methods defined here:
 +
    | 
 +
    |  __init__(self, id, compartment, name='NONE', maxLevel='1', constant='false', miriam_id='NONE')
 +
    |      @Parameters:
 +
    |          id: node id
 +
    |          compartment: node compartment, for example, operons belong in the plasmid compartment
 +
    |          name: node name, default=NONE because operons don't have a name
 +
    |          maxLevel: node threshold, default = 1 because a logic model was implemented
 +
    |          constant: denotes node passivity, if constant = True then the node does not interact with
 +
    |          network. Thus, the node does not transfer information.
 +
    |          miriam_id: Minimal Information Required in the Annotation of Models id. This allows for
 +
    |          a standarized citation of literature references
 +
    |     
 +
    |      @Method:
 +
    |          Translate all the inputed information to SBML and append to list
 +
    | 
 +
    |  appendToQualSpecies(self, node_name)
 +
   
 +
    class Transitions
 +
    |  Input and output transition constructor; transitions denote the operon's input
 +
    |  and output reaction in our network.
 +
    | 
 +
    |  Methods defined here:
 +
    | 
 +
    |  input_transition(self, node_name, trans_id, input_id_boolean_tuple, operon_id, trans_logic)
 +
    |      @Parameters:
 +
    |          node_name: name of node object, instantiated using the Node class
 +
    |          trans_id: transition id
 +
    |          input_id_boolean_tuple: tuple of the form (input chemical species, repressor boolean)
 +
    |              input chemical species: chemical species involved in reaction
 +
    |              repressor boolean: denotes whether a chemical species is a repressor (True or False)
 +
    |              Can input a list if multiple operators are involved, such is the case for an AND gate
 +
    |          operon_id: operon id
 +
    |          trans_logic: transition logic denotes the Boolean logic of a reaction ('AND', 'OR', 'NOT')
 +
    |         
 +
    |      @Method:
 +
    |          Translate all the inputed information to SBML and append to list
 +
    | 
 +
    |  output_transition(self, node_name, trans_id, output_id, operon_id)
 +
    |      @Parameters:
 +
    |          node_name: name of node object, instantiated using the Node class
 +
    |          trans_id: transition id
 +
    |          output_id: single variable input which denotes the id of an operon's output
 +
    |          operon_id: operon id
 +
    |         
 +
    |      @Method:
 +
    |          Translate all the inputed information to SBML and append to list
-
<div id = "w2"><h2 style = "border-bottom: 0px solid #57c4d0;" class = "text-center"><b>Future Directions</b></h2>
 
-
<h3><b>Database - Integrating NDEx</b></h3>
 
-
NDEx is a breeding ground for network sharing, discussion, analysis and storage. By acting like the Facebook of networks, NDEx serves a medium for the discovery, sharing and discussion of networks. Networks are commonly used for their ability to capture the biology as a system of particular molecular interactions with interaction types varying between the type of networks built by scientist. The discussion of networks offered by NDEx provides a means for researchers to share their ideas behind network construction and analysis as well as sharing a copy of the network. NDEx also provides what is know as provenance history which means that history of the network construction is saved and the development of the network can be seen. As a means of further connection the biological network community NDEx offers an API and has plans for further integration with the network visualizer, Cytoscape (www.ndexbio.org). <br><br>
+
Help on module helper:
-
SBiDer was developed with the intention to involve the biology community with the SBiDer Network. Discussion of genetic circuits is imperative for the proper use of a circuit as well as to give the proper context of the circuit. NDex would give a discussion board to the SBiDer network where biologist can discuss topics regarding optimal genetic circuits, the potential to experimentally create new circuits from the existing network or a range of many other topics. As said before, genetic device building is not an easy task and provenance history provides useful backtracking to understand the development of genetic circuit networks and due to the ability of network sharing it becomes possible for the SBiDer network to exist in different versions with the purpose of displaying genetic circuit networks with specific functionalities. NDEx API functionality then provides the means to create tools with which SBiDer networks can be better analyzed.  
+
NAME
 +
    helper - Useful helper functions.
-
<h3><b>Traversal</b></h3>
+
FILE
-
SBiDer’s three main pillars - database, search algorithm, and web application - intertwine effectively and make SBiDer a robust tool for the synthetic biology community. Furthermore, the database, search algorithm, and web application are modularly developed so that each component can be easily updated, extended, and optimized by the global synthetic biology community. In the development, there was a focus on minimizing the barrier of collaboration by using an open source platform and generating a comprehensive usage and implementation documents. SBiDer was developed on the consideration to encourage the synthetic biology community to collaborate and drive the field forward. In the course of the development, various tools that could further develop SBiDer were discovered. In future iterations of SBiDer, the following functionalities should be considered for extending SBiDer:
+
    /Users/jenhantao/Documents/UCSD_IGEM/CircuitNetwork/web/helper.py
-
<br>
+
DESCRIPTION
 +
    ******************************************************************************
 +
    @author: Huwate(Kwat) Yeerna, University of California, San Diego
 +
            Joaquin Reina, University of California, San Diego
 +
    ******************************************************************************
-
<h4><b>Web Ontology Language (OWL)</b></h4>
+
FUNCTIONS
-
<h4><u>What OWL is</u></h4>
+
    activated(inp_dic, ope, spe)
-
The Web Ontology Language (OWL) is a family of knowledge representation languages or ontology languages for authoring ontologies or knowledge bases (W3C). The data described by an ontology in the OWL family is interpreted as a set of "individuals" and a set of "property assertions" which relate these individuals to each other. An ontology consists of a set of axioms which place constraints on sets of individuals (called "classes") and the types of relationships permitted between them. These axioms provide semantics by allowing systems to infer additional information based on the data explicitly provided.  
+
        Check if there is an activation signal for a operon.
 +
        :param inp_dic: dictionary of operon and their activation requirement.
 +
        :param ope: operon whose activation signal is checked.
 +
        :param spe: species that may induce activation signal for the operon.
 +
        :return: True only if species match any of the activation requirement of an operon, False otherwise.
 +
   
 +
    contain_all_elements(list_of_lists, lst)
 +
        Check if a list that matches the specified list.
 +
        :param list_of_lists: list whose inner lists are checked.
 +
        :param lst: list matched
 +
        :return: True only if the list_of_lists contain a list that matches lst.
 +
   
 +
    contain_an_element(lst1, lst2)
 +
        Check if at least on of the elements is a list is in another list.
 +
        :param lst1: list that may contain at least one element from anther list.
 +
        :param lst2: list whose elements are searched for in another list.
 +
        :return: True only if at least an element from lst2 in found in lst1.
 +
   
 +
    format_values(value_list)
 +
        Create a list by adding elements of a list in a standard expression.
 +
        :param value_list: list whose elements with non-standard expression are reformatted and added to the new list.
 +
        :return: a new list with elements in standard expression.
 +
   
 +
    get_matching_list_and_index(list_of_lists, lst)
 +
        Get a matching list within a list of lists that matches a specified list.
 +
        :param list_of_lists: list whose inner lists are checked to see if any of them match the specified list.
 +
        :param lst: list checked.
 +
        :return: list within list_of_lists that matches the specified list.
 +
   
 +
    list_is_type(lst, typ)
 +
        Check if all elements of a list are the specified type.
 +
        :param lst: list whose elements are checked.
 +
        :param typ: type specified.
 +
        :return: True only if all elements of the list is the specified type, False otherwise.
 +
   
 +
    match_any_list(list_of_lists, lst)
 +
        Check if a list matches any of the lists within a list of lists.
 +
        :param list_of_lists: list of lists that contain potential matching lists.
 +
        :param lst: list matched.
 +
        :return: True only is at least a list within the list of lists matches the specified list.
 +
   
 +
    promoter_activation(inp_dic, rep_dic, ope, spe, memory_spe, indirect_flag)
 +
        Check if a promoter is activated.
 +
        :param inp_dic: dictionary of operon and their activation requirement.
 +
        :param rep_dic: dictionary of operon and their repression requirement.
 +
        :param ope: operon whose activation is checked.
 +
        :param spe: species that can activate or repress an operon.
 +
        :param memory_spe: species that can activate or repress an operon.
 +
        :param indirect_flag: Boolean flag for checking indirect activation of an operon
 +
        :return: True if the operon is activated.
 +
   
 +
    remove_duplicated_lists_within_a_list_of_lists(list_of_lists)
 +
        Create a list that contains unique lists within another list.
 +
        :param list_of_lists: list that contains duplicated lists.
 +
        :return: list that contains unique lists from the list.
 +
   
 +
    remove_duplicates_within_list(lst)
 +
        Create a list with only unique elements form another list.
 +
        :param lst: list whose unique elements will be stored in a new list.
 +
        :return: a list that contains non-duplicated elements from the parameter list.
 +
   
 +
    remove_parentheses(sequence)
 +
        Remove the outermost parentheses of a string, and return the element right after the closing parentheses.
 +
        :param sequence:
 +
        :return:
 +
   
 +
    repressed(rep_dic, ope, spe)
 +
        Check if there is an repression signal for a operon.
 +
        :param rep_dic: dictionary of operon and their repression requirement.
 +
        :param ope: operon whose repression signal is checked.
 +
        :param spe: species that may induce repression signal for the operon.
 +
        :return: True only if species match any of the repression requirement of an operon, False otherwise.
 +
   
 +
    reverse_index(sequence, element)
 +
        Find the last occurring index of an element in a sequence.
 +
        :param sequence: list checked.
 +
        :param element: element searched.
 +
        :return: index of the last occurring index of an element.
 +
   
 +
    split_by(sequence, element)
 +
        Split a sequence by the first occurring index of a specified element, and return the the resulting two-halves of
 +
        the sequence in a dictionary.
 +
        :param sequence: sequence that is split.
 +
        :param element: element whose first occurring index splits the sequence.
 +
        :return: dictionary that contains the split two halves of the sequence.
 +
   
 +
    uniquely_merge_list_of_lists(list_of_lists)
 +
        Create a list that contain unique elements from lists within itself.
 +
        :param list_of_lists: list that contains lists
 +
        :return: list that contains unique elements from lists within the list.
 +
   
 +
    uniquely_merge_multi_dimensional_list_of_lists(multi_dimensional_list_of_lists)
 +
        Create a list that contain unique elements from lists within itself.
 +
        :param multi_dimensional_list_of_lists: list that contains lists
 +
        :return: list that contains unique elements from lists within the list.
-
<h4><u>Integration of OWL into SBiDer</u></h4>
 
-
SBiDer can describe all of the components in the database using OWL by creating a unique ontological hierarchy that suits the field of synthetic biology. Using OWL relationships, SBiDer can better connect its components through more complex fashion that better captures the biological reality underlying synthetic biology. For example, an ontology describing components used by SBiDer, or individuals in the semantics of ontology, might include axioms stating that a "activatePromotor" property is only present between two individuals when "isBiochecmicalSpecies" is also present, and individuals of class "activatePromotor" are never related via "isBiochemicalSpecies" to of the "transcribeRNA" class. If it is stated that the individual green fluorescent protein (GFP) is related via "produceLight" to the individual yellow fluorescent protein (YFP), and that GFP is a member of the "isProtein" class, then it can be inferred that YFP is not a member of "isPromotor" class. In this fashion, OWL allows the use of more sophisticated relationships amongst database components. Furthermore, there already exists various ontological hierarchy optimized for biology such as genetic interaction ontology, protein interaction ontology, and cancer genomics ontology. And OWL allows potential interaction of multiple ontologies. So, the integration of OWL into SBiDer allows SBiDer to potentially interact with many other aspect of biology such as genetic interaction, protein interaction, and RNA processing. As a result of OWL integration, SBiDer can represent the biological reality of synthetic biology in a much more complex, sophisticated, and realistic manner.
 
 +
Help on module node:
-
<h4><b>Factor Graph</b></h4>
+
NAME
-
<h4><u>What Factor Graph is</u></h4>
+
    node - Subtitle
-
In probability theory and its applications, a factor graph is a particular type of graphical model, with applications in Bayesian inference, that enables efficient computation of marginal distributions through the sum-product algorithm (H. Loeliger). Factor graph can capture a system as Markov networks or Bayesian networks, and represent mathematical relationships of elements of a system.
+
 +
FILE
 +
    /Users/jenhantao/Documents/UCSD_IGEM/CircuitNetwork/web/node.py
-
<h4><u>Integration of Factor Graph into SBiDer</u></h4>
+
DESCRIPTION
-
SBiDer currently implements its network representation of the database as a Petri-Net, which allows modeling of our complex biological system. SBiDer can also capture the network using factor graph, which provides additional statistical tools for analyzing, interpreting, and prediction of the behaviour of our network. Integration of the factor graph can also provide us with machine learning tools to further advance our tools quantitatively and qualitatively.
+
    Descriptive paragraph
 +
   
 +
    ******************************************************************************
 +
    @author: Huwate(Kwat) Yeerna, University of California, San Diego
 +
    ******************************************************************************
-
<h3><b>Web App</b></h3>
+
CLASSES
-
The current SBiDer web tool has been constructed with consideration for expansion in all its components from the structure of the source code to the allowance of users to contribute to the database. It is the latter improvement that allows SBiDer to become more efficient as time progresses. As more information becomes available, the SBiDer application can begin to transition from a qualitative description of how its proposed genetic circuits behave to a more quantitative model.
+
    __builtin__.object
 +
        Node
 +
   
 +
    class Node(__builtin__.object)
 +
    |  Methods defined here:
 +
    | 
 +
    |  __init__(self, value)
 +
    | 
 +
    |  __repr__(self, level=0)
 +
    | 
 +
    |  append_child(self, obj)
 +
    | 
 +
    |  get_all_leaf(self)
 +
    | 
 +
    |  get_path_from_all_leaf(self)
 +
    | 
 +
    |  ----------------------------------------------------------------------
 +
    |  Data descriptors defined here:
 +
    | 
 +
    |  __dict__
 +
    |      dictionary for instance variables (if defined)
 +
    | 
 +
    |  __weakref__
 +
    |      list of weak references to the object (if defined)
-
</div>
 
-
<div id = "w3"><h2 style = "border-bottom: 0px solid #57c4d0;" class = "text-center"><b>Web Application</b></h2>
+
Help on module sbider_database:
-
<h3><b>Framework of the SBiDer Interface</b></h3>
+
NAME
-
<h4><b>Structure Overview</b></h4>
+
    sbider_database - Subtitle
-
SBiDer was developed off of <a href = "http://idekerlab.github.io/cy-net-share/#">CyNetShare</a>, a HTML5 application designed to make utilizing and visualizing <a href = "http://cytoscape.github.io/cytoscape.js/">CytoscapeJS</a> graphs simple and intuitive through use of the javascript library <a href = "https://docs.angularjs.org/api">AngularJS</a>. The object of the SBiDer web tool is to visually present genetic circuits and possible interactions between them in addition to providing relative information about each device’s construction and function through reference material. Images of devices and image data, in Systems Biology Markup Language (<a href = "http://sbml.org/Main_Page">SBML</a>), are provided by a Synthetic Biology Open Language (<a href = "http://www.sbolstandard.org/about">SBOL</a>) visual rendered through use of the popular <a href = "http://pubs.acs.org/doi/abs/10.1021/sb400024s">PigeonCad</a> for intuitive understanding and universal sharing. Users are also provided with the PubMed ID’s of all genetic devices so that they may be able to access and verify entries information in the <a href = "http://www.ebi.ac.uk/miriam/main/">PubMed journal service</a>.
+
FILE
-
<br>
+
    /Users/jenhantao/Documents/UCSD_IGEM/CircuitNetwork/web/sbider_database.py
-
<h4><b>Visualizing the Network</b></h4>
+
-
CytoscapeJS is a widely used visualization library written in Javascript that presents complex relationships in more easily understood figures of nodes connected by edges. The library’s popularity and supportive community make it an ideal framework from which the SBiDer team can reach a large audience of synthetic biologists. Characterizing information about the genetic devices can be easily stored inside CytoscapeJS’s nodes as <a href = "http://cytoscape.github.io/cytoscape.js/#collection/data">data</a>. Unfortunately, manipulating, editing, and updating this data autonomously without further means poses a difficult challenge that is resolved with the use of AngularJS and CyNetShare.
+
-
<br>
+
-
<h4><b>Dynamic Interface and Data Handling</b></h4>
+
-
The large portion of the SBiDer framework relies on the data manipulation and two-way <a href = "https://docs.angularjs.org/guide/databinding">databinding</a> provided by the AngularJS javascript library which provides the interactivity to the web application. Key to this is the two-way binding that allows information to be changed through the User Interface (UI) and updated between the scripting code and html without need to constantly resync data with the server, allowing for quicker response times for users and cleaner source code for further development. The ability to pass data from the UI to the SBiDer application also simplified the procedure for User-generated entries to the SBiDer database. The major alternative library was JQuery, an older and popular method of achieving a dynamic interface that doesn’t have the crucial feature of two-way databinding. Data is passed from server to client through a JSON string which is parsed by AngularJS for the SBiDer application to visualize the network using CytoscapeJS as well as updating the web page without need to reload the window unlike when employing JQuery. Additionally, AngularJS is compatible with many <a href = "https://docs.angularjs.org/api/ng/function/angular.element">JQuery functionalities</a> which allows for a combination of use for both libraries with negligible drawbacks. Effectively, AngularJS allows SBiDer to effectively and dynamically communicate with CytoscapeJS and other components of the application without the clutter of JQuery’s syntax.
+
-
<br>
+
-
<h4><b>Modular Interface</b></h4>
+
-
CyNetShare is a new innovation from the creators of CytoscapeJS which is used to share visualizations made with CytoscapeJS without the need to manually exchange files, instead rendering the files through encoded url’s. CyNetShare provides the basic framework for SBiDer as it has much of the core foundation in its source code including the CytoscapeJS visualization, table of node information, and a basic user interface layout and styling. SBiDer developed upon this framework to include the ability to retrieve results from the SBiDer database, display images of genetic devices, and easily access and download data.
+
-
<br>
+
-
<h4><b>Other Utilized Technologies</b></h4>
+
-
Apart from the aforementioned technologies that were used to create SBiDer itself, there were two other major technologies/languages involved, namely <a href = "http://getbootstrap.com/">Boostrap</a>, to design the website & the wiki, and Java, for the server. <br> Bootstrap is a front-end framework that contains several HTML & CSS-based design templates for various aspects of web pages. It's an easy to use framework that's used widely all over the world since it makes websites look more modern, cleaner and aesthetically pleasing. <br>
+
-
The language chosen for the server was Java since it's easier for other developers to use, is extremely common and is compatible with a lot of languages including but not limited to Python, JavaScript and SQL. In essence, all of the languages that we made use of are very well documented, modern and easy to use languages.
+
-
<br><br>
+
-
</div>
+
DESCRIPTION
 +
    Descriptive paragraph
 +
   
 +
    ******************************************************************************
 +
    @author: Huwate(Kwat) Yeerna, University of California, San Diego
 +
            Joaquin Reina, University of California, San Diego
 +
    ******************************************************************************
 +
FUNCTIONS
 +
    db_close(connection, cursor)
 +
        Close a database.
 +
   
 +
    db_create_table(cursor)
 +
        Make tables for sbider.db
 +
   
 +
    db_custom(cursor, sql_command)
 +
        Do whatever.
 +
   
 +
    db_delete(cursor, table_name)
 +
        Delete table contents.
 +
   
 +
    db_drop_all_table(cursor)
 +
        Drop all tables.
 +
   
 +
    db_drop_table(cursor, table_name)
 +
        Drop a table.
 +
   
 +
    db_get_operon_id_from_name(cursor, operon_name)
 +
   
 +
    db_get_operon_name_from_id(cursor, operon_id)
 +
   
 +
    db_get_plasmid_id_from_name(cursor, plasmid_name)
 +
   
 +
    db_get_plasmid_name_from_id(cursor, plasmid_id)
 +
   
 +
    db_get_species_id_from_name(cursor, species_name)
 +
   
 +
    db_get_species_name_from_id(cursor, species_id)
 +
   
 +
    db_insert(cursor, table_name, table_header_list, insert_data_list)
 +
        Insert into a table.
 +
       
 +
        Args:
 +
            table_name, that table that you wish to insert into
 +
            cols, the columns that you want to insert into
 +
            new_row, the values that correspond to the columns
 +
       
 +
        Examples:
 +
            ex 1. Inserting into plasmid table and filling in all the columns.
 +
   
 +
    db_open(database_file)
 +
        Connect to a database or create a database if it does not already
 +
        exist.
 +
   
 +
    db_print_all_table(cursor)
 +
        Print all tables.
 +
   
 +
    db_print_table(cursor, table_name)
 +
        Print a table.
 +
   
 +
    db_select(cursor, table_name, table_header_list, where_columns=None, where_options=None, where_values=None, where_bools=None, group=None, having_columns=None, having_bools=None, having_values=None)
 +
        Select from a table.
 +
       
 +
        Argument(s):
 +
            table_name: table you wish to pull data from
 +
            col_names: list of numbers indexing the table columns
 +
            w_col: column names for where clause
 +
            w_opt: operator for where clause
 +
            w_var: variable for where clause
 +
            w_bool: boolean for where clause
 +
            group: group name for GROUP BY clause
 +
            h_col: group specifier
 +
       
 +
        Return:
 +
   
 +
    db_update(cursor, table_name, table_header_list, update_data_list, where_column='', where_option='', where_value='')
 +
        Update.
 +
   
 +
    get_all_input_transition_species(cursor, input_transition_id)
 +
        Obtain all species an input transition takes.
 +
   
 +
    get_all_output_transition_species(cursor, input_transition_id)
 +
        Obtain all species an output transition produces.
 +
   
 +
    make_input_ope_id_spe_id_dic(cursor)
 +
        Make operon input species dictionary.
 +
   
 +
    make_ope_id_rep_spe_id_dic(cursor)
 +
        Make operon input not dictionary.
 +
   
 +
    make_ope_id_spe_id_dics(cursor)
 +
   
 +
    make_output_ope_id_spe_id_dic(cursor)
 +
        Make operon output species dictionary.
 +
   
 +
    make_pla_name_spe_name_dics(cursor)
 +
        Make operon input and output species dictionary.
 +
   
 +
    make_plasmid_species_name_dictionary(cursor, operon_id_plasmid_name_dictionary, operon_species_dictionary)
 +
   
 +
    make_sql_delete_command(table_name)
 +
   
 +
    make_sql_drop_command(table_name)
 +
   
 +
    make_sql_insert_command(table_name, table_header_list, insert_data_list)
 +
        Make SQL insert command.
 +
   
 +
    make_sql_select_command(table_name, table_header_list, where_columns=None, where_options=None, where_values=None, where_bools=None, group=None, having_columns=None, having_bools=None, having_values=None)
 +
        Make SQL select command.
 +
       
 +
        @param table_header_list - list of columns to be selected
 +
        @param where_columns - column names for where clause
 +
        @param where_options - operator for where clause
 +
        @param where_values - variable for where clause
 +
        @param where_bools - boolean for where clause
 +
        @param group - group name for GROUP BY clause
 +
        @param having_columns
 +
   
 +
    make_sql_update_command(table_name, table_header_list, update_data_list, where_column='', where_option='', where_value='')
 +
        Makes SQL update command
 +
        @param table_name - Updating table
 +
        @param table_header_list - Selected columns
 +
        @param where_columns - Where column names
 +
        @param where_options - List of operators
 +
        @param where_values - variable for where clause
 +
        @param where_bools - boolean for where clause
-
<div id = "w4"><h2 style = "border-bottom: 0px solid #57c4d0;" class = "text-center"><b>The Search Algorithm</b></h2>
 
-
<h3><b>Introduction to the SBiDer Search Algorithm</b></h3>
 
-
<h4><b>Purpose of the Algorithm</b></h4>
 
-
SBiDer is fundamentally constructed on a manually curated database of existing genetic devices, or operons. This SBiDer database stores operons, species, and most importantly the biochemical interactions of these elements. Also, the database can be represented as an operon interaction network via species. Using this network representation of the database, SBiDer’s search algorithm searches for feasible operon paths connecting a set of species to another set of species. As a result, given a set of input species and a set of output species, the search algorithm returns a subnetwork of operon paths connecting the input species to the output species. Each path within the subnetwork is an operon path that can be used to produce the output species from the input species. In other words, placing operons from a returned operon path as well as the input species into a system can produce the output species.
 
-
<br>
 
-
<h4><b>Biology Captured by the Algorithm</b></h4>
 
-
The search algorithm conducts a complex, effective, and robust operon path search over the network representation of the database, ultimately generating single or multiple operon paths connecting a set of input species to a set of output species. A resulting path represents a system that can produce the output species given the input species. Also, each path attempts to capture biological reality by considering two major mechanisms of operon activation (detailed description below).
 
-
<h4>Robustness and Modularity of the Algorithm</h4>
+
Help on module sbider_grapher:
-
Due to the current number of operons in the database, the search algorithm should scale with the increasing size of the database, which will expand as the synthetic biology community adds more species, operons, and plasmids to the database (see complexity analysis of the algorithm is located below). In addition to this robustness, the search algorithm is easily modifiable since it has been implemented independently from the database and the SBiDer web application. Therefore, the search algorithm can be applied to a broad range of networks. Furthermore, the search algorithm was developed on an open source platform to encourage global collaboration in further optimizing the search algorithm and minimizing the barrier for algorithm improvement. As a result, the database as well as the search algorithm will be easily, effectively, and accurately expanded, extended, and optimized by the global synthetic biology community - together.
+
-
<br>
+
-
<h3><b>Algorithm</b></h3>
+
-
<h4><b>Overview of the Algorithm</b></h4>
+
-
SBiDer's search algorithm is fundamentally based on multiple breadth first searches (BFS) on the SBiDer database. From a set of input species, the algorithm searches for any operon that can be activated by the input species (see Tutorial for how to format the input query). If such an operon is found, the output species of the activated operon and/or other existing species in the system (details below) is used to search for the next operon. In the process, the search algorithm constructs an operon paths by successively adding activated operons to the path. There are two ways of activating an operon: linear successional activation and nonlinear successional activation (more details below), and the search algorithm can create an operon path using either or both of the activation methods. This search algorithm continues until either: the search algorithm concludes that there is no operon path that can lead to the production of the output species; or an operon path producing the output species is found. <br>
+
-
<h4><b>Linear Successional Activation Search (LSAS)</b></h4>
+
NAME
-
The search algorithm uses linear successional activation search (LSAS) to generate an operon path in which the output species of a preceding operon produces all of the required input species for the succeeding operon. LSAS extends an operon path by adding only operons that can be activated by the species produced by the last operon in the path. Thus, for each potential activated operon by the input species, LSAS uses a tree data structure in searching an operon path. From an input species (or multiple input species with an AND relationship), LSAS builds a tree, and if an output species is found in the process of growing the tree, the path from the root operon to the leaf operon that has produced the output species is returned as a resulting operon path. Finally, this resulting set operon paths is used to construct a Petri net path including all of the input species, input transitions, input transition logic, operons, output transitions, output transition logic, and output species. <br>
+
    sbider_grapher - Subtitle
-
<h4><b>Nonlinear Successional Activation Search (NLSAS)</b></h4>
+
FILE
-
An operon may not produce all of the input species required for an activation of another operon. Yet, multiple operons may together produce all of the required input species for the other operon. Here, each of the activating operons produces some, but not all, of the required species for the activated operon. The search algorithm captures such operon activation mechanism using nonlinear successional search (NLSAS) in building an operon path. As LSAS, NLSAS also uses a tree data structure, but appends an operon whose input species, or activation requirements, are produced by any of the preceding operons in the path. While NLSAS assumes no degradation of the species in the system, it allows for a wider range of operon sets that could produce our desired output from our given input. As a result, each resulting operon path can be linear or nonlinear. Since a NLSAS result captures operon activation in which a single or multiple preceding operons produce species required for the activation of a succeeding operon, LSAS result is a subset of a corresponding NLSAS result.
+
    /Users/jenhantao/Documents/UCSD_IGEM/CircuitNetwork/web/sbider_grapher.py
-
<br>
+
-
<h4><b>Overview of LSAS and NLSAS</b></h4>
+
DESCRIPTION
-
Overall, LSAS generates a single or multiple operon paths in which a preceding operon directly activates a succeeding operon, and NLSAS paths in which any of the preceding operons can activate a succeeding operon. In general, a resulting LSAS operon path includes operons mined from same or similarly conducted experimental protocols, where the operons are optimized to coexist in a system. As a result, LSAS can return well optimized operon paths and interactions, which may be used in biochemical reactions with higher confidence. The SBiDer web application can further facilitate the use of such operons paths by providing literature and other published resources. NLSAS, on the other hand, can generate an operon path by including operons from dissimilar experimental protocols. So, using NLSAS can potentially lead to the discovery of novel operon paths and thus new biochemical systems. By providing LSAS and NLSAS variations of the search algorithm, SBiDer assists a user in capturing the biological reality underlying an operon activation as accurately as possible, and provides a means to evaluate, analyze, and apply the results.
+
    Descriptive paragraph
-
<br><br>
+
   
 +
    ******************************************************************************
 +
    @author: Joaquin Reyna, University of California, San Diego
 +
            Huwate(Kwat) Yeerna, University of California, San Diego
 +
    ******************************************************************************
-
<h3><b>Complexity Analysis</b></h3>
+
FUNCTIONS
-
The SBiDer network is based upon the Petri Net model, which allows for the capturing of boolean logic. The linearity of the network representation of the database is such that one input transition leads to one operon, which leads to one output transition, and one list containing all species produced by that operon, as shown in Figure 1.  
+
    add_edge_id_abbreviation(edge, abbrev1, abbrev2, index1=0, index2=0)
-
<br><br>
+
   
-
<figure>
+
    add_edge_list_id_abbreviation(edge_list, abbrev1, abbrev2, index1=0, index2=0)
-
<img src = "http://i.imgur.com/Vvnbwni.png?1">
+
   
-
<figcaption><font size = "2px">Figure 1 - Petri Net representation of an input species node, an input transition, an operon node, an output transition, and a species node consisting of only the species produced by the current operon respectively.This is the representation used for the construction of the SBiDer database since they allow for the incorporation of boolean logic.</font>
+
    add_node_id_abbreviation(node_, abbrev, index)
-
</figcaption>
+
        Adds an id abbreviation to a node.
-
</figure>
+
       
-
<br>
+
        Argument(s):
 +
            node - list representing node information.
 +
            abbrev - string abbreviation.
 +
            index - integer indicating which value to abbreviate.
 +
       
 +
        Return:
 +
            A node with the abbreviation added to the given index.
 +
            For example: [ "abbreviation_node_id", "node_field_2", "node_field_3", ...]
 +
   
 +
    add_node_list_id_abbreviation(node_list, abbrev, id_index)
 +
        Adds an id abbreviation to a list of nodes.
 +
       
 +
        Argument(s):
 +
            node_list - list containing nodes.
 +
            abbrev - string abbreviation.
 +
            index - integer indicating which value to abbreviate.
 +
       
 +
        Return:
 +
            A node_list the abbreviation added to the given index
 +
            of every node.
 +
            For example: [ [ "abbreviation_node_id_1", "node_field_2", "node_field_3", ...],
 +
                          [ "abbreviation_node_id_2", "node_field_2", "node_field_3", ...], ...]
 +
   
 +
    add_node_values_to_nxgraph(nxgraph, node_list)
 +
        Extracts the node id and enters it into nxGraph.
 +
   
 +
    create_input_species_nodes(cursor, it_id)
 +
        Create species nodes from the corresponding it_id.
 +
   
 +
    create_input_transition_nodes(cursor, starting_species_list, operon_id, input_transition_id_dict)
 +
        Create input transition nodes list from the corresponding operon_id.
 +
       
 +
        Argument(s):
 +
            cursor - sqlite3 cursor object
 +
            starting_species_list - a list of species activating an operon
 +
            operon_id - sbider based operon id
 +
            input_transition_id_dict - dictionary mapping input transitions to corresponding species
 +
       
 +
        Return:
 +
            A tuple of input transition nodes list (with abbreviation) and
 +
            input transition id list.
 +
            For example:
 +
            ( [ ("ope_1-1", "pLux-->gfp", "sbol_image_path_1"), ("ope_2-1", "pLambda-->gfp", "sbol_image_path_2"), ... ],
 +
              ["1-1", "2-1", ...] )
 +
   
 +
    create_json_network_file(json_file_path, species_nodes_list, input_transitions_nodes_list, operon_nodes_list, output_transitions_nodes_list, source_id_target_id_list)
 +
        Writes the whole network json.
 +
        :param json_file_path:
 +
        :param species_nodes_list:
 +
        :param input_transitions_nodes_list:
 +
        :param operon_nodes_list:
 +
        :param output_transitions_nodes_list:
 +
        :param source_id_target_id_list:
 +
   
 +
    create_json_network_string(species_nodes_list, input_transitions_nodes_list, operon_nodes_list, output_transitions_nodes_list, source_id_target_id_list, path_json_highlighter)
 +
   
 +
    create_json_whole_network_file(file_name, cursor)
 +
        Generates the whole network json.
 +
   
 +
    create_operon_node(cursor, operon_id)
 +
        Create an operon node from the corresponding operon_id.
 +
       
 +
        Argument(s):
 +
            cursor - sqlite 3 cursor object.
 +
            operon_id - sbider based operon id
 +
       
 +
        Return:
 +
            A tuple with operon node information as a tuple
 +
            (id abbrevation included) and the corresponding
 +
            operon id.
 +
            For example: ( ("ope_1-1", "pLux-->gfp", "sbol_image_path_1"), "1-1" )
 +
   
 +
    create_output_species_nodes(cursor, ot_id)
 +
        Create species nodes from the corresponding ot_id.
 +
   
 +
    create_output_transition_node(cursor, operon_id)
 +
        Create output transition nodes from the corresponding operon_id.
 +
       
 +
        Argument(s):
 +
            cursor - sqlite3 cursor object
 +
            operon_id - sbider based operon id
 +
       
 +
        Return:
 +
            A list of tuples with operon node information.
 +
   
 +
    create_subnetwork_json_string(cursor, list_of_operon_paths)
 +
        Generates the subnetwork json.
 +
   
 +
    create_subnetwork_path(cursor, starting_species_list, operon_path, it_trans_dict)
 +
        Creating a subnetwork path.
 +
        :rtype : object
 +
        :param cursor:
 +
        :param starting_species_list:
 +
        :param operon_path:
 +
        :param it_trans_dict:
 +
   
 +
    determine_operon_activated_input_transition(cursor, starting_species_list, operon_id, input_transition_id_dict)
 +
        Determining which input transition is activating an operon.
 +
       
 +
        Argument(s):
 +
            cursor - sqlite3 cursor object
 +
            starting_species_list - a list of species activating an operon
 +
            operon_id - sbider based operon id
 +
            id_id_dict - dictionary mapping input transitions to corresponding species
 +
       
 +
        Return:
 +
            A list of transitions that activate the operon (from operon_id).
 +
            For example: ["it_1", "it_2", ...]
 +
   
 +
    get_input_transition_species_dictionary(cursor)
 +
        Retrieves all rows pertaining to the sbider inputTranstion
 +
        table using these values the dictionary is created.
 +
       
 +
        Argument(s):
 +
            cursor - sqlite3 cursor object instance
 +
       
 +
        Return:
 +
            A dictionary mapping input transition id to a species id list.
 +
   
 +
    get_node1_list_from_node2_id(cursor, node1_node2_relationship_table, node2_id, node2_id_type, node1_table_name, node1_id_type)
 +
        Query the database to find all node1's from node2's id.
 +
            It's possible to have multiple node1's map to node2.
 +
       
 +
        Argument(s):
 +
            cursor - sqlite3 cursor object
 +
            node1_node2_relationship_table - table_name relating node1 and node2
 +
            node2_id - string representation of node1_id
 +
            node2_id_type - node2_id type being used in the sbider database
 +
            node1_table_name - table_name where node information exists
 +
            node1_id_type - node1_id type being used in the sbider database
 +
       
 +
        Return:
 +
            A list of nodes representing all node1's related to node2.
 +
   
 +
    get_node_from_id(cursor, node_table_name, node_id, node_id_type)
 +
        Query the database using the node_id for node.
 +
       
 +
        Argument(s):
 +
            cursor - sqlite3 cursor object
 +
            node_table_name - table_name where node information exists
 +
            node_id - string representation of node_id
 +
            node_id_type - the type of node being used from the sbider database.
 +
       
 +
        Return:
 +
            A tuple of information representing the node.
 +
   
 +
    get_path_json_array(cursor, starting_species_list, operon_paths_list)
 +
        Generate json array for node highlighting.
 +
   
 +
    get_subnetwork(cursor, list_of_operon_paths)
 +
   
 +
    get_whole_network(cursor)
 +
        Whole network data prep for json.
 +
   
 +
    list_of_lists(list_of_tups)
 +
        Creates a list of lists from a list of tuples.
 +
       
 +
        Return:
 +
            A list with list values.
 +
   
 +
    list_of_tuples(list_of_lsts)
 +
        Creates a list of tuples from a list of lists.
 +
       
 +
        Return:
 +
            A list with tuple values.
 +
   
 +
    merge_list_of_lists(list_of_lsts)
 +
        ALREADY EXISTS IN THE HELPER!!
 +
   
 +
    nx_node_coordinates_dictionary(node_id_list, edge_list)
 +
        Creates a dictionary of node coordinates using spring layout from networkx.
 +
       
 +
        Argument(s):
 +
            node_id_list - ids of nodes for positioning
 +
            edge_list - all edges between nodes stored in a tuple as follows,
 +
                        (source_node_id, target_node_id)
 +
       
 +
        Return:
 +
            A dictionary mapping
 +
   
 +
    resize_network(total_subnetwork_nodes, total_whole_nodes=540)
 +
        Resize the network.
 +
   
 +
    unique_node_list(nodes_list)
 +
        Removal of duplicate nodes from the node_list.
 +
       
 +
        Argument(s):
 +
            node_list - list of node information stored as list (list of lists).
 +
       
 +
        Return:
 +
            A list of unique nodes.
 +
            For example:
 +
            [ ["node_id_1", "node_field_2", "node_field_3"], ["node_id_2", "node_field_2", "node_field_3", ...], ...]
-
This entire structure can be collapsed into one node since there is no branching, and allows us to represent the network as a directed graph, as shown in Figure 2. By condensing the network in this fashion, complex searches can be conducted in a more efficient manner.<br><br>
 
-
<figure>
+
Help on module sbider_network_builder:
-
<img src = "http://i.imgur.com/5wxbadI.png?1">
+
-
<figcaption><font size = "2px">Figure 2 - Operon representation of the network where the input and output transitions have been collapsed into one operon node to decrease the complexity of the search algorithm. This is possible because an input transition always points to one operon and one output transition always points to one species node.</font></figcaption>
+
-
</figure>
+
-
<br>
+
-
<h4><b>LSAS</b></h4>
+
NAME
-
Assume the network has m transitions, with depth d and breadth b from a specified root, and V vertices which represent the aforementioned condensed nodes (centered on operons), and E directed edges connecting said vertices.
+
    sbider_network_builder - Subtitle
-
<br><br>
+
-
The SBiDer search algorithm is a modified version of breadth first search where at each transition m that is activated by the input species set a breadth first search for the output species set is performed. For a standard breadth first search, the complexity is
+
-
<br><br>
+
-
BFS Complexity = O(|b|^|d|)
+
-
<br><br>
+
-
This is another way of saying that in the worst case, every vertex and every edge is explored, which can be rewritten in terms of the number of vertices and edges. Since all edges have weights of one, V and E will always be positive.
+
-
<br><br>
+
-
BFS Complexity = O(|V| + |E|) => O(V + E). <br><br>
+
-
For this standard BFS, assuming a large network where every node is connected to every other node, for V significantly large, V ≈ V - 1, meaning the number of edges searched after the selection of each successive node is approximately equal to V, meaning the V nodes are searched V times. Additionally, consider that the total number of edges (E) in a completely connected graph is bound by V^2. In a completely connected graph (with no self or duplicate edges) with V nodes, the total number of edges is (V-1) + (V-2) + (V-3) + … + 2 + 1. It has been shown that the (V-1)th partial sum of this divergent series sums to [V*(V-1)]/2, which is bound by V^2. Therefore the upper bound for the time complexity for a single breadth first search from a single activated transition from an input species is O(V + E) ≤ O(V+V^2) => O(V^2).<br><br>
+
FILE
 +
    /Users/jenhantao/Documents/UCSD_IGEM/CircuitNetwork/web/sbider_network_builder.py
-
For our network, a breadth first search of time complexity O(V^2) happens at every activated transition m.<br>
+
DESCRIPTION
 +
    Descriptive paragraph
 +
   
 +
    ******************************************************************************
 +
    @author: Huwate(Kwat) Yeerna, University of California, San Diego
 +
            Joaquin Reyna, University of California, San Diego
 +
    ******************************************************************************
-
Therefore, the LSAS complexity = O(mV^2)<br><br>
+
FUNCTIONS
-
Paths generated using the LSAS search would resemble Figure 2 where a species node directly activates an operon, which produces a singular species node. The LSAS algorithm would not be able to capture the logic encompassed within Figure 3 where multiple species nodes are required to activate the middle input transition.
+
    build_sbider_network(directory_path, user_query, indirect=False)
-
<h4><b>NLSAS</b></h4>
 
-
For the NLSAS, a similar tree from LSAS is created for each activated input transition by the input species. However, the difference here lies in the construction of the path from the input species to the output species. A special traceback algorithm is used to tie the output species to the input species creating a path that may resemble a subnetwork rather than a traditional linear path. This traceback algorithm is where the true complexity of this algorithm arises from.
 
-
<br>
 
-
Similar to LSAS, this algorithm also begins by constructing a subnetwork of paths that can lead to the output of interest from a specific input. This generates a list of edges to be used in the traceback algorithm. Assuming every edge could be explored, the algorithm runs in O(E) time. As shown for the LSAS algorithm, O(E) <= O(V^2), and also returns a list that will be explored also in O(E) size or O(V^2). Again, a new list is constructed for each potentially activated transition, thus giving this entire first step a run time complexity of O(m*V^2).
 
-
<br><br>
 
-
Now, for each of the O(m) list of edges constructed from the last step, a traceback algorithm is run for this path from the output species set to return a subnetwork of operons that could form a system that leads to the production of the desired output. From the desired output species, the traceback algorithm searches through the list of edges E to find the transitions for each operon contained in the path that produces the output species of interest. Since every transition in the set E must be checked, the algorithm runs in O(E) or O(V^2) time. At worst, every operon must be checked, resulting in a complexity of O(m*V^2) for this step.
 
-
<br><br>
 
-
Now, in order to determine which species were required to activate the operons now connected to the output species, the database of transitions is searched to identify which transitions will have to be activated. This search happens across an O(m) space for each of the O(V) operons that could be activating the output. Therefore, this next time step happens in O(mV) time. The first two steps together now will happen as O(m*(V2+mV)). At the end of these steps, the path now has O(m*V) species.
 
-
<br><br>
 
-
However, it is important to note here that at the step when possible operons are being explored, the search will have a time complexity of O(E), and will never happen more than O(m*V) times, which is the bound for the number of unique species in the system. For the following step, the search for species activating all operons on this increment will have a time complexity of O(m), but it will never happen more than O(V) times, which is the bound for the number of unique operons in the system. Therefore, for a full iteration of these two steps in the traceback algorithm, it will be bounded by the time complexity of O(V^2*mV + m*V). This traceback step will happen until the depth of the entire path generated from the LSAS step has been explored, which is bound by O(V). Thus, the time complexity for the traceback of a single path is O(mV^4+mV^2). Then complexity of the path generation is added for a complexity of O(mV^4+mV2+V^2). Now consider that this path generation and traceback happens for every single activated transition by the input species, which gives O(m*(mV^4+mV^2+V^2))=>O(m^2*V^4).
 
-
<br><br>
 
-
<figure>
+
Help on module sbider_parser:
-
  <img src="http://i.imgur.com/pxzwTMO.png?1">
+
-
  <figcaption><font size = "2px">Figure 3 - Operon representation of a simple circuit and a potential output from NLSAS search algorithm where species from multiple operons are required to activate the next operon. This path could not be captured by the LSAS algorithm because the incorporation of multiple species to activate one operon is not possible.</font>
+
-
</figcaption>
+
-
</figure>
+
-
<br>
+
-
<figure>
+
NAME
-
  <img src="http://i.imgur.com/x5dKWIL.png?1" width="704">
+
    sbider_parser - Subtitle
-
  <figcaption><font size = "2px">Figure 4 - Petri Net representation Figure 3 where multiple species nodes are required to activate one input transition. First two species nodes activate each of the three initial input transitions, which in turn activate three separate operons. The output of each operon is an output transition which points to a species node that contains all output species produced by that operon. The three species nodes in the center of the graph trigger the final input transition, triggering the final operon, and producing the final species node. This expansion would add an additional layer of complexity to the NLSAS algorithm that is unnecessary given the previously explained linearity of the operon nodes.</font>
+
-
</figcaption>
+
-
</figure>
+
-
<br>
+
 +
FILE
 +
    /Users/jenhantao/Documents/UCSD_IGEM/CircuitNetwork/web/sbider_parser.py
 +
DESCRIPTION
 +
    Descriptive paragraph
 +
   
 +
    ******************************************************************************
 +
    @author: Huwate(Kwat) Yeerna, University of California, San Diego
 +
    ******************************************************************************
-
<b><h3>References</h3></b>
+
FUNCTIONS
 +
    grammar_0(cursor, tokens)
 +
        Grammar for 'grammar_0:= grammar_1 > grammar_1'.
 +
        :param cursor:
 +
        :param tokens:
 +
        :return:
 +
   
 +
    grammar_1(cursor, tokens)
 +
        Grammar for 'grammar_1:= grammar_2 or grammar_1 |
 +
        grammar_2 and grammar_1 |
 +
        grammar_2'.
 +
        :param cursor:
 +
        :param tokens:
 +
        :return:
 +
   
 +
    grammar_2(cursor, tokens)
 +
        Grammar for 'grammar_2:= (grammar_1) or grammar_1 |
 +
        (grammar_1) and grammar_1 |
 +
        (grammar_1) |
 +
        interactor'.
 +
        :param cursor:
 +
        :param tokens:
 +
        :return:
 +
   
 +
    grammar_and(tokens1, tokens2)
 +
        Grammar for 'and'.
 +
        :param tokens1:
 +
        :param tokens2:
 +
        :return:
 +
   
 +
    grammar_or(tokens1, tokens2)
 +
        Grammar for 'or'.
 +
        :param tokens1:
 +
        :param tokens2:
 +
        :return:
 +
   
 +
    grammar_output(tokens1, tokens2)
 +
        Grammar for '='.
 +
        :param tokens1:
 +
        :param tokens2:
 +
        :return:
 +
   
 +
    interactor(cursor, token)
 +
        Grammar for 'interactor'.
 +
        :param cursor:
 +
        :param token:
 +
        :return:
 +
   
 +
    parse_logic(cursor, logic_input)
 +
        Parse a logic input into atomized and equivalent logic.
 +
        :param cursor:
 +
        :param logic_input:
 +
        :return:
-
<SPAN class="ft4">[1]</SPAN><SPAN class="ft26">Carl Adam Petri and Wolfgang Reisig (2008) Petri net. Scholarpedia, 3(4):6477</SPAN>
 
-
<br><br>
 
-
<SPAN class="ft4">[2]</SPAN><SPAN class="ft26">"<i>OWL 2 Web Ontology Language Document Overview</i>". W3C. 2009-10-27.</SPAN>
 
-
<br><br>
 
-
<SPAN class="ft4">[3]</SPAN><SPAN class="ft26">An Introduction to Factor Graphs by Hans-Andrea Loeliger, IEEE Signal Processing Magazine,January 2004, pp. 28–41.</SPAN>
 
 +
Help on module sbider_searcher:
-
</div>
+
NAME
 +
    sbider_searcher - Subtitle
-
<div id = "w5"><h2 style = "border-bottom: 0px solid #57c4d0;" class = "text-center"><b>Database</b></h2>
+
FILE
 +
    /Users/jenhantao/Documents/UCSD_IGEM/CircuitNetwork/web/sbider_searcher.py
 +
DESCRIPTION
 +
    Descriptive paragraph
 +
   
 +
    ******************************************************************************
 +
    @author: Huwate(Kwat) Yeerna, University of California, San Diego
 +
            Joaquin Reina, University of California, San Diego
 +
    ******************************************************************************
-
<h3><b>Data Collection</b></h3>
+
FUNCTIONS
 +
    build_direct_sbider_path(input_dictionary, repressor_dictionary, output_dictionary, input_species_list, output_species_list, path_queue, final_operon_path_list, memory_operon, memory_species, activated_paths, indirect_flag)
 +
   
 +
    build_indirect_sbider_path(input_dictionary, repressor_dictionary, output_dictionary, input_species_list, output_species_list, path_queue, final_operon_path_list, memory_operon, memory_species, activated_paths)
 +
   
 +
    build_sbider_path_memory_tree(input_dictionary, activated_paths, start_operon)
 +
   
 +
    get_sbider_path(inp_dic, rep_dic, outp_dic, inp_spe, outp_spe, indirect_flag=False)
 +
   
 +
    search_sbider_path_memory(input_dictionary, activated_paths, from_operon)
-
The database was built to meet the needs of synthetic biology and genetic circuit building by offering literature references, storage, maintenance and upload of genetic devices as well as SBML text files for network data exchange.1 Genetic circuit information is not easily extracted from papers making it difficult to begin any genetic device construction. SBiDer provides a centralized library of relevant genetic circuit references in the form of pubmed id’s so that synthetic biologists can quickly and easily access experimentally backed information. Outsourcing the literature search to SBiDer gives synthetic biologists an interface with reliably relevant information. As well as providing literature references, SBiDer extracts the necessary details of each genetic device so that synthetic biologists can build devices using essential genetic building blocks. As a means of further involving the biology community, SBML data exchange files for our genetic parts and SBiDer network are accessible by using the SBiDer API. Using SBML provides further data analysis of the SBiDer network by taking advantage of approximately 200 SBML supported softwares such as Cytoscape, Systems Biology Workbench and more (www.cytoscape.org) (http://sbw.kgi.edu/research/sbwintro.htm) (www.sbml.org).
 
-
<br><br>
 
-
<div class = "row text-center">
+
Help on module sbider_upload_database:
-
<figure>
+
-
  <img src="http://i.imgur.com/3qqxiao.jpg?1" width="604" height="308">
+
-
  <figcaption><font size = "2px">Figure 1. Plasmids used to create a genetic circuit know as μBE (Hoon Hong, 2012).</font></figcaption>
+
-
</figure>
+
-
</div>
+
-
<h3><b>Petri Net and Schema Design</b></h3>
+
-
This project integrated the Petri net model by describing interactions between species and operons. Species act as input for operon activation and output. In the context of biology, a simple genetic circuit is broken down into operons, and operons can be broken down into their components: promoters, regulating elements, and coding sequences. Combining the biology and Petri net formalism, genetic device information is captured and makes for a database schema that innately captures a network of genetic device interactions. The Petri net model inspired schema works by atomizing the necessary genetic circuit information so the parts necessary for genetic circuit design are represented. Operons and species are represented as equivalents of Petri net chemical species while the interaction of species with operons and the production of species by operons is represent by input and output transitions namely. Genetic circuit design is now formalized for the biology community under the Petri net model and stored inside the SBiDer database. 
+
NAME
 +
    sbider_upload_database
-
<h3><b>Community Based Support</b></h3>
+
FILE
 +
    /Users/jenhantao/Documents/UCSD_IGEM/CircuitNetwork/web/sbider_upload_database.py
-
A single genetic circuit has a set of responses based on the chemical or environmental factors present in a biological system. By introducing new genetic circuits into the SBiDer network the biology community benefits from new devices with new functionalities or improved functionality, and when introduced into the SBiDer network creates a multitude of new genetic device combinations. The SBiDer website includes a device upload page to encourage the collaboration of the synthetic biology community to keep expanding the database and network for improved and up to date genetic devices. The database also maintains updated SBML forms of all genetic device parts and the SBiDer network so the biology community can continue working on the most up to date information.
+
FUNCTIONS
-
+
    check_species_name_in_database(cursor, species_name)
-
<h3><b>Technologies</b></h3>
+
        Safely return species id or None.
 +
   
 +
    db_test()
 +
   
 +
    determine_and_insert(connection, cursor, component_keyword, component_data=[], parent_component_id='')
 +
        Determine insertion method and insert into into the database.
 +
   
 +
    determine_parent_keyword(component_keyword)
 +
        Determine which is your parent keyword.
 +
   
 +
    get_data_keyword(data_string)
 +
        Get the keyword belonging to data_string.
 +
   
 +
    get_last_row_id(cursor, table_name)
 +
        Get the last inserted rowid.
 +
   
 +
    insert_new_device(connection, cursor, device)
 +
        Inserts a new device into the database.
 +
        Argument(s):
 +
            connection - sqlite3 connection object
 +
            cursor - sqlite3 cursor object
 +
            device_string - whole device as a string
 +
   
 +
    insert_new_input_transition(cursor, operon_id, logic)
 +
        Insert new input transition.
 +
   
 +
    insert_new_input_transition_species(cursor, it_id, species_name, species_type, species_repression)
 +
        Insert new input transition species.
 +
   
 +
    insert_new_operon(cursor, plasmid_id, operon_name, direction)
 +
        Insert new operon.
 +
   
 +
    insert_new_output_transition(cursor, operon_id)
 +
        Insert new output transition.
 +
   
 +
    insert_new_output_transition_species(cursor, ot_id, species_name, species_type)
 +
        Insert new output transition species.
 +
   
 +
    insert_new_plasmid(cursor, plasmid_name, miriam_id)
 +
        Insert new plasmid.
 +
   
 +
    main()
 +
   
 +
    make_input_transition_sbml_file(input_species_list, transition_id, operon_id, trans_logic)
 +
   
 +
    make_new_id(id_string)
 +
        Convert old string id to old string id + 1.
 +
   
 +
    make_output_transition_sbml_file(output_species_list, transition_id, operon_id)
 +
        make the sbml.
 +
   
 +
    make_sbol_file(output_species_list, promoter_list, prev_operon_direction, operon_id)
 +
        Insert and make the sbol file.
 +
   
 +
    make_sbol_string_db_update(input_list, direction)
 +
        Make an sbol string using uploading information.
 +
   
 +
    reset_db(original_db='sbider.db', test_db_file='sbider_test_2.db')
 +
   
 +
    select_last_inserted_table_id(cursor, table_name, table_id_type)
 +
        Select the last inserted row.
 +
   
 +
    select_last_inserted_table_row(cursor, table_name)
 +
        Select the last inserted row.
 +
   
 +
    write_sbol_file(operon_id, sbol_string)
 +
        Write out sbol string to file.
 +
   
 +
    write_to_file(string_to_write, file_name)
 +
        Write a file.
-
The database was implemented using SQLite, a widely used database management system, and the SQLite3 Python module.  SQLite is developed and maintained by multiple companies including Oracle and Adobe (www.sqlite.com). With it’s widespread use and fast queries, SQLite is a powerful tool to use for collaboration with the biological community. Python’s success within the biology community, it’s ease of use and compatibility with major operating systems also makes for an effective combination with SQLite and computational work in biology (“Programming for Biologists”, 2014). Using these two technologies, a Python based API was create that encourages the synthetic biology community to participate in the database expansion and operation as well as SBML file access.
 
-
<br>
+
Help on module sbml_database:
 +
NAME
 +
    sbml_database - //Title: SBML Database Access
 +
FILE
 +
    /Users/jenhantao/Documents/UCSD_IGEM/CircuitNetwork/web/sbml_database.py
-
<h3><b>Database Schema in Depth</b></h3>
+
DESCRIPTION
 +
    //Description:
 +
        Access SBiDer database and retrieve all necessary SBML information
 +
   
 +
    *************************************************
 +
    @author: Fernando Contreras
 +
    @email: f2contre@gmail.com
 +
    @project: SBiDer
 +
    @institution: University of California, San Diego
 +
    *************************************************
-
The plasmid table stores the name and pubmed literature references allowing users to easily find out more about their given device. The plasmid is then broken down into operons where multiple operons can be mapped to the same plasmid. In order to capture this relationship, a table of plasmid id and operon id allows for multiple operons relating to a single plasmid. A direction column in the plasmid-operon relationship table also allows users to specify the directionality of the operon inside of the given plasmid as multiple operon sequences can can be found with presence in either strands of the DNA. Operons are also mapped exclusively to their plasmid, meaning that identical operons from different plasmids require insertion into the database with a mapping to the corresponding “parent” plasmid. The operon table itself contains information on the operon sbol and sbml files representations. <br><br>
+
FUNCTIONS
 +
    get_sbml_input_logic()
 +
        Access the input transition logic table and acquire
 +
        input transition Boolean logic
 +
       
 +
        @Output: dictionary = {it_id: logic}
 +
            key = input transition id
 +
            value = associated Boolean logic
 +
   
 +
    get_sbml_input_operon_edges()
 +
        Access the input transition-operon relationship table and acquire
 +
        input transition-operon edges
 +
       
 +
        @Output: dictionary = {it_id: ope_id}
 +
            key = input transition id  
 +
            value = operon id
 +
   
 +
    get_sbml_input_species_edges()
 +
        Access the input transition-chemical species relationship table and acquire
 +
        input species-transition edges
 +
       
 +
        @Output: dictionary = {it_id: [(spe_id, repressor_boolean)]}
 +
            key = input transition id
 +
            value = list of associated input chemical species
 +
                tuple = (chemical species, associated repressor boolean). If
 +
                chemical species is a repressor then repressor_boolean is 'True'
 +
   
 +
    get_sbml_miriam_ids()
 +
        Access plasmid table and plasmid-operon relationship table to retrieve
 +
        the miriam ids of each operon
 +
       
 +
        @Output: dictionary = {operon id: miriam id}
 +
            operon id: string type
 +
            miriam id: string type
 +
   
 +
    get_sbml_operons()
 +
        Access operon table to retrieve all relevant operon information
 +
       
 +
        @Output: dictionary = {operon id: operon name}
 +
            key = operon id: string type
 +
            value = operon name: string type
 +
   
 +
    get_sbml_output_operon_edges()
 +
        Access the output transition-operon relationship table and acquire
 +
        output transition-operon edges
 +
       
 +
        @Output: dictionary = {ot_id: ope_id}
 +
            key = output transition id
 +
            value = operon id
 +
   
 +
    get_sbml_output_species_edges()
 +
        Access the output transition-chemical species relationship table and acquire
 +
        output species-transition edges
 +
       
 +
        @Output: dictionary = {ot_id: [spe_id]}
 +
            key = output transition id
 +
            value = list of associated output chemical species
 +
   
 +
    get_sbml_species()
 +
        Access chemical species table and retrieve all relevant species information
 +
       
 +
        @Output: dictionary = {species id: species name}
 +
            key = species id
 +
            value = species name
-
The input transition table explains the type of logic that is being used for operon activation as either AND or OR logic. AND logic transitions are transitions which must take in all corresponding inputs species for the activation of the operon. OR logic transitions are transitions which require a single input species or multiple input species but do not require all. More complex relations are made between the input species and the input transitions table. <br><br>
+
DATA
 +
    con = <sqlite3.Connection object>
 +
    cursor = <sqlite3.Cursor object>
 +
    cwd = '/Users/jenhantao/Documents/UCSD_IGEM/CircuitNetwork/web'
 +
    database_path = '/Users/jenhantao/Documents/UCSD_IGEM/CircuitNetwork/w...
-
Input transition and species interactions are captured using a separate relationship table. Using this separate input transition species relationship table allows for more flexibility when describing the boolean logic at a given input transition. The same species may interact as a repressor or as activator depending on what input transition it encounters. Therefore, the table attribute repression gives a true or false statement under the repression column describing the role of that species in a given operon activation. All complex logic types, NAND; NOR; XOR; and XNOR, are captured solely by using the atomic logic types, AND; OR; and NOT.  So a NAND input transition would be represented as an AND inside the input transition table with repressor molecules as the interacting species and TRUE values in the repression columns of these species. <br><br>
 
-
Operons also have associated output transitions which describe the events and species produced after operon activation. These transitions unlike input transitions have very simple logic, namely IF. The reason for this is, that once an operon is activated then the production of the protein will inevitably occur. Just like input transitions and species, output transitions and species also have a relationship table with multiple species mapping to a single output transition when applicable. This illustrates the idea that operons are a sequence of genes that when activated, transcribe mRNA and protein species. 
+
Help on module sbml_update:
-
<br><br><br>
+
NAME
 +
    sbml_update - //Title: SBML Node Generator
-
<figure>
+
FILE
-
  <img src="http://i.imgur.com/0QGqZEI.png?1"><br><br>
+
    /Users/jenhantao/Documents/UCSD_IGEM/CircuitNetwork/web/sbml_update.py
-
  <figcaption><font size = "2px">Figure 2. An entity relational diagram displaying the sbider database. Entities and their corresponding attributes are like-colored. Relationships represented by the grey diamonds may also store attributes tied to entities to illustrate that certain information is the result of a relationship.</font></figcaption>
+
-
</figure>
+
 +
DESCRIPTION
 +
    //Description:
 +
        Translate individual node information to SBML and store node file
 +
        in current working directory 
 +
   
 +
    *************************************************
 +
    @author: Fernando Contreras
 +
    @email: f2contre@gmail.com
 +
    @project: SBiDer
 +
    @institution: University of California, San Diego
 +
    *************************************************
 +
 +
FUNCTIONS
 +
    sbml_input_trans(trans_id, input_species_id_and_boolean_tuple, operon_id, trans_logic, filename)
 +
        #construct input/output transition component of network SBML file
 +
   
 +
    sbml_operon(operon_id, operon_name, miriam_id, filename)
 +
        #construct operon/chemical species component of network SBML file
 +
   
 +
    sbml_output_trans(trans_id, output_species_id, operon_id, filename)
 +
   
 +
    sbml_species(species_id, species_name, filename)
-
<b><h3>References</h3></b>
+
</pre>
-
<SPAN class="ft4">[1]</SPAN><SPAN class="ft26">Hucka, M., 25 Oct. 2002., "<i>The Systems Biology Markup Language (SBML): A Medium for
 
-
Representation and Exchange of Biochemical Network Models</i>". Oxford Journals, www.http://bioinformatics.oxfordjournals.org (October 15, 2014)
 
-
</SPAN><br><br>
 
-
<SPAN class="ft4">[2]</SPAN><SPAN class="ft26">"Cytoscape Core Features." <i>What Is Cytoscape?</i>,  www.cytoscape.org (October 15, 2014)
 
-
</SPAN><br><br>
 
-
<SPAN class="ft4">[3]</SPAN><SPAN class="ft26">"<i>Download SBW File A Bug Browse Forum.</i>" http://sbw.kgi.edu/research/sbwintro.htm  (October 15, 2014)
 
-
</SPAN><br><br>
 
-
<SPAN class="ft4">[4]</SPAN><SPAN class="ft26">"<i>SBML Software Showcase.</i>" 10 June 2014., The System Biology Markup Language,  www.sbml.org (October 15, 2014)
 
-
</SPAN><br><br>
 
-
<SPAN class="ft4">[5]</SPAN><SPAN class="ft26">Baez, John C. "<i>Petri Nets.</i>"  www.johncarlosbaez.wordpress.com (October 15, 2014)
 
-
</SPAN><br><br>
 
-
<SPAN class="ft4">[6]</SPAN><SPAN class="ft26">"<i>SQLite Home Page.</i>" SQLite Home Page. www.sqlite.org (October 15, 2014)
 
-
</SPAN><br><br>
 
-
<SPAN class="ft4">[7]</SPAN><SPAN class="ft26">"<i>Why Python?</i>" www.programmingforbiologists.org (15 October 2014)
 
-
</SPAN><br><br>
 
-
<SPAN class="ft4">[8]</SPAN><SPAN class="ft26">"<i>NDEx About.</i>" www.ndexbio.org (October 15, 2014)</SPAN><br><br>
 
-
<SPAN class="ft4">[9]</SPAN><SPAN class="ft26">Hoon Hong, Seok. 03 Jan. 2012, "<i>Synthetic Quorum-sensing Circuit to Control Consortial Biogilm Formation and Dispersal in a Microfluidic Device</i>." Nature.com. Nature Publishing Group,  (October 17, 2014)</SPAN><br>
 
</div>
</div>
-
<div id = "w6"><h2 style = "border-bottom: 0px solid #57c4d0;" class = "text-center"><b>Modeling</b></h2>
 
 +
<div id = "w3">
 +
<h2 class = "text-center"><b>Testing</b></h2>
 +
<h3>SBiDer Function Testing</h3>
 +
<h4><b>Database</b></h4>
 +
The database wrapper functions were tested by verifying correct table creation and droppage. Individual SQL Python wrapper functions were tested for proper input, update, and removal of table entries. Functions were tested on the SBiDer database itself to ensure future functional usage of the SBiDer API. <br>
 +
<h4><b>Logic Parser</b></h4>
 +
The SBiDer logic parser required testing under multiple logic situations. The input necessary for parsing logic is specific due to the ability to make complex search queries. AND logic testing was done by verifying proper breakdown of the logic. OR logic testing was done by verifying that multiple queries were generated with the total number of queries equal to the total number of OR statements plus one. <br>
 +
<h4><b>Traversal: Direct  and Indirect Algorithms</b></h4>
 +
To ensure that the correct paths were generated a Python unit test was constructed to verify proper operon activation along a given path. We considered two options for our traversal: direct path and indirect path.  <br><br>
-
<ol>
+
In the direct path the preceding operon produces the species necessary for the activation of the following operon. Iteration through a loop ensured that all paths discovered by the traversal algorithm were legitimate activatable paths. This was done by starting at the first operon of every path and checking whether the starting input species were enough to activate the first operon. That operon would then produce some species that would then have to activate the next operon. Assertions were made at this point to verify if the species taken as input for operon activation were those produced by the previous operon or initial input. If all operons were activated then that would mean that the path was a correct linear path. <br><br>
-
<b><li>What is this program?</li></b>
+
-
Synthetic biology has been developed for a decade and is being expected to evolve the academic society because of its standardization and convenience.<SPAN class="ft5">1, 2 </SPAN>This novel technology has already yielded bunches of applications on the field of pharmacy<SPAN class="ft5">1, 2 </SPAN>and therapeutics<SPAN class="ft5">3 </SPAN>while also showing its potential on energy industry.<SPAN class="ft5">5 </SPAN>However, a standardized model is eagerly required to be established because it will facilitate the exploration of synthetic biology. Therefore, we developed the software – AutoModel, which integrates dozens of models of simple devices and stipulates the I/O interface then provides user standardized modeling path with high degree of freedom.<br><br>
+
-
This python script is being expected to help noviciate to construct their model and decide how much experimental data should be collected. In the coming section, we will demonstrate how this software works and how it help <NOBR>wet-lab</NOBR> experiments. Meanwhile, some instance are listed for illumination.<br><br>
+
-
<b><li>How does it work?</li></b>
+
As an example query Lara and araC are the starting input species and gfp is the final output species. The query has the following operon path: pLac_pBAD--->LuxR_luxI followed by pTet--->gfp. An assertion is done at operon pLac_pBAD--->LuxR_luxI to verify if Lara and arac activate it. The assertion is passed because pLac_pBAD--->LuxR_luxI is activated by Lara and arac and the operon produces the species AHL and luxR. One last assertion is done to verify if AHL and LuxR  activate pTet--->gfp. This assertion is passed and so operon pTet--->gfp produces gfp, the desired final species.
-
During the synthetic biological procedure, substantial biochemical reaction happens <SPAN class="ft7">in vivo </SPAN>or <SPAN class="ft7">in vitro</SPAN>. Generally speaking, those gene expression molecular level events could be represented by mass equation:<SPAN class="ft8">4</SPAN><br><br>
 
-
 
-
<div class = "row text-center">
 
-
k<SPAN class="ft9">1</SPAN><SPAN class="ft4">[</SPAN>A<SPAN class="ft4">]</SPAN><SPAN class="ft10">aq </SPAN><SPAN class="ft4">+ </SPAN>k<SPAN class="ft9">2</SPAN><SPAN class="ft4">[</SPAN>B<SPAN class="ft4">]</SPAN><SPAN class="ft10">aq </SPAN>k<SPAN class="ft9">3</SPAN><SPAN class="ft4">[</SPAN>A B<SPAN class="ft4">]</SPAN><SPAN class="ft10">aq</SPAN><br><br></div>
 
-
 
-
where <SPAN class="ft11">k</SPAN><SPAN class="ft12">1</SPAN>, <SPAN class="ft11">k</SPAN><SPAN class="ft12">2 </SPAN>and <SPAN class="ft11">k</SPAN><SPAN class="ft12">3 </SPAN>are reaction coefficients. One of best mathematical representation for this reaction formula is differential equation. The differential equation is a mathematical equation about some continuously varying quantities and their rates of change in time that relates some function of one or more variables with its derivatives. Therefore, differential model is widely employed on the chemical modeling. However, constructing a precise model for any specific reaction is always complex because dozens of material and formulae has to be considered.<br><br>
 
-
 
-
But now, a novel technique has been developed to help you figure out this problem. Inspired by the primary idea of synthetic biology, the AutoModel separates existed simple device as individual parts and integrates them into the device file which is a <NOBR>plug-in</NOBR> for main program. There are hundreds of mathematical expressions in the device file that represents those relationship between input(reactant) and output(resultant). Customers could add, adapt or ampu- tate any functions, parameters and terms to optimally fitting their experimental data and theoretical model. Besides, preseted device functions could be called for predict your experimental result.<br><br>
 
-
 
-
<b><li> How to use it?</li></b><br>
 
-
There are 3 kinds of documents included in the program package.<br><br>
 
-
<b>3.1</b> Device<br><br>
 
-
All of differential equations are stored in the ’DEVICE.py’ file which is a list of import subfunction of python. Those subfunction are defined in the same format that allowing user to recall them by the same method. The format is <br><br>
 
-
 
-
<div style="font-weight: normal">
 
-
def device’s name (od , input_1, input_2, output, dt = 0.1) : <br>
 
-
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;parameters<br>
 
-
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;input1 = input_1 + (differential equation of input_1)* od* d t<br>
 
-
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;input2 = input_2 + (differential equation of input_2)* od* d t<br>
 
-
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;output1 = output + (differential equation of output)* od* d t<br>
 
-
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return (input1 , input2, output)<br>
 
-
where od is optical density and dt is integral time step.
 
-
</div><br><br>
 
-
 
-
<b>3.2</b> Network Document<br><br>
 
-
 
-
The ’network.txt’ is the file of network which describes the connection among simulated model. This text file is
 
-
a table. The first column is device’s name which corresponds to the name in ’DEVICE.py’. The next 2 columns are
 
-
input_1 and its initial value. It could be either inducer’s name or device’s name from first column. The 4th and 5th
 
-
represent input_2. Last 2 columns are output’s name and its value. If the word in any row is output, it means that the
 
-
program will return the output value of this device. <br><br>
 
-
 
-
<b>3.3</b> Main Program<br><br>
 
-
 
-
The main code for simulation is written in ’demo python.py’ which contains calculating function for growing curve, integrating function for ODE and a plotting part. Here we use an instance for illustration how to use this software.<br>
 
-
First, there is a default growing curve provided by demo. The initial cell density(OD) is 0.2 while growing rate is<br>
 
-
0.3 per 6 mins. You can change the maximum value of density by change the parameter <SPAN class="ft11">k</SPAN><SPAN class="ft12">1 </SPAN>in the function grow. Second, function ’Calculate’ is an integral function that calculating the output value while reading the network from network file from top to bottom and then loop this process until the end of simulation time. In this case, the demo network is invested by David L. Shis and Matthew R. Bennett.<SPAN class="ft8">6</SPAN><br><br>
 
-
Final, ’Calculate’ will return a matrix of time scalar, optical density and output to our plotting script.<br><br>
 
-
 
-
<b><li>Demonstration</li></b>
 
-
 
-
It is reasonable to assume that our host is incubated in ideal environment that the curve of optical density (OD) perfectly matches the ’S’ shape model. In other word, the growing curve is integrated by logistic model<br><br>
 
-
 
-
 
-
<div class = "row text-center">
 
-
<img src = "http://i.imgur.com/RhgJlc0.png?1">
 
-
</div><br><br>
 
-
 
-
where <SPAN class="ft7">k</SPAN><SPAN class="ft10">grow </SPAN>is producing rate of cells and <SPAN class="ft7">k</SPAN><SPAN class="ft10">max </SPAN>is maximun value of density of cells, i.e. 1=(<SPAN class="ft7">OD</SPAN><SPAN class="ft10">max</SPAN>).
 
<br><br>
<br><br>
-
The AND gate with two devices achieved by Shis, David L., and Matthew R. Bennett<SPAN class="ft8">6 </SPAN>has been modeled for two separated parts that each one could be recalled as an individual function to represent the corresponding device. The ODEs for these 2 devices are demonstrated below.<br><br>
+
-
When pTara is induced by arabinose, this circuit produces LacI then stimulates its downstream device pET28. As result, the output of pTara is consumable inducer for circuit pET28. Therefore, we have 2 equations for pTara, which are<br><br>
+
The approach to verify the indirect traversal option was more involved due to path convergence. A Python unittest was created using two sets: one containing all inputs necessary for every operon in the path (set I), and one containing all of the outputs for every operon in the path plus the starting inputs (set O). If set I is a subset of set O, this verifies that the indirect operon path is constructed correctly and therefore activation will occur.  
-
<div class = "row text-center">
 
-
<img src = "http://i.imgur.com/WjS4BrQ.png?1">
 
-
</div><br><br>
 
-
and <br><br>
 
-
<div class = "row text-center">
 
-
<img src = "http://i.imgur.com/CbJYFKB.png?1">
 
-
</div>
 
<br><br>
<br><br>
-
where OD is optical density and <SPAN class="ft7">x</SPAN><SPAN class="ft9">1 </SPAN>is the input of device pTara, i.e., arabinose. Meanwhile, <SPAN class="ft7">y </SPAN>is the output of device p- Tara and input of device pTara. The first equation represents the consumption of inducer that will give us an exponatial decay of the value of its input. The second equation is modeled for the output of pTara. The positive term corresponds to the producing rate of LacI whereas the negative term is of consuming rate. <br><br>
+
An example the same query will be reused here below. The indirect traversal has the following path:  pCONST--->araC, pBAD--->T7-C, pT7--->gfp. pCONST--->araC uses a constitutive promoter (no input) and produces araC. pBAD--->T7-C takes as input arac and Lara and produces T7-C. pT7--->gfp takes as input T7 and produces gfp. Set I in this case contains arac, lara and T7. Set O in this case contains arac, Lara, T7 and gfp. Set I is a subset of set O so all of the input species necessary to activate the operons in the path are activated and the path is a correct path.
-
<div class = "row text-center">
+
 
-
<img class = "text-center" src = "http://i.imgur.com/mBru0Nz.png?1"><br><br>
+
<h4><b>Traversal: Accounting for Repressor Species</b></h4>
-
</div>
+
The current SBiDer development only takes queries for activation of genetic devices. As a result operons may not be activated due to repression events. To verify this event it was necessary to manually trace and validate paths that had species products with repression interactions with operons that could potentially repress our system.
<br>
<br>
-
As principle employed on modeling pTara, we also provide a differential equation for pET28 which is<br><br>
+
 
-
<div class = "row text-center">
+
<h4><b>Complexity Analysis of the Search Algorithm</b></h4>
-
<img src = "http://i.imgur.com/BKDkbdl.png?1"><br><br>
+
The complexity analysis was performed on the search algorithm, which have two methods of search: linear successive activation search (LSAS) and nonlinear successive activation search (NLSAS). Our complexity analysis concluded the complexity of LSAS and NLSAS to be O(mV^2) and O(m^2*V^4). respectively. Detailed complexity analysis can be found in the documentation section.
-
</div>
+
<h4><b>JSON Generation</b></h4>
-
where z is the output of device pET28, i.e., the value of GFP. Again the positive term is the producing rate of GFP but
+
The SBiDer network shown at the beginning of the SBiDer application as well as the subnetwork that resulted from the traversal output required JSON files with complete information. This information was captured using functions for data extraction and processing which were individually tested by running inputs and reviewing printing the resulting output with great care. Once the information was gathered, it was inserted into the JSON file generator. The JSON string was then taken and validated using the Online <a href = "http://jsonviewer.stack.hu/">JSON Viewer</a>. The image produced by the JSON converter was then displayed on CyNetShare using Cytoscape JS. In addition, the table generated by the JSON converter was validated against the database itself to ensure that the network was correctly reproduced.<br>
-
the negative term is of decomposition rate. <br><br>
+
<h4><b>SBML Generation</b></h4>
-
Finally, we link these 2 device to finalize the model of AND gate. The plot of the simulation result shows that our
+
The SBML document was taken and validated using the Online SBML Validator (http://sbml.org/Facilities/Validator/). We ensured that our SBML documents were accurate.<br>
-
model approximately fittings the experimental data.<br>
+
<h4><b>SBOL Validation</b></h4>
-
In this work, we successfully construct a new approaching of modeling for synthetic biology by applying the idea
+
We confirmed that the images we generated supported the SBOL standard by comparing the corresponding text file for each image to with images from the SBOL website. We ensured that the correct images were produced for all of the image.
-
of this field which is about modulization. The modulized modeling functions which are using as bio-brick provide a
+
 
-
novel method to academic society that allows circuit consturctors predict their experimental data. Furthermore, it gives
+
-
us chance to develop the virtual laboratory so that dramatically reduces the laborious work in lab.
+
-
</ol>
+
<br>
<br>
-
<b><h3>References</h3></b>
+
Check out the test code on our <a href = "https://github.com/igemsoftware/UCSD-iGEM_2014/blob/master/CircuitNetwork/test/sbider_tester.py">GitHub</a> branch.
-
 
+
-
<SPAN class="ft4">[1]</SPAN><SPAN class="ft26">Ellis, Tom, Xiao Wang, and James J. Collins. <NOBR>”Diversity-based,</NOBR> <NOBR>model-guided</NOBR> construction of synthetic gene networks with predicted functions.” </SPAN><SPAN class="ft7">Nature biotechnology</SPAN><SPAN class = "ft26"> 27.5 (2009): <NOBR>465-471.</NOBR></SPAN>
+
-
<br><br>
+
-
<SPAN class="ft4">[2]</SPAN><SPAN class="ft26">Andrianantoandro, Ernesto, et al. ”Synthetic biology: new engineering rules for an emerging discipline.” </SPAN><SPAN class="ft7">Molecular systems biology</SPAN> <SPAN class = "ft26">2.1 (2006).</SPAN>
+
-
<br><br>
+
-
<SPAN class="ft4">[3]</SPAN><SPAN class="ft26">Lu, Timothy K., and James J. Collins. ”Engineered bacteriophage targeting gene networks as adjuvants for an- tibiotic therapy.” </SPAN><SPAN class="ft7">Proceedings of the National Academy of Sciences</SPAN><SPAN class = "ft26"> 106.12 (2009): <NOBR>4629-4634.</NOBR></SPAN>
+
-
<br><br>
+
-
<SPAN class="ft4">[4]</SPAN><SPAN class="ft26">Kaznessis, Yiannis N. ”Models for synthetic biology.” </SPAN><SPAN class="ft7">BMC systems biology</SPAN><SPAN class = "ft26"> 1.1 (2007): 47.</SPAN>
+
-
<br><br>
+
-
<SPAN class="ft4">[5]</SPAN><SPAN class="ft26">Lee, Sung Kuk, et al. ”Metabolic engineering of microorganisms for biofuels production: from bugs to synthetic biology to fuels.” </SPAN><SPAN class="ft7">Current opinion in biotechnology</SPAN><SPAN class = "ft26"> 19.6 (2008): <NOBR>556-563.</NOBR></SPAN>
+
-
<br><br>
+
-
<SPAN class="ft4">[6]</SPAN><SPAN class="ft27">Shis, David L., and Matthew R. Bennett. ”Library of synthetic transcriptional AND gates built with split T7 RNA polymerase mutants.” </SPAN><SPAN class="ft7">Proceedings of the National Academy of Sciences</SPAN><SPAN class = "ft26"> 110.13 (2013): <NOBR>5028-5033.</NOBR></SPAN>
+
</div>
</div>
-
          </div>
+
</div>
-
    </div>
+
</div>
</div>
<script>
<script>
Line 1,067: Line 1,678:
       window.location.href="https://igem.org/Team.cgi?year=2013&team_name=UCSD_Software";  
       window.location.href="https://igem.org/Team.cgi?year=2013&team_name=UCSD_Software";  
     });
     });
-
     /*$("#project").click(function(){
+
     $("#project").click(function(){
       window.location.href="https://2014.igem.org/Team:UCSD_Software/Project";  
       window.location.href="https://2014.igem.org/Team:UCSD_Software/Project";  
-
     });*/
+
     });
     $("#parts").click(function(){
     $("#parts").click(function(){
       window.location.href="https://2014.igem.org/Team:UCSD_Software/Parts";  
       window.location.href="https://2014.igem.org/Team:UCSD_Software/Parts";  
Line 1,075: Line 1,686:
     $("#modeling").click(function(){
     $("#modeling").click(function(){
       window.location.href="https://2014.igem.org/Team:UCSD_Software/Modelingl";  
       window.location.href="https://2014.igem.org/Team:UCSD_Software/Modelingl";  
 +
    });
 +
    $("#doc").click(function(){
 +
      window.location.href="https://2014.igem.org/Team:UCSD_Software/Documentation";
     });
     });
     $("#notebook").click(function(){
     $("#notebook").click(function(){
Line 1,088: Line 1,702:
       window.location.href="https://2014.igem.org/Team:UCSD_Software/Attributions";  
       window.location.href="https://2014.igem.org/Team:UCSD_Software/Attributions";  
     });
     });
-
   
+
 
 +
    var myCountdown1 = new Countdown({time:316});
 +
 
     });
     });
</script>
</script>

Latest revision as of 03:16, 18 October 2014


Tutorial



    

API Documentation

Download and view the documentation on github here. A text version of the documentation is shown below:
Help on module Gen_Network:

NAME
    Gen_Network - //Title: SBML Network Generator

FILE
    /Users/jenhantao/Documents/UCSD_IGEM/CircuitNetwork/web/Gen_Network.py

DESCRIPTION
    //Description: 
        Translate entire network model to SBML and store network file 
        in current working directory  
    
    *************************************************
    @author: Fernando Contreras
    @email: f2contre@gmail.com
    @project: SBiDer
    @institution: University of California, San Diego
    *************************************************

FUNCTIONS
    create_whole_network_sbml()


Help on module SBML_Network:

NAME
    SBML_Network - //Title: SBML Network Constructor.

FILE
    /Users/jenhantao/Documents/UCSD_IGEM/CircuitNetwork/web/SBML_Network.py

DESCRIPTION
    //Description: 
        Each class generates a corresponding SBML description of the input information 
        and appends the information to a list which is then written to file
    
    *************************************************
    @author: Fernando Contreras
    @email: f2contre@gmail.com
    @project: SBiDer
    @institution: University of California, San Diego
    *************************************************

CLASSES
    CloseModel
    IntermediateStep
    Model
    QualitativeSpecies
    Transitions
    
    class CloseModel
     |  Require class, need to append closing SBML statements for network model
     |  
     |  Methods defined here:
     |  
     |  __init__(self, model_name)
     |      @Parameter:
     |          model_name: model object, instantiated using Model class
    
    class IntermediateStep
     |  Require class, need to append necessary SBML statements for network model
     |  
     |  Methods defined here:
     |  
     |  __init__(self, model_name)
     |      @Parameter:
     |          model_name: model object, instantiated using Model class
    
    class Model
     |  Creates a model object. When instantiated the class appends all the URLs 
     |  necessary to understand our network model
     |  
     |  Methods defined here:
     |  
     |  __init__(self, id='SBider_Network')
     |  
     |  writeSBML(self, filename)
     |      @Parameters: 
     |          filename: desired file name for network file 
     |          type: string 
     |      
     |      @Method:
     |          Write SBML formatted network model text file. File is then stored in 
     |          the current working directory.
    
    class QualitativeSpecies
     |  Qualitative species, such as operons and chemical species, constructor
     |  
     |  Methods defined here:
     |  
     |  __init__(self, id, compartment, name='NONE', maxLevel='1', constant='false', miriam_id='NONE')
     |      @Parameters:
     |          id: node id 
     |          compartment: node compartment, for example, operons belong in the plasmid compartment
     |          name: node name, default=NONE because operons don't have a name 
     |          maxLevel: node threshold, default = 1 because a logic model was implemented 
     |          constant: denotes node passivity, if constant = True then the node does not interact with 
     |          network. Thus, the node does not transfer information.
     |          miriam_id: Minimal Information Required in the Annotation of Models id. This allows for 
     |          a standarized citation of literature references 
     |      
     |      @Method:
     |          Translate all the inputed information to SBML and append to list
     |  
     |  appendToQualSpecies(self, model_name)
    
    class Transitions
     |  Input and output transition constructor; transitions denote the operon's input 
     |  and output reaction in our network.
     |  
     |  Methods defined here:
     |  
     |  input_transition(self, model_name, trans_id, input_id_boolean_tuple, operon_id, trans_logic)
     |      @Parameters:
     |          node_name: name of node object, instantiated using the Node class 
     |          trans_id: transition id 
     |          input_id_boolean_tuple: tuple of the form (input chemical species, repressor boolean)
     |              input chemical species: chemical species involved in reaction 
     |              repressor boolean: denotes whether a chemical species is a repressor (True or False)
     |              Can input a list if multiple operators are involved, such is the case for an AND gate 
     |          operon_id: operon id 
     |          trans_logic: transition logic denotes the Boolean logic of a reaction ('AND', 'OR', 'NOT')
     |          
     |      @Method:
     |          Translate all the inputed information to SBML and append to list
     |  
     |  output_transition(self, model_name, trans_id, output_id, operon_id)
     |      @Parameters:
     |          node_name: name of node object, instantiated using the Node class 
     |          trans_id: transition id 
     |          output_id: single variable input which denotes the id of an operon's output
     |          operon_id: operon id 
     |          
     |      @Method:
     |          Translate all the inputed information to SBML and append to list


Help on module SBML_Nodes:

NAME
    SBML_Nodes - //Title: SBML Node Constructor.

FILE
    /Users/jenhantao/Documents/UCSD_IGEM/CircuitNetwork/web/SBML_Nodes.py

DESCRIPTION
    //Description: 
        Each class generates a corresponding SBML description of the input information.
    
    *************************************************
    @author: Fernando Contreras
    @email: f2contre@gmail.com
    @project: SBiDer
    @institution: University of California, San Diego
    *************************************************

CLASSES
    Nodes
    QualitativeSpecies
    Transitions
    
    class Nodes
     |  Place, passive component of Petri Net model, and transition, active component 
     |  of Petri Net model, file constructor.When instantiated, a qualitative species 
     |  list and a transitions list are created. Data is then stored according to 
     |  SBML standards.
     |  
     |  Methods defined here:
     |  
     |  __init__(self)
     |      Instantiate qualitative species and transitions list objects
     |  
     |  writeQualSpecies(self, filename)
     |      @Parameters: filename
     |          type: string 
     |          description: desired file name for a particular qualitative species
     |          SBML text file(i.e. operon or chemical species)
     |      @Method:
     |          Write SBML text file for a qualitative species stored in the qualitative 
     |          species list object. File is then stored in the current working directory.
     |  
     |  writeTransition(self, filename)
     |      @Parameters: filename
     |          type: string 
     |          description: desired file name for a particular transition SBML text 
     |          file(i.e. input transition or output transition)
     |      @Method:
     |          Write SBML text file for a transition stored in the transition list 
     |          object. File is then stored in the current working directory.
    
    class QualitativeSpecies
     |  Qualitative species, such as operons and chemical species, constructor
     |  
     |  Methods defined here:
     |  
     |  __init__(self, id, compartment, name='NONE', maxLevel='1', constant='false', miriam_id='NONE')
     |      @Parameters:
     |          id: node id 
     |          compartment: node compartment, for example, operons belong in the plasmid compartment
     |          name: node name, default=NONE because operons don't have a name 
     |          maxLevel: node threshold, default = 1 because a logic model was implemented 
     |          constant: denotes node passivity, if constant = True then the node does not interact with 
     |          network. Thus, the node does not transfer information.
     |          miriam_id: Minimal Information Required in the Annotation of Models id. This allows for 
     |          a standarized citation of literature references 
     |      
     |      @Method:
     |          Translate all the inputed information to SBML and append to list
     |  
     |  appendToQualSpecies(self, node_name)
    
    class Transitions
     |  Input and output transition constructor; transitions denote the operon's input 
     |  and output reaction in our network.
     |  
     |  Methods defined here:
     |  
     |  input_transition(self, node_name, trans_id, input_id_boolean_tuple, operon_id, trans_logic)
     |      @Parameters:
     |          node_name: name of node object, instantiated using the Node class 
     |          trans_id: transition id 
     |          input_id_boolean_tuple: tuple of the form (input chemical species, repressor boolean)
     |              input chemical species: chemical species involved in reaction 
     |              repressor boolean: denotes whether a chemical species is a repressor (True or False)
     |              Can input a list if multiple operators are involved, such is the case for an AND gate 
     |          operon_id: operon id 
     |          trans_logic: transition logic denotes the Boolean logic of a reaction ('AND', 'OR', 'NOT')
     |          
     |      @Method:
     |          Translate all the inputed information to SBML and append to list
     |  
     |  output_transition(self, node_name, trans_id, output_id, operon_id)
     |      @Parameters:
     |          node_name: name of node object, instantiated using the Node class 
     |          trans_id: transition id 
     |          output_id: single variable input which denotes the id of an operon's output
     |          operon_id: operon id 
     |          
     |      @Method:
     |          Translate all the inputed information to SBML and append to list


Help on module helper:

NAME
    helper - Useful helper functions.

FILE
    /Users/jenhantao/Documents/UCSD_IGEM/CircuitNetwork/web/helper.py

DESCRIPTION
    ******************************************************************************
    @author: Huwate(Kwat) Yeerna, University of California, San Diego
             Joaquin Reina, University of California, San Diego
    ******************************************************************************

FUNCTIONS
    activated(inp_dic, ope, spe)
        Check if there is an activation signal for a operon.
        :param inp_dic: dictionary of operon and their activation requirement.
        :param ope: operon whose activation signal is checked.
        :param spe: species that may induce activation signal for the operon.
        :return: True only if species match any of the activation requirement of an operon, False otherwise.
    
    contain_all_elements(list_of_lists, lst)
        Check if a list that matches the specified list.
        :param list_of_lists: list whose inner lists are checked.
        :param lst: list matched
        :return: True only if the list_of_lists contain a list that matches lst.
    
    contain_an_element(lst1, lst2)
        Check if at least on of the elements is a list is in another list.
        :param lst1: list that may contain at least one element from anther list.
        :param lst2: list whose elements are searched for in another list.
        :return: True only if at least an element from lst2 in found in lst1.
    
    format_values(value_list)
        Create a list by adding elements of a list in a standard expression.
        :param value_list: list whose elements with non-standard expression are reformatted and added to the new list.
        :return: a new list with elements in standard expression.
    
    get_matching_list_and_index(list_of_lists, lst)
        Get a matching list within a list of lists that matches a specified list.
        :param list_of_lists: list whose inner lists are checked to see if any of them match the specified list.
        :param lst: list checked.
        :return: list within list_of_lists that matches the specified list.
    
    list_is_type(lst, typ)
        Check if all elements of a list are the specified type.
        :param lst: list whose elements are checked.
        :param typ: type specified.
        :return: True only if all elements of the list is the specified type, False otherwise.
    
    match_any_list(list_of_lists, lst)
        Check if a list matches any of the lists within a list of lists.
        :param list_of_lists: list of lists that contain potential matching lists.
        :param lst: list matched.
        :return: True only is at least a list within the list of lists matches the specified list.
    
    promoter_activation(inp_dic, rep_dic, ope, spe, memory_spe, indirect_flag)
        Check if a promoter is activated.
        :param inp_dic: dictionary of operon and their activation requirement.
        :param rep_dic: dictionary of operon and their repression requirement.
        :param ope: operon whose activation is checked.
        :param spe: species that can activate or repress an operon.
        :param memory_spe: species that can activate or repress an operon.
        :param indirect_flag: Boolean flag for checking indirect activation of an operon
        :return: True if the operon is activated.
    
    remove_duplicated_lists_within_a_list_of_lists(list_of_lists)
        Create a list that contains unique lists within another list.
        :param list_of_lists: list that contains duplicated lists.
        :return: list that contains unique lists from the list.
    
    remove_duplicates_within_list(lst)
        Create a list with only unique elements form another list.
        :param lst: list whose unique elements will be stored in a new list.
        :return: a list that contains non-duplicated elements from the parameter list.
    
    remove_parentheses(sequence)
        Remove the outermost parentheses of a string, and return the element right after the closing parentheses.
        :param sequence:
        :return:
    
    repressed(rep_dic, ope, spe)
        Check if there is an repression signal for a operon.
        :param rep_dic: dictionary of operon and their repression requirement.
        :param ope: operon whose repression signal is checked.
        :param spe: species that may induce repression signal for the operon.
        :return: True only if species match any of the repression requirement of an operon, False otherwise.
    
    reverse_index(sequence, element)
        Find the last occurring index of an element in a sequence.
        :param sequence: list checked.
        :param element: element searched.
        :return: index of the last occurring index of an element.
    
    split_by(sequence, element)
        Split a sequence by the first occurring index of a specified element, and return the the resulting two-halves of
        the sequence in a dictionary.
        :param sequence: sequence that is split.
        :param element: element whose first occurring index splits the sequence.
        :return: dictionary that contains the split two halves of the sequence.
    
    uniquely_merge_list_of_lists(list_of_lists)
        Create a list that contain unique elements from lists within itself.
        :param list_of_lists: list that contains lists
        :return: list that contains unique elements from lists within the list.
    
    uniquely_merge_multi_dimensional_list_of_lists(multi_dimensional_list_of_lists)
        Create a list that contain unique elements from lists within itself.
        :param multi_dimensional_list_of_lists: list that contains lists
        :return: list that contains unique elements from lists within the list.


Help on module node:

NAME
    node - Subtitle

FILE
    /Users/jenhantao/Documents/UCSD_IGEM/CircuitNetwork/web/node.py

DESCRIPTION
    Descriptive paragraph
    
    ******************************************************************************
    @author: Huwate(Kwat) Yeerna, University of California, San Diego
    ******************************************************************************

CLASSES
    __builtin__.object
        Node
    
    class Node(__builtin__.object)
     |  Methods defined here:
     |  
     |  __init__(self, value)
     |  
     |  __repr__(self, level=0)
     |  
     |  append_child(self, obj)
     |  
     |  get_all_leaf(self)
     |  
     |  get_path_from_all_leaf(self)
     |  
     |  ----------------------------------------------------------------------
     |  Data descriptors defined here:
     |  
     |  __dict__
     |      dictionary for instance variables (if defined)
     |  
     |  __weakref__
     |      list of weak references to the object (if defined)


Help on module sbider_database:

NAME
    sbider_database - Subtitle

FILE
    /Users/jenhantao/Documents/UCSD_IGEM/CircuitNetwork/web/sbider_database.py

DESCRIPTION
    Descriptive paragraph
    
    ******************************************************************************
    @author: Huwate(Kwat) Yeerna, University of California, San Diego
             Joaquin Reina, University of California, San Diego
    ******************************************************************************

FUNCTIONS
    db_close(connection, cursor)
        Close a database.
    
    db_create_table(cursor)
        Make tables for sbider.db
    
    db_custom(cursor, sql_command)
        Do whatever.
    
    db_delete(cursor, table_name)
        Delete table contents.
    
    db_drop_all_table(cursor)
        Drop all tables.
    
    db_drop_table(cursor, table_name)
        Drop a table.
    
    db_get_operon_id_from_name(cursor, operon_name)
    
    db_get_operon_name_from_id(cursor, operon_id)
    
    db_get_plasmid_id_from_name(cursor, plasmid_name)
    
    db_get_plasmid_name_from_id(cursor, plasmid_id)
    
    db_get_species_id_from_name(cursor, species_name)
    
    db_get_species_name_from_id(cursor, species_id)
    
    db_insert(cursor, table_name, table_header_list, insert_data_list)
        Insert into a table.
        
        Args:
            table_name, that table that you wish to insert into
            cols, the columns that you want to insert into
            new_row, the values that correspond to the columns
        
        Examples:
            ex 1. Inserting into plasmid table and filling in all the columns.
    
    db_open(database_file)
        Connect to a database or create a database if it does not already
        exist.
    
    db_print_all_table(cursor)
        Print all tables.
    
    db_print_table(cursor, table_name)
        Print a table.
    
    db_select(cursor, table_name, table_header_list, where_columns=None, where_options=None, where_values=None, where_bools=None, group=None, having_columns=None, having_bools=None, having_values=None)
        Select from a table.
        
        Argument(s):
            table_name: table you wish to pull data from
            col_names: list of numbers indexing the table columns
            w_col: column names for where clause
            w_opt: operator for where clause
            w_var: variable for where clause 
            w_bool: boolean for where clause
            group: group name for GROUP BY clause
            h_col: group specifier
        
        Return:
    
    db_update(cursor, table_name, table_header_list, update_data_list, where_column='', where_option='', where_value='')
        Update.
    
    get_all_input_transition_species(cursor, input_transition_id)
        Obtain all species an input transition takes.
    
    get_all_output_transition_species(cursor, input_transition_id)
        Obtain all species an output transition produces.
    
    make_input_ope_id_spe_id_dic(cursor)
        Make operon input species dictionary.
    
    make_ope_id_rep_spe_id_dic(cursor)
        Make operon input not dictionary.
    
    make_ope_id_spe_id_dics(cursor)
    
    make_output_ope_id_spe_id_dic(cursor)
        Make operon output species dictionary.
    
    make_pla_name_spe_name_dics(cursor)
        Make operon input and output species dictionary.
    
    make_plasmid_species_name_dictionary(cursor, operon_id_plasmid_name_dictionary, operon_species_dictionary)
    
    make_sql_delete_command(table_name)
    
    make_sql_drop_command(table_name)
    
    make_sql_insert_command(table_name, table_header_list, insert_data_list)
        Make SQL insert command.
    
    make_sql_select_command(table_name, table_header_list, where_columns=None, where_options=None, where_values=None, where_bools=None, group=None, having_columns=None, having_bools=None, having_values=None)
        Make SQL select command.
        
        @param table_header_list - list of columns to be selected
        @param where_columns - column names for where clause
        @param where_options - operator for where clause
        @param where_values - variable for where clause
        @param where_bools - boolean for where clause
        @param group - group name for GROUP BY clause
        @param having_columns
    
    make_sql_update_command(table_name, table_header_list, update_data_list, where_column='', where_option='', where_value='')
        Makes SQL update command
        @param table_name - Updating table
        @param table_header_list - Selected columns
        @param where_columns - Where column names
        @param where_options - List of operators
        @param where_values - variable for where clause 
        @param where_bools - boolean for where clause


Help on module sbider_grapher:

NAME
    sbider_grapher - Subtitle

FILE
    /Users/jenhantao/Documents/UCSD_IGEM/CircuitNetwork/web/sbider_grapher.py

DESCRIPTION
    Descriptive paragraph
    
    ******************************************************************************
    @author: Joaquin Reyna, University of California, San Diego
             Huwate(Kwat) Yeerna, University of California, San Diego
    ******************************************************************************

FUNCTIONS
    add_edge_id_abbreviation(edge, abbrev1, abbrev2, index1=0, index2=0)
    
    add_edge_list_id_abbreviation(edge_list, abbrev1, abbrev2, index1=0, index2=0)
    
    add_node_id_abbreviation(node_, abbrev, index)
        Adds an id abbreviation to a node.
        
        Argument(s):
            node - list representing node information.
            abbrev - string abbreviation.
            index - integer indicating which value to abbreviate.
        
        Return:
            A node with the abbreviation added to the given index.
            For example: [ "abbreviation_node_id", "node_field_2", "node_field_3", ...]
    
    add_node_list_id_abbreviation(node_list, abbrev, id_index)
        Adds an id abbreviation to a list of nodes.
        
        Argument(s):
            node_list - list containing nodes.
            abbrev - string abbreviation.
            index - integer indicating which value to abbreviate.
        
        Return:
            A node_list the abbreviation added to the given index
            of every node.
            For example: [ [ "abbreviation_node_id_1", "node_field_2", "node_field_3", ...],
                           [ "abbreviation_node_id_2", "node_field_2", "node_field_3", ...], ...]
    
    add_node_values_to_nxgraph(nxgraph, node_list)
        Extracts the node id and enters it into nxGraph.
    
    create_input_species_nodes(cursor, it_id)
        Create species nodes from the corresponding it_id.
    
    create_input_transition_nodes(cursor, starting_species_list, operon_id, input_transition_id_dict)
        Create input transition nodes list from the corresponding operon_id.
        
        Argument(s):
            cursor - sqlite3 cursor object
            starting_species_list - a list of species activating an operon
            operon_id - sbider based operon id
            input_transition_id_dict - dictionary mapping input transitions to corresponding species
        
        Return:
            A tuple of input transition nodes list (with abbreviation) and
            input transition id list.
            For example:
            ( [ ("ope_1-1", "pLux-->gfp", "sbol_image_path_1"), ("ope_2-1", "pLambda-->gfp", "sbol_image_path_2"), ... ],
              ["1-1", "2-1", ...] )
    
    create_json_network_file(json_file_path, species_nodes_list, input_transitions_nodes_list, operon_nodes_list, output_transitions_nodes_list, source_id_target_id_list)
        Writes the whole network json.
        :param json_file_path:
        :param species_nodes_list:
        :param input_transitions_nodes_list:
        :param operon_nodes_list:
        :param output_transitions_nodes_list:
        :param source_id_target_id_list:
    
    create_json_network_string(species_nodes_list, input_transitions_nodes_list, operon_nodes_list, output_transitions_nodes_list, source_id_target_id_list, path_json_highlighter)
    
    create_json_whole_network_file(file_name, cursor)
        Generates the whole network json.
    
    create_operon_node(cursor, operon_id)
        Create an operon node from the corresponding operon_id.
        
        Argument(s):
            cursor - sqlite 3 cursor object.
            operon_id - sbider based operon id
        
        Return:
            A tuple with operon node information as a tuple
            (id abbrevation included) and the corresponding
            operon id.
            For example: ( ("ope_1-1", "pLux-->gfp", "sbol_image_path_1"), "1-1" )
    
    create_output_species_nodes(cursor, ot_id)
        Create species nodes from the corresponding ot_id.
    
    create_output_transition_node(cursor, operon_id)
        Create output transition nodes from the corresponding operon_id.
        
        Argument(s):
            cursor - sqlite3 cursor object
            operon_id - sbider based operon id
        
        Return:
            A list of tuples with operon node information.
    
    create_subnetwork_json_string(cursor, list_of_operon_paths)
        Generates the subnetwork json.
    
    create_subnetwork_path(cursor, starting_species_list, operon_path, it_trans_dict)
        Creating a subnetwork path.
        :rtype : object
        :param cursor:
        :param starting_species_list: 
        :param operon_path: 
        :param it_trans_dict:
    
    determine_operon_activated_input_transition(cursor, starting_species_list, operon_id, input_transition_id_dict)
        Determining which input transition is activating an operon.
        
        Argument(s):
            cursor - sqlite3 cursor object
            starting_species_list - a list of species activating an operon
            operon_id - sbider based operon id
            id_id_dict - dictionary mapping input transitions to corresponding species
        
        Return:
            A list of transitions that activate the operon (from operon_id).
            For example: ["it_1", "it_2", ...]
    
    get_input_transition_species_dictionary(cursor)
        Retrieves all rows pertaining to the sbider inputTranstion
        table using these values the dictionary is created.
        
        Argument(s):
            cursor - sqlite3 cursor object instance
        
        Return:
            A dictionary mapping input transition id to a species id list.
    
    get_node1_list_from_node2_id(cursor, node1_node2_relationship_table, node2_id, node2_id_type, node1_table_name, node1_id_type)
        Query the database to find all node1's from node2's id.
            It's possible to have multiple node1's map to node2.
        
        Argument(s):
            cursor - sqlite3 cursor object
            node1_node2_relationship_table - table_name relating node1 and node2
            node2_id - string representation of node1_id
            node2_id_type - node2_id type being used in the sbider database
            node1_table_name - table_name where node information exists
            node1_id_type - node1_id type being used in the sbider database
        
        Return:
            A list of nodes representing all node1's related to node2.
    
    get_node_from_id(cursor, node_table_name, node_id, node_id_type)
        Query the database using the node_id for node.
        
        Argument(s):
            cursor - sqlite3 cursor object
            node_table_name - table_name where node information exists
            node_id - string representation of node_id
            node_id_type - the type of node being used from the sbider database.
        
        Return:
            A tuple of information representing the node.
    
    get_path_json_array(cursor, starting_species_list, operon_paths_list)
        Generate json array for node highlighting.
    
    get_subnetwork(cursor, list_of_operon_paths)
    
    get_whole_network(cursor)
        Whole network data prep for json.
    
    list_of_lists(list_of_tups)
        Creates a list of lists from a list of tuples.
        
        Return:
            A list with list values.
    
    list_of_tuples(list_of_lsts)
        Creates a list of tuples from a list of lists.
        
        Return:
            A list with tuple values.
    
    merge_list_of_lists(list_of_lsts)
        ALREADY EXISTS IN THE HELPER!!
    
    nx_node_coordinates_dictionary(node_id_list, edge_list)
        Creates a dictionary of node coordinates using spring layout from networkx.
        
        Argument(s):
            node_id_list - ids of nodes for positioning
            edge_list - all edges between nodes stored in a tuple as follows,
                        (source_node_id, target_node_id)
        
        Return:
            A dictionary mapping
    
    resize_network(total_subnetwork_nodes, total_whole_nodes=540)
        Resize the network.
    
    unique_node_list(nodes_list)
        Removal of duplicate nodes from the node_list.
        
        Argument(s):
            node_list - list of node information stored as list (list of lists).
        
        Return:
            A list of unique nodes.
            For example:
            [ ["node_id_1", "node_field_2", "node_field_3"], ["node_id_2", "node_field_2", "node_field_3", ...], ...]


Help on module sbider_network_builder:

NAME
    sbider_network_builder - Subtitle

FILE
    /Users/jenhantao/Documents/UCSD_IGEM/CircuitNetwork/web/sbider_network_builder.py

DESCRIPTION
    Descriptive paragraph
    
    ******************************************************************************
    @author: Huwate(Kwat) Yeerna, University of California, San Diego
             Joaquin Reyna, University of California, San Diego
    ******************************************************************************

FUNCTIONS
    build_sbider_network(directory_path, user_query, indirect=False)


Help on module sbider_parser:

NAME
    sbider_parser - Subtitle

FILE
    /Users/jenhantao/Documents/UCSD_IGEM/CircuitNetwork/web/sbider_parser.py

DESCRIPTION
    Descriptive paragraph
    
    ******************************************************************************
    @author: Huwate(Kwat) Yeerna, University of California, San Diego
    ******************************************************************************

FUNCTIONS
    grammar_0(cursor, tokens)
        Grammar for 'grammar_0:= grammar_1 > grammar_1'.
        :param cursor:
        :param tokens:
        :return:
    
    grammar_1(cursor, tokens)
        Grammar for 'grammar_1:= grammar_2 or grammar_1 |
        grammar_2 and grammar_1 |
        grammar_2'.
        :param cursor:
        :param tokens:
        :return:
    
    grammar_2(cursor, tokens)
        Grammar for 'grammar_2:= (grammar_1) or grammar_1 |
        (grammar_1) and grammar_1 |
        (grammar_1) |
        interactor'.
        :param cursor:
        :param tokens:
        :return:
    
    grammar_and(tokens1, tokens2)
        Grammar for 'and'.
        :param tokens1:
        :param tokens2:
        :return:
    
    grammar_or(tokens1, tokens2)
        Grammar for 'or'.
        :param tokens1:
        :param tokens2:
        :return:
    
    grammar_output(tokens1, tokens2)
        Grammar for '='.
        :param tokens1:
        :param tokens2:
        :return:
    
    interactor(cursor, token)
        Grammar for 'interactor'.
        :param cursor:
        :param token:
        :return:
    
    parse_logic(cursor, logic_input)
        Parse a logic input into atomized and equivalent logic.
        :param cursor:
        :param logic_input:
        :return:


Help on module sbider_searcher:

NAME
    sbider_searcher - Subtitle

FILE
    /Users/jenhantao/Documents/UCSD_IGEM/CircuitNetwork/web/sbider_searcher.py

DESCRIPTION
    Descriptive paragraph
    
    ******************************************************************************
    @author: Huwate(Kwat) Yeerna, University of California, San Diego
             Joaquin Reina, University of California, San Diego
    ******************************************************************************

FUNCTIONS
    build_direct_sbider_path(input_dictionary, repressor_dictionary, output_dictionary, input_species_list, output_species_list, path_queue, final_operon_path_list, memory_operon, memory_species, activated_paths, indirect_flag)
    
    build_indirect_sbider_path(input_dictionary, repressor_dictionary, output_dictionary, input_species_list, output_species_list, path_queue, final_operon_path_list, memory_operon, memory_species, activated_paths)
    
    build_sbider_path_memory_tree(input_dictionary, activated_paths, start_operon)
    
    get_sbider_path(inp_dic, rep_dic, outp_dic, inp_spe, outp_spe, indirect_flag=False)
    
    search_sbider_path_memory(input_dictionary, activated_paths, from_operon)


Help on module sbider_upload_database:

NAME
    sbider_upload_database

FILE
    /Users/jenhantao/Documents/UCSD_IGEM/CircuitNetwork/web/sbider_upload_database.py

FUNCTIONS
    check_species_name_in_database(cursor, species_name)
        Safely return species id or None.
    
    db_test()
    
    determine_and_insert(connection, cursor, component_keyword, component_data=[], parent_component_id='')
        Determine insertion method and insert into into the database.
    
    determine_parent_keyword(component_keyword)
        Determine which is your parent keyword.
    
    get_data_keyword(data_string)
        Get the keyword belonging to data_string.
    
    get_last_row_id(cursor, table_name)
        Get the last inserted rowid.
    
    insert_new_device(connection, cursor, device)
        Inserts a new device into the database.
        Argument(s):
            connection - sqlite3 connection object
            cursor - sqlite3 cursor object
            device_string - whole device as a string
    
    insert_new_input_transition(cursor, operon_id, logic)
        Insert new input transition.
    
    insert_new_input_transition_species(cursor, it_id, species_name, species_type, species_repression)
        Insert new input transition species.
    
    insert_new_operon(cursor, plasmid_id, operon_name, direction)
        Insert new operon.
    
    insert_new_output_transition(cursor, operon_id)
        Insert new output transition.
    
    insert_new_output_transition_species(cursor, ot_id, species_name, species_type)
        Insert new output transition species.
    
    insert_new_plasmid(cursor, plasmid_name, miriam_id)
        Insert new plasmid.
    
    main()
    
    make_input_transition_sbml_file(input_species_list, transition_id, operon_id, trans_logic)
    
    make_new_id(id_string)
        Convert old string id to old string id + 1.
    
    make_output_transition_sbml_file(output_species_list, transition_id, operon_id)
        make the sbml.
    
    make_sbol_file(output_species_list, promoter_list, prev_operon_direction, operon_id)
        Insert and make the sbol file.
    
    make_sbol_string_db_update(input_list, direction)
        Make an sbol string using uploading information.
    
    reset_db(original_db='sbider.db', test_db_file='sbider_test_2.db')
    
    select_last_inserted_table_id(cursor, table_name, table_id_type)
        Select the last inserted row.
    
    select_last_inserted_table_row(cursor, table_name)
        Select the last inserted row.
    
    write_sbol_file(operon_id, sbol_string)
        Write out sbol string to file.
    
    write_to_file(string_to_write, file_name)
        Write a file.


Help on module sbml_database:

NAME
    sbml_database - //Title: SBML Database Access

FILE
    /Users/jenhantao/Documents/UCSD_IGEM/CircuitNetwork/web/sbml_database.py

DESCRIPTION
    //Description: 
        Access SBiDer database and retrieve all necessary SBML information 
    
    *************************************************
    @author: Fernando Contreras
    @email: f2contre@gmail.com
    @project: SBiDer
    @institution: University of California, San Diego
    *************************************************

FUNCTIONS
    get_sbml_input_logic()
        Access the input transition logic table and acquire 
        input transition Boolean logic
        
        @Output: dictionary = {it_id: logic}
            key = input transition id 
            value = associated Boolean logic
    
    get_sbml_input_operon_edges()
        Access the input transition-operon relationship table and acquire 
        input transition-operon edges
        
        @Output: dictionary = {it_id: ope_id}
            key = input transition id 
            value = operon id
    
    get_sbml_input_species_edges()
        Access the input transition-chemical species relationship table and acquire 
        input species-transition edges
        
        @Output: dictionary = {it_id: [(spe_id, repressor_boolean)]}
            key = input transition id 
            value = list of associated input chemical species
                tuple = (chemical species, associated repressor boolean). If 
                chemical species is a repressor then repressor_boolean is 'True'
    
    get_sbml_miriam_ids()
        Access plasmid table and plasmid-operon relationship table to retrieve 
        the miriam ids of each operon
        
        @Output: dictionary = {operon id: miriam id}
            operon id: string type 
            miriam id: string type
    
    get_sbml_operons()
        Access operon table to retrieve all relevant operon information
        
        @Output: dictionary = {operon id: operon name}
            key = operon id: string type
            value = operon name: string type
    
    get_sbml_output_operon_edges()
        Access the output transition-operon relationship table and acquire 
        output transition-operon edges
        
        @Output: dictionary = {ot_id: ope_id}
            key = output transition id 
            value = operon id
    
    get_sbml_output_species_edges()
        Access the output transition-chemical species relationship table and acquire 
        output species-transition edges
        
        @Output: dictionary = {ot_id: [spe_id]}
            key = output transition id 
            value = list of associated output chemical species
    
    get_sbml_species()
        Access chemical species table and retrieve all relevant species information 
        
        @Output: dictionary = {species id: species name}
            key = species id 
            value = species name

DATA
    con = 
    cursor = 
    cwd = '/Users/jenhantao/Documents/UCSD_IGEM/CircuitNetwork/web'
    database_path = '/Users/jenhantao/Documents/UCSD_IGEM/CircuitNetwork/w...


Help on module sbml_update:

NAME
    sbml_update - //Title: SBML Node Generator

FILE
    /Users/jenhantao/Documents/UCSD_IGEM/CircuitNetwork/web/sbml_update.py

DESCRIPTION
    //Description: 
        Translate individual node information to SBML and store node file 
        in current working directory  
    
    *************************************************
    @author: Fernando Contreras
    @email: f2contre@gmail.com
    @project: SBiDer
    @institution: University of California, San Diego
    *************************************************

FUNCTIONS
    sbml_input_trans(trans_id, input_species_id_and_boolean_tuple, operon_id, trans_logic, filename)
        #construct input/output transition component of network SBML file
    
    sbml_operon(operon_id, operon_name, miriam_id, filename)
        #construct operon/chemical species component of network SBML file
    
    sbml_output_trans(trans_id, output_species_id, operon_id, filename)
    
    sbml_species(species_id, species_name, filename)

Testing

SBiDer Function Testing

Database

The database wrapper functions were tested by verifying correct table creation and droppage. Individual SQL Python wrapper functions were tested for proper input, update, and removal of table entries. Functions were tested on the SBiDer database itself to ensure future functional usage of the SBiDer API.

Logic Parser

The SBiDer logic parser required testing under multiple logic situations. The input necessary for parsing logic is specific due to the ability to make complex search queries. AND logic testing was done by verifying proper breakdown of the logic. OR logic testing was done by verifying that multiple queries were generated with the total number of queries equal to the total number of OR statements plus one.

Traversal: Direct and Indirect Algorithms

To ensure that the correct paths were generated a Python unit test was constructed to verify proper operon activation along a given path. We considered two options for our traversal: direct path and indirect path.

In the direct path the preceding operon produces the species necessary for the activation of the following operon. Iteration through a loop ensured that all paths discovered by the traversal algorithm were legitimate activatable paths. This was done by starting at the first operon of every path and checking whether the starting input species were enough to activate the first operon. That operon would then produce some species that would then have to activate the next operon. Assertions were made at this point to verify if the species taken as input for operon activation were those produced by the previous operon or initial input. If all operons were activated then that would mean that the path was a correct linear path.

As an example query Lara and araC are the starting input species and gfp is the final output species. The query has the following operon path: pLac_pBAD--->LuxR_luxI followed by pTet--->gfp. An assertion is done at operon pLac_pBAD--->LuxR_luxI to verify if Lara and arac activate it. The assertion is passed because pLac_pBAD--->LuxR_luxI is activated by Lara and arac and the operon produces the species AHL and luxR. One last assertion is done to verify if AHL and LuxR activate pTet--->gfp. This assertion is passed and so operon pTet--->gfp produces gfp, the desired final species.

The approach to verify the indirect traversal option was more involved due to path convergence. A Python unittest was created using two sets: one containing all inputs necessary for every operon in the path (set I), and one containing all of the outputs for every operon in the path plus the starting inputs (set O). If set I is a subset of set O, this verifies that the indirect operon path is constructed correctly and therefore activation will occur.

An example the same query will be reused here below. The indirect traversal has the following path: pCONST--->araC, pBAD--->T7-C, pT7--->gfp. pCONST--->araC uses a constitutive promoter (no input) and produces araC. pBAD--->T7-C takes as input arac and Lara and produces T7-C. pT7--->gfp takes as input T7 and produces gfp. Set I in this case contains arac, lara and T7. Set O in this case contains arac, Lara, T7 and gfp. Set I is a subset of set O so all of the input species necessary to activate the operons in the path are activated and the path is a correct path.

Traversal: Accounting for Repressor Species

The current SBiDer development only takes queries for activation of genetic devices. As a result operons may not be activated due to repression events. To verify this event it was necessary to manually trace and validate paths that had species products with repression interactions with operons that could potentially repress our system.

Complexity Analysis of the Search Algorithm

The complexity analysis was performed on the search algorithm, which have two methods of search: linear successive activation search (LSAS) and nonlinear successive activation search (NLSAS). Our complexity analysis concluded the complexity of LSAS and NLSAS to be O(mV^2) and O(m^2*V^4). respectively. Detailed complexity analysis can be found in the documentation section.

JSON Generation

The SBiDer network shown at the beginning of the SBiDer application as well as the subnetwork that resulted from the traversal output required JSON files with complete information. This information was captured using functions for data extraction and processing which were individually tested by running inputs and reviewing printing the resulting output with great care. Once the information was gathered, it was inserted into the JSON file generator. The JSON string was then taken and validated using the Online JSON Viewer. The image produced by the JSON converter was then displayed on CyNetShare using Cytoscape JS. In addition, the table generated by the JSON converter was validated against the database itself to ensure that the network was correctly reproduced.

SBML Generation

The SBML document was taken and validated using the Online SBML Validator (http://sbml.org/Facilities/Validator/). We ensured that our SBML documents were accurate.

SBOL Validation

We confirmed that the images we generated supported the SBOL standard by comparing the corresponding text file for each image to with images from the SBOL website. We ensured that the correct images were produced for all of the image.
Check out the test code on our GitHub branch.