Skip to content

Commit

Permalink
Deploying to gh-pages from @ d4d0beb 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
jkanche committed Dec 30, 2023
1 parent dfc5f4e commit 8aacccc
Show file tree
Hide file tree
Showing 24 changed files with 1,516 additions and 880 deletions.
2 changes: 1 addition & 1 deletion .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: 6d2d40649fbf85e077e1288bf76b90f4
config: 8a374754974aedcf2b3cadae5ceb969c
tags: 645f666f9bcd5a90fca523b33c5a78b7
10 changes: 5 additions & 5 deletions _modules/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta name="color-scheme" content="light dark"><link rel="index" title="Index" href="../genindex.html" /><link rel="search" title="Search" href="../search.html" />

<!-- Generated with Sphinx 7.2.6 and Furo 2023.09.10 -->
<title>Overview: module code - SingleCellExperiment 0.3.3 documentation</title>
<title>Overview: module code - SingleCellExperiment 0.4.0 documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="../_static/styles/furo.css?v=135e06be" />
<link rel="stylesheet" type="text/css" href="../_static/styles/furo-extensions.css?v=36a5483c" />
Expand Down Expand Up @@ -122,7 +122,7 @@
</label>
</div>
<div class="header-center">
<a href="../index.html"><div class="brand">SingleCellExperiment 0.3.3 documentation</div></a>
<a href="../index.html"><div class="brand">SingleCellExperiment 0.4.0 documentation</div></a>
</div>
<div class="header-right">
<div class="theme-toggle-container theme-toggle-header">
Expand All @@ -145,7 +145,7 @@
<div class="sidebar-sticky"><a class="sidebar-brand" href="../index.html">


<span class="sidebar-brand-text">SingleCellExperiment 0.3.3 documentation</span>
<span class="sidebar-brand-text">SingleCellExperiment 0.4.0 documentation</span>

</a><form class="sidebar-search-container" method="get" action="../search.html" role="search">
<input class="sidebar-search" placeholder="Search" name="q" aria-label="Search">
Expand Down Expand Up @@ -207,7 +207,7 @@
<article role="main">
<h1>All modules for which code is available</h1>
<ul><li><a href="singlecellexperiment/SingleCellExperiment.html">singlecellexperiment.SingleCellExperiment</a></li>
<li><a href="singlecellexperiment/io/anndata.html">singlecellexperiment.io.anndata</a></li>
<li><a href="singlecellexperiment/io/h5ad.html">singlecellexperiment.io.h5ad</a></li>
<li><a href="singlecellexperiment/io/tenx.html">singlecellexperiment.io.tenx</a></li>
</ul>
</article>
Expand Down Expand Up @@ -241,7 +241,7 @@ <h1>All modules for which code is available</h1>

</aside>
</div>
</div><script src="../_static/documentation_options.js?v=d5a15cff"></script>
</div><script src="../_static/documentation_options.js?v=6c02275b"></script>
<script src="../_static/doctools.js?v=888ff710"></script>
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../_static/scripts/furo.js?v=32e29ea5"></script>
Expand Down
1,317 changes: 924 additions & 393 deletions _modules/singlecellexperiment/SingleCellExperiment.html

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta name="color-scheme" content="light dark"><link rel="index" title="Index" href="../../../genindex.html" /><link rel="search" title="Search" href="../../../search.html" />

<!-- Generated with Sphinx 7.2.6 and Furo 2023.09.10 -->
<title>singlecellexperiment.io.anndata - SingleCellExperiment 0.3.3 documentation</title>
<title>singlecellexperiment.io.h5ad - SingleCellExperiment 0.4.0 documentation</title>
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="../../../_static/styles/furo.css?v=135e06be" />
<link rel="stylesheet" type="text/css" href="../../../_static/styles/furo-extensions.css?v=36a5483c" />
Expand Down Expand Up @@ -122,7 +122,7 @@
</label>
</div>
<div class="header-center">
<a href="../../../index.html"><div class="brand">SingleCellExperiment 0.3.3 documentation</div></a>
<a href="../../../index.html"><div class="brand">SingleCellExperiment 0.4.0 documentation</div></a>
</div>
<div class="header-right">
<div class="theme-toggle-container theme-toggle-header">
Expand All @@ -145,7 +145,7 @@
<div class="sidebar-sticky"><a class="sidebar-brand" href="../../../index.html">


