Skip to content
Snippets Groups Projects
Commit 0ce69502 authored by Sergio Sarnataro's avatar Sergio Sarnataro
Browse files

Replace README.md

parent a512db96
Branches master
No related tags found
No related merge requests found
# Normalization of spatially resolved data
## A short report about normalization of spatially resolved transcriptomics data in the literature
One of the key step of the analysis of single-cell RNA-Seq data is the normalization of the counts, where the biological heterogeneity among cells can be confounded by technical differences.
When analyzing spatially resolved transcriptomics data, besides the cell-to-cell variation, also the tissue heterogeneity plays an important role.
Then, it is crucial to think about how to normalize the raw data coming from spatial transcriptomics. In other words, removing the noise and normalize the data should be two independent procedures.
Clearly, this in practice is very hard to accomplish.
What we will do here is to navigate into a bit of literature about spatial transcriptomics data normalization, in order to provide some points for users to ponder before they normalize their data.
## Getting started
#### Normalization by the total number of reads per cell/spot
In [this publication](https://www-nature-com.insb.bib.cnrs.fr/articles/s41421-021-00266-1) on MERFISH data, the authors normalize by the total number of reads per cell when they have to perform differential gene expression analyses or to investigate co-expression of genes. In particular, the copy number of each RNA species in the cell was divided by the copy number of all labeled RNA species in the cell, and then multiplied by a factor of 1000.
To make it easy for you to get started with GitLab, here's a list of recommended next steps.
Another option is to normalize by correcting the mean total RNA counts per cell, setting the same mean value for all the cells. For example, [here](https://pubmed.ncbi.nlm.nih.gov/36945367/) the authors normalize for the volume of the cells and then corrected the RNA counts per cell to 250.
Similarly, [here](https://www.life-science-alliance.org/content/6/1/e202201701#sec-9) data were normalized to a total count of 10000 transcripts per cell.
Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
## Add your files
###### Is it always the right thing to do?
Clearly, the normalizations discussed above provide simple and effective ways to make data comparable and limit technical variations. On the other hand, we might have as unwanted effect the lost of biological heterogeneity, assuming that all the cells behave the same way, independently on their biological state and on their position on the tissue we are analyzing.
- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
For example, [here](https://academic.oup.com/jmcb/article/12/11/906/5861536?login=false) it has been show that normalizing by the total number of counts per cell/spot is not always a good idea, and the number of counts per cell/spot can be very informative. In this work, a papillary thyroid cancer was profiled using spatial transcriptomics as described in Salmén et al. (Nature Protocol, 2018). The authors quantified the cellular content of individual spots from image analysis and compared it with read counts. They assessed that for at least some genes (i.e. Vimentin), normalization affected the spatial expression pattern, and they show that genes tend to show a similar expression pattern that reflects total transcriptional output when raw counts are considered, while normalized expression highlights contrasts between genes. In conclusion, total counts per spot are biologically informative and do not necessarily need to be normalized out.
```
cd existing_repo
git remote add origin http://gitbio.ens-lyon.fr/spatial-cell-id/normalization-of-spatially-resolved-data.git
git branch -M master
git push -uf origin master
```
#### SCT transform
Of note, in 2019 C. Hafemeister and R. Satija proposed a [new method](https://genomebiology.biomedcentral.com/articles/10.1186/s13059-019-1874-1) for modeling, normalization and variance stabilization of UMI-based scRNA-seq datasets. This approach is also implemented in the R package [sctransform](https://github.com/satijalab/sctransform), and is part of the single-cell tooklit [Seurat](https://satijalab.org/seurat/).
Moreover and interestingly for us, in their vignettes, the authors provided guidelines to use sctransform both when dealing with [single-cell RNA-Seq data](https://satijalab.org/seurat/articles/sctransform_v2_vignette.html) and with [spatial transcriptomics data](https://satijalab.org/seurat/articles/spatial_vignette.html) from Visium technology.
## Integrate with your tools
In brief, the paper is based on the principle that a proper normalized expression level of a gene should correlate with the total sequencing depth of a cell, and that the variance of a normalized gene expression across cells should reflect biological variability, being independent on gene abundance and sequencing depth.
To address these points, the paper proposes a generalized linear model (GLM) for each gene, where UMI counts are the response variable and sequencing depth is the explanatory variable. Then, the authors explore the different possible error models of the GLM, and find that unconstrained negative binomial (NB) and zero-inflation negative binomial (ZINB) models cause overfitting of the data, while pooling information across genes with similar abundance can regularize parameter estimates.
We refer to the original paper for further mathematical details.
One computational limitation of sctransform is only available in R. If you are a python user and you are analyzing your data in the context of [scanpy](https://scanpy.readthedocs.io/en/stable/) or [squidpy](https://squidpy.readthedocs.io/en/stable/), you can have a look at this [wrapper](https://github.com/normjam/benchmark/blob/master/normbench/methods/ad2seurat.py), where sctransform is usable in python via [rpy2](https://rpy2.github.io/) and [anndata2ri](https://pypi.org/project/anndata2ri/).
- [ ] [Set up project integrations](http://gitbio.ens-lyon.fr/spatial-cell-id/normalization-of-spatially-resolved-data/-/settings/integrations)
#### 3D case: what to do when having several slices
During the last years, one of the goals of the spatially resolved transcriptomics has been to provide a three-dimensional resolution of the gene expression of tissues of interest. To do that, generally different slices of the same tissues are analyzed, in order to reconstruct the gene expression spatial features across all the dimensions. We wondered how to pre-process and normalize data in such case.
First thing to highlight is that data from different slices need to be normalized together, in order to proceed with a comprehensive, three-dimensional downstream analysis. At the end, it will be like having a count matrix where rows are cells/spot, regardless of the slice they come from.
About the mathematical way for normalizing 3D data, different methods have been published in literature.
For example, [here](https://www.biorxiv.org/content/10.1101/2023.03.06.531121v1.full.pdf) overall counts of genes were normalized by cell volume and then log2 transformed. [Here](https://www.biorxiv.org/content/10.1101/2023.03.06.531348v1.full.pdf), instead, the authors normalized the total count of each cell to 1000, then log1p transformed the counts and finally scaled the transformed counts to Z-scores.
A bit different is what the authors did in [this publication](https://www-ncbi-nlm-nih-gov.insb.bib.cnrs.fr/pmc/articles/PMC6482113/), where they analyzed hypothalamic preoptic region by using MERFISH-based imaging. First, they normalized RNA counts per cell by the imaged volume of each cell. As they observed batch effect between different MERFISH runs (mean total number of RNAs identified per cell varied by ~20% from run-to-run), they removed this batch effect by normalizing the mean total RNA density per cell for each MERFISH dataset so then this mean value was the same across all datasets.
## Collaborate with your team
- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
- [ ] [Set auto-merge](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
## Test and Deploy
Use the built-in continuous integration in GitLab.
- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing(SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
***
# Editing this README
When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thank you to [makeareadme.com](https://www.makeareadme.com/) for this template.
## Suggestions for a good README
Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
## Name
Choose a self-explaining name for your project.
## Description
Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
## Badges
On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
## Visuals
Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
## Installation
Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
## Usage
Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
## Support
Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
## Roadmap
If you have ideas for releases in the future, it is a good idea to list them in the README.
## Contributing
State if you are open to contributions and what your requirements are for accepting them.
For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
## Authors and acknowledgment
Show your appreciation to those who have contributed to the project.
## License
For open source projects, say how it is licensed.
## Project status
If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
#### Conclusions
Normalization of single-cell RNA-Seq and spatially resolved data is far from being a standard operation. Before proceeding, the biological context and the experimental technique should be carefully considered. A good balance between normalizing by the total number of reads per cell and preserving information on heterogeneity of tissue and cells/spot should be aimed. Also, in some cases, one could consider to use some normalizations methods like SCT transform, which provide a more complex mathematical model for pre-processing the data a getting normalized gene expression.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment