Welcome to TiddlyWiki created by Jeremy Ruston, Copyright © 2007 UnaMesa Association
Background: #fff
Foreground: #000
PrimaryPale: #8cf
PrimaryLight: #18f
PrimaryMid: #04b
PrimaryDark: #014
SecondaryPale: #ffc
SecondaryLight: #fe8
SecondaryMid: #db4
SecondaryDark: #841
TertiaryPale: #eee
TertiaryLight: #ccc
TertiaryMid: #999
TertiaryDark: #666
Error: #f88
/*{{{*/
body {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];}
a {color:[[ColorPalette::PrimaryMid]];}
a:hover {background-color:[[ColorPalette::PrimaryMid]]; color:[[ColorPalette::Background]];}
a img {border:0;}
h1,h2,h3,h4,h5,h6 {color:[[ColorPalette::SecondaryDark]]; background:transparent;}
h1 {border-bottom:2px solid [[ColorPalette::TertiaryLight]];}
h2,h3 {border-bottom:1px solid [[ColorPalette::TertiaryLight]];}
.button {color:[[ColorPalette::PrimaryDark]]; border:1px solid [[ColorPalette::Background]];}
.button:hover {color:[[ColorPalette::PrimaryDark]]; background:[[ColorPalette::SecondaryLight]]; border-color:[[ColorPalette::SecondaryMid]];}
.button:active {color:[[ColorPalette::Background]]; background:[[ColorPalette::SecondaryMid]]; border:1px solid [[ColorPalette::SecondaryDark]];}
.header {background:[[ColorPalette::PrimaryMid]];}
.headerShadow {color:[[ColorPalette::Foreground]];}
.headerShadow a {font-weight:normal; color:[[ColorPalette::Foreground]];}
.headerForeground {color:[[ColorPalette::Background]];}
.headerForeground a {font-weight:normal; color:[[ColorPalette::PrimaryPale]];}
.tabSelected{color:[[ColorPalette::PrimaryDark]];
background:[[ColorPalette::TertiaryPale]];
border-left:1px solid [[ColorPalette::TertiaryLight]];
border-top:1px solid [[ColorPalette::TertiaryLight]];
border-right:1px solid [[ColorPalette::TertiaryLight]];
}
.tabUnselected {color:[[ColorPalette::Background]]; background:[[ColorPalette::TertiaryMid]];}
.tabContents {color:[[ColorPalette::PrimaryDark]]; background:[[ColorPalette::TertiaryPale]]; border:1px solid [[ColorPalette::TertiaryLight]];}
.tabContents .button {border:0;}
#sidebar {}
#sidebarOptions input {border:1px solid [[ColorPalette::PrimaryMid]];}
#sidebarOptions .sliderPanel {background:[[ColorPalette::PrimaryPale]];}
#sidebarOptions .sliderPanel a {border:none;color:[[ColorPalette::PrimaryMid]];}
#sidebarOptions .sliderPanel a:hover {color:[[ColorPalette::Background]]; background:[[ColorPalette::PrimaryMid]];}
#sidebarOptions .sliderPanel a:active {color:[[ColorPalette::PrimaryMid]]; background:[[ColorPalette::Background]];}
.wizard {background:[[ColorPalette::PrimaryPale]]; border:1px solid [[ColorPalette::PrimaryMid]];}
.wizard h1 {color:[[ColorPalette::PrimaryDark]]; border:none;}
.wizard h2 {color:[[ColorPalette::Foreground]]; border:none;}
.wizardStep {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];
border:1px solid [[ColorPalette::PrimaryMid]];}
.wizardStep.wizardStepDone {background::[[ColorPalette::TertiaryLight]];}
.wizardFooter {background:[[ColorPalette::PrimaryPale]];}
.wizardFooter .status {background:[[ColorPalette::PrimaryDark]]; color:[[ColorPalette::Background]];}
.wizard .button {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::SecondaryLight]]; border: 1px solid;
border-color:[[ColorPalette::SecondaryPale]] [[ColorPalette::SecondaryDark]] [[ColorPalette::SecondaryDark]] [[ColorPalette::SecondaryPale]];}
.wizard .button:hover {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::Background]];}
.wizard .button:active {color:[[ColorPalette::Background]]; background:[[ColorPalette::Foreground]]; border: 1px solid;
border-color:[[ColorPalette::PrimaryDark]] [[ColorPalette::PrimaryPale]] [[ColorPalette::PrimaryPale]] [[ColorPalette::PrimaryDark]];}
#messageArea {border:1px solid [[ColorPalette::SecondaryMid]]; background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]];}
#messageArea .button {color:[[ColorPalette::PrimaryMid]]; background:[[ColorPalette::SecondaryPale]]; border:none;}
.popupTiddler {background:[[ColorPalette::TertiaryPale]]; border:2px solid [[ColorPalette::TertiaryMid]];}
.popup {background:[[ColorPalette::TertiaryPale]]; color:[[ColorPalette::TertiaryDark]]; border-left:1px solid [[ColorPalette::TertiaryMid]]; border-top:1px solid [[ColorPalette::TertiaryMid]]; border-right:2px solid [[ColorPalette::TertiaryDark]]; border-bottom:2px solid [[ColorPalette::TertiaryDark]];}
.popup hr {color:[[ColorPalette::PrimaryDark]]; background:[[ColorPalette::PrimaryDark]]; border-bottom:1px;}
.popup li.disabled {color:[[ColorPalette::TertiaryMid]];}
.popup li a, .popup li a:visited {color:[[ColorPalette::Foreground]]; border: none;}
.popup li a:hover {background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]]; border: none;}
.popup li a:active {background:[[ColorPalette::SecondaryPale]]; color:[[ColorPalette::Foreground]]; border: none;}
.popupHighlight {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];}
.listBreak div {border-bottom:1px solid [[ColorPalette::TertiaryDark]];}
.tiddler .defaultCommand {font-weight:bold;}
.shadow .title {color:[[ColorPalette::TertiaryDark]];}
.title {color:[[ColorPalette::SecondaryDark]];}
.subtitle {color:[[ColorPalette::TertiaryDark]];}
.toolbar {color:[[ColorPalette::PrimaryMid]];}
.toolbar a {color:[[ColorPalette::TertiaryLight]];}
.selected .toolbar a {color:[[ColorPalette::TertiaryMid]];}
.selected .toolbar a:hover {color:[[ColorPalette::Foreground]];}
.tagging, .tagged {border:1px solid [[ColorPalette::TertiaryPale]]; background-color:[[ColorPalette::TertiaryPale]];}
.selected .tagging, .selected .tagged {background-color:[[ColorPalette::TertiaryLight]]; border:1px solid [[ColorPalette::TertiaryMid]];}
.tagging .listTitle, .tagged .listTitle {color:[[ColorPalette::PrimaryDark]];}
.tagging .button, .tagged .button {border:none;}
.footer {color:[[ColorPalette::TertiaryLight]];}
.selected .footer {color:[[ColorPalette::TertiaryMid]];}
.sparkline {background:[[ColorPalette::PrimaryPale]]; border:0;}
.sparktick {background:[[ColorPalette::PrimaryDark]];}
.error, .errorButton {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::Error]];}
.warning {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::SecondaryPale]];}
.lowlight {background:[[ColorPalette::TertiaryLight]];}
.zoomer {background:none; color:[[ColorPalette::TertiaryMid]]; border:3px solid [[ColorPalette::TertiaryMid]];}
.imageLink, #displayArea .imageLink {background:transparent;}
.annotation {background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]]; border:2px solid [[ColorPalette::SecondaryMid]];}
.viewer .listTitle {list-style-type:none; margin-left:-2em;}
.viewer .button {border:1px solid [[ColorPalette::SecondaryMid]];}
.viewer blockquote {border-left:3px solid [[ColorPalette::TertiaryDark]];}
.viewer table, table.twtable {border:2px solid [[ColorPalette::TertiaryDark]];}
.viewer th, .viewer thead td, .twtable th, .twtable thead td {background:[[ColorPalette::SecondaryMid]]; border:1px solid [[ColorPalette::TertiaryDark]]; color:[[ColorPalette::Background]];}
.viewer td, .viewer tr, .twtable td, .twtable tr {border:1px solid [[ColorPalette::TertiaryDark]];}
.viewer pre {border:1px solid [[ColorPalette::SecondaryLight]]; background:[[ColorPalette::SecondaryPale]];}
.viewer code {color:[[ColorPalette::SecondaryDark]];}
.viewer hr {border:0; border-top:dashed 1px [[ColorPalette::TertiaryDark]]; color:[[ColorPalette::TertiaryDark]];}
.highlight, .marked {background:[[ColorPalette::SecondaryLight]];}
.editor input {border:1px solid [[ColorPalette::PrimaryMid]];}
.editor textarea {border:1px solid [[ColorPalette::PrimaryMid]]; width:100%;}
.editorFooter {color:[[ColorPalette::TertiaryMid]];}
#backstageArea {background:[[ColorPalette::Foreground]]; color:[[ColorPalette::TertiaryMid]];}
#backstageArea a {background:[[ColorPalette::Foreground]]; color:[[ColorPalette::Background]]; border:none;}
#backstageArea a:hover {background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]]; }
#backstageArea a.backstageSelTab {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];}
#backstageButton a {background:none; color:[[ColorPalette::Background]]; border:none;}
#backstageButton a:hover {background:[[ColorPalette::Foreground]]; color:[[ColorPalette::Background]]; border:none;}
#backstagePanel {background:[[ColorPalette::Background]]; border-color: [[ColorPalette::Background]] [[ColorPalette::TertiaryDark]] [[ColorPalette::TertiaryDark]] [[ColorPalette::TertiaryDark]];}
.backstagePanelFooter .button {border:none; color:[[ColorPalette::Background]];}
.backstagePanelFooter .button:hover {color:[[ColorPalette::Foreground]];}
#backstageCloak {background:[[ColorPalette::Foreground]]; opacity:0.6; filter:'alpha(opacity:60)';}
/*}}}*/
/*{{{*/
* html .tiddler {height:1%;}
body {font-size:.75em; font-family:arial,helvetica; margin:0; padding:0;}
h1,h2,h3,h4,h5,h6 {font-weight:bold; text-decoration:none;}
h1,h2,h3 {padding-bottom:1px; margin-top:1.2em;margin-bottom:0.3em;}
h4,h5,h6 {margin-top:1em;}
h1 {font-size:1.35em;}
h2 {font-size:1.25em;}
h3 {font-size:1.1em;}
h4 {font-size:1em;}
h5 {font-size:.9em;}
hr {height:1px;}
a {text-decoration:none;}
dt {font-weight:bold;}
ol {list-style-type:decimal;}
ol ol {list-style-type:lower-alpha;}
ol ol ol {list-style-type:lower-roman;}
ol ol ol ol {list-style-type:decimal;}
ol ol ol ol ol {list-style-type:lower-alpha;}
ol ol ol ol ol ol {list-style-type:lower-roman;}
ol ol ol ol ol ol ol {list-style-type:decimal;}
.txtOptionInput {width:11em;}
#contentWrapper .chkOptionInput {border:0;}
.externalLink {text-decoration:underline;}
.indent {margin-left:3em;}
.outdent {margin-left:3em; text-indent:-3em;}
code.escaped {white-space:nowrap;}
.tiddlyLinkExisting {font-weight:bold;}
.tiddlyLinkNonExisting {font-style:italic;}
/* the 'a' is required for IE, otherwise it renders the whole tiddler in bold */
a.tiddlyLinkNonExisting.shadow {font-weight:bold;}
#mainMenu .tiddlyLinkExisting,
#mainMenu .tiddlyLinkNonExisting,
#sidebarTabs .tiddlyLinkNonExisting {font-weight:normal; font-style:normal;}
#sidebarTabs .tiddlyLinkExisting {font-weight:bold; font-style:normal;}
.header {position:relative;}
.header a:hover {background:transparent;}
.headerShadow {position:relative; padding:4.5em 0em 1em 1em; left:-1px; top:-1px;}
.headerForeground {position:absolute; padding:4.5em 0em 1em 1em; left:0px; top:0px;}
.siteTitle {font-size:3em;}
.siteSubtitle {font-size:1.2em;}
#mainMenu {position:absolute; left:0; width:10em; text-align:right; line-height:1.6em; padding:1.5em 0.5em 0.5em 0.5em; font-size:1.1em;}
#sidebar {position:absolute; right:3px; width:16em; font-size:.9em;}
#sidebarOptions {padding-top:0.3em;}
#sidebarOptions a {margin:0em 0.2em; padding:0.2em 0.3em; display:block;}
#sidebarOptions input {margin:0.4em 0.5em;}
#sidebarOptions .sliderPanel {margin-left:1em; padding:0.5em; font-size:.85em;}
#sidebarOptions .sliderPanel a {font-weight:bold; display:inline; padding:0;}
#sidebarOptions .sliderPanel input {margin:0 0 .3em 0;}
#sidebarTabs .tabContents {width:15em; overflow:hidden;}
.wizard {padding:0.1em 1em 0em 2em;}
.wizard h1 {font-size:2em; font-weight:bold; background:none; padding:0em 0em 0em 0em; margin:0.4em 0em 0.2em 0em;}
.wizard h2 {font-size:1.2em; font-weight:bold; background:none; padding:0em 0em 0em 0em; margin:0.4em 0em 0.2em 0em;}
.wizardStep {padding:1em 1em 1em 1em;}
.wizard .button {margin:0.5em 0em 0em 0em; font-size:1.2em;}
.wizardFooter {padding:0.8em 0.4em 0.8em 0em;}
.wizardFooter .status {padding:0em 0.4em 0em 0.4em; margin-left:1em;}
.wizard .button {padding:0.1em 0.2em 0.1em 0.2em;}
#messageArea {position:fixed; top:2em; right:0em; margin:0.5em; padding:0.5em; z-index:2000; _position:absolute;}
.messageToolbar {display:block; text-align:right; padding:0.2em 0.2em 0.2em 0.2em;}
#messageArea a {text-decoration:underline;}
.tiddlerPopupButton {padding:0.2em 0.2em 0.2em 0.2em;}
.popupTiddler {position: absolute; z-index:300; padding:1em 1em 1em 1em; margin:0;}
.popup {position:absolute; z-index:300; font-size:.9em; padding:0; list-style:none; margin:0;}
.popup .popupMessage {padding:0.4em;}
.popup hr {display:block; height:1px; width:auto; padding:0; margin:0.2em 0em;}
.popup li.disabled {padding:0.4em;}
.popup li a {display:block; padding:0.4em; font-weight:normal; cursor:pointer;}
.listBreak {font-size:1px; line-height:1px;}
.listBreak div {margin:2px 0;}
.tabset {padding:1em 0em 0em 0.5em;}
.tab {margin:0em 0em 0em 0.25em; padding:2px;}
.tabContents {padding:0.5em;}
.tabContents ul, .tabContents ol {margin:0; padding:0;}
.txtMainTab .tabContents li {list-style:none;}
.tabContents li.listLink { margin-left:.75em;}
#contentWrapper {display:block;}
#splashScreen {display:none;}
#displayArea {margin:1em 17em 0em 14em;}
.toolbar {text-align:right; font-size:.9em;}
.tiddler {padding:1em 1em 0em 1em;}
.missing .viewer,.missing .title {font-style:italic;}
.title {font-size:1.6em; font-weight:bold;}
.missing .subtitle {display:none;}
.subtitle {font-size:1.1em;}
.tiddler .button {padding:0.2em 0.4em;}
.tagging {margin:0.5em 0.5em 0.5em 0; float:left; display:none;}
.isTag .tagging {display:block;}
.tagged {margin:0.5em; float:right;}
.tagging, .tagged {font-size:0.9em; padding:0.25em;}
.tagging ul, .tagged ul {list-style:none; margin:0.25em; padding:0;}
.tagClear {clear:both;}
.footer {font-size:.9em;}
.footer li {display:inline;}
.annotation {padding:0.5em; margin:0.5em;}
* html .viewer pre {width:99%; padding:0 0 1em 0;}
.viewer {line-height:1.4em; padding-top:0.5em;}
.viewer .button {margin:0em 0.25em; padding:0em 0.25em;}
.viewer blockquote {line-height:1.5em; padding-left:0.8em;margin-left:2.5em;}
.viewer ul, .viewer ol {margin-left:0.5em; padding-left:1.5em;}
.viewer table, table.twtable {border-collapse:collapse; margin:0.8em 1.0em;}
.viewer th, .viewer td, .viewer tr,.viewer caption,.twtable th, .twtable td, .twtable tr,.twtable caption {padding:3px;}
table.listView {font-size:0.85em; margin:0.8em 1.0em;}
table.listView th, table.listView td, table.listView tr {padding:0px 3px 0px 3px;}
.viewer pre {padding:0.5em; margin-left:0.5em; font-size:1.2em; line-height:1.4em; overflow:auto;}
.viewer code {font-size:1.2em; line-height:1.4em;}
.editor {font-size:1.1em;}
.editor input, .editor textarea {display:block; width:100%; font:inherit;}
.editorFooter {padding:0.25em 0em; font-size:.9em;}
.editorFooter .button {padding-top:0px; padding-bottom:0px;}
.fieldsetFix {border:0; padding:0; margin:1px 0px 1px 0px;}
.sparkline {line-height:1em;}
.sparktick {outline:0;}
.zoomer {font-size:1.1em; position:absolute; overflow:hidden;}
.zoomer div {padding:1em;}
* html #backstage {width:99%;}
* html #backstageArea {width:99%;}
#backstageArea {display:none; position:relative; overflow: hidden; z-index:150; padding:0.3em 0.5em 0.3em 0.5em;}
#backstageToolbar {position:relative;}
#backstageArea a {font-weight:bold; margin-left:0.5em; padding:0.3em 0.5em 0.3em 0.5em;}
#backstageButton {display:none; position:absolute; z-index:175; top:0em; right:0em;}
#backstageButton a {padding:0.1em 0.4em 0.1em 0.4em; margin:0.1em 0.1em 0.1em 0.1em;}
#backstage {position:relative; width:100%; z-index:50;}
#backstagePanel {display:none; z-index:100; position:absolute; margin:0em 3em 0em 3em; padding:1em 1em 1em 1em;}
.backstagePanelFooter {padding-top:0.2em; float:right;}
.backstagePanelFooter a {padding:0.2em 0.4em 0.2em 0.4em;}
#backstageCloak {display:none; z-index:20; position:absolute; width:100%; height:100px;}
.whenBackstage {display:none;}
.backstageVisible .whenBackstage {display:block;}
/*}}}*/
/***
StyleSheet for use when a translation requires any css style changes.
This StyleSheet can be used directly by languages such as Chinese, Japanese and Korean which use a logographic writing system and need larger font sizes.
***/
/*{{{*/
body {font-size:0.8em;}
#sidebarOptions {font-size:1.05em;}
#sidebarOptions a {font-style:normal;}
#sidebarOptions .sliderPanel {font-size:0.95em;}
.subtitle {font-size:0.8em;}
.viewer table.listView {font-size:0.95em;}
.htmlarea .toolbarHA table {border:1px solid ButtonFace; margin:0em 0em;}
/*}}}*/
/*{{{*/
@media print {
#mainMenu, #sidebar, #messageArea, .toolbar, #backstageButton {display: none ! important;}
#displayArea {margin: 1em 1em 0em 1em;}
/* Fixes a feature in Firefox 1.5.0.2 where print preview displays the noscript content */
noscript {display:none;}
}
/*}}}*/
<!--{{{-->
<div class='header' macro='gradient vert [[ColorPalette::PrimaryLight]] [[ColorPalette::PrimaryMid]]'>
<div class='headerShadow'>
<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
</div>
<div class='headerForeground'>
<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
</div>
</div>
<div id='mainMenu' refresh='content' tiddler='MainMenu'></div>
<div id='sidebar'>
<div id='sidebarOptions' refresh='content' tiddler='SideBarOptions'></div>
<div id='sidebarTabs' refresh='content' force='true' tiddler='SideBarTabs'></div>
</div>
<div id='displayArea'>
<div id='messageArea'></div>
<div id='tiddlerDisplay'></div>
</div>
<!--}}}-->
<!--{{{-->
<div class='toolbar' macro='toolbar closeTiddler closeOthers +editTiddler > fields syncing permalink references jump'></div>
<div class='title' macro='view title'></div>
<div class='subtitle'><span macro='view modifier link'></span>, <span macro='view modified date'></span> (<span macro='message views.wikified.createdPrompt'></span> <span macro='view created date'></span>)</div>
<div class='tagging' macro='tagging'></div>
<div class='tagged' macro='tags'></div>
<div class='viewer' macro='view text wikified'></div>
<div class='tagClear'></div>
<!--}}}-->
<!--{{{-->
<div class='toolbar' macro='toolbar +saveTiddler -cancelTiddler deleteTiddler'></div>
<div class='title' macro='view title'></div>
<div class='editor' macro='edit title'></div>
<div macro='annotations'></div>
<div class='editor' macro='edit text'></div>
<div class='editor' macro='edit tags'></div><div class='editorFooter'><span macro='message views.editor.tagPrompt'></span><span macro='tagChooser'></span></div>
<!--}}}-->
To get started with this blank TiddlyWiki, you'll need to modify the following tiddlers:
* SiteTitle & SiteSubtitle: The title and subtitle of the site, as shown above (after saving, they will also appear in the browser title bar)
* MainMenu: The menu (usually on the left)
* DefaultTiddlers: Contains the names of the tiddlers that you want to appear when the TiddlyWiki is opened
You'll also need to enter your username for signing your edits: <<option txtUserName>>
These InterfaceOptions for customising TiddlyWiki are saved in your browser
Your username for signing your edits. Write it as a WikiWord (eg JoeBloggs)
<<option txtUserName>>
<<option chkSaveBackups>> SaveBackups
<<option chkAutoSave>> AutoSave
<<option chkRegExpSearch>> RegExpSearch
<<option chkCaseSensitiveSearch>> CaseSensitiveSearch
<<option chkAnimate>> EnableAnimations
----
Also see AdvancedOptions
The library has been conceived and programmed by ''[[István Albert|http://www.personal.psu.edu/iua1/]]'' with ideas and contributions by:
* ''Song Li''
* ''[[Juilee Thakar|http://www.phys.psu.edu/~jthakar/]]''
* ''Ranran Zhang''
* ''Assieh Saadatpour Moghaddam''.
None of us would be thinking about Boolean Networks if it weren't for ''[[Réka Albert|http://www.phys.psu.edu/~ralbert/]]''.
Software that we distribute with ''~BooleanNet'':
* [[PLY|http://www.dabeaz.com/ply/]] by ''David Beazley''
Software required to run ''~BooleanNet'' (see [[Installation]]):
* [[Matplotlib|http://matplotlib.sourceforge.net]]
* [[NumPy|http://numpy.scipy.org/]]
We'd like to express our thanks and gratitude to the authors of these outstanding software packages.
!!!Generating all initial states:
Often it is necessary to generate all possible initial states for a system. Here is how to do it with ~BooleanNet: [[all-initial-states.py|http://code.google.com/p/booleannet/source/browse/trunk/examples/samples/all-initial-states.py]]
!!!Drawing a transition graph.
A transition graph is a directed graph that connects the states that the system visits during its evolution. ~BooleanNet offers helper functions to make this process easy. Note that his example also colors the strongly connected components with different colors: [[threenodes.py|http://code.google.com/p/booleannet/source/browse/trunk/examples/samples/threenodes.py]]
[img[png/threenodes.png]]
During the run a log file is generated that contains all transitions. Note: this example requires the presence of the [[Networkx|http://networkx.lanl.gov/]] module. The saved graph is in ''gml'' format and can directly visualized via [[yED|http://www.yworks.com/en/products_yed_about.html]]
The goal is to set up an environment that allows the user to run external tools on text that is being edited, without having to leave the editor. In a typical workflow to run a tutorial, one would simply open the file then press ''Ctrl+1'' (holding Ctrl while pressing 1) to execute it, then watch the results in a lower window pane. Here is a screenshot:
[img[png/crimson-1.png]]
The upper window holds the tutorial while the lower window shows the result of running the tutorial. Here is how to get there.
First follow the instructions on the [[Installation]] page to install ''Python'' and all other libraries. Next install the [[Crimson Editor|http://www.crimsoneditor.com/]]. (the editor is also included in the [[windows-quickstart.zip (17 MB)|http://atlas.bx.psu.edu/booleannet/windows-quickstart.zip]] download that we distribute). Once installed, open ''Crimson Editor'' and find the ''Tools->Conf. Tools'' menu and click it. A window will pop up that will need be filled as follows:
[img[png/crimson-2.png]]
You may type in the values or use the little widgets at the end of each entry box to select the appropriate values. '
''And You're Done!''
Load a tutorial and press Ctrl-1 to verify that it works. The steps laid out above can be applied to set up any other environment, be that ''R'', ''Matlab'' etc. specific. We also note that there are many other editors and setups that would allow an identical behavior.
To capture more sophisticated biological behaviors we often need to override the behavior of the model for certain nodes or rules. ''~BooleanNet'' has been built specifically to support this need, although this type of modifications will require a more in depth understanding of some of the functioning principles of the software.
In a nutshell, every action, be that setting a node, applying a boolean rule, starting an iteration (etc) is performed via a function that may replaced with a custom built one. Below we will detail a few possible extension methods.
!!!Overriding getter functions
Imagine a situation where we wish to model a perturbation that causes a node to return unpredictable values on each access. We may model this as a node that may return random state (true or false) upon every access of the node. To achieve this goal we need to override the ''~RULE_GETVALUE'' special function that has the signature:
{{{
get_value( state, name, parser)
}}}
the {{{state}}} parameter is the state that is accessed, the {{{name}}} parameter is the node name, the {{{parser}}} parameter is a reference to the entire parser state, this is only needed in very advanced use cases so may be disregarded in most situations. We will need to create a new function and attach it to our model like so:
{{{
model = Model( text=rules, mode='sync')
model.parser.RULE_GETVALUE = get_value
model.initialize()
model.iterate( steps=5 )
}}}
Here is a sample program: [[extend-getvalue.py|http://code.google.com/p/booleannet/source/browse/trunk/examples/samples/extend-getvalue.py]]
!!!Overriding setter values
A related but different use case is that of overriding the node values as these are set. Conceptually this is very different from the previous case, in that the getter method will be called upon accessing the node every single time, whereas the setter method will only be called once when assigning the value to the node. There is a subtle but very important difference between the two use cases.
We need to override the ''~RULE_SETVALUE'' special function that has the signature:
{{{
set_value( state, name, value, parser)
}}}
Here is a sample program: [[extend-setvalue.py|http://code.google.com/p/booleannet/source/browse/trunk/examples/samples/extend-setvalue.py]]
!!!Overriding boolean rules
To override say the ''AND'' boolean operator we need to replace the ''~RULE_AND'' special function that has the signature:
{{{
and_function( a, b, parser)
}}}
In the sampe program we created a special ''AND'' function that returns the ''real'' value 75% of the time and randomly guesses 25% of time. Here is a sample program: [[extend-rules.py|http://code.google.com/p/booleannet/source/browse/trunk/examples/samples/extend-rules.py]]
!!!Requirements
The ~BooleanNet library requires [[Python|http://www.python.org]], [[Matplotlib|http://matplotlib.sourceforge.net]] and [[NumPy|http://numpy.scipy.org/]] to be installed.
* On ''Windows'' the installation of these is very straightforward. The only important detail is to select the executable (.exe or .msi extension) that matches the version of Python that is installed. For convenience, we have packaged Python 2.5 and the all necessary libraries into a single download [[windows-quickstart.zip (17 MB)|http://atlas.bx.psu.edu/booleannet/windows-quickstart.zip]]. Unpack the archive, read the included ''readme.txt'' then double click each of the programs to install them. We also recommend reading the [[Editor Setup]] page.
* ''Linux/Unix'' users should use their package manager to install {{{python, numpy}}} and the {{{matplotlib}}} packages.
!!!~BooleanNet Library Installation
* If you downloaded the [[windows-quickstart.zip (17 MB)|http://atlas.bx.psu.edu/booleannet/windows-quickstart.zip]] file as described above no other action is necessary, all files are included in this download. To get a different version, ''Windows'' users should download the latest windows installer from the [[download area|http://code.google.com/p/booleannet/downloads/list]]. Once downloaded open the executable and follow the on screen instructions. This will install the library system wide. Windows users should also download the source distribution (.zip) and unpack it to access the tutorials and the examples.
* ''Linux/Unix'' users should download the source (.zip) distribution and run the {{{python setup.py install}}} command with sufficient privileges. This package also contains the examples folder.
* ''Debian'' package (thanks Falko Krause, falko.krause@staff.hu-berlin.de) found at [[http://jaguar.biologie.hu-berlin.de/~fkrause/booleannet_1.2.4-1_all.deb|http://jaguar.biologie.hu-berlin.de/~fkrause/booleannet_1.2.4-1_all.deb]]
Once the installation is finished please read the [[Using the library]] pages
When trying to understand the role and functioning of a regulatory network, the first step is to assemble the components of the network and the interactions between them. In a Boolean representation we assume that nodes are equivalent, and their interactions form a directed graph in which each node receives inputs from its neighbors (nodes that are connected to it). The state of nodes is described by binary (ON/OFF) variables, and the dynamic behavior of each variable, that is, whether it will be ON or OFF at next moment, is governed by a Boolean function.
In this software package, we implement multiple advanced methodologies which combine discrete logical rules with more realistic assumptions regarding the relative timescales of the processes.
* ''synchronous'' updates are performed in listed order, but the states change only at the end of the update round
* ''asynchronous'' updates are performed in random order and the states immediately reflect the changes, this makes the model stochastic.
* ''ranked asynchronous'' updates are performed in rank order, within the same rank the updates take place asynchronously
* ''time synchronous'' update are performed in time. Each rule has a time delay associated with them, updates take place at multiples of these delays
* ''piece wise differential equation'' updates associate a set of continuous variables (concentrations, decay rates and thresholds) to each discrete variable in the system.
[img[png/hybrid-example.png]]
We may think of ''~BooleanNet'' as a ''mini'' programming language particularly well suited for modeling biological systems. It provides functionality that facilitates various important steps of the modeling, as well as helper functions that provide the means of interpreting the results.
See the [[Tutorials]] for examples of how the software may be used.
Aenean eros arcu, condimentum nec, dapibus ut, tincidunt sit amet, urna. Quisque viverra, eros sed imperdiet iaculis, est risus facilisis quam, id malesuada arcu nulla luctus urna. Nullam et est. Vestibulum velit sem, faucibus cursus, dapibus vestibulum, pellentesque et, urna. Donec luctus. Donec lectus. Aliquam eget eros facilisis tortor feugiat sollicitudin. Integer lobortis vulputate sapien. Sed iaculis erat ac nunc. Etiam eu enim. Mauris ipsum urna, rhoncus at, bibendum sit amet, euismod eget, dolor. Mauris fermentum quam vitae ligula. Vestibulum in libero feugiat justo dictum consectetuer. Vestibulum euismod purus eget elit. Nunc sed massa porta elit bibendum posuere. Nunc pulvinar justo sit amet odio. In sed est. Phasellus ornare elementum nulla. Nulla ipsum neque, cursus a, viverra a, imperdiet at, enim. Quisque facilisis, diam sed accumsan suscipit, odio arcu hendrerit dolor, quis aliquet massa nulla nec sem.
!heading 1
!!heading 2
!!!heading3
----
{{{
Code
}}}
<<tag button>>
This is a link to a [[StyleSheet]] tiddler.
> This is a blockquote
> This is a blockquote
> This is a blockquote
|>|>| !This is a header |h
|column1|column2|column3|
|row2| row2 |row2|
|column1|column2|column3|
|row2| row2 |row2|
|column1|column2|column3|
|row2| row2 |row2|
[[Introduction]]
[[Installation]]
[[Quick Reference]]
[[Tutorials]]
[[Advanced Usage]]
[[Extending]]
[[About]]
<<closeAll>><<permaview>><<saveChanges>><<slider chkSliderOptionsPanel OptionsPanel 'options »' 'Change TiddlyWiki advanced options'>>
[[Project Home|http://code.google.com/p/booleannet/]]
[[Project Downloads|http://code.google.com/p/booleannet/downloads/list]]
<!--{{{-->
<div id='header' class='header'>
<div class='headerShadow'>
<span class='searchBar' macro='search'></span>
<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
</div>
</div>
<div id='mainMenu'>
<span refresh='content' tiddler='MainMenu'></span>
<span id='noticeBoard' refresh='content' tiddler='NoticeBoard'></span>
</div>
<div id='sidebar'>
<div id='sidebarOptions' refresh='content' tiddler='MochaSideBarOptions'></div>
<div id='sidebarTabs' refresh='content' force='true' tiddler='SideBarTabs'></div>
</div>
<div id='displayArea'>
<div id='messageArea'></div>
<div id='tiddlerDisplay'></div>
</div>
<div id='contentFooter' refresh='content' tiddler='contentFooter'></div>
<!--}}}-->
A brief reference of the main routines. More details can be found in the [[Tutorials]] and [[Advanced Usage]] pages.
!Specifying rules
The word ''text'' will be used to describe the rules as defined either in the program as a string or when read from a file. Multi line strings may be created with triple quotes like so:
{{{
text = """
A = B = True
A* = B
B* = not A
"""
}}}
The ''A = B = True'' line is an initialization line that gets executed only once. The allowable values are ''True, False'' and ''Random''. Note that assigning values on the same line will yield the same value, after a ''A = B = Random'', ''A'' and ''B'' will have the same random value ''True'' or ''False''. The ''*'' symbol specifies an updating rule. ''A* = B'' states that the new value of ''A'' will be equal to the old value of ''B''. Here is how we read ''text'' from a file:
{{{
text = file('my-rules.txt').read()
}}}
!Model Creation
{{{
import boolean2
model = boolean2.Model(text, mode='sync')
}}}
the ''mode'' parameter may be: ''sync'', ''async'', ''rank'', ''time'' or ''plde'' corresponding to synchronous, asycnhronous and piece-wise linear differential equations.
!Model Initialization
If not all nodes are intialized in the text then one must use an initializer function.
{{{
def missing( node_name ):
return True
model.initialize( misssing=missing )
}}}
Initializes unintialized nodes to a value, this case ''True''. The ''node_name'' parameter is a string.
{{{
data = dict( A=False )
model.initialize( default=data )
}}}
The optional default parameter takes a dictionary that main contain nodes mapped to values. The value of the node will override all other values set either via the text or via the missing parameter. Main use case is to temporarily override settings with ease.
!State Modification
{{{
import boolean2
on = ["A", "B"]
off = ["C", "D"]
new_text = boolean2.modify_states(old_text, turnon=on, turnoff=off)
}}}
A convenience function that modifies the input rules, to generate knockout or overexpressed mutants. Note that it operates on the input text. The example above will set nodes ''A'' and ''B'' to ''True'' and nodes ''C'' and ''D'' to ''False'' over the entire simulation. It will also remove the updating rules for all these nodes. You can print the ''text'' variable before and after the modifications to see how the rules are altered.
!Evolving the model
{{{
model = Model( text, mode='sync')
model.initialize()
model.iterate( steps=5 )
for state in model.states:
print state
}}}
This will run the model specified in the ''text'' for ''5'' iterations. The variable ''state'' refers to an object that may be accessed by attribute i.e. {{{ state.A }}} if it has a node named {{{A}}}. See the [[Tutorials]] for more examples on accessing states.
!Cycle detection
{{{
size, index = model.detect_cycles()
print "Size =%s, Index %s" % (size, index)
}}}
The {{{ detect_cycles() }}} method returns a tuple (two values) where the first value indicates the length of the cycle, the second number indicates the iteration at which the cycle starts. A cycle of size=1 is a steady state. If no cycles can be detected the method will return (0, 0). For convenience there is a second method that prints the results of the cycle detection:
{{{
model.report_cycles()
# example output: Cycle of length 4 starting at index 0
}}}
!Column access
Data may be accessed as a column. The {{{ model.data }}} attribute is a dictionary that is keyed by node names with values being a list with the states for each iteration. Assuming a node named ''A'':
{{{
print model.data['A']
}}}
will returns a list of values {{{[True, False .... ]}}}.
!State fingerprints
Often it is desirable to be able to easily identify certain states (a set of True, False states mapped to a set of nodes). For example to trace the evolution of states from different starting configurations. The state and model ''fingerprints'' generate a simple unique name like so:
{{{
for state in model.states:
print state.fp()
}}}
will print a the a short name corresponding to each state, in this case a cycle of lenght 2 starting from the beginning:
{{{
S1
S2
S1
S2
}}}
Entire modeling runs can have fingerprints as well, for example:
{{{
for i in range(10):
model = boolean2.Model( text, mode='sync')
model.initialize()
model.iterate( steps=5 )
print model.fp()
}}}
will print:
{{{
('S1', 'S2', 'S3', 'S4', 'S1', 'S2')
('S2', 'S3', 'S4', 'S1', 'S2', 'S3')
('S6', 'S4', 'S1', 'S2', 'S3', 'S4')
....
}}}
In the runs above some of the nodes were given {{{Random}}} initial states, this allowed for variations in the outcomes.
!Data collectors
A data collector is a utility function used in asynchronous modeling to average the values of multiple runs. Here is an example run:
{{{
from boolean2 import util
coll = util.Collector()
for i in range(3):
model = boolean.Model( text, mode='async')
model.initialize()
model.iterate( steps=5 )
# takes all nodes
nodes = model.nodes()
coll.collect( states=model.states, nodes=nodes )
avgs = coll.get_averages( normalize=True )
print avgs
}}}
The ''avg'' variable is a dictionary that is mapped by nodes and contains as values the normalized counts (percentages) for the state of the variable at a given timestep. There is a detailed example on using the collectors in the [[Tutorials]]
boolean network modeling for life science research
#contentWrapper{
margin: 0 3.4em;
font-family: Lucida Grande, Tahoma, Arial, Helvetica, sans-serif; /* Lucida Grande for the Macs, Tahoma for the PCs */
font-size: 14px;
line-height: 1.6em;
color: #666;
}
.header {
background: #fff;
padding-top: 10px;
clear: both;
border-bottom: 4px solid #948979;
}
.headerShadow { padding: 2.6em 0em 0.5em 0em; }
.siteTitle {
font-family: 'Trebuchet MS' sans-serif;
font-weight: bold;
font-size: 32px;
color: #CC6633;
margin-bottom: 30px;
background-color: #FFF;
}
.siteTitle a{color:#CC6633; border-bottom:1px dotted #cc6633;}
.siteSubtitle {
font-size: 1.0em;
display: block;
margin: .5em 3em; color: #999999;
}
#mainMenu {
position:relative;
float:left;
margin-bottom:1em;
display:inline;
text-align:left;
padding: 2em 0.5em 0.5em 0em;
width:13em;
font-size:1em;
}
#sidebar{
position:relative;
float:right;
margin-bottom:1em;
padding-top:2em;
display:inline;
}
#displayArea {
margin: 0em 17em 0em 15em;
}
.tagClear {clear:none;}
#contentFooter {background:#575352; color:#BFB6B3; clear: both; padding: 0.5em 1em;}
#contentFooter a {
color: #BFB6B3;
border-bottom: 1px dotted #BFB6B3;
}
#contentFooter a:hover {
color: #FFFFFF;
background-color:#575352;
}
a,#sidebarOptions .sliderPanel a{
color:#CC6714;
text-decoration: none;
}
a:hover,#sidebarOptions .sliderPanel a:hover {
color:#CC6714;
background-color: #F5F5F5;
}
.viewer .button, .editorFooter .button{
color: #666;
border: 1px solid #CC6714;
}
.viewer .button:hover,
.editorFooter .button:hover{
color: #fff;
background: #CC6714;
border-color: #CC6714;
}
.viewer .button:active, .viewer .highlight,.editorFooter .button:active, .editorFooter .highlight{color:#fff; background:#575352;border-color:#575352;}
#mainMenu a {
display: block;
padding: 5px;
border-bottom: 1px solid #CCC;
}
#mainMenu a:link, #navlist a:visited {
color:#CC6714;
text-decoration: none;
}
#mainMenu a:hover {
background: #000000 url(arrow.gif) 96% 50% no-repeat;
background-color: #F5F5F5;
color:#CC6714;
}
#mainMenu a:hover, #mainMenu a:active, #mainMenu .highlight, #mainMenu .marked {
background: #000000 url(arrow.gif) 96% 50% no-repeat;
background-color: #F5F5F5;
color:#CC6714;
}
#mainMenu span {position:relative;}
#mainMenu br {display:none;}
#sidebarOptions a {
color:#999;
text-decoration: none;
}
#sidebarOptions a:hover {
color:#4F4B45;
background-color: #F5F5F5;border:1px solid #fff;
}
#sidebarOptions {line-height:1.4em;}
.tiddler {
padding-bottom: 40px;
border-bottom: 1px solid #DDDDDD;
}
.title {color:#CC6633;}
.subtitle, .subtitle a { color: #999999; font-size: 1.0em;margin:0.2em;}
.shadow .title{color:#948979;}
.selected .toolbar a {color:#999999;}
.selected .toolbar a:hover {color:#4F4B45; background:transparent;border:1px solid #fff;}
.toolbar .button:hover, .toolbar .highlight, .toolbar .marked, .toolbar a.button:active{color:#4F4B45; background:transparent;border:1px solid #fff;}
.listLink,#sidebarTabs .tabContents {line-height:1.5em;}
.listTitle {color:#888;}
#sidebarTabs .tabContents {background:#fff;}
#sidebarTabs .tabContents .tiddlyLink, #sidebarTabs .tabContents .button{color:#999;}
#sidebarTabs .tabContents .tiddlyLink:hover,#sidebarTabs .tabContents .button:hover{color:#4F4B45;background:#fff}
#sidebarTabs .tabContents .button:hover, #sidebarTabs .tabContents .highlight, #sidebarTabs .tabContents .marked, #sidebarTabs .tabContents a.button:active{color:#4F4B45;background:#fff}
.tabSelected{color:#fff; background:#948979;}
.tabUnselected {
background: #ccc;
}
.tabSelected, .tabSelected:hover {
color: #fff;
background: #948979;
border: solid 1px #948979;
padding-bottom:1px;
}
.tabUnselected {
color: #999;
background: #eee;
border: solid 1px #ccc;
padding-bottom:1px;
}
#sidebarTabs .tabUnselected { border-bottom: none;padding-bottom:3px;}
#sidebarTabs .tabSelected{padding-bottom:3px;}
#sidebarTabs .tabUnselected:hover { border-bottom: none;padding-bottom:3px;color:#4F4B45}
#sidebarOptions .sliderPanel {
background: #fff; border:none;
font-size: .9em;
}
#sidebarOptions .sliderPanel a {font-weight:normal;}
#sidebarOptions .sliderPanel input {border:1px solid #999;}
.viewer blockquote {
border-left: 3px solid #948979;
}
.viewer table {
border: 2px solid [[ColorPalette::TertiaryDark]];
}
.viewer th, thead td {
background: #948979;
border: 1px solid #948979;
color: #fff;
}
.viewer pre {
border: 1px solid #948979;
background: #f5f5f5;
}
.viewer code {
color: #2F2A29;
}
.viewer hr {
border-top: dashed 1px #948979;
}
.editor input {
border: 1px solid #948979;
}
.editor textarea {
border: 1px solid #948979;
}
.popup {
background: #948979;
border: 1px solid #948979;
}
.popup li.disabled {
color: #000;
}
.popup li a, .popup li a:visited {
color: #eee;
border: none;
}
.popup li a:hover {
background: #575352;
color: #fff;
border: none;
}
.tagging, .tagged {
border: 1px solid #eee;
background-color: #F7F7F7;
}
.selected .tagging, .selected .tagged {
background-color: #eee;
border: 1px solid #BFBAB3;
}
.tagging .listTitle, .tagged .listTitle {
color: #bbb;
}
.selected .tagging .listTitle, .selected .tagged .listTitle {
color: #666;
}
.tagging .button, .tagged .button {
color:#aaa;
}
.selected .tagging .button, .selected .tagged .button {
color:#4F4B45;
}
.highlight, .marked {background:transparent; color:#111; border:none; text-decoration:underline;}
.tagging .button:hover, .tagged .button:hover, .tagging .button:active, .tagged .button:active {
border: none; background:transparent; text-decoration:underline; color:#000;
}
h1,h2,h3,h4,h5 { color: #666; background: transparent; padding-bottom:2px; font-family: Arial, Helvetica, sans-serif; }
h1 {font-size:18px;}
h2 {font-size:16px;}
h3 {font-size: 14px;}
#messageArea {
border: 4px solid #948979;
background: #f5f5f5;
color: #999;
font-size:90%;
}
#messageArea a:hover { background:#f5f5f5;}
#messageArea .button{
color: #666;
border: 1px solid #CC6714;
}
#messageArea .button:hover {
color: #fff;
background: #948979;
border-color: #948979;
}
* html .viewer pre {
margin-left: 0em;
}
* html .editor textarea, * html .editor input {
width: 98%;
}
.searchBar {float:right;font-size: 1.0em;}
.searchBar .button {color:#999;display:block;}
.searchBar .button:hover {border:1px solid #fff;color:#4F4B45;}
.searchBar input {
background-color: #FFF;
color: #999999;
border: 1px solid #CCC; margin-right:3px;
}
#sidebarOptions .button:active, #sidebarOptions .highlight {background:#F5F5F5;}
*html #contentFooter { padding:0.25em 1em 0.5em 1em;}
#noticeBoard {font-size: 0.9em; color:#999; position:relative;display:block;background:#fff; clear: both; margin-right:0.5em; margin-top:60px; padding:5px; border-bottom: 1px dotted #CCC; border-top: 1px dotted #CCC;}
#mainMenu #noticeBoard a,#mainMenu #noticeBoard .tiddlyLink {display:inline;border:none;padding:5px 2px;color:#DF9153 }
#noticeBoard a:hover {border:none;}
#noticeBoard br {display:inline;}
#mainMenu #noticeBoard .button{
color: #666;
border: 1px solid #DF9153;padding:2px;
}
#mainMenu #noticeBoard .button:hover{
color: #fff;
background: #DF9153;
border-color: #DF9153;
}
.searchbar {position:relative; width:11em;}
.searchbar .button{margin:0; width:11em;}
#header {display:inline-block;}
/*}}}*/
We assume that you have [[installed|Installation]] the required software and read the [[Using the library]] and/or [[Editor Setup]] pages. All tutorials are located in the ''examples/tutorials'' folder and follow a cookbook like approach with emphasis on practical usage scenarios. You will need to download the source code archive to access the tutorials. All tutorials will generate the plots that are displayed next to their description.
!!!Tutorial 1: Testing the installation.
Use this tutorial to test that the installation has been succesfull. The code will print the states for the nodes for 6 steps (1 initial condition and 5 iteration steps)
Link to [[t-01.py source|http://code.google.com/p/booleannet/source/browse/trunk/examples/tutorials/t-01.py]]
!!!Tutorial 2: Computing Steady States.
[>img[Tutorial 2|png/t-02.png]]This tutorial demonstrates the cycle and steady state detection functions. Changing one initial parameter will turn a cycle of lenght 4 into a steady state. Note in the plot how node {{{B}}} is in a steady state while node {{{A}}} oscillates between the on and off positions.
Link to [[t-02.py source|http://code.google.com/p/booleannet/source/browse/trunk/examples/tutorials/t-02.py]]
!!!Tutorial 3: Random sampling and fingerprinting.
Tutorial 3 demonstrates the use of fingerprints to describe the start and subsequent transitions. Nodes assigned to {{{Random}}} initial conditions will be randomly initialized to {{{True}}} or {{{False}}} during each run. The model is then simulated for 20 iterations and the cycle detection method is used to find the length of the cycle and position at which it occurred. A //fingerprint// is a short text word that uniquely identifies a set of values for the nodes. For example the {{{S1}}} could be the fingerprint for the state in which {{{A=True, B=True, C=False}}}. Note that the states are unique within a certain run but may not be compared across separate invocations of the entire program. This is to allow to keep the states short and readable. Fingerprinting allows us to describe transitions between states in a simpler manner.
Link to [[t-03.py source|http://code.google.com/p/booleannet/source/browse/trunk/examples/tutorials/t-03.py]]
!!!Tutorial 4: Modifying rules: knockouts and overexpression.
Most simulations require the modification of the states/rules to describe //knockout// or //overexpressed// states. From a technical point of view this can be done by setting the corresponding nodes to either {{{False}}} or {{{True}}} and then removing the corresponding updating rules for these nodes. Doing it manually can be tedious and error prone and can lead to having too many rule files. The {{{modify_states}}} function takes to parameters {{{turnon}}} and {{{turnoff}}} that may be used to modify the original rules from the program itself.
Link to [[t-04.py source|http://code.google.com/p/booleannet/source/browse/trunk/examples/tutorials/t-04.py]]
!!!Tutorial 5: Helper function: the Collector
[>img[Tutorial 5|png/t-05.png]]Asynchronous updating rules are non deterministic and need to be averaged over many runs. The {{{Collector}}} class makes this averaging easy. It allows one to determine the fraction of the simulations that had a certain node set as {{{True}}} at a given timestep. The plot produced by this tutorial shows that node {{{A}}} always reaches the state of {{{True}}} within one simulation step and it stays as such. For nodes {{{B}}} and {{{C}}} the states are {{{True}}} about 50% of the time for all timesteps.
Link to [[t-05.py source|http://code.google.com/p/booleannet/source/browse/trunk/examples/tutorials/t-05.py]]
!!!Tutorial 6: Using piecewise linear differential equations
[>img[Tutorial 6|png/t-06.png]] One of the unique features of ''~BooleanNet'' is the ease of switching to a completely different simulation methodology without changing the rules. using a different parameter in the model constructor {{{Model(mode='plde')}}} we can simulate the same rules as piecewise linear differential equations. Note that changing
Link to [[t-06.py source|http://code.google.com/p/booleannet/source/browse/trunk/examples/tutorials/t-06.py]]
The simulation code for more realistic research projects gets more complex. We include in the source distribution both the simulations and plot generation code for three fairly complicated tasks that have each been independently published:
* ''examples/projects/aba'' includes the model published under the title //Predicting essential components of signal transduction networks: dynamic model of guard cell abscisic acid signaling// in ''~PLoS Biology 4 (10): e312, 2006 ''
* ''examples/projects/immune'' includes the model published under the title //Modeling Systems Level Regulation of Host Immune Responses// in ''~PLoS Computational Biology 6, e109, 2007''
* ''examples/projects/LGL'' includes the model published under the title //Network Model of Survival Signaling in LGL Leukemia// in ''PNAS, 2008 (to appear)''
''~BooleanNet'' is a software library, and therefore is used within simple python programs. Similarly to the way on uses ''Matlab'' or ''R'', in order to use ''~BooleanNet'' one writes a separate script that invokes certain functions offered by the library. Here is an example:
{{{
import boolean
text = """
A = B = C = True
A* = A and C
B* = A and B
C* = not A
"""
from boolean import Model
model = boolean.Model( text, mode='sync')
model.initialize()
model.iterate( steps=5 )
for state in model.states:
print state.A, state.B, state.C
}}}
place the content above in a file called ''simulation.py'' then execute it from the command line like so:
{{{
python simulation.py
}}}
it will print the following:
{{{
True True True
True True False
False True False
False False True
False False True
False False True
}}}
This works as described provided that you know what a command line (command shell) is and how to use one to navigate to the location of the file that you have placed your simulation in. Windows users often have less familiarity with this concept as the operating system is mostly interacted with via the mouse.
To facilitate the use of the library on windows we are recommending the use of a simple but powerful freeware text editor called [[Crimson Editor|http://www.crimsoneditor.com/]] that allows users to run python programs from the editor itself. On more details on how to use the ''Crimson Editor'' with ''~BooleanNet'' read the [[Editor Setup]] page.
Copyright © 2008 | Istvan Albert, Reka Albert | Released with the MIT Public License
//{{{
//This ensures that the footer sticks to the bottom of the screen when there are no tiddlers open. If that is not desirable, it can be deleted.
function setFooter() {
if (document.getElementById && document.getElementById("contentFooter") ) {
var windowHeight=findWindowHeight();
if (windowHeight>0) {
var contentHeight= document.getElementById('mainMenu').offsetHeight + document.getElementById("header").offsetHeight + document.getElementById("contentFooter").offsetHeight;
var menu= document.getElementById('mainMenu');
if (windowHeight-(contentHeight)>=0) {
menu.style.position='relative';
menu.style.marginBottom=(windowHeight-(contentHeight))+'px';
}
else {
menu.style.position='';
menu.style.marginBottom='';
}
}
}
}
window.onresize = function() {
setFooter();
}
Story.prototype.refreshTiddler_footerhack=Story.prototype.refreshTiddler;
Story.prototype.refreshTiddler = function (title,template,force)
{
var theTiddler = Story.prototype.refreshTiddler_footerhack.apply(this,arguments);
setFooter();
return theTiddler;}
//}}}