<span class="sidebar-brand-text">SingleCellExperiment 0.3.3 documentation</span>
<span class="sidebar-brand-text">SingleCellExperiment 0.4.0 documentation</span>

</a><form class="sidebar-search-container" method="get" action="../../../search.html" role="search">
<input class="sidebar-search" placeholder="Search" name="q" aria-label="Search">
Expand Down Expand Up @@ -205,87 +205,30 @@
</label>
</div>
<article role="main">
<h1>Source code for singlecellexperiment.io.anndata</h1><div class="highlight"><pre>
<span></span><span class="kn">from</span> <span class="nn">collections</span> <span class="kn">import</span> <span class="n">OrderedDict</span>

<span class="kn">from</span> <span class="nn">biocframe</span> <span class="kn">import</span> <span class="n">from_pandas</span>

<span class="kn">from</span> <span class="nn">..SingleCellExperiment</span> <span class="kn">import</span> <span class="n">SingleCellExperiment</span>

<span class="k">try</span><span class="p">:</span>
<span class="kn">from</span> <span class="nn">anndata</span> <span class="kn">import</span> <span class="n">AnnData</span>
<span class="k">except</span> <span class="ne">ImportError</span><span class="p">:</span>
<span class="k">pass</span>
<h1>Source code for singlecellexperiment.io.h5ad</h1><div class="highlight"><pre>
<span></span><span class="kn">from</span> <span class="nn">..SingleCellExperiment</span> <span class="kn">import</span> <span class="n">SingleCellExperiment</span>

<span class="n">__author__</span> <span class="o">=</span> <span class="s2">&quot;jkanche&quot;</span>
<span class="n">__copyright__</span> <span class="o">=</span> <span class="s2">&quot;jkanche&quot;</span>
<span class="n">__license__</span> <span class="o">=</span> <span class="s2">&quot;MIT&quot;</span>


<span class="k">def</span> <span class="nf">_to_normal_dict</span><span class="p">(</span><span class="n">obj</span><span class="p">):</span>
<span class="n">norm_obj</span> <span class="o">=</span> <span class="n">obj</span>
<span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">norm_obj</span><span class="o">.</span><span class="n">keys</span><span class="p">())</span> <span class="o">==</span> <span class="mi">0</span><span class="p">:</span>
<span class="n">norm_obj</span> <span class="o">=</span> <span class="kc">None</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">norm_obj</span> <span class="o">=</span> <span class="n">OrderedDict</span><span class="p">()</span>
<span class="k">for</span> <span class="n">okey</span><span class="p">,</span> <span class="n">oval</span> <span class="ow">in</span> <span class="n">norm_obj</span><span class="o">.</span><span class="n">items</span><span class="p">():</span>
<span class="n">norm_obj</span><span class="p">[</span><span class="n">okey</span><span class="p">]</span> <span class="o">=</span> <span class="n">oval</span>

<span class="k">return</span> <span class="n">norm_obj</span>


