Skip to content

Commit

Permalink
update docs and tutorials fix #107, #108
Browse files Browse the repository at this point in the history
  • Loading branch information
nargesr committed Jul 24, 2024
1 parent e7cbb65 commit b4c4d27
Show file tree
Hide file tree
Showing 126 changed files with 1,637 additions and 13,960 deletions.
Binary file modified docs/doctrees/api.doctree
Binary file not shown.
Binary file modified docs/doctrees/cite.doctree
Binary file not shown.
Binary file modified docs/doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/doctrees/index.doctree
Binary file not shown.
Binary file modified docs/doctrees/installation.doctree
Binary file not shown.
Binary file modified docs/doctrees/suggested_reading.doctree
Binary file not shown.
Binary file modified docs/doctrees/tutorials.doctree
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/html/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +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: 0248ca8ec65abf37a867cfd291cc8594
config: cbe10723dc5e8bd89364990d7a6ff241
tags: 645f666f9bcd5a90fca523b33c5a78b7
134 changes: 90 additions & 44 deletions docs/html/_modules/PyWGCNA/comparison.html

Large diffs are not rendered by default.

54 changes: 36 additions & 18 deletions docs/html/_modules/PyWGCNA/geneExp.html
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
<!DOCTYPE html>

<html lang="en">
<html lang="en" data-content_root="../../">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>PyWGCNA.geneExp &#8212; PyWGCNA documentation</title>
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="../../_static/bootstrap-sphinx.css" />
<link rel="stylesheet" type="text/css" href="../../_static/graphviz.css" />
<script data-url_root="../../" id="documentation_options" src="../../_static/documentation_options.js"></script>
<script src="../../_static/jquery.js"></script>
<script src="../../_static/underscore.js"></script>
<script src="../../_static/_sphinx_javascript_frameworks_compat.js"></script>
<script src="../../_static/doctools.js"></script>
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=a746c00c" />
<link rel="stylesheet" type="text/css" href="../../_static/bootstrap-sphinx.css?v=4468db6d" />
<link rel="stylesheet" type="text/css" href="../../_static/graphviz.css?v=fd3f3429" />
<script src="../../_static/documentation_options.js?v=5929fcd5"></script>
<script src="../../_static/doctools.js?v=9a2dae69"></script>
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
<link rel="index" title="Index" href="../../genindex.html" />
<link rel="search" title="Search" href="../../search.html" />
<meta charset='utf-8'>
Expand Down Expand Up @@ -102,7 +100,18 @@

<div class="container">
<div class="row">
<div class="body col-md-12 content" role="main">
<div class="col-md-3">
<div id="sidebar" class="bs-sidenav" role="complementary">
<form action="../../search.html" method="get">
<div class="form-group">
<input type="text" name="q" class="form-control" placeholder="Search" />
</div>
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="body col-md-9 content" role="main">

