Skip to content

Commit

Permalink
Deployed 2f40821 to main with MkDocs 1.5.3 and mike 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Apr 18, 2024
1 parent cc3a96c commit 7ecf1b0
Show file tree
Hide file tree
Showing 6 changed files with 87 additions and 50 deletions.
27 changes: 20 additions & 7 deletions main/computational/from_spacemake/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1729,18 +1729,31 @@ <h2 id="segmentation-dge-creation">Segmentation &amp; DGE creation<a class="head
</span><span id="__span-13-4"><a id="__codelineno-13-4" name="__codelineno-13-4" href="#__codelineno-13-4"></a><span class="w"> </span>segment<span class="w"> </span><span class="se">\</span>
</span><span id="__span-13-5"><a id="__codelineno-13-5" name="__codelineno-13-5" href="#__codelineno-13-5"></a><span class="w"> </span>--model<span class="w"> </span>HE_cellpose_rajewsky<span class="w"> </span><span class="c1"># default model for segmebntation of H&amp;E images</span>
</span></code></pre></div>
<div class="admonition tip">
<p class="admonition-title">Tip</p>
<p>You can assess the quality of the segmentation mask using <code>openst preview</code>, which leverages <code>napari</code> for visualization:</p>
<div class="language-sh highlight"><pre><span></span><code><span id="__span-14-1"><a id="__codelineno-14-1" name="__codelineno-14-1" href="#__codelineno-14-1"></a>openst<span class="w"> </span>from_spacemake<span class="w"> </span><span class="se">\</span>
</span><span id="__span-14-2"><a id="__codelineno-14-2" name="__codelineno-14-2" href="#__codelineno-14-2"></a><span class="w"> </span>--project-id<span class="w"> </span>openst_demo<span class="w"> </span><span class="se">\</span>
</span><span id="__span-14-3"><a id="__codelineno-14-3" name="__codelineno-14-3" href="#__codelineno-14-3"></a><span class="w"> </span>--sample-id<span class="w"> </span>openst_demo_adult_mouse<span class="w"> </span><span class="se">\</span>
</span><span id="__span-14-4"><a id="__codelineno-14-4" name="__codelineno-14-4" href="#__codelineno-14-4"></a><span class="w"> </span>preview<span class="w"> </span><span class="se">\</span>
</span><span id="__span-14-5"><a id="__codelineno-14-5" name="__codelineno-14-5" href="#__codelineno-14-5"></a><span class="w"> </span>--image-key<span class="w"> </span>uns/spatial/staining_image<span class="w"> </span>uns/spatial/staining_image_mask
</span></code></pre></div>
<p>This will create a <code>napari</code> window with two image layers. We recommend changing the mask <em>image</em> layer into a
<a href="https://napari.org/stable/howtos/layers/labels.html"><em>label</em> layer</a>, which is designed for <em>displaying each integer (ID
from the segmentation mask) as a different random color, with background rendered as transparent</em>.</p>
</div>
<p>Then, you can create the DGE from the segmentation and ST data. Make sure to populate the <code>--spatial-key</code> argument with the
proper key depending on whether you ran (semi)automated or fully manual pairwise aligmment.</p>
<div class="language-sh highlight"><pre><span></span><code><span id="__span-14-1"><a id="__codelineno-14-1" name="__codelineno-14-1" href="#__codelineno-14-1"></a>openst<span class="w"> </span>from_spacemake<span class="w"> </span><span class="se">\</span>
</span><span id="__span-14-2"><a id="__codelineno-14-2" name="__codelineno-14-2" href="#__codelineno-14-2"></a><span class="w"> </span>--project-id<span class="w"> </span>openst_demo<span class="w"> </span><span class="se">\</span>
</span><span id="__span-14-3"><a id="__codelineno-14-3" name="__codelineno-14-3" href="#__codelineno-14-3"></a><span class="w"> </span>--sample-id<span class="w"> </span>openst_demo_adult_mouse<span class="w"> </span><span class="se">\</span>
</span><span id="__span-14-4"><a id="__codelineno-14-4" name="__codelineno-14-4" href="#__codelineno-14-4"></a><span class="w"> </span>transcript_assign<span class="w"> </span><span class="se">\</span>
</span><span id="__span-14-5"><a id="__codelineno-14-5" name="__codelineno-14-5" href="#__codelineno-14-5"></a><span class="w"> </span>--spatial-key<span class="w"> </span>obsm/spatial_pairwise_aligned_fine<span class="w"> </span><span class="c1"># default if you ran (semi)automated pipeline</span>
<div class="language-sh highlight"><pre><span></span><code><span id="__span-15-1"><a id="__codelineno-15-1" name="__codelineno-15-1" href="#__codelineno-15-1"></a>openst<span class="w"> </span>from_spacemake<span class="w"> </span><span class="se">\</span>
</span><span id="__span-15-2"><a id="__codelineno-15-2" name="__codelineno-15-2" href="#__codelineno-15-2"></a><span class="w"> </span>--project-id<span class="w"> </span>openst_demo<span class="w"> </span><span class="se">\</span>
</span><span id="__span-15-3"><a id="__codelineno-15-3" name="__codelineno-15-3" href="#__codelineno-15-3"></a><span class="w"> </span>--sample-id<span class="w"> </span>openst_demo_adult_mouse<span class="w"> </span><span class="se">\</span>
</span><span id="__span-15-4"><a id="__codelineno-15-4" name="__codelineno-15-4" href="#__codelineno-15-4"></a><span class="w"> </span>transcript_assign<span class="w"> </span><span class="se">\</span>
</span><span id="__span-15-5"><a id="__codelineno-15-5" name="__codelineno-15-5" href="#__codelineno-15-5"></a><span class="w"> </span>--spatial-key<span class="w"> </span>obsm/spatial_pairwise_aligned_fine<span class="w"> </span><span class="c1"># default if you ran (semi)automated pipeline</span>
</span></code></pre></div>
<h2 id="expected-output">Expected output<a class="headerlink" href="#expected-output" title="Permanent link">&para;</a></h2>
<p>After running all these steps, you will find a <code>stitched_segmented.h5ad</code> file inside the <code>spacemake</code> folder structure, that you can use for analysis:</p>
<div class="language-sh highlight"><pre><span></span><code><span id="__span-15-1"><a id="__codelineno-15-1" name="__codelineno-15-1" href="#__codelineno-15-1"></a><span class="o">(</span>spacemake<span class="o">)</span><span class="w"> </span>user@computer:~/openst_adult_demo/spacemake$<span class="w"> </span>ls<span class="w"> </span>projects/openst_demo/processed_data/openst_demo_adult_mouse/multimodal
</span><span id="__span-15-2"><a id="__codelineno-15-2" name="__codelineno-15-2" href="#__codelineno-15-2"></a>stitched_segmented.h5ad
<div class="language-sh highlight"><pre><span></span><code><span id="__span-16-1"><a id="__codelineno-16-1" name="__codelineno-16-1" href="#__codelineno-16-1"></a><span class="o">(</span>spacemake<span class="o">)</span><span class="w"> </span>user@computer:~/openst_adult_demo/spacemake$<span class="w"> </span>ls<span class="w"> </span>projects/openst_demo/processed_data/openst_demo_adult_mouse/multimodal
</span><span id="__span-16-2"><a id="__codelineno-16-2" name="__codelineno-16-2" href="#__codelineno-16-2"></a>stitched_segmented.h5ad
</span></code></pre></div>


Expand Down
18 changes: 13 additions & 5 deletions main/computational/generate_expression_matrix/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1512,15 +1512,23 @@ <h2 id="segmentation-of-staining-image">Segmentation of staining image<a class="
</span><span id="__span-2-4"><a id="__codelineno-2-4" name="__codelineno-2-4" href="#__codelineno-2-4"></a><span class="w"> </span>--mask-out<span class="w"> </span>uns/spatial/staining_image_mask_combined
</span></code></pre></div>
</div>
<p>You can assess the quality of the segmentation mask using <code>openst preview</code>, which leverages <code>napari</code> for visualization:</p>
<div class="language-sh highlight"><pre><span></span><code><span id="__span-3-1"><a id="__codelineno-3-1" name="__codelineno-3-1" href="#__codelineno-3-1"></a>openst<span class="w"> </span>preview<span class="w"> </span><span class="se">\</span>
</span><span id="__span-3-2"><a id="__codelineno-3-2" name="__codelineno-3-2" href="#__codelineno-3-2"></a><span class="w"> </span>--h5-in<span class="w"> </span>spatial_stitched_spots.h5ad<span class="w"> </span><span class="se">\</span>
</span><span id="__span-3-3"><a id="__codelineno-3-3" name="__codelineno-3-3" href="#__codelineno-3-3"></a><span class="w"> </span>--image-key<span class="w"> </span>uns/spatial/staining_image<span class="w"> </span>uns/spatial/staining_image_mask
</span></code></pre></div>
<p>This will create a <code>napari</code> window with two image layers. We recommend changing the mask <em>image</em> layer into a
<a href="https://napari.org/stable/howtos/layers/labels.html"><em>label</em> layer</a>, which is designed for <em>displaying each integer (ID
from the segmentation mask) as a different random color, with background rendered as transparent</em>.</p>
<h2 id="assigning-transcripts-to-segmented-cells">Assigning transcripts to segmented cells<a class="headerlink" href="#assigning-transcripts-to-segmented-cells" title="Permanent link">&para;</a></h2>
<p>Now, we aggregate the initial <span class="arithmatex">\(N\times G\)</span> matrix into an <span class="arithmatex">\(M\times G\)</span> matrix,
where <span class="arithmatex">\(N\)</span> maps to <span class="arithmatex">\(M\)</span> via the segmentation mask.</p>
<p>This step allows you to associate capture spots with segmented cells.</p>
<div class="language-sh highlight"><pre><span></span><code><span id="__span-3-1"><a id="__codelineno-3-1" name="__codelineno-3-1" href="#__codelineno-3-1"></a>openst<span class="w"> </span>transcript_assign<span class="w"> </span><span class="se">\</span>
</span><span id="__span-3-2"><a id="__codelineno-3-2" name="__codelineno-3-2" href="#__codelineno-3-2"></a><span class="w"> </span>--h5-in<span class="w"> </span>spatial_stitched_spots.h5ad<span class="w"> </span><span class="se">\</span>
</span><span id="__span-3-3"><a id="__codelineno-3-3" name="__codelineno-3-3" href="#__codelineno-3-3"></a><span class="w"> </span>--spatial-key<span class="w"> </span>obsm/spatial_pairwise_aligned_fine<span class="w"> </span><span class="se">\</span>
</span><span id="__span-3-4"><a id="__codelineno-3-4" name="__codelineno-3-4" href="#__codelineno-3-4"></a><span class="w"> </span>--mask-in<span class="w"> </span>uns/spatial/staining_image_mask<span class="w"> </span><span class="se">\</span>
</span><span id="__span-3-5"><a id="__codelineno-3-5" name="__codelineno-3-5" href="#__codelineno-3-5"></a><span class="w"> </span>--h5-out<span class="w"> </span>spatial_per_segmented_cell.h5ad
<div class="language-sh highlight"><pre><span></span><code><span id="__span-4-1"><a id="__codelineno-4-1" name="__codelineno-4-1" href="#__codelineno-4-1"></a>openst<span class="w"> </span>transcript_assign<span class="w"> </span><span class="se">\</span>
</span><span id="__span-4-2"><a id="__codelineno-4-2" name="__codelineno-4-2" href="#__codelineno-4-2"></a><span class="w"> </span>--h5-in<span class="w"> </span>spatial_stitched_spots.h5ad<span class="w"> </span><span class="se">\</span>
</span><span id="__span-4-3"><a id="__codelineno-4-3" name="__codelineno-4-3" href="#__codelineno-4-3"></a><span class="w"> </span>--spatial-key<span class="w"> </span>obsm/spatial_pairwise_aligned_fine<span class="w"> </span><span class="se">\</span>
</span><span id="__span-4-4"><a id="__codelineno-4-4" name="__codelineno-4-4" href="#__codelineno-4-4"></a><span class="w"> </span>--mask-in<span class="w"> </span>uns/spatial/staining_image_mask<span class="w"> </span><span class="se">\</span>
</span><span id="__span-4-5"><a id="__codelineno-4-5" name="__codelineno-4-5" href="#__codelineno-4-5"></a><span class="w"> </span>--h5-out<span class="w"> </span>spatial_per_segmented_cell.h5ad
</span></code></pre></div>
<p>In this case, the argument <code>--mask-in</code> was set to a single mask, but it can be set to the previously
introduced <em>combined</em> masks (e.g., <code>--mask-in uns/spatial/staining_image_mask_combined</code>).</p>
Expand Down
30 changes: 23 additions & 7 deletions main/computational/getting_started/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1523,26 +1523,42 @@ <h3 id="with-pip-recommended">with pip <small>recommended</small><a class="heade
good introduction on the mechanics of Python package management and helps you
troubleshoot if you run into errors.</p>
</div>
<div class="admonition warning">
<p class="admonition-title">Warning</p>
<p>If you have a Mac with Apple Silicon (M1 or later), please install <code>openst</code> on a Rosetta environment
to ensure full compatibility (i.e., <code>openst manual_pairwise_aligner</code> might not work otherwise).
Also, the version of scikit-image pinned in the requirements might not be available for Apple Silicon.
Thus, create an environment and install dependencies as follows (assuming you have installed <code>conda</code>):</p>
<div class="language-bash highlight"><pre><span></span><code><span id="__span-1-1"><a id="__codelineno-1-1" name="__codelineno-1-1" href="#__codelineno-1-1"></a><span class="nv">CONDA_SUBDIR</span><span class="o">=</span>osx-64<span class="w"> </span>conda<span class="w"> </span>create<span class="w"> </span>-n<span class="w"> </span>openst<span class="w"> </span><span class="nv">python</span><span class="o">=</span><span class="m">3</span>.11
</span><span id="__span-1-2"><a id="__codelineno-1-2" name="__codelineno-1-2" href="#__codelineno-1-2"></a>conda<span class="w"> </span>install<span class="w"> </span>scikit-image<span class="o">==</span><span class="m">0</span>.19.3
</span><span id="__span-1-3"><a id="__codelineno-1-3" name="__codelineno-1-3" href="#__codelineno-1-3"></a>pip<span class="w"> </span>install<span class="w"> </span>openst
</span></code></pre></div>
<p>When running <code>openst manual_pairwise_aligner</code> for the first time, startup time will be longer than
usual. This is the expected behavior with osx-64 binaries (Rosetta). Also, you can install the optional
<code>napari</code> (used in <code>openst preview</code>):</p>
<div class="language-bash highlight"><pre><span></span><code><span id="__span-2-1"><a id="__codelineno-2-1" name="__codelineno-2-1" href="#__codelineno-2-1"></a>pip<span class="w"> </span>install<span class="w"> </span>napari
</span></code></pre></div>
</div>
<h3 id="with-docker">with docker<a class="headerlink" href="#with-docker" title="Permanent link">&para;</a></h3>
<p>The official <a href="https://hub.docker.com/r/rajewsky/openst/">Docker image</a> is a great way to get up and running in a few
minutes, as it comes with all dependencies pre-installed. Open up a terminal
and pull the image with:</p>
<div class="language-sh highlight"><pre><span></span><code><span id="__span-1-1"><a id="__codelineno-1-1" name="__codelineno-1-1" href="#__codelineno-1-1"></a>docker<span class="w"> </span>pull<span class="w"> </span>rajewsky/openst
<div class="language-sh highlight"><pre><span></span><code><span id="__span-3-1"><a id="__codelineno-3-1" name="__codelineno-3-1" href="#__codelineno-3-1"></a>docker<span class="w"> </span>pull<span class="w"> </span>rajewsky/openst
</span></code></pre></div>
<p>The <code>openst</code> executable is provided as an entry point and <code>serve</code> is the
default command.</p>
<p>You can run a terminal for <code>openst</code> by running
<div class="language-sh highlight"><pre><span></span><code><span id="__span-2-1"><a id="__codelineno-2-1" name="__codelineno-2-1" href="#__codelineno-2-1"></a>docker<span class="w"> </span>run<span class="w"> </span>-it<span class="w"> </span>openst
<div class="language-sh highlight"><pre><span></span><code><span id="__span-4-1"><a id="__codelineno-4-1" name="__codelineno-4-1" href="#__codelineno-4-1"></a>docker<span class="w"> </span>run<span class="w"> </span>-it<span class="w"> </span>openst
</span></code></pre></div></p>
<p>Optionally, you might want to enable X11 redirection to enable GUI support (e.g., for the <code>openst manual_pairwise_aligner</code> tool).
Follow these steps:</p>
<ol>
<li>Install X Server on your host machine if not already installed.</li>
<li>Allow connections to your X Server by running the following command on your host:
<div class="language-sh highlight"><pre><span></span><code><span id="__span-3-1"><a id="__codelineno-3-1" name="__codelineno-3-1" href="#__codelineno-3-1"></a>xhost<span class="w"> </span>+
<div class="language-sh highlight"><pre><span></span><code><span id="__span-5-1"><a id="__codelineno-5-1" name="__codelineno-5-1" href="#__codelineno-5-1"></a>xhost<span class="w"> </span>+
</span></code></pre></div></li>
<li>Run the Docker container with the following additional options:
<div class="language-sh highlight"><pre><span></span><code><span id="__span-4-1"><a id="__codelineno-4-1" name="__codelineno-4-1" href="#__codelineno-4-1"></a>docker<span class="w"> </span>run<span class="w"> </span>-it<span class="w"> </span>--rm<span class="w"> </span>-e<span class="w"> </span><span class="nv">DISPLAY</span><span class="o">=</span><span class="nv">$DISPLAY</span><span class="w"> </span>-v<span class="w"> </span>/tmp/.X11-unix:/tmp/.X11-unix<span class="w"> </span>openst
<div class="language-sh highlight"><pre><span></span><code><span id="__span-6-1"><a id="__codelineno-6-1" name="__codelineno-6-1" href="#__codelineno-6-1"></a>docker<span class="w"> </span>run<span class="w"> </span>-it<span class="w"> </span>--rm<span class="w"> </span>-e<span class="w"> </span><span class="nv">DISPLAY</span><span class="o">=</span><span class="nv">$DISPLAY</span><span class="w"> </span>-v<span class="w"> </span>/tmp/.X11-unix:/tmp/.X11-unix<span class="w"> </span>openst
</span></code></pre></div></li>
</ol>
<p>Now, you can execute PyQt5-based applications, and the GUI will be displayed on your host machine.</p>
Expand All @@ -1552,18 +1568,18 @@ <h3 id="with-docker">with docker<a class="headerlink" href="#with-docker" title=
<li>Ensure that the X Server on your host allows connections (xhost +) before running the container,</li>
<li>Make sure the necessary dependencies are installed on your host machine for PyQt5 applications.</li>
<li>Remember to close the X Server connections after using the container:
<div class="language-sh highlight"><pre><span></span><code><span id="__span-5-1"><a id="__codelineno-5-1" name="__codelineno-5-1" href="#__codelineno-5-1"></a>xhost<span class="w"> </span>-
<div class="language-sh highlight"><pre><span></span><code><span id="__span-7-1"><a id="__codelineno-7-1" name="__codelineno-7-1" href="#__codelineno-7-1"></a>xhost<span class="w"> </span>-
</span></code></pre></div></li>
</ul>
</div>
<h3 id="with-git">with git<a class="headerlink" href="#with-git" title="Permanent link">&para;</a></h3>
<p><code>openst</code> can be directly used from <a href="https://github.com/rajewsky-lab/openst">GitHub</a> by cloning the
repository into a subfolder of your project root which might be useful if you
want to use the very latest version:</p>
<div class="language-text highlight"><pre><span></span><code><span id="__span-6-1"><a id="__codelineno-6-1" name="__codelineno-6-1" href="#__codelineno-6-1"></a>git clone https://github.com/rajewsky-lab/openst.git
<div class="language-text highlight"><pre><span></span><code><span id="__span-8-1"><a id="__codelineno-8-1" name="__codelineno-8-1" href="#__codelineno-8-1"></a>git clone https://github.com/rajewsky-lab/openst.git
</span></code></pre></div>
<p>Next, install the theme and its dependencies with:</p>
<div class="language-text highlight"><pre><span></span><code><span id="__span-7-1"><a id="__codelineno-7-1" name="__codelineno-7-1" href="#__codelineno-7-1"></a>pip install -e openst
<div class="language-text highlight"><pre><span></span><code><span id="__span-9-1"><a id="__codelineno-9-1" name="__codelineno-9-1" href="#__codelineno-9-1"></a>pip install -e openst
</span></code></pre></div>


Expand Down
2 changes: 1 addition & 1 deletion main/search/search_index.json

Large diffs are not rendered by default.

Loading

0 comments on commit 7ecf1b0

Please sign in to comment.