Skip to content

Commit

Permalink
added latest python api with back-end enrichrgram method
Browse files Browse the repository at this point in the history
  • Loading branch information
cornhundred committed Apr 13, 2017
1 parent f244dc9 commit 0d9aaf2
Show file tree
Hide file tree
Showing 9 changed files with 62 additions and 18 deletions.
40 changes: 31 additions & 9 deletions clustergrammer_py/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class Network(object):
'''
version 1.12.4
version 1.13.3
Clustergrammer.py takes a matrix as input (either from a file of a Pandas DataFrame), normalizes/filters, hierarchically clusters, and produces the :ref:`visualization_json` for :ref:`clustergrammer_js`.
Expand Down Expand Up @@ -373,17 +373,39 @@ def Iframe_web_app(self, filename=None, width=1000, height=800):

return link

def enrichr(self, req_type, gene_list=None, lib=None, list_id=None,
max_terms=None):
def enrichrgram(self, lib, axis='row'):
'''
Under development; get enrichment results from Enrichr and add them to
clustergram.
Add Enrichr gene enrichment results to your visualization (where your rows
are genes). Run enrichrgram before clustering to incldue enrichment results
as row categories. Enrichrgram can also be run on the front-end using the
Enrichr logo at the top left.
Set lib to the Enrichr library that you want to use for enrichment analysis.
Libraries included:
* ChEA_2016
* KEA_2015
* ENCODE_TF_ChIP-seq_2015
* ENCODE_Histone_Modifications_2015
* Disease_Perturbations_from_GEO_up
* Disease_Perturbations_from_GEO_down
* GO_Molecular_Function_2015
* GO_Biological_Process_2015
* GO_Cellular_Component_2015
* Reactome_2016
* KEGG_2016
* MGI_Mammalian_Phenotype_Level_4
* LINCS_L1000_Chem_Pert_up
* LINCS_L1000_Chem_Pert_down
'''
if req_type == 'post':
return enr_fun.post_request(gene_list)

if req_type == 'get':
return enr_fun.get_request(lib, list_id, max_terms)
df = self.export_df()
df, bar_info = enr_fun.add_enrichr_cats(df, axis, lib)
self.load_df(df)

self.dat['enrichrgram_lib'] = lib
self.dat['row_cat_bars'] = bar_info

@staticmethod
def load_gmt(filename):
Expand Down
Binary file modified clustergrammer_py/__init__.pyc
Binary file not shown.
Binary file modified docs/_build_html/.doctrees/clustergrammer_py.doctree
Binary file not shown.
Binary file modified docs/_build_html/.doctrees/environment.pickle
Binary file not shown.
32 changes: 27 additions & 5 deletions docs/_build_html/clustergrammer_py.html
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ <h2>Installation<a class="headerlink" href="#installation" title="Permalink to t
<span class="target" id="module-clustergrammer_py"></span><dl class="class">
<dt id="clustergrammer_py.Network">
<em class="property">class </em><code class="descclassname">clustergrammer_py.</code><code class="descname">Network</code><span class="sig-paren">(</span><em>widget=None</em><span class="sig-paren">)</span><a class="headerlink" href="#clustergrammer_py.Network" title="Permalink to this definition"></a></dt>
<dd><p>version 1.12.4</p>
<dd><p>version 1.13.3</p>
<p>Clustergrammer.py takes a matrix as input (either from a file of a Pandas DataFrame), normalizes/filters, hierarchically clusters, and produces the <a class="reference internal" href="clustergrammer_js.html#visualization-json"><span class="std std-ref">Visualization-JSON</span></a> for <a class="reference internal" href="clustergrammer_js.html#clustergrammer-js"><span class="std std-ref">Clustergrammer-JS</span></a>.</p>
<p>Networks have two states:</p>
<blockquote>
Expand Down Expand Up @@ -291,10 +291,32 @@ <h2>Installation<a class="headerlink" href="#installation" title="Permalink to t
</dd></dl>

<dl class="method">
<dt id="clustergrammer_py.Network.enrichr">
<code class="descname">enrichr</code><span class="sig-paren">(</span><em>req_type</em>, <em>gene_list=None</em>, <em>lib=None</em>, <em>list_id=None</em>, <em>max_terms=None</em><span class="sig-paren">)</span><a class="headerlink" href="#clustergrammer_py.Network.enrichr" title="Permalink to this definition"></a></dt>
<dd><p>Under development; get enrichment results from Enrichr and add them to
clustergram.</p>
<dt id="clustergrammer_py.Network.enrichrgram">
<code class="descname">enrichrgram</code><span class="sig-paren">(</span><em>lib</em>, <em>axis='row'</em><span class="sig-paren">)</span><a class="headerlink" href="#clustergrammer_py.Network.enrichrgram" title="Permalink to this definition"></a></dt>
<dd><p>Add Enrichr gene enrichment results to your visualization (where your rows
are genes). Run enrichrgram before clustering to incldue enrichment results
as row categories. Enrichrgram can also be run on the front-end using the
Enrichr logo at the top left.</p>
<p>Set lib to the Enrichr library that you want to use for enrichment analysis.
Libraries included:</p>
<blockquote>
<div><ul class="simple">
<li>ChEA_2016</li>
<li>KEA_2015</li>
<li>ENCODE_TF_ChIP-seq_2015</li>
<li>ENCODE_Histone_Modifications_2015</li>
<li>Disease_Perturbations_from_GEO_up</li>
<li>Disease_Perturbations_from_GEO_down</li>
<li>GO_Molecular_Function_2015</li>
<li>GO_Biological_Process_2015</li>
<li>GO_Cellular_Component_2015</li>
<li>Reactome_2016</li>
<li>KEGG_2016</li>
<li>MGI_Mammalian_Phenotype_Level_4</li>
<li>LINCS_L1000_Chem_Pert_up</li>
<li>LINCS_L1000_Chem_Pert_down</li>
</ul>
</div></blockquote>
</dd></dl>

<dl class="method">
Expand Down
4 changes: 2 additions & 2 deletions docs/_build_html/clustergrammer_widget.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/_build_html/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ <h2 id="E">E</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%" valign="top"><dl>

<dt><a href="clustergrammer_py.html#clustergrammer_py.Network.enrichr">enrichr() (clustergrammer_py.Network method)</a>
<dt><a href="clustergrammer_py.html#clustergrammer_py.Network.enrichrgram">enrichrgram() (clustergrammer_py.Network method)</a>
</dt>


Expand Down
Binary file modified docs/_build_html/objects.inv
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/_build_html/searchindex.js

Large diffs are not rendered by default.

0 comments on commit 0d9aaf2

Please sign in to comment.