<h1>Source code for PyWGCNA.geneExp</h1><div class="highlight"><pre>
<span></span><span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
Expand All @@ -115,8 +124,10 @@ <h1>Source code for PyWGCNA.geneExp</h1><div class="highlight"><pre>
<span class="n">np</span><span class="o">.</span><span class="n">seterr</span><span class="p">(</span><span class="n">divide</span><span class="o">=</span><span class="s1">&#39;ignore&#39;</span><span class="p">,</span> <span class="n">invalid</span><span class="o">=</span><span class="s1">&#39;ignore&#39;</span><span class="p">)</span>


<div class="viewcode-block" id="GeneExp"><a class="viewcode-back" href="../../api.html#PyWGCNA.geneExp.GeneExp">[docs]</a><span class="k">class</span> <span class="nc">GeneExp</span><span class="p">:</span>
<span class="sd">&quot;&quot;&quot;</span>
<div class="viewcode-block" id="GeneExp">
<a class="viewcode-back" href="../../api.html#PyWGCNA.geneExp.GeneExp">[docs]</a>
<span class="k">class</span> <span class="nc">GeneExp</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> A class used to creat gene expression anndata along data trait including both genes and samples information.</span>

<span class="sd"> :param species: species of the data you use i.e mouse, human</span>
Expand Down Expand Up @@ -175,9 +186,11 @@ <h1>Source code for PyWGCNA.geneExp</h1><div class="highlight"><pre>

<span class="bp">self</span><span class="o">.</span><span class="n">geneExpr</span> <span class="o">=</span> <span class="n">ad</span><span class="o">.</span><span class="n">AnnData</span><span class="p">(</span><span class="n">X</span><span class="o">=</span><span class="n">expressionList</span><span class="p">,</span> <span class="n">obs</span><span class="o">=</span><span class="n">sampleInfo</span><span class="p">,</span> <span class="n">var</span><span class="o">=</span><span class="n">geneInfo</span><span class="p">)</span>

<div class="viewcode-block" id="GeneExp.updateGeneInfo"><a class="viewcode-back" href="../../api.html#PyWGCNA.geneExp.GeneExp.updateGeneInfo">[docs]</a> <span class="nd">@staticmethod</span>
<div class="viewcode-block" id="GeneExp.updateGeneInfo">
<a class="viewcode-back" href="../../api.html#PyWGCNA.geneExp.GeneExp.updateGeneInfo">[docs]</a>
<span class="nd">@staticmethod</span>
<span class="k">def</span> <span class="nf">updateGeneInfo</span><span class="p">(</span><span class="n">geneExpr</span><span class="p">,</span> <span class="n">geneInfo</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">path</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">sep</span><span class="o">=</span><span class="s1">&#39;,&#39;</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> add/update genes info in expr anndata</span>

<span class="sd"> :param geneExpr: gene expression data along with sample and genes/transcript information</span>
Expand Down Expand Up @@ -208,9 +221,12 @@ <h1>Source code for PyWGCNA.geneExp</h1><div class="highlight"><pre>

<span class="k">return</span> <span class="n">geneExpr</span></div>

<div class="viewcode-block" id="GeneExp.updateSampleInfo"><a class="viewcode-back" href="../../api.html#PyWGCNA.geneExp.GeneExp.updateSampleInfo">[docs]</a> <span class="nd">@staticmethod</span>

<div class="viewcode-block" id="GeneExp.updateSampleInfo">
<a class="viewcode-back" href="../../api.html#PyWGCNA.geneExp.GeneExp.updateSampleInfo">[docs]</a>
<span class="nd">@staticmethod</span>
<span class="k">def</span> <span class="nf">updateSampleInfo</span><span class="p">(</span><span class="n">geneExpr</span><span class="p">,</span> <span class="n">sampleInfo</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">path</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">sep</span><span class="o">=</span><span class="s1">&#39;,&#39;</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> add/update metadata in expr anndata</span>

<span class="sd"> :param geneExpr: gene expression data along with sample and genes/transcript information</span>
Expand Down Expand Up @@ -239,7 +255,9 @@ <h1>Source code for PyWGCNA.geneExp</h1><div class="highlight"><pre>
<span class="n">geneExpr</span><span class="o">.</span><span class="n">obs</span><span class="o">.</span><span class="n">drop</span><span class="p">(</span><span class="n">same_columns</span><span class="p">,</span> <span class="n">axis</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="n">inplace</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="n">geneExpr</span><span class="o">.</span><span class="n">obs</span> <span class="o">=</span> <span class="n">pd</span><span class="o">.</span><span class="n">concat</span><span class="p">([</span><span class="n">geneExpr</span><span class="o">.</span><span class="n">obs</span><span class="p">,</span> <span class="n">sampleInfo</span><span class="p">],</span> <span class="n">axis</span><span class="o">=</span><span class="mi">1</span><span class="p">)</span><span class="o">.</span><span class="n">loc</span><span class="p">[</span><span class="n">geneExpr</span><span class="o">.</span><span class="n">obs</span><span class="o">.</span><span class="n">index</span><span class="p">,</span> <span class="p">:]</span>

<span class="k">return</span> <span class="n">geneExpr</span></div></div>
<span class="k">return</span> <span class="n">geneExpr</span></div>
</div>

</pre></div>

</div>
Expand All @@ -254,7 +272,7 @@ <h1>Source code for PyWGCNA.geneExp</h1><div class="highlight"><pre>
</p>
<p>
&copy; Copyright 2022, Narges Rezaie.<br/>
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 5.0.2.<br/>
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 7.4.7.<br/>
</p>
</div>
</footer>
Expand Down
73 changes: 50 additions & 23 deletions docs/html/_modules/PyWGCNA/utils.html
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
<!DOCTYPE html>

<html lang="en">
<html lang="en" data-content_root="../../">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>PyWGCNA.utils &#8212; PyWGCNA documentation</title>
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="../../_static/bootstrap-sphinx.css" />
<link rel="stylesheet" type="text/css" href="../../_static/graphviz.css" />
<script data-url_root="../../" id="documentation_options" src="../../_static/documentation_options.js"></script>
<script src="../../_static/jquery.js"></script>
<script src="../../_static/underscore.js"></script>
<script src="../../_static/_sphinx_javascript_frameworks_compat.js"></script>
<script src="../../_static/doctools.js"></script>
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=a746c00c" />
<link rel="stylesheet" type="text/css" href="../../_static/bootstrap-sphinx.css?v=4468db6d" />
<link rel="stylesheet" type="text/css" href="../../_static/graphviz.css?v=fd3f3429" />
<script src="../../_static/documentation_options.js?v=5929fcd5"></script>
<script src="../../_static/doctools.js?v=9a2dae69"></script>
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
<link rel="index" title="Index" href="../../genindex.html" />
<link rel="search" title="Search" href="../../search.html" />
<meta charset='utf-8'>
Expand Down Expand Up @@ -102,7 +100,18 @@

<div class="container">
<div class="row">
<div class="body col-md-12 content" role="main">
<div class="col-md-3">
<div id="sidebar" class="bs-sidenav" role="complementary">
<form action="../../search.html" method="get">
<div class="form-group">
<input type="text" name="q" class="form-control" placeholder="Search" />
</div>
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="body col-md-9 content" role="main">

<h1>Source code for PyWGCNA.utils</h1><div class="highlight"><pre>
<span></span><span class="kn">import</span> <span class="nn">pickle</span>
Expand All @@ -128,8 +137,10 @@ <h1>Source code for PyWGCNA.utils</h1><div class="highlight"><pre>


<span class="c1"># read WGCNA obj</span>
<div class="viewcode-block" id="readWGCNA"><a class="viewcode-back" href="../../api.html#PyWGCNA.utils.readWGCNA">[docs]</a><span class="k">def</span> <span class="nf">readWGCNA</span><span class="p">(</span><span class="n">file</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<div class="viewcode-block" id="readWGCNA">
<a class="viewcode-back" href="../../api.html#PyWGCNA.utils.readWGCNA">[docs]</a>
<span class="k">def</span> <span class="nf">readWGCNA</span><span class="p">(</span><span class="n">file</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Read a WGCNA from a saved pickle file.</span>

<span class="sd"> :param file: Name / path of WGCNA object</span>
Expand All @@ -148,9 +159,12 @@ <h1>Source code for PyWGCNA.utils</h1><div class="highlight"><pre>
<span class="k">return</span> <span class="n">wgcna</span></div>



<span class="c1"># compare serveral networks</span>
<div class="viewcode-block" id="compareNetworks"><a class="viewcode-back" href="../../api.html#PyWGCNA.utils.compareNetworks">[docs]</a><span class="k">def</span> <span class="nf">compareNetworks</span><span class="p">(</span><span class="n">PyWGCNAs</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<div class="viewcode-block" id="compareNetworks">
<a class="viewcode-back" href="../../api.html#PyWGCNA.utils.compareNetworks">[docs]</a>
<span class="k">def</span> <span class="nf">compareNetworks</span><span class="p">(</span><span class="n">PyWGCNAs</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Compare serveral PyWGCNA objects</span>
<span class="sd"> </span>
<span class="sd"> :param PyWGCNAs: list of PyWGCNA objects</span>
Expand All @@ -168,9 +182,12 @@ <h1>Source code for PyWGCNA.utils</h1><div class="highlight"><pre>
<span class="k">return</span> <span class="n">compare</span></div>



<span class="c1"># compare WGCNA to single cell</span>
<div class="viewcode-block" id="compareSingleCell"><a class="viewcode-back" href="../../api.html#PyWGCNA.utils.compareSingleCell">[docs]</a><span class="k">def</span> <span class="nf">compareSingleCell</span><span class="p">(</span><span class="n">PyWGCNAs</span><span class="p">,</span> <span class="n">sc</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<div class="viewcode-block" id="compareSingleCell">
<a class="viewcode-back" href="../../api.html#PyWGCNA.utils.compareSingleCell">[docs]</a>
<span class="k">def</span> <span class="nf">compareSingleCell</span><span class="p">(</span><span class="n">PyWGCNAs</span><span class="p">,</span> <span class="n">sc</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Compare WGCNA and gene marker from single cell experiment</span>

<span class="sd"> :param PyWGCNAs: WGCNA object</span>
Expand All @@ -192,11 +209,14 @@ <h1>Source code for PyWGCNA.utils</h1><div class="highlight"><pre>
<span class="k">return</span> <span class="n">compare</span></div>


<div class="viewcode-block" id="getGeneList"><a class="viewcode-back" href="../../api.html#PyWGCNA.utils.getGeneList">[docs]</a><span class="k">def</span> <span class="nf">getGeneList</span><span class="p">(</span><span class="n">dataset</span><span class="o">=</span><span class="s1">&#39;mmusculus_gene_ensembl&#39;</span><span class="p">,</span>

<div class="viewcode-block" id="getGeneList">
<a class="viewcode-back" href="../../api.html#PyWGCNA.utils.getGeneList">[docs]</a>
<span class="k">def</span> <span class="nf">getGeneList</span><span class="p">(</span><span class="n">dataset</span><span class="o">=</span><span class="s1">&#39;mmusculus_gene_ensembl&#39;</span><span class="p">,</span>
<span class="n">attributes</span><span class="o">=</span><span class="p">[</span><span class="s1">&#39;ensembl_gene_id&#39;</span><span class="p">,</span> <span class="s1">&#39;external_gene_name&#39;</span><span class="p">,</span> <span class="s1">&#39;gene_biotype&#39;</span><span class="p">],</span>
<span class="n">maps</span><span class="o">=</span><span class="p">[</span><span class="s1">&#39;gene_id&#39;</span><span class="p">,</span> <span class="s1">&#39;gene_name&#39;</span><span class="p">,</span> <span class="s1">&#39;go_id&#39;</span><span class="p">],</span>
<span class="n">server_domain</span><span class="o">=</span><span class="s2">&quot;http://ensembl.org/biomart&quot;</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> get table that map gene ensembl id to gene name from biomart</span>

<span class="sd"> :param dataset: name of the dataset we used from biomart; mouse: mmusculus_gene_ensembl and human: hsapiens_gene_ensembl</span>
Expand Down Expand Up @@ -246,11 +266,14 @@ <h1>Source code for PyWGCNA.utils</h1><div class="highlight"><pre>
<span class="k">return</span> <span class="n">geneInfo</span></div>


<div class="viewcode-block" id="getGeneListGOid"><a class="viewcode-back" href="../../api.html#PyWGCNA.utils.getGeneListGOid">[docs]</a><span class="k">def</span> <span class="nf">getGeneListGOid</span><span class="p">(</span><span class="n">dataset</span><span class="o">=</span><span class="s1">&#39;mmusculus_gene_ensembl&#39;</span><span class="p">,</span>

<div class="viewcode-block" id="getGeneListGOid">
<a class="viewcode-back" href="../../api.html#PyWGCNA.utils.getGeneListGOid">[docs]</a>
<span class="k">def</span> <span class="nf">getGeneListGOid</span><span class="p">(</span><span class="n">dataset</span><span class="o">=</span><span class="s1">&#39;mmusculus_gene_ensembl&#39;</span><span class="p">,</span>
<span class="n">attributes</span><span class="o">=</span><span class="p">[</span><span class="s1">&#39;ensembl_gene_id&#39;</span><span class="p">,</span> <span class="s1">&#39;external_gene_name&#39;</span><span class="p">,</span> <span class="s1">&#39;go_id&#39;</span><span class="p">],</span>
<span class="n">Goid</span><span class="o">=</span><span class="s1">&#39;GO:0003700&#39;</span><span class="p">,</span>
<span class="n">server_domain</span><span class="o">=</span><span class="s2">&quot;http://ensembl.org/biomart&quot;</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> get table that find gene id and gene name to specific Go term from biomart</span>

<span class="sd"> :param dataset: name of the dataset we used from biomart; mouse: mmusculus_gene_ensembl and human: hsapiens_gene_ensembl</span>
Expand Down Expand Up @@ -300,9 +323,12 @@ <h1>Source code for PyWGCNA.utils</h1><div class="highlight"><pre>
<span class="k">return</span> <span class="n">geneInfo</span></div>



<span class="c1"># read comparison obj</span>
<div class="viewcode-block" id="readComparison"><a class="viewcode-back" href="../../api.html#PyWGCNA.utils.readComparison">[docs]</a><span class="k">def</span> <span class="nf">readComparison</span><span class="p">(</span><span class="n">file</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<div class="viewcode-block" id="readComparison">
<a class="viewcode-back" href="../../api.html#PyWGCNA.utils.readComparison">[docs]</a>
<span class="k">def</span> <span class="nf">readComparison</span><span class="p">(</span><span class="n">file</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Read a comparison from a saved pickle file.</span>

<span class="sd"> :param file: Name / path of comparison object</span>
Expand All @@ -319,6 +345,7 @@ <h1>Source code for PyWGCNA.utils</h1><div class="highlight"><pre>

<span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;</span><span class="si">{</span><span class="n">BOLD</span><span class="si">}{</span><span class="n">OKBLUE</span><span class="si">}</span><span class="s2">Reading comparison done!</span><span class="si">{</span><span class="n">ENDC</span><span class="si">}</span><span class="s2">&quot;</span><span class="p">)</span>
<span class="k">return</span> <span class="n">comparison</span></div>

</pre></div>

</div>
Expand All @@ -333,7 +360,7 @@ <h1>Source code for PyWGCNA.utils</h1><div class="highlight"><pre>
</p>
<p>
&copy; Copyright 2022, Narges Rezaie.<br/>
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 5.0.2.<br/>
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 7.4.7.<br/>
</p>
</div>
</footer>
Expand Down
Loading

0 comments on commit b4c4d27

Please sign in to comment.