Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhuoqing Fang committed May 30, 2017
1 parent 29ee2f8 commit 47df07b
Show file tree
Hide file tree
Showing 22 changed files with 134 additions and 117 deletions.
14 changes: 6 additions & 8 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ GSEAPY is a python wrapper for **GSEA** and **Enrichr**.
GSEAPY could be used for **RNA-seq, ChIP-seq, Microarry** data. It's used for convenient GO enrichments and produce **publishable quality figures** in python.


GSEAPY has five sub-commands available: ``gsea``, ``prerank``, ``single``, ``replot`` ``enrichr``.
GSEAPY has five sub-commands available: ``gsea``, ``prerank``, ``ssgsea``, ``replot`` ``enrichr``.


:gsea: The ``gsea`` module produce `GSEA <http://www.broadinstitute.org/cancer/software/gsea/wiki/index.php/Main_Page>`_ results.The input requries a txt file(FPKM, Expected Counts, TPM, et.al), a cls file, and gene_sets file in gmt format.
:prerank: The ``prerank`` module produce **Prerank tool** results. The input expects a pre-ranked gene list dataset with correlation values, which in .rnk format, and gene_sets file in gmt format. ``prerank`` module is an API to `GSEA` pre-rank tools.
:single: The ``single`` module perform **single sample GSEA(ssGSEA)** analysis. The input expects a gene list with expression values(same with ``.rnk`` file, and gene_sets file in gmt format. ssGSEA enrichment score for the gene set as described by `D. Barbie et al 2009 <http://www.nature.com/nature/journal/v462/n7269/abs/nature08460.html>`_.
:ssgsea: The ``ssgsea`` module perform **single sample GSEA(ssGSEA)** analysis. The input expects a gene list with expression values(same with ``.rnk`` file, and gene_sets file in gmt format. ssGSEA enrichment score for the gene set as described by `D. Barbie et al 2009 <http://www.nature.com/nature/journal/v462/n7269/abs/nature08460.html>`_.

:replot: The ``replot`` module reproduce GSEA desktop version results. The only input for GSEAPY is the location to ``GSEA`` Desktop output results.

Expand Down Expand Up @@ -221,8 +221,8 @@ For command line usage:
# An example to run Prerank using gseapy prerank module
$ gseapy prerank -r gsea_data.rnk -g gene_sets.gmt -o test
# An example to run ssGSEA using gseapy single module
$ gseapy single -d expression.txt -g gene_sets.gmt -o test
# An example to run ssGSEA using gseapy ssgsea module
$ gseapy ssgsea -d expression.txt -g gene_sets.gmt -o test
# An example to use enrichr api
# see details of -g below, -d is optional
Expand Down Expand Up @@ -271,10 +271,8 @@ Run gseapy inside python console:
gseapy.prerank(rnk=gene_ranked_dataframe, gene_sets='KEGG_2016', outdir='test')
# using ssGSEA
from gseapy.gsea import SingleSampleGSEA
ssGSEA_dataframe = pd.DataFrame()
ss = SingleSampleGSEA(data=ssGSEA_dataframe, gene_sets='KEGG_2016', outdir='test')
ss.run()
gseapy.ssgsea(data=ssGSEA_dataframe, gene_sets='KEGG_2016', outdir='test')
3. For ``enrichr`` , you could assign a list object or a txt file

Expand Down
Binary file modified docs/_build/doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/_build/doctrees/gseapy_example.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/gseapy_tutorial.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/index.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/run.doctree
Binary file not shown.
12 changes: 6 additions & 6 deletions docs/_build/html/_sources/gseapy_example.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Examples to walk through ``GSEApy`` and enrichr
See all gseapy supported enrichr library names
==============================================

Enrichr library could be used for ``call`` and ``prerank``, too
Enrichr library could be used for ``gsea`` and ``prerank``, too

.. code:: ipython3
Expand Down Expand Up @@ -137,15 +137,15 @@ i. Assign enrichr with gene list object
# run gseapy
# if you are only intrested in dataframe that enrichr returned, please set no_plot=True
enrichr_results = gp.enrichr(gene_list=glist, description='test_name', gene_sets='KEGG_2016',
enr = gp.enrichr(gene_list=glist, description='test_name', gene_sets='KEGG_2016',
outdir='enrichr_kegg', cutoff=0.5, no_plot=False)
# and provide a txt file for enrichr will also work
#enrichr_results = gp.enrichr(gene_list='./gene_list.txt', description='KEGG',
#enr = gp.enrichr(gene_list='./gene_list.txt', description='KEGG',
# gene_sets='KEGG_2016', outdir='enrichr_kegg')
.. code:: ipython3
enrichr_results.iloc[:5,:6]
enr.res2d.iloc[:5,:6]
Expand Down Expand Up @@ -848,7 +848,7 @@ You may also want to use gsea in command line
5. Single Sample GSEA example
=============================

**Note: When you run ssGSEA, all genes names in your gene\_sets file
**Note: When you run ssGSEA, all genes names in your gene_sets file
should be found in your expression table**

i. Assign ssgsea() with a txt file or a dataframe
Expand Down Expand Up @@ -1030,7 +1030,7 @@ ii. command line usage of single sample gsea

.. code:: ipython3
!gseapy single -d ./temp.txt -g temp.gmt -o ssgsea_report2 -v
!gseapy ssgsea -d ./temp.txt -g temp.gmt -o ssgsea_report2 -v
.. parsed-literal::
Expand Down
6 changes: 3 additions & 3 deletions docs/_build/html/_sources/gseapy_tutorial.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -222,19 +222,19 @@ Or run inside python.
Use ``single`` command, or :func:`ssgsea`
Use ``ssgsea`` command, or :func:`ssgsea`
===============================================================


.. code:: bash
gseapy single -d expression.txt -g gene_sets.gmt -o test
gseapy ssgsea -d expression.txt -g gene_sets.gmt -o test
.. code:: python
#ssGSEA
ss = ssgsea(data="expression.txt", gene_sets= "gene_sets.gmt", outdir='test')
gseapy.ssgsea(data="expression.txt", gene_sets= "gene_sets.gmt", outdir='test')
Expand Down
6 changes: 3 additions & 3 deletions docs/_build/html/_sources/index.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ GSEAPY: Gene Set Enrichment Analysis in Python.
GSEAPY is a python wrapper for **GSEA** and **Enrichr**.
--------------------------------------------------------------------------------------------

GSEAPY has five subcommands: ``gsea``, ``prerank``, ``single``, ``replot`` ``enrichr``.
GSEAPY has five subcommands: ``gsea``, ``prerank``, ``ssgsea``, ``replot`` ``enrichr``.

1. The ``gsea`` module produce **GSEA** results.
The input requries a txt file(FPKM, Expected Counts, TPM, et.al), a cls file, and gene_sets file in gmt format.

2. The ``prerank`` module produce **Prerank tool** results.
The input expects a pre-ranked gene list dataset with correlation values, which in .rnk format, and gene_sets file in gmt format. ``prerank`` module is an API to `GSEA` pre-rank tools.

3. The ``single`` module perform **single sample GSEA(ssGSEA)** analysis.
3. The ``ssgsea`` module perform **single sample GSEA(ssGSEA)** analysis.
The input expects a gene list with expression values(same with ``.rnk`` file, and gene_sets file in gmt format. ssGSEA enrichment score for the gene set as described by `D. Barbie et al 2009 <http://www.nature.com/nature/journal/v462/n7269/abs/nature08460.html>`_.

4. The ``replot`` module reproduce GSEA desktop version results.
Expand All @@ -70,7 +70,7 @@ do gene set enrichment analysis in python. So, here is my reason:

* **Running inside python interactive console without switch to R!!!**
* User friendly for both wet and dry lab usrers.
* Produce pubilishable figures.
* Produce and reproduce pubilishable figures.
* Perform batch jobs easy(using for loops).
* Easy to use in bash shell or your data analysis workflow, e.g. snakemake.

Expand Down
16 changes: 10 additions & 6 deletions docs/_build/html/_sources/run.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,15 @@ To See help information of GSEAPY
$ gseapy --help
usage: gseapy [-h] [--version] {gsea,prerank,single,replot,enrichr} ...
usage: gseapy [-h] [--version] {gsea,prerank,ssgsea,replot,enrichr} ...
gseapy -- Gene Set Enrichment Analysis in Python
positional arguments:
{gsea,replot}
{gsea,prerank,ssgsea,replot,enrichr}
gsea Main GSEAPY Function: run GSEAPY instead of GSEA.
prerank Using pre-ranked tool to run GSEAPY.
single Run Single Sample GSEA.
ssgsea Run Single Sample GSEA.
replot Reproduce GSEA desktop figures.
enrichr Peform GSEA using enrichr API.
optional arguments:
Expand All @@ -141,9 +141,12 @@ For command line options of each command, type: gseapy COMMAND -h
# or
$ gseapy prerank -h
# or
$ gseapy ssgsea -h
# or
$ gseapy enrichr -h
Expand All @@ -152,17 +155,18 @@ Module APIs
---------------------
.. autofunction:: replot()
.. autofunction:: gsea()
.. autofunction:: prerank()
.. autofunction:: ssgsea()
.. autofunction:: enrichr()
.. autofunction:: replot()
Algorithm
-------------------------
Expand Down
14 changes: 10 additions & 4 deletions docs/_build/html/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,8 @@ <h2 id="E">E</h2>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="run.html#gseapy.enrichr.Enrichr">Enrichr (class in gseapy.enrichr)</a>
</li>
<li><a href="run.html#gseapy.enrichr">enrichr() (in module gseapy)</a>

<ul>
Expand All @@ -240,14 +242,12 @@ <h2 id="G">G</h2>
<li><a href="run.html#gseapy.parser.gsea_edb_parser">gsea_edb_parser() (in module gseapy.parser)</a>
</li>
<li><a href="run.html#gseapy.parser.gsea_gmt_parser">gsea_gmt_parser() (in module gseapy.parser)</a>
</li>
<li><a href="run.html#gseapy.plot.gsea_plot">gsea_plot() (in module gseapy.plot)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="run.html#gseapy.algorithm.gsea_pval">gsea_pval() (in module gseapy.algorithm)</a>
<li><a href="run.html#gseapy.plot.gsea_plot">gsea_plot() (in module gseapy.plot)</a>
</li>
<li><a href="run.html#gseapy.parser.gsea_rank_metric">gsea_rank_metric() (in module gseapy.parser)</a>
<li><a href="run.html#gseapy.algorithm.gsea_pval">gsea_pval() (in module gseapy.algorithm)</a>
</li>
<li><a href="run.html#gseapy.algorithm.gsea_significance">gsea_significance() (in module gseapy.algorithm)</a>
</li>
Expand Down Expand Up @@ -300,6 +300,8 @@ <h2 id="R">R</h2>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="run.html#gseapy.replot">replot() (in module gseapy)</a>
</li>
<li><a href="run.html#gseapy.enrichr.Enrichr.run">run() (gseapy.enrichr.Enrichr method)</a>
</li>
</ul></td>
</tr></table>
Expand All @@ -308,6 +310,10 @@ <h2 id="S">S</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="run.html#gseapy.algorithm.shuffle_list">shuffle_list() (in module gseapy.algorithm)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="run.html#gseapy.ssgsea">ssgsea() (in module gseapy)</a>
</li>
</ul></td>
</tr></table>
Expand Down
2 changes: 1 addition & 1 deletion docs/_build/html/gseapy_example.html
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ <h1>1. Load essential packages<a class="headerlink" href="#load-essential-packag
</div>
<div class="section" id="see-all-gseapy-supported-enrichr-library-names">
<h1>See all gseapy supported enrichr library names<a class="headerlink" href="#see-all-gseapy-supported-enrichr-library-names" title="Permalink to this headline"></a></h1>
<p>Enrichr library could be used for <code class="docutils literal"><span class="pre">call</span></code> and <code class="docutils literal"><span class="pre">prerank</span></code>, too</p>
<p>Enrichr library could be used for <code class="docutils literal"><span class="pre">gsea</span></code> and <code class="docutils literal"><span class="pre">prerank</span></code>, too</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="p">[</span><span class="s1">&#39;Achilles_fitness_decrease&#39;</span><span class="p">,</span>
<span class="s1">&#39;Achilles_fitness_increase&#39;</span><span class="p">,</span>
<span class="s1">&#39;Aging_Perturbations_from_GEO_down&#39;</span><span class="p">,</span>
Expand Down
10 changes: 5 additions & 5 deletions docs/_build/html/gseapy_tutorial.html
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#use-prerank-command-or-prerank">Use <code class="docutils literal"><span class="pre">prerank</span></code> Command, or <code class="docutils literal"><span class="pre">prerank()</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="#use-single-command-or-ssgsea">Use <code class="docutils literal"><span class="pre">single</span></code> command, or <code class="docutils literal"><span class="pre">ssgsea()</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="#use-ssgsea-command-or-ssgsea">Use <code class="docutils literal"><span class="pre">ssgsea</span></code> command, or <code class="docutils literal"><span class="pre">ssgsea()</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="#use-enrichr-command-or-enrichr">Use <code class="docutils literal"><span class="pre">enrichr</span></code> command, or <code class="docutils literal"><span class="pre">enrichr()</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="#use-replot-command-or-replot">Use <code class="docutils literal"><span class="pre">replot</span></code> Command, or <code class="docutils literal"><span class="pre">replot()</span></code></a></li>
</ul>
Expand Down Expand Up @@ -347,13 +347,13 @@ <h2>Use <code class="docutils literal"><span class="pre">prerank</span></code> C
</pre></div>
</div>
</div>
<div class="section" id="use-single-command-or-ssgsea">
<h2>Use <code class="docutils literal"><span class="pre">single</span></code> command, or <code class="xref py py-func docutils literal"><span class="pre">ssgsea()</span></code><a class="headerlink" href="#use-single-command-or-ssgsea" title="Permalink to this headline"></a></h2>
<div class="code bash highlight-default"><div class="highlight"><pre><span></span><span class="n">gseapy</span> <span class="n">single</span> <span class="o">-</span><span class="n">d</span> <span class="n">expression</span><span class="o">.</span><span class="n">txt</span> <span class="o">-</span><span class="n">g</span> <span class="n">gene_sets</span><span class="o">.</span><span class="n">gmt</span> <span class="o">-</span><span class="n">o</span> <span class="n">test</span>
<div class="section" id="use-ssgsea-command-or-ssgsea">
<h2>Use <code class="docutils literal"><span class="pre">ssgsea</span></code> command, or <code class="xref py py-func docutils literal"><span class="pre">ssgsea()</span></code><a class="headerlink" href="#use-ssgsea-command-or-ssgsea" title="Permalink to this headline"></a></h2>
<div class="code bash highlight-default"><div class="highlight"><pre><span></span><span class="n">gseapy</span> <span class="n">ssgsea</span> <span class="o">-</span><span class="n">d</span> <span class="n">expression</span><span class="o">.</span><span class="n">txt</span> <span class="o">-</span><span class="n">g</span> <span class="n">gene_sets</span><span class="o">.</span><span class="n">gmt</span> <span class="o">-</span><span class="n">o</span> <span class="n">test</span>
</pre></div>
</div>
<div class="code python highlight-default"><div class="highlight"><pre><span></span><span class="c1">#ssGSEA</span>
<span class="n">ss</span> <span class="o">=</span> <span class="n">ssgsea</span><span class="p">(</span><span class="n">data</span><span class="o">=</span><span class="s2">&quot;expression.txt&quot;</span><span class="p">,</span> <span class="n">gene_sets</span><span class="o">=</span> <span class="s2">&quot;gene_sets.gmt&quot;</span><span class="p">,</span> <span class="n">outdir</span><span class="o">=</span><span class="s1">&#39;test&#39;</span><span class="p">)</span>
<span class="n">gseapy</span><span class="o">.</span><span class="n">ssgsea</span><span class="p">(</span><span class="n">data</span><span class="o">=</span><span class="s2">&quot;expression.txt&quot;</span><span class="p">,</span> <span class="n">gene_sets</span><span class="o">=</span> <span class="s2">&quot;gene_sets.gmt&quot;</span><span class="p">,</span> <span class="n">outdir</span><span class="o">=</span><span class="s1">&#39;test&#39;</span><span class="p">)</span>
</pre></div>
</div>
</div>
Expand Down
8 changes: 4 additions & 4 deletions docs/_build/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,12 @@ <h2>GSEAPY: Gene Set Enrichment Analysis in Python.<a class="headerlink" href="#
</div>
<div class="section" id="gseapy-is-a-python-wrapper-for-gsea-and-enrichr">
<h2>GSEAPY is a python wrapper for <strong>GSEA</strong> and <strong>Enrichr</strong>.<a class="headerlink" href="#gseapy-is-a-python-wrapper-for-gsea-and-enrichr" title="Permalink to this headline"></a></h2>
<p>GSEAPY has five subcommands: <code class="docutils literal"><span class="pre">gsea</span></code>, <code class="docutils literal"><span class="pre">prerank</span></code>, <code class="docutils literal"><span class="pre">single</span></code>, <code class="docutils literal"><span class="pre">replot</span></code> <code class="docutils literal"><span class="pre">enrichr</span></code>.</p>
<p>GSEAPY has five subcommands: <code class="docutils literal"><span class="pre">gsea</span></code>, <code class="docutils literal"><span class="pre">prerank</span></code>, <code class="docutils literal"><span class="pre">ssgsea</span></code>, <code class="docutils literal"><span class="pre">replot</span></code> <code class="docutils literal"><span class="pre">enrichr</span></code>.</p>
<p>1. The <code class="docutils literal"><span class="pre">gsea</span></code> module produce <strong>GSEA</strong> results.
The input requries a txt file(FPKM, Expected Counts, TPM, et.al), a cls file, and gene_sets file in gmt format.</p>
<p>2. The <code class="docutils literal"><span class="pre">prerank</span></code> module produce <strong>Prerank tool</strong> results.
The input expects a pre-ranked gene list dataset with correlation values, which in .rnk format, and gene_sets file in gmt format. <code class="docutils literal"><span class="pre">prerank</span></code> module is an API to <cite>GSEA</cite> pre-rank tools.</p>
<p>3. The <code class="docutils literal"><span class="pre">single</span></code> module perform <strong>single sample GSEA(ssGSEA)</strong> analysis.
<p>3. The <code class="docutils literal"><span class="pre">ssgsea</span></code> module perform <strong>single sample GSEA(ssGSEA)</strong> analysis.
The input expects a gene list with expression values(same with <code class="docutils literal"><span class="pre">.rnk</span></code> file, and gene_sets file in gmt format. ssGSEA enrichment score for the gene set as described by <a class="reference external" href="http://www.nature.com/nature/journal/v462/n7269/abs/nature08460.html">D. Barbie et al 2009</a>.</p>
<p>4. The <code class="docutils literal"><span class="pre">replot</span></code> module reproduce GSEA desktop version results.
The only input for GSEAPY is the location to GSEA Desktop output results.</p>
Expand All @@ -205,7 +205,7 @@ <h2>Why GSEAPY<a class="headerlink" href="#why-gseapy" title="Permalink to this
<ul class="simple">
<li><strong>Running inside python interactive console without switch to R!!!</strong></li>
<li>User friendly for both wet and dry lab usrers.</li>
<li>Produce pubilishable figures.</li>
<li>Produce and reproduce pubilishable figures.</li>
<li>Perform batch jobs easy(using for loops).</li>
<li>Easy to use in bash shell or your data analysis workflow, e.g. snakemake.</li>
</ul>
Expand Down Expand Up @@ -249,7 +249,7 @@ <h2>Why GSEAPY<a class="headerlink" href="#why-gseapy" title="Permalink to this
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="gseapy_tutorial.html#use-prerank-command-or-prerank">Use <code class="docutils literal"><span class="pre">prerank</span></code> Command, or <code class="docutils literal"><span class="pre">prerank()</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="gseapy_tutorial.html#use-single-command-or-ssgsea">Use <code class="docutils literal"><span class="pre">single</span></code> command, or <code class="docutils literal"><span class="pre">ssgsea()</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="gseapy_tutorial.html#use-ssgsea-command-or-ssgsea">Use <code class="docutils literal"><span class="pre">ssgsea</span></code> command, or <code class="docutils literal"><span class="pre">ssgsea()</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="gseapy_tutorial.html#use-enrichr-command-or-enrichr">Use <code class="docutils literal"><span class="pre">enrichr</span></code> command, or <code class="docutils literal"><span class="pre">enrichr()</span></code></a></li>
<li class="toctree-l2"><a class="reference internal" href="gseapy_tutorial.html#use-replot-command-or-replot">Use <code class="docutils literal"><span class="pre">replot</span></code> Command, or <code class="docutils literal"><span class="pre">replot()</span></code></a></li>
</ul>
Expand Down
Binary file modified docs/_build/html/objects.inv
Binary file not shown.

0 comments on commit 47df07b

Please sign in to comment.