Skip to content

Commit

Permalink
Merge pull request #231 from DendrouLab/sarah_spatial_norm_info
Browse files Browse the repository at this point in the history
Add spatial normalization info
  • Loading branch information
bio-la authored Mar 14, 2024
2 parents c61e5cc + 0c4d791 commit c94a59b
Showing 1 changed file with 23 additions and 14 deletions.
37 changes: 23 additions & 14 deletions docs/usage/normalization_methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Normalization methods
=======================


panpipes currently supports the following normalization methods:
`panpipes` currently supports the following normalization methods:

## RNA

Expand All @@ -16,9 +16,9 @@ Additionally, the normalized data can be scaled using scanpy's [sc.pp.scale](htt
1. clr margin= 0, normalize within each cells' counts distribution, across all features (row-wise, as you would do for RNA data)
2. clr margin= 1, normalize within each feature's distribution, across all cells (column-wise, recommended for proteomics data)

*if you come from R, please note that the [margins are transposed](https://images.hindustantimes.com/rf/image_size_630x354/HT/p2/2017/09/21/Pictures/_78c6a162-9e94-11e7-9c3b-8e901839ece0.JPG) in the Python and anndata world*

<img src="https://github.com/DendrouLab/panpipes/tree/main/docs/img/clr_margins.png" width="65%">
*If you come from R, please note that the [margins are transposed](https://images.hindustantimes.com/rf/image_size_630x354/HT/p2/2017/09/21/Pictures/_78c6a162-9e94-11e7-9c3b-8e901839ece0.JPG) in the Python and anndata world.*
<img src="../img/clr_margins.png" width="40%">

2. dsb using [muon's prot processing](https://muon.readthedocs.io/en/latest/api/generated/muon.prot.pp.html). This method is only applicable when you have raw 10x inputs (see [supported input files](https://panpipes-pipelines.readthedocs.io/en/latest/usage/setup_for_qc_mm.html#supported-input-filetypes)).

Expand All @@ -31,6 +31,13 @@ Additionally, the normalized data can be scaled using scanpy's [sc.pp.scale](htt
2. "logTF": logging the TF term using using [muon's atac processing](https://muon.readthedocs.io/en/latest/api/generated/muon.atac.pp.tfidf.html#muon.atac.pp.tfidf)
3. "logIDF": logging the IDF term using using [muon's atac processing](https://muon.readthedocs.io/en/latest/api/generated/muon.atac.pp.tfidf.html#muon.atac.pp.tfidf)

## Spatial Transcriptomics

1. Standard normalization using scanpy's [normalize_total](https://scanpy.readthedocs.io/en/stable/generated/scanpy.pp.normalize_total.html) and [log1p](https://scanpy.readthedocs.io/en/stable/generated/scanpy.pp.log1p.html).

2. Analytic Pearson Residual normalization using scanpy's [normalize_pearson_residuals](https://scanpy.readthedocs.io/en/stable/generated/scanpy.experimental.pp.normalize_pearson_residuals.html).


## Layers nomenclature within each modality

Raw, Normalised and Scaled data are saved for each modality in their specific layers:
Expand All @@ -39,13 +46,15 @@ Raw, Normalised and Scaled data are saved for each modality in their specific la

Using the following nomenclature:

| method | layer | modality |
| ---------------------- | --------------- | ------------- |
| raw counts | "raw_counts" | RNA/ATAC/PROT |
| standard log1p | "logged_counts" | RNA or ATAC |
| scaled counts | "scaled_counts" | RNA or ATAC |
| clr | "clr" | PROT |
| dsb | "dsb" | PROT |
| TFIDF (signac flavour) | "signac_norm" | ATAC |
| TFIDF (logTF) | "logTF_norm" | ATAC |
| TFIDF (logIDF) | "logIDF_norm" | ATAC |
| method | layer | modality |
| ---------------------- | -------------------- | ------------- |
| raw counts | "raw_counts" | RNA/ATAC/PROT |
| standard log1p | "logged_counts" | RNA or ATAC |
| scaled counts | "scaled_counts" | RNA or ATAC |
| clr | "clr" | PROT |
| dsb | "dsb" | PROT |
| TFIDF (signac flavour) | "signac_norm" | ATAC |
| TFIDF (logTF) | "logTF_norm" | ATAC |
| TFIDF (logIDF) | "logIDF_norm" | ATAC |
| standard log1p | "lognorm" | Spatial |
| Pearson Residuals | "norm_pearson_resid" | Spatial |

0 comments on commit c94a59b

Please sign in to comment.