-
-
Notifications
You must be signed in to change notification settings - Fork 33
Add spatial cheatsheet #962
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
0b42d43
add spatial cheatsheet with functions from notebook 1
sjspielman c9efbe5
add patchwork::wrap_plots
sjspielman a444274
Apply suggestions from code review
sjspielman 1777ed2
patchwork math
sjspielman 9f6c32e
fix spotsweeper links
sjspielman bcf2bfb
pdfifiy
sjspielman 611e36e
visiumio links
sjspielman cad753c
use rdrr for scuttle
sjspielman b87af2b
Update module-cheatsheets/spatial-cheatsheet.md
sjspielman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,118 @@ | ||
| # Spatial Transcriptomics Cheatsheet | ||
|
|
||
| #### The tables below consist of valuable functions or commands that will help you through this module. | ||
| ##### Each table represents a different library/tool and its corresponding commands. | ||
| > Please note that these tables are not intended to tell you all the information you need to know about each command. | ||
| > | ||
| > The hyperlinks found in each piece of code will take you to the documentation for further information on the usage of each command. | ||
| > Please be aware that the documentation will generally provide information about the given function's most current version (or a recent version, depending on how often the documentation site is updated). | ||
| This will usually (but not always!) match what you have installed on your machine. | ||
| If you have a different version of R or other R packages, the documentation may differ from what you have installed. | ||
|
|
||
|
|
||
| <!-- START doctoc generated TOC please keep comment here to allow auto update --> | ||
| <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> | ||
| **Table of Contents** | ||
|
|
||
| - [`SpatialExperiment`](#spatialexperiment) | ||
| - [`VisiumIO`](#visiumio) | ||
| - [`ggspavis`](#ggspavis) | ||
| - [`SpotSweeper`](#spotsweeper) | ||
| - [`scuttle`](#scuttle) | ||
| - [`patchwork`](#patchwork) | ||
|
|
||
| <!-- END doctoc generated TOC please keep comment here to allow auto update --> | ||
|
|
||
| <div style="page-break-after: always;"></div> | ||
|
|
||
|
|
||
| ### `SpatialExperiment` | ||
|
|
||
|
|
||
| Read the [`SpatialExperiment` package documentation (and e-book)](https://bioconductor.org/books/release/OSTA/) and a [vignette on its usage](https://www.bioconductor.org/packages/release/bioc/vignettes/SpatialExperiment/inst/doc/SpatialExperiment.html). | ||
|
|
||
| `SpatialExperiment` objects are based on [`SingleCellExperiment` objects](https://bioconductor.org/books/release/OSCA/). | ||
| There are many functions that are shared between the two, with equivalent usage. | ||
| See [this `SingleCellExperiment` vignette](https://bioconductor.org/packages/release/bioc/vignettes/SingleCellExperiment/inst/doc/intro.html) for example usage of shared functions. | ||
| You can also refer to the Data Lab cheatsheets for our "Introduction to scRNA-seq" (`scRNA-seq-cheatsheet.pdf`) and "Advanced scRNA-seq" (`scRNA-seq-advanced-cheatsheet.pdf`) training modules. | ||
|
|
||
|
|
||
|
|
||
| | Library/Package | Piece of Code | What it's called | What it does | | ||
| |----------------------|----------------------------|--------------------------------------------|--------------------------------------------------------------| | ||
| | `SpatialExperiment` | [`SpatialExperiment()`](https://www.bioconductor.org/packages/release/bioc/vignettes/SpatialExperiment/inst/doc/SpatialExperiment.html) | Spatial Experiment| Creates a `SpatialExperiment` object | | ||
| | `SpatialExperiment` | [`spatialCoords()`](https://www.bioconductor.org/packages/release/bioc/vignettes/SpatialExperiment/inst/doc/SpatialExperiment.html#13_spatialCoords) | Spatial Experiment coordinates | Extracts spatial coordinates of spots in the `SpatialExperiment` object | | ||
| | `SpatialExperiment` | [`imgData()`](https://www.bioconductor.org/packages/release/bioc/vignettes/SpatialExperiment/inst/doc/SpatialExperiment.html#14_imgData) | Spatial Experiment images | View the image data associated with a `SpatialExperiment` object | | ||
|
|
||
|
|
||
|
|
||
|
|
||
| ### `VisiumIO` | ||
|
|
||
| <!-- TODO: This package has not yet made it to rdrr --> | ||
| Read the R package [`VisiumIO` documentation](https://www.bioconductor.org/packages/release/bioc/html/VisiumIO.html) and a [vignette on its usage](https://www.bioconductor.org/packages/release/bioc/vignettes/VisiumIO/inst/doc/VisiumIO.html). | ||
|
|
||
| |Library/Package|Piece of Code|What it's called| What it does| | ||
| |---------------|-------------|----------------|-------------| | ||
| | `VisiumIO` | [`TENxVisium()`](https://www.bioconductor.org/packages/release/bioc/vignettes/VisiumIO/inst/doc/VisiumIO.html#tenxvisium) | 10x Visium | Constructor function for importing 10x Visium data | | ||
| | `VisiumIO`| [`import()`](https://www.bioconductor.org/packages/release/bioc/vignettes/VisiumIO/inst/doc/VisiumIO.html#importing-into-spatialexperiment) | Import | Loads 10x Visium data defined with the `TENxVisium()` constructor function | | ||
|
|
||
|
|
||
|
|
||
|
|
||
| ### `ggspavis` | ||
|
|
||
| <!-- TODO: This package has not yet made it to rdrr --> | ||
| Read the [`ggspavis` package documentation](https://www.bioconductor.org/packages/release/bioc/html/ggspavis.html) and a [vignette on its usage](https://www.bioconductor.org/packages/release/bioc/vignettes/ggspavis/inst/doc/ggspavis_overview.html). | ||
|
|
||
|
|
||
|
|
||
| | Library/Package | Piece of Code | What it's called | What it does | | ||
| |----------------------|----------------------------|--------------------------------------------|--------------------------------------------------------------| | ||
| | `ggspavis` | [`plotCoords()`](https://www.bioconductor.org/packages/release/bioc/vignettes/ggspavis/inst/doc/ggspavis_overview.html#spot-shape---slide-seq-and-visium) | Plot coordinates | Creates a spot plot showing spatial locations in x/y with options for spot annotation | | ||
| | `ggspavis` | [`plotVisium()`](https://www.bioconductor.org/packages/release/bioc/vignettes/ggspavis/inst/doc/ggspavis_overview.html#spot-shape---slide-seq-and-visium) | Plot Visium | Creates a spot plot for Visium data specifically showing spatial locations in x/y with options for spot annotation as well as an option to show the spatial image, e.g., the H&E image | | ||
|
|
||
|
|
||
| <div style="page-break-after: always;"></div> | ||
|
|
||
|
|
||
|
|
||
| ### `SpotSweeper` | ||
|
|
||
|
|
||
| <!-- TODO: This package has not yet made it to rdrr --> | ||
| Read the [`SpotSweeper` package documentation](https://www.bioconductor.org/packages/release/bioc/html/SpotSweeper.html) and a [vignette on its usage](https://www.bioconductor.org/packages/release/bioc/vignettes/SpotSweeper/inst/doc/getting_started.html). | ||
|
|
||
|
|
||
|
|
||
| | Library/Package | Piece of Code | What it's called | What it does | | ||
| |----------------------|----------------------------|--------------------------------------------|--------------------------------------------------------------| | ||
| | `SpotSweeper` | [`localOutliers()`](https://www.bioconductor.org/packages/release/bioc/vignettes/SpotSweeper/inst/doc/getting_started.html#identifying-local-outliers-using-spotsweeper) | Local outliers | Detect local outlier spots in a `SpatialExperiment` based on a given quality control metric | | ||
| | `SpotSweeper`| [`plotQCmetrics()`](https://www.bioconductor.org/packages/release/bioc/vignettes/SpotSweeper/inst/doc/getting_started.html#visualizing-local-outliers)| Plot QC metrics | Create a spot plot highlighting outliers detected with `SpotSweeper::localOutliers()` | | ||
|
|
||
|
|
||
|
|
||
|
|
||
| ### `scuttle` | ||
|
|
||
|
|
||
| Read the [`scuttle` package documentation](https://rdrr.io/bioc/scuttle/), and a [vignette on its usage](https://rdrr.io/bioc/scuttle/f/vignettes/overview.Rmd). | ||
|
|
||
|
|
||
| | Library/Package | Piece of Code | What it's called | What it does | | ||
| |----------------------|----------------------------|--------------------------------------------|--------------------------------------------------------------| | ||
| | `scuttle` | [`computeLibraryFactors()`](https://rdrr.io/bioc/scuttle/man/librarySizeFactors.html) | Compute Library Factors | Returns a numeric vector of computed size factors for each spot (or cell) stored in a `SpatialExperiment` (or `SingleCellExperiment`) object. The size factor is computed as the library size of each spot/cell after scaling them to have a mean of 1 across all spots/cells | | ||
| | `scuttle`| [`logNormCounts()`](https://rdrr.io/bioc/scuttle/man/logNormCounts.html)| Normalize log counts | Returns the `SpatialExperiment` (or `SingleCellExperiment`) object with normalized expression values for each spot (cell), using the size factors stored in the object | | ||
|
|
||
|
|
||
| ### `patchwork` | ||
|
|
||
|
|
||
| Read the [`patchwork` package documentation](https://rdrr.io/cran/patchwork), and a [vignette on its usage](https://patchwork.data-imaginist.com/articles/patchwork.html). | ||
|
|
||
|
|
||
| | Library/Package | Piece of Code | What it's called | What it does | | ||
| |----------------------|----------------------------|--------------------------------------------|--------------------------------------------------------------| | ||
| | `patchwork` | [`wrap_plots()`](https://rdrr.io/cran/patchwork/man/wrap_plots.html) | Wrap plots | Wrap multiple `ggplot2` objects into a single multi-panel plot | | ||
| | `patchwork` | [`+`](https://rdrr.io/cran/patchwork/man/wrap_plots.html) | Plot arithmetic | Place `ggplot2` objects side-by-side by adding them together with a `+`. The `patchwork` package must be loaded to use this symbol with plots | | ||
| | `patchwork` | [`/`](https://rdrr.io/cran/patchwork/man/wrap_plots.html) | Plot arithmetic | Stack `ggplot2` objects on top of one another "dividing" them with a `/`. The `patchwork` package must be loaded to use this symbol with plots | | ||
Binary file not shown.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we might want to add just a bit about the basic operators like
+and/?