<div class="viewcode-block" id="from_anndata">
<a class="viewcode-back" href="../../../api/singlecellexperiment.io.html#singlecellexperiment.io.anndata.from_anndata">[docs]</a>
<span class="k">def</span> <span class="nf">from_anndata</span><span class="p">(</span><span class="n">adata</span><span class="p">:</span> <span class="n">AnnData</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">SingleCellExperiment</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Read an :py:class:`~anndata.AnnData` into</span>
<span class="sd"> :py:class:`~singlecellexperiment.SingleCellExperiment.SingleCellExperiment`.</span>

<span class="sd"> Args:</span>
<span class="sd"> adata (AnnData): Input data.</span>

<span class="sd"> Returns:</span>
<span class="sd"> SingleCellExperiment: A single-cell experiment object.</span>
<span class="sd"> &quot;&quot;&quot;</span>

<span class="n">layers</span> <span class="o">=</span> <span class="n">OrderedDict</span><span class="p">()</span>
<span class="k">for</span> <span class="n">asy</span><span class="p">,</span> <span class="n">mat</span> <span class="ow">in</span> <span class="n">adata</span><span class="o">.</span><span class="n">layers</span><span class="o">.</span><span class="n">items</span><span class="p">():</span>
<span class="n">layers</span><span class="p">[</span><span class="n">asy</span><span class="p">]</span> <span class="o">=</span> <span class="n">mat</span><span class="o">.</span><span class="n">transpose</span><span class="p">()</span>

<span class="k">if</span> <span class="n">adata</span><span class="o">.</span><span class="n">X</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
<span class="n">layers</span><span class="p">[</span><span class="s2">&quot;X&quot;</span><span class="p">]</span> <span class="o">=</span> <span class="n">adata</span><span class="o">.</span><span class="n">X</span><span class="o">.</span><span class="n">transpose</span><span class="p">()</span>

<span class="n">obsm</span> <span class="o">=</span> <span class="n">_to_normal_dict</span><span class="p">(</span><span class="n">adata</span><span class="o">.</span><span class="n">obsm</span><span class="p">)</span>
<span class="n">varp</span> <span class="o">=</span> <span class="n">_to_normal_dict</span><span class="p">(</span><span class="n">adata</span><span class="o">.</span><span class="n">varp</span><span class="p">)</span>
<span class="n">obsp</span> <span class="o">=</span> <span class="n">_to_normal_dict</span><span class="p">(</span><span class="n">adata</span><span class="o">.</span><span class="n">obsp</span><span class="p">)</span>

<span class="k">return</span> <span class="n">SingleCellExperiment</span><span class="p">(</span>
<span class="n">assays</span><span class="o">=</span><span class="n">layers</span><span class="p">,</span>
<span class="n">row_data</span><span class="o">=</span><span class="n">from_pandas</span><span class="p">(</span><span class="n">adata</span><span class="o">.</span><span class="n">var</span><span class="p">),</span>
<span class="n">col_data</span><span class="o">=</span><span class="n">from_pandas</span><span class="p">(</span><span class="n">adata</span><span class="o">.</span><span class="n">obs</span><span class="p">),</span>
<span class="n">metadata</span><span class="o">=</span><span class="n">adata</span><span class="o">.</span><span class="n">uns</span><span class="p">,</span>
<span class="n">reduced_dims</span><span class="o">=</span><span class="n">obsm</span><span class="p">,</span>
<span class="n">row_pairs</span><span class="o">=</span><span class="n">varp</span><span class="p">,</span>
<span class="n">col_pairs</span><span class="o">=</span><span class="n">obsp</span><span class="p">,</span>
<span class="p">)</span></div>



<div class="viewcode-block" id="read_h5ad">
<a class="viewcode-back" href="../../../api/singlecellexperiment.io.html#singlecellexperiment.io.anndata.read_h5ad">[docs]</a>
<a class="viewcode-back" href="../../../api/singlecellexperiment.io.html#singlecellexperiment.io.h5ad.read_h5ad">[docs]</a>
<span class="k">def</span> <span class="nf">read_h5ad</span><span class="p">(</span><span class="n">path</span><span class="p">:</span> <span class="nb">str</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="n">SingleCellExperiment</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Read a H5ad file as :py:class:`~singlecellexperiment.SingleCellExperiment.SingleCellExperiment`.</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Create a ``SingleCellExperiment`` from a H5AD file.</span>

<span class="sd"> Args:</span>
<span class="sd"> path (str): Path to a H5AD file.</span>
<span class="sd"> path:</span>
<span class="sd"> Path to a H5AD file.</span>

<span class="sd"> Returns:</span>
<span class="sd"> SingleCellExperiment: A single-cell experiment object.</span>
<span class="sd"> A ``SingleCellExperiment`` object.</span>
<span class="sd"> &quot;&quot;&quot;</span>

<span class="kn">import</span> <span class="nn">anndata</span>

<span class="n">adata</span> <span class="o">=</span> <span class="n">anndata</span><span class="o">.</span><span class="n">read_h5ad</span><span class="p">(</span><span class="n">path</span><span class="p">)</span>
<span class="k">return</span> <span class="n">from_anndata</span><span class="p">(</span><span class="n">adata</span><span class="p">)</span></div>
<span class="k">return</span> <span class="n">SingleCellExperiment</span><span class="o">.</span><span class="n">from_anndata</span><span class="p">(</span><span class="n">adata</span><span class="p">)</span></div>

</pre></div>
</article>
Expand Down Expand Up @@ -319,7 +262,7 @@ <h1>Source code for singlecellexperiment.io.anndata</h1><div class="highlight"><

</aside>
</div>
</div><script src="../../../_static/documentation_options.js?v=d5a15cff"></script>
</div><script src="../../../_static/documentation_options.js?v=6c02275b"></script>
<script src="../../../_static/doctools.js?v=888ff710"></script>
<script src="../../../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../../../_static/scripts/furo.js?v=32e29ea5"></script>
Expand Down
23 changes: 13 additions & 10 deletions _modules/singlecellexperiment/io/tenx.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta name="color-scheme" content="light dark"><link rel="index" title="Index" href="../../../genindex.html" /><link rel="search" title="Search" href="../../../search.html" />

<!-- Generated with Sphinx 7.2.6 and Furo 2023.09.10 -->
<title>singlecellexperiment.io.tenx - SingleCellExperiment 0.3.3 documentation</title>
<title>singlecellexperiment.io.tenx - SingleCellExperiment 0.4.0 documentation</title>
<link rel="stylesheet" type="text/css" href="../../../_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="../../../_static/styles/furo.css?v=135e06be" />
<link rel="stylesheet" type="text/css" href="../../../_static/styles/furo-extensions.css?v=36a5483c" />
Expand Down Expand Up @@ -122,7 +122,7 @@
</label>
</div>
<div class="header-center">
<a href="../../../index.html"><div class="brand">SingleCellExperiment 0.3.3 documentation</div></a>
<a href="../../../index.html"><div class="brand">SingleCellExperiment 0.4.0 documentation</div></a>
</div>
<div class="header-right">
<div class="theme-toggle-container theme-toggle-header">
Expand All @@ -145,7 +145,7 @@
<div class="sidebar-sticky"><a class="sidebar-brand" href="../../../index.html">


<span class="sidebar-brand-text">SingleCellExperiment 0.3.3 documentation</span>
<span class="sidebar-brand-text">SingleCellExperiment 0.4.0 documentation</span>

</a><form class="sidebar-search-container" method="get" action="../../../search.html" role="search">
<input class="sidebar-search" placeholder="Search" name="q" aria-label="Search">
Expand Down Expand Up @@ -223,13 +223,15 @@ <h1>Source code for singlecellexperiment.io.tenx</h1><div class="highlight"><pre
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Read 10X Matrix market directory as :py:class:`~singlecellexperiment.SingleCellExperiment.SingleCellExperiment`.</span>

<span class="sd"> Args:</span>
<span class="sd"> path (str): Path to 10X MTX directory.</span>
<span class="sd"> path:</span>
<span class="sd"> Path to 10X MTX directory.</span>

<span class="sd"> Directory must contain `matrix.mtx`, and optionally</span>
<span class="sd"> a `genes.tsv` to represent featires and `barcodes.tsv` for cell</span>
<span class="sd"> annotations.</span>

<span class="sd"> Returns:</span>
<span class="sd"> SingleCellExperiment: A single-cell experiment object.</span>
<span class="sd"> A single-cell experiment object.</span>
<span class="sd"> &quot;&quot;&quot;</span>

<span class="kn">import</span> <span class="nn">pandas</span> <span class="k">as</span> <span class="nn">pd</span>
Expand All @@ -248,7 +250,7 @@ <h1>Source code for singlecellexperiment.io.tenx</h1><div class="highlight"><pre
<span class="k">return</span> <span class="n">SingleCellExperiment</span><span class="p">(</span>
<span class="n">assays</span><span class="o">=</span><span class="p">{</span><span class="s2">&quot;counts&quot;</span><span class="p">:</span> <span class="n">mat</span><span class="p">},</span>
<span class="n">row_data</span><span class="o">=</span><span class="n">from_pandas</span><span class="p">(</span><span class="n">genes</span><span class="p">),</span>
<span class="n">col_data</span><span class="o">=</span><span class="n">from_pandas</span><span class="p">(</span><span class="n">cells</span><span class="p">),</span>
<span class="n">column_data</span><span class="o">=</span><span class="n">from_pandas</span><span class="p">(</span><span class="n">cells</span><span class="p">),</span>
<span class="p">)</span></div>


Expand All @@ -261,10 +263,11 @@ <h1>Source code for singlecellexperiment.io.tenx</h1><div class="highlight"><pre
<span class="sd"> Note: Currently only supports version 3 of the 10X H5 format.</span>

<span class="sd"> Args:</span>
<span class="sd"> path (str): Path to 10x H5 file.</span>
<span class="sd"> path:</span>
<span class="sd"> Path to 10x H5 file.</span>

<span class="sd"> Returns:</span>
<span class="sd"> SingleCellExperiment: A single-cell experiment object.</span>
<span class="sd"> A single-cell experiment object.</span>
<span class="sd"> &quot;&quot;&quot;</span>

<span class="kn">import</span> <span class="nn">h5py</span>
Expand Down Expand Up @@ -317,7 +320,7 @@ <h1>Source code for singlecellexperiment.io.tenx</h1><div class="highlight"><pre
<span class="n">barcodes</span> <span class="o">=</span> <span class="n">BiocFrame</span><span class="p">(</span><span class="n">barcodes</span><span class="p">,</span> <span class="n">number_of_rows</span><span class="o">=</span><span class="n">counts</span><span class="o">.</span><span class="n">shape</span><span class="p">[</span><span class="mi">1</span><span class="p">])</span>

<span class="k">return</span> <span class="n">SingleCellExperiment</span><span class="p">(</span>
<span class="n">assays</span><span class="o">=</span><span class="p">{</span><span class="s2">&quot;counts&quot;</span><span class="p">:</span> <span class="n">counts</span><span class="p">},</span> <span class="n">row_data</span><span class="o">=</span><span class="n">features</span><span class="p">,</span> <span class="n">col_data</span><span class="o">=</span><span class="n">barcodes</span>
<span class="n">assays</span><span class="o">=</span><span class="p">{</span><span class="s2">&quot;counts&quot;</span><span class="p">:</span> <span class="n">counts</span><span class="p">},</span> <span class="n">row_data</span><span class="o">=</span><span class="n">features</span><span class="p">,</span> <span class="n">column_data</span><span class="o">=</span><span class="n">barcodes</span>
<span class="p">)</span></div>

</pre></div>
Expand Down Expand Up @@ -352,7 +355,7 @@ <h1>Source code for singlecellexperiment.io.tenx</h1><div class="highlight"><pre

</aside>
</div>
</div><script src="../../../_static/documentation_options.js?v=d5a15cff"></script>
</div><script src="../../../_static/documentation_options.js?v=6c02275b"></script>
<script src="../../../_static/doctools.js?v=888ff710"></script>
<script src="../../../_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="../../../_static/scripts/furo.js?v=32e29ea5"></script>
Expand Down
Loading

0 comments on commit 8aacccc

Please sign in to comment.