-
Notifications
You must be signed in to change notification settings - Fork 218
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
built documentation for cobra pie. now tidy up the installer and roll…
… out beta 1
- Loading branch information
danielhyduke
committed
Jun 22, 2012
1 parent
98ae241
commit 13ff8f5
Showing
104 changed files
with
18,510 additions
and
2 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Sphinx build info version 1 | ||
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. | ||
config: d23dacab69c1dc358bb2f5562d93961e | ||
tags: fbb0d17656682115ca4d033fb2f83ba1 |
384 changes: 384 additions & 0 deletions
384
cobra/documentation/html/_modules/cobra/core/ArrayBasedModel.html
Large diffs are not rendered by default.
Oops, something went wrong.
329 changes: 329 additions & 0 deletions
329
cobra/documentation/html/_modules/cobra/core/DictList.html
Large diffs are not rendered by default.
Oops, something went wrong.
367 changes: 367 additions & 0 deletions
367
cobra/documentation/html/_modules/cobra/core/Formula.html
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,191 @@ | ||
|
||
|
||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | ||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | ||
|
||
|
||
<html xmlns="http://www.w3.org/1999/xhtml"> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | ||
|
||
<title>cobra.core.Gene — cobra 0.1.0.b1 documentation</title> | ||
|
||
<link rel="stylesheet" href="../../../_static/default.css" type="text/css" /> | ||
<link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" /> | ||
|
||
<script type="text/javascript"> | ||
var DOCUMENTATION_OPTIONS = { | ||
URL_ROOT: '../../../', | ||
VERSION: '0.1.0.b1', | ||
COLLAPSE_INDEX: false, | ||
FILE_SUFFIX: '.html', | ||
HAS_SOURCE: true | ||
}; | ||
</script> | ||
<script type="text/javascript" src="../../../_static/jquery.js"></script> | ||
<script type="text/javascript" src="../../../_static/underscore.js"></script> | ||
<script type="text/javascript" src="../../../_static/doctools.js"></script> | ||
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script> | ||
<link rel="top" title="cobra 0.1.0.b1 documentation" href="../../../index.html" /> | ||
<link rel="up" title="Module code" href="../../index.html" /> | ||
</head> | ||
<body> | ||
<div class="related"> | ||
<h3>Navigation</h3> | ||
<ul> | ||
<li class="right" style="margin-right: 10px"> | ||
<a href="../../../genindex.html" title="General Index" | ||
accesskey="I">index</a></li> | ||
<li class="right" > | ||
<a href="../../../py-modindex.html" title="Python Module Index" | ||
>modules</a> |</li> | ||
<li><a href="../../../index.html">cobra 0.1.0.b1 documentation</a> »</li> | ||
<li><a href="../../index.html" accesskey="U">Module code</a> »</li> | ||
</ul> | ||
</div> | ||
|
||
<div class="document"> | ||
<div class="documentwrapper"> | ||
<div class="bodywrapper"> | ||
<div class="body"> | ||
|
||
<h1>Source code for cobra.core.Gene</h1><div class="highlight"><pre> | ||
<span class="c">#cobra.Gene.py</span> | ||
<span class="c">#######################</span> | ||
<span class="c">#BEGIN Class Gene</span> | ||
<span class="c">#</span> | ||
<span class="kn">import</span> <span class="nn">re</span> | ||
<span class="kn">from</span> <span class="nn">.Metabolite</span> <span class="kn">import</span> <span class="n">Metabolite</span> | ||
<div class="viewcode-block" id="Gene"><a class="viewcode-back" href="../../../cobra.core.html#cobra.core.Gene.Gene">[docs]</a><span class="k">class</span> <span class="nc">Gene</span><span class="p">(</span><span class="n">Metabolite</span><span class="p">):</span> | ||
<span class="sd">"""A Gene is a special class of metabolite.</span> | ||
<span class="sd"> </span> | ||
|
||
<span class="sd"> TODO: Make design decisions about TUs and such</span> | ||
<span class="sd"> """</span> | ||
<span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="n">formula</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> | ||
<span class="n">name</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">compartment</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">strand</span><span class="o">=</span><span class="s">'+'</span><span class="p">,</span> | ||
<span class="n">locus_start</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">locus_end</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">functional</span><span class="o">=</span><span class="bp">True</span><span class="p">):</span> | ||
<span class="sd">"""</span> | ||
<span class="sd"> id: A string.</span> | ||
|
||
<span class="sd"> formula: cobra.Formula or String of a chemical formula. Defaults to None</span> | ||
<span class="sd"> to save time in pickling and such.</span> | ||
<span class="sd"> </span> | ||
<span class="sd"> name: String. A human readable name.</span> | ||
<span class="sd"> </span> | ||
<span class="sd"> compartment: None or a dictionary indicating the cellular location</span> | ||
<span class="sd"> of the metabolite. Used when in a cobra.Reaction or Model</span> | ||
<span class="sd"> object</span> | ||
|
||
<span class="sd"> strand: '+' or '-' to indicate forward or reverse strand for DNA.</span> | ||
|
||
<span class="sd"> locus_start: Int. The index of the starting base for the gene.</span> | ||
|
||
<span class="sd"> locus_end: Int. The index of the last base for the gene.</span> | ||
|
||
<span class="sd"> functional: Boolean. Indicate whether the gene is functional. If it</span> | ||
<span class="sd"> is not functional then it cannot be used in an enzyme complex nor</span> | ||
<span class="sd"> can its products be used.</span> | ||
<span class="sd"> </span> | ||
<span class="sd"> """</span> | ||
<span class="n">Metabolite</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="nb">id</span><span class="p">,</span> <span class="n">formula</span><span class="o">=</span><span class="n">formula</span><span class="p">,</span> | ||
<span class="n">name</span><span class="o">=</span><span class="n">name</span><span class="p">,</span> <span class="n">compartment</span><span class="o">=</span><span class="n">compartment</span><span class="p">)</span> | ||
<span class="bp">self</span><span class="o">.</span><span class="n">locus_start</span> <span class="o">=</span> <span class="n">locus_start</span> | ||
<span class="bp">self</span><span class="o">.</span><span class="n">locus_end</span> <span class="o">=</span> <span class="n">locus_end</span> | ||
<span class="bp">self</span><span class="o">.</span><span class="n">strand</span> <span class="o">=</span> <span class="n">strand</span> | ||
<span class="bp">self</span><span class="o">.</span><span class="n">functional</span> <span class="o">=</span> <span class="n">functional</span> | ||
|
||
<div class="viewcode-block" id="Gene.guided_copy"><a class="viewcode-back" href="../../../cobra.core.html#cobra.core.Gene.Gene.guided_copy">[docs]</a> <span class="k">def</span> <span class="nf">guided_copy</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">the_model</span><span class="p">):</span> | ||
<span class="sd">"""Trying to make a faster copy proceedure for cases where large</span> | ||
<span class="sd"> numbers of metabolites might be copied. Such as when copying reactions.</span> | ||
|
||
<span class="sd"> """</span> | ||
<span class="n">the_copy</span> <span class="o">=</span> <span class="n">Metabolite</span><span class="o">.</span><span class="n">guided_copy</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">the_model</span><span class="p">)</span> | ||
<span class="k">return</span><span class="p">(</span><span class="n">the_copy</span><span class="p">)</span> | ||
</div> | ||
<div class="viewcode-block" id="Gene.remove_from_model"><a class="viewcode-back" href="../../../cobra.core.html#cobra.core.Gene.Gene.remove_from_model">[docs]</a> <span class="k">def</span> <span class="nf">remove_from_model</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">the_model</span><span class="p">,</span> | ||
<span class="n">make_dependent_reactions_nonfunctional</span><span class="o">=</span><span class="bp">True</span><span class="p">):</span> | ||
<span class="sd">"""Removes the association</span> | ||
|
||
<span class="sd"> the_model: cobra.Model object. remove the reaction from this model.</span> | ||
|
||
<span class="sd"> make_dependent_reactions_nonfunctional: Boolean. If True then replace</span> | ||
<span class="sd"> the gene with 'False' in the gene association, else replace the gene</span> | ||
<span class="sd"> with 'True'</span> | ||
|
||
<span class="sd"> TODO: Better handling of the gene association</span> | ||
<span class="sd"> </span> | ||
<span class="sd"> """</span> | ||
<span class="k">if</span> <span class="n">make_dependent_reactions_nonfunctional</span><span class="p">:</span> | ||
<span class="n">gene_state</span> <span class="o">=</span> <span class="s">'False'</span> | ||
<span class="k">else</span><span class="p">:</span> | ||
<span class="n">gene_state</span> <span class="o">=</span> <span class="s">'True'</span> | ||
<span class="n">the_gene_re</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">compile</span><span class="p">(</span><span class="s">'(^|(?<=( |\()))</span><span class="si">%s</span><span class="s">(?=( |\)|$))'</span><span class="o">%</span><span class="n">re</span><span class="o">.</span><span class="n">escape</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">id</span><span class="p">))</span> | ||
<span class="k">if</span> <span class="n">the_model</span> <span class="o">!=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_model</span><span class="p">:</span> | ||
<span class="k">raise</span> <span class="ne">Exception</span><span class="p">(</span><span class="s">'</span><span class="si">%s</span><span class="s"> not in </span><span class="si">%s</span><span class="s"> ergo it cannot be removed. (</span><span class="si">%s</span><span class="s">)'</span><span class="o">%</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> | ||
<span class="n">the_model</span><span class="p">,</span> | ||
<span class="bp">self</span><span class="o">.</span><span class="n">_model</span><span class="p">))</span> | ||
|
||
<span class="bp">self</span><span class="o">.</span><span class="n">_model</span><span class="o">.</span><span class="n">genes</span><span class="o">.</span><span class="n">remove</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> | ||
<span class="bp">self</span><span class="o">.</span><span class="n">_model</span> <span class="o">=</span> <span class="bp">None</span> | ||
|
||
<span class="k">for</span> <span class="n">the_reaction</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">_reaction</span><span class="p">:</span> | ||
<span class="n">the_reaction</span><span class="o">.</span><span class="n">gene_reaction_rule</span> <span class="o">=</span> <span class="n">the_gene_re</span><span class="o">.</span><span class="n">sub</span><span class="p">(</span><span class="n">gene_state</span><span class="p">,</span> | ||
<span class="n">the_reaction</span><span class="o">.</span><span class="n">gene_reaction_rule</span><span class="p">)</span> | ||
<span class="n">the_reaction</span><span class="o">.</span><span class="n">_genes</span><span class="o">.</span><span class="n">pop</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span> | ||
<span class="c">#Now deactivate the reaction if its gene association evaluates to False</span> | ||
<span class="n">the_gene_reaction_relation</span> <span class="o">=</span> <span class="n">the_reaction</span><span class="o">.</span><span class="n">gene_reaction_rule</span> | ||
<span class="k">for</span> <span class="n">other_gene</span> <span class="ow">in</span> <span class="n">the_reaction</span><span class="o">.</span><span class="n">_genes</span><span class="p">:</span> | ||
<span class="n">other_gene_re</span> <span class="o">=</span> <span class="n">re</span><span class="o">.</span><span class="n">compile</span><span class="p">(</span><span class="s">'(^|(?<=( |\()))</span><span class="si">%s</span><span class="s">(?=( |\)|$))'</span><span class="o">%</span><span class="n">re</span><span class="o">.</span><span class="n">escape</span><span class="p">(</span><span class="n">other_gene</span><span class="o">.</span><span class="n">id</span><span class="p">))</span> | ||
<span class="n">the_gene_reaction_relation</span> <span class="o">=</span> <span class="n">other_gene_re</span><span class="o">.</span><span class="n">sub</span><span class="p">(</span><span class="s">'True'</span><span class="p">,</span> <span class="n">the_gene_reaction_relation</span><span class="p">)</span> | ||
<span class="c">#</span> | ||
<span class="k">if</span> <span class="ow">not</span> <span class="nb">eval</span><span class="p">(</span><span class="n">the_gene_reaction_relation</span><span class="p">):</span> | ||
<span class="n">the_reaction</span><span class="o">.</span><span class="n">lower_bound</span> <span class="o">=</span> <span class="mi">0</span> | ||
<span class="n">the_reaction</span><span class="o">.</span><span class="n">upper_bound</span> <span class="o">=</span> <span class="mi">0</span> | ||
|
||
<span class="c">#</span> | ||
<span class="c">#END Class Gene</span> | ||
<span class="c">########################</span></div></div> | ||
</pre></div> | ||
|
||
</div> | ||
</div> | ||
</div> | ||
<div class="sphinxsidebar"> | ||
<div class="sphinxsidebarwrapper"> | ||
<div id="searchbox" style="display: none"> | ||
<h3>Quick search</h3> | ||
<form class="search" action="../../../search.html" method="get"> | ||
<input type="text" name="q" /> | ||
<input type="submit" value="Go" /> | ||
<input type="hidden" name="check_keywords" value="yes" /> | ||
<input type="hidden" name="area" value="default" /> | ||
</form> | ||
<p class="searchtip" style="font-size: 90%"> | ||
Enter search terms or a module, class or function name. | ||
</p> | ||
</div> | ||
<script type="text/javascript">$('#searchbox').show(0);</script> | ||
</div> | ||
</div> | ||
<div class="clearer"></div> | ||
</div> | ||
<div class="related"> | ||
<h3>Navigation</h3> | ||
<ul> | ||
<li class="right" style="margin-right: 10px"> | ||
<a href="../../../genindex.html" title="General Index" | ||
>index</a></li> | ||
<li class="right" > | ||
<a href="../../../py-modindex.html" title="Python Module Index" | ||
>modules</a> |</li> | ||
<li><a href="../../../index.html">cobra 0.1.0.b1 documentation</a> »</li> | ||
<li><a href="../../index.html" >Module code</a> »</li> | ||
</ul> | ||
</div> | ||
<div class="footer"> | ||
© Copyright 2012, Daniel Robert Hyduke. | ||
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1. | ||
</div> | ||
</body> | ||
</html> |
Oops, something went wrong.