Skip to content

Commit

Permalink
updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
WQ-CHENG committed Jul 23, 2024
1 parent 67a6901 commit f740063
Show file tree
Hide file tree
Showing 18 changed files with 41 additions and 44 deletions.
8 changes: 4 additions & 4 deletions docs/analysis/cell_idx/step1-cell_SGE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Step1. Prepare Cell-indexed Spatial Digital Gene Expression Matrix
# Step1. Prepare Cell-indexed Spatial Digital Gene Expression (SGE) Matrix

## Set Up Computing Environment

Expand Down Expand Up @@ -33,7 +33,7 @@ prefix=<output_prefix> ## Replace with your out

## Step 1.1 Prepare Histology-based Cell Segmentation Mask Matrix

To construct a cell-indexed spatial digital gene expression matrix (SGE), begin by executing histology-based cell segmentation using external methodologies, such as [Watershed](https://imagej.net/imaging/watershed) or [Cellpose](https://github.com/MouseLand/cellpose). Details for performing histology-based cell segmentation using [Watershed](https://imagej.net/imaging/watershed) and [Cellpose](https://github.com/MouseLand/cellpose) are provided in the [NovaScope Protocol paper](../../index.md#references).
To construct a cell-indexed spatial digital gene expression (SGE) matrix, begin by executing histology-based cell segmentation using external methodologies, such as [Watershed](https://imagej.net/imaging/watershed) or [Cellpose](https://github.com/MouseLand/cellpose). Details for performing histology-based cell segmentation using [Watershed](https://imagej.net/imaging/watershed) and [Cellpose](https://github.com/MouseLand/cellpose) are provided in the [NovaScope Protocol paper](../../index.md#references).

!!! note

Expand Down Expand Up @@ -69,9 +69,9 @@ Examples:
### Cellpose
Cellpose produces an `npy` file that serves as the segmentation mask matrix in `NumPy` array format. No additional action is required with NEDA.

## Step1.2 Create cell-indexed spatial digital gene expression matrix
## Step1.2 Create cell-indexed SGE matrix

Use the histology-based cell segmentation mask matrix file from [Step1.1](#step-11-prepare-histology-based-cell-segmentation-mask-matrix) to aggregate spatial transcriptomic data at the cellular level. NEDA’s `make_sge_from_npy.py` script is utilized here. Note that the npy file from [Watershed](https://imagej.net/imaging/watershed) and [Cellpose](https://github.com/MouseLand/cellpose) differs, so the script requires specifying the `--approach`. This step creates a cell-indexed SGE in 10x genomics format.
Use the histology-based cell segmentation mask matrix file from [Step1.1](#step-11-prepare-histology-based-cell-segmentation-mask-matrix) to aggregate the input SGE matrix at the cellular level. NEDA’s `make_sge_from_npy.py` script is utilized here. Note that the `npy` file from [Watershed](https://imagej.net/imaging/watershed) and [Cellpose](https://github.com/MouseLand/cellpose) differs, so the script requires specifying the `--approach`. This step creates a cell-indexed SGE in 10X Genomics format.

### Watershed

Expand Down
4 changes: 1 addition & 3 deletions docs/analysis/cell_idx/step2-Seurat-clustering.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ Parameters:
* `--Y_col`: Specify which part of the hexagon ID corresponds to the Y coordinate. As the Y coordinate is the second component in the example case, it should set to 2. Default: 4.
* `--nFeature_RNA_cutoff`: Cutoff value for filtering hexagons by nFeature_RNA. Since this cell-indexed SGE is derived from histology files, `nFeature_RNA_cutoff` is set to be 0.


Commands:
```bash
Rscript ${neda}/scripts/seurat_analysis.R \
Expand All @@ -40,5 +39,4 @@ Rscript ${neda}/scripts/seurat_analysis.R \
--X_col 1 \
--Y_col 2 \
--nFeature_RNA_cutoff 0
```

```
2 changes: 1 addition & 1 deletion docs/analysis/hex_idx/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ Each step contains detailed instructions for:

## An Overview
![overview_brief](./ST_overview.png)
**Figure 1: A Brief Overview of the Inputs, Outputs, and Process Steps for Pixel-level Analysis.**
**Figure 1: A Brief Overview of the Inputs, Outputs, and Process Steps for Pixel-level Analysis.**
2 changes: 1 addition & 1 deletion docs/analysis/hex_idx/job_config.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ If you wish to customize these defaults, refer to the `AUXILIARY PARAMS` section
# Mandatory Fields
#=========================
## Input files
input_transcripts=/path/to/the/transcripts/file ## Path to the input spatial digital gene expression matrix (SGE) in FICTURE-compatible TSV format.
input_transcripts=/path/to/the/transcripts/file ## Path to the input spatial digital gene expression (SGE) matrix in FICTURE-compatible TSV format.
input_features=/path/to/the/feature/file ## Path to the input feature file.
input_xyrange=/path/to/the/xyrange ## Path to the input meta file with minimum and maximum X Y coordinates.
Expand Down
6 changes: 3 additions & 3 deletions docs/analysis/hex_idx/prepare_data.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Preparing Input Dataset

The input spatial transcriptomics data can be generated using [NovaScope](https://github.com/seqscope/NovaScope/tree/main).
The input spatial digital gene expression (SGE) matrix can be generated using [NovaScope](https://github.com/seqscope/NovaScope/tree/main).

## Input Files:
The following files are essential and can be prepared using NovaScope:

### (1) A Spatial Digital Gene Expression (SGE) Matrix in TSV format

* Description: A Spatial Digital Gene Expression (SGE) matrix in **FICTURE-compatible TSV format**, containing information of spatial barcode, gene, and UMI count for each genomic feature by barcode and gene.
* Description: A SGE matrix in **FICTURE-compatible TSV format**, containing information of spatial barcode, gene, and UMI count for each genomic feature by barcode and gene.
* Preparation: NovaScope facilitates the preparation of a raw SGE matrix via [Rule sdgeAR_reformat](https://seqscope.github.io/NovaScope/fulldoc/rules/sdgeAR_reformat) and a filtered SGE matrix via [Rule sdgeAR_polygonfilter](https://seqscope.github.io/NovaScope/fulldoc/rules/sdgeAR_polygonfilter). Both can serve as input files for NEDA. The filtered SGE matrix undergoes gene filtering and density-based polygon filtering in this format. Users can select the option that best suits their requirements. Our example uses the filtered SGE matrix as input.

### (2) A Tab-Delimited Feature File
Expand All @@ -29,4 +29,4 @@ The following files are essential and can be prepared using NovaScope:
* For Seurat+FICTURE analysis, supply a hexagon-indexed SGE matrix in 10x Genomics format. This file can be generated using Rule [sdgeAR_segment_10x](https://seqscope.github.io/NovaScope/fulldoc/rules/c04_sdgeAR_segment_10x) in NovaScope.

## Example Datasets
Alternatively, NEDA offers three example datasets, each suitable for input in spatial transcriptomic analysis within NEDA. For detailed information on these datasets and instructions on how to download them, see [Accessing Example Datasets](../../installation/example_data.md#input-for-spatial-transcriptomic-analysis).
Alternatively, NEDA offers three example datasets for this pixel-level analysis. For detailed information on these datasets and instructions on how to download them, see [Accessing Example Datasets](../../installation/example_data.md#input-for-spatial-transcriptomic-analysis).
1 change: 0 additions & 1 deletion docs/analysis/hex_idx/step4-decode.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ decode_prefix="${train_prefix}.decode.prj_${fit_width}.r_${anchor_dist}_${neighb
* `neighbor_radius`: represents the radius (um) of each anchor point's territory. By default, `neighbor_radius = anchor_dist + 1`.
* Other variables applied above are in the [Job Configuration](./job_config.md).


## Step 4.1 pixel-level Decoding.
Decode the model matrix on individual pixels, which returns a tab-delimited file of the posterior count of factors on individual pixels.

Expand Down
2 changes: 1 addition & 1 deletion docs/home/documentation_overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ The current documentation include the following sections:

* [Introduction](../analysis/cell_idx/intro.md): An Overview of the prelimary single-cell analysis.
* [Preparing Input Data](../analysis/cell_idx/prepare_data.md): Details of required input files.
* [Create Cell-indexed SGE](../analysis/cell_idx/step1-cell_SGE.md): Computing environment setup and preparation of a cell-indexed spatial digital gene expression matrix.
* [Create Cell-indexed SGE](../analysis/cell_idx/step1-cell_SGE.md): Computing environment setup and preparation of a cell-indexed spatial digital gene expression (SGE) matrix.
* [Seurat Clustering](../analysis/cell_idx/step2-Seurat-clustering.md): Application of multi-dimensional clustering with `Seurat` for cell type factor inference.
8 changes: 4 additions & 4 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
## Introduction
This document serves as a guide for exemplary downstream analysis of spatial transcriptomics data generated from [NovaScope](https://github.com/seqscope/NovaScope/tree/main). The main functionalities include:

1) **[Pixel-level Analysis](./analysis/hex_idx/intro.md)**:
This feature enables the identification of spatial factors at a pixel-level resolution using a hexagon-indexed spatial digital gene expression matrix (SGE).
1) **[Pixel-level Analysis](./analysis/hex_idx/intro.md)**:
This feature enables the identification of spatial factors at a pixel-level resolution using a hexagon-indexed spatial digital gene expression (SGE) matrix.

2) **[Cell Segmentation-based Analysis](./analysis/cell_idx/intro.md)**:
This feature facilitates the aggregation of spatial transcriptomics data at the cellular level based on histology files and supports the analysis of cell type clusters using the cell-indexed SGE.
2) **[Cell Segmentation-based Analysis](./analysis/cell_idx/intro.md)**:
This feature facilitates the aggregation of SGE matrix at the cellular level based on histology files and supports the analysis of cell type clusters using the cell-indexed SGE.

## References
For additional information, please refer to the following links:
Expand Down
4 changes: 2 additions & 2 deletions docs/installation/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ ls -hlt $neda_dir/submodules/ficture

#### 2.2.2 Create a Python Environment

Set up a Python environment for [FICTURE](https://github.com/seqscope/ficture/tree/protocol) as per the [requirement file](https://github.com/seqscope/ficture/blob/8ceb419618c1181bb673255427b53198c4887cfa/requirements.txt). The requirement file is included in the FICTURE repository.
Set up a Python environment for FICTURE as per the [requirement file](https://github.com/seqscope/ficture/blob/8ceb419618c1181bb673255427b53198c4887cfa/requirements.txt). The requirement file is included in the FICTURE repository.

First, ensure the requirements file is accessible:

Expand Down Expand Up @@ -90,7 +90,7 @@ To enable Seurat analysis, install the following required R packages:
* RColorBrewer

```R
## install all required packages in R
## install all required packages in R (need to be done only once)
install.packages(c( "Seurat", "optparse", "patchwork", "dplyr", "tidyverse", "stringr",
"ggplot2", "cowplot", "RColorBrewer"))
```
22 changes: 11 additions & 11 deletions site/analysis/cell_idx/step1-cell_SGE/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
<div data-md-component="skip">


<a href="#step1-prepare-cell-indexed-spatial-digital-gene-expression-matrix" class="md-skip">
<a href="#step1-prepare-cell-indexed-spatial-digital-gene-expression-sge-matrix" class="md-skip">
Skip to content
</a>

Expand Down Expand Up @@ -1108,13 +1108,13 @@
</li>

<li class="md-nav__item">
<a href="#step12-create-cell-indexed-spatial-digital-gene-expression-matrix" class="md-nav__link">
<a href="#step12-create-cell-indexed-sge-matrix" class="md-nav__link">
<span class="md-ellipsis">
Step1.2 Create cell-indexed spatial digital gene expression matrix
Step1.2 Create cell-indexed SGE matrix
</span>
</a>

<nav class="md-nav" aria-label="Step1.2 Create cell-indexed spatial digital gene expression matrix">
<nav class="md-nav" aria-label="Step1.2 Create cell-indexed SGE matrix">
<ul class="md-nav__list">

<li class="md-nav__item">
Expand Down Expand Up @@ -1254,13 +1254,13 @@
</li>

<li class="md-nav__item">
<a href="#step12-create-cell-indexed-spatial-digital-gene-expression-matrix" class="md-nav__link">
<a href="#step12-create-cell-indexed-sge-matrix" class="md-nav__link">
<span class="md-ellipsis">
Step1.2 Create cell-indexed spatial digital gene expression matrix
Step1.2 Create cell-indexed SGE matrix
</span>
</a>

<nav class="md-nav" aria-label="Step1.2 Create cell-indexed spatial digital gene expression matrix">
<nav class="md-nav" aria-label="Step1.2 Create cell-indexed SGE matrix">
<ul class="md-nav__list">

<li class="md-nav__item">
Expand Down Expand Up @@ -1304,7 +1304,7 @@



<h1 id="step1-prepare-cell-indexed-spatial-digital-gene-expression-matrix">Step1. Prepare Cell-indexed Spatial Digital Gene Expression Matrix<a class="headerlink" href="#step1-prepare-cell-indexed-spatial-digital-gene-expression-matrix" title="Permanent link">&para;</a></h1>
<h1 id="step1-prepare-cell-indexed-spatial-digital-gene-expression-sge-matrix">Step1. Prepare Cell-indexed Spatial Digital Gene Expression (SGE) Matrix<a class="headerlink" href="#step1-prepare-cell-indexed-spatial-digital-gene-expression-sge-matrix" title="Permanent link">&para;</a></h1>
<h2 id="set-up-computing-environment">Set Up Computing Environment<a class="headerlink" href="#set-up-computing-environment" title="Permanent link">&para;</a></h2>
<p>Ensure that your computing environment is properly configured before <strong>each</strong> step.</p>
<div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal"> 1</span>
Expand Down Expand Up @@ -1354,7 +1354,7 @@ <h2 id="set-up-computing-environment">Set Up Computing Environment<a class="head
<span class="nv">prefix</span><span class="o">=</span>&lt;output_prefix&gt;<span class="w"> </span><span class="c1">## Replace with your output prefix, e.g., watershed</span>
</code></pre></div></td></tr></table></div>
<h2 id="step-11-prepare-histology-based-cell-segmentation-mask-matrix">Step 1.1 Prepare Histology-based Cell Segmentation Mask Matrix<a class="headerlink" href="#step-11-prepare-histology-based-cell-segmentation-mask-matrix" title="Permanent link">&para;</a></h2>
<p>To construct a cell-indexed spatial digital gene expression matrix (SGE), begin by executing histology-based cell segmentation using external methodologies, such as <a href="https://imagej.net/imaging/watershed">Watershed</a> or <a href="https://github.com/MouseLand/cellpose">Cellpose</a>. Details for performing histology-based cell segmentation using <a href="https://imagej.net/imaging/watershed">Watershed</a> and <a href="https://github.com/MouseLand/cellpose">Cellpose</a> are provided in the <a href="../../../#references">NovaScope Protocol paper</a>. </p>
<p>To construct a cell-indexed spatial digital gene expression (SGE) matrix, begin by executing histology-based cell segmentation using external methodologies, such as <a href="https://imagej.net/imaging/watershed">Watershed</a> or <a href="https://github.com/MouseLand/cellpose">Cellpose</a>. Details for performing histology-based cell segmentation using <a href="https://imagej.net/imaging/watershed">Watershed</a> and <a href="https://github.com/MouseLand/cellpose">Cellpose</a> are provided in the <a href="../../../#references">NovaScope Protocol paper</a>. </p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Irrespective of the segmentation technique used, ensure that the input histology image is <strong>aligned</strong> with the input SGE. </p>
Expand Down Expand Up @@ -1387,8 +1387,8 @@ <h3 id="watershed">Watershed<a class="headerlink" href="#watershed" title="Perma
<strong>Figure 3: A black-and-white cell segmentation TIFF image from <a href="https://imagej.net/imaging/watershed">Watershed</a>.</strong> </p>
<h3 id="cellpose">Cellpose<a class="headerlink" href="#cellpose" title="Permanent link">&para;</a></h3>
<p>Cellpose produces an <code>npy</code> file that serves as the segmentation mask matrix in <code>NumPy</code> array format. No additional action is required with NEDA.</p>
<h2 id="step12-create-cell-indexed-spatial-digital-gene-expression-matrix">Step1.2 Create cell-indexed spatial digital gene expression matrix<a class="headerlink" href="#step12-create-cell-indexed-spatial-digital-gene-expression-matrix" title="Permanent link">&para;</a></h2>
<p>Use the histology-based cell segmentation mask matrix file from <a href="#step-11-prepare-histology-based-cell-segmentation-mask-matrix">Step1.1</a> to aggregate spatial transcriptomic data at the cellular level. NEDA’s <code>make_sge_from_npy.py</code> script is utilized here. Note that the npy file from <a href="https://imagej.net/imaging/watershed">Watershed</a> and <a href="https://github.com/MouseLand/cellpose">Cellpose</a> differs, so the script requires specifying the <code>--approach</code>. This step creates a cell-indexed SGE in 10x genomics format.</p>
<h2 id="step12-create-cell-indexed-sge-matrix">Step1.2 Create cell-indexed SGE matrix<a class="headerlink" href="#step12-create-cell-indexed-sge-matrix" title="Permanent link">&para;</a></h2>
<p>Use the histology-based cell segmentation mask matrix file from <a href="#step-11-prepare-histology-based-cell-segmentation-mask-matrix">Step1.1</a> to aggregate the input SGE matrix at the cellular level. NEDA’s <code>make_sge_from_npy.py</code> script is utilized here. Note that the <code>npy</code> file from <a href="https://imagej.net/imaging/watershed">Watershed</a> and <a href="https://github.com/MouseLand/cellpose">Cellpose</a> differs, so the script requires specifying the <code>--approach</code>. This step creates a cell-indexed SGE in 10X Genomics format.</p>
<h3 id="watershed_1">Watershed<a class="headerlink" href="#watershed_1" title="Permanent link">&para;</a></h3>
<p>Input &amp; Output
<div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">1</span>
Expand Down
2 changes: 1 addition & 1 deletion site/analysis/hex_idx/intro/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1242,7 +1242,7 @@ <h2 id="a-step-by-step-procedure">A Step-by-Step Procedure<a class="headerlink"
</ul>
<h2 id="an-overview">An Overview<a class="headerlink" href="#an-overview" title="Permanent link">&para;</a></h2>
<p><img alt="overview_brief" src="../ST_overview.png" />
<strong>Figure 1: A Brief Overview of the Inputs, Outputs, and Process Steps for Pixel-level Analysis.</strong> </p>
<strong>Figure 1: A Brief Overview of the Inputs, Outputs, and Process Steps for Pixel-level Analysis.</strong></p>



Expand Down
2 changes: 1 addition & 1 deletion site/analysis/hex_idx/job_config/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1250,7 +1250,7 @@ <h2 id="an-input-configuration-template">An Input Configuration Template<a class
# Mandatory Fields
#=========================
## Input files
input_transcripts=/path/to/the/transcripts/file ## Path to the input spatial digital gene expression matrix (SGE) in FICTURE-compatible TSV format.
input_transcripts=/path/to/the/transcripts/file ## Path to the input spatial digital gene expression (SGE) matrix in FICTURE-compatible TSV format.
input_features=/path/to/the/feature/file ## Path to the input feature file.
input_xyrange=/path/to/the/xyrange ## Path to the input meta file with minimum and maximum X Y coordinates.

Expand Down
Loading

0 comments on commit f740063

Please sign in to comment.