Skip to content
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

Update cheatsheet links for intro-R and scRNAseq #521

Merged
merged 23 commits into from
Mar 1, 2022
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
1cd02ca
Links updated for intro-to-R-tidyverse-cheatsheet
sjspielman Feb 25, 2022
d8a5a3d
Removed HTMLs which we do not save. Updated scRNA cheatsheet EXCEPT f…
sjspielman Feb 25, 2022
f62abe7
Removed yaml
sjspielman Feb 28, 2022
53b41de
Add function to ggplot section of cheatsheet, as discussed in Issue …
sjspielman Feb 28, 2022
978b566
Update module-cheatsheets/intro-to-R-tidyverse-cheatsheet.md
sjspielman Feb 28, 2022
d201194
Update module-cheatsheets/intro-to-R-tidyverse-cheatsheet.md
sjspielman Feb 28, 2022
77eb6fb
Update module-cheatsheets/scRNA-seq-cheatsheet.md
sjspielman Feb 28, 2022
f303167
Update module-cheatsheets/scRNA-seq-cheatsheet.md
sjspielman Feb 28, 2022
f19c4ae
Fixed normalize link
sjspielman Feb 28, 2022
cc40f7b
Updates to intro cheatsheet
sjspielman Feb 28, 2022
14a9e53
PDFs of updated cheatsheets with MacDown. Also added blurb to scRNA-s…
sjspielman Mar 1, 2022
9c15f26
we use macdown for pdfs
sjspielman Mar 1, 2022
c444097
Dictionary updates for cheatsheet README
sjspielman Mar 1, 2022
f7ca9c1
Removed cheatsheet readme and fleshed out section in CONTRIBUTING
sjspielman Mar 1, 2022
1beccc7
Update components/dictionary.txt
sjspielman Mar 1, 2022
88d78d7
doctoc'd CONTRIBUTING
sjspielman Mar 1, 2022
3535f53
markdown words back into the dictionary
sjspielman Mar 1, 2022
163bf0f
Update components/dictionary.txt
sjspielman Mar 1, 2022
0431341
Update CONTRIBUTING.md
sjspielman Mar 1, 2022
8ba3de6
rm ggplot from scRNA-seq, include hline and vline geoms in intro chea…
sjspielman Mar 1, 2022
5f1175b
Update CONTRIBUTING.md
sjspielman Mar 1, 2022
31ee52a
go away md
sjspielman Mar 1, 2022
0c883d4
PDF formatting fixed
sjspielman Mar 1, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions components/dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,12 @@ lv
LV
LVs
lysis
MacDown
MacOS
macrophage
Malhotra
McInnes
md
sjspielman marked this conversation as resolved.
Show resolved Hide resolved
medulloblastoma
jashapiro marked this conversation as resolved.
Show resolved Hide resolved
MEK
Menyhárt
Expand Down
8 changes: 8 additions & 0 deletions module-cheatsheets/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
### Cheatsheets Module
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this content makes more sense as part of CONTRIBUTING.md than living here.


Cheatsheets are written in plain markdown and can be converted to a usable PDF format interactively:

+ Be on a MacOS computer
+ Install and/or open the [MacDown program](https://macdown.uranusjr.com/)
+ Open a md cheatsheet in MacDown, and go to `File` -> `Export` -> `PDF`
+ Save appropriately and voila!
142 changes: 74 additions & 68 deletions module-cheatsheets/intro-to-R-tidyverse-cheatsheet.md

Large diffs are not rendered by default.

Binary file modified module-cheatsheets/intro-to-R-tidyverse-cheatsheet.pdf
Binary file not shown.
51 changes: 26 additions & 25 deletions module-cheatsheets/scRNA-seq-cheatsheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,55 +5,57 @@
> 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.

<div style="page-break-after: always;"></div>

### Base `R`

Read the Base `R` documentation [**here**](https://www.rdocumentation.org/packages/base/versions/3.5.1).
Read the Base `R` documentation [**here**](https://rdrr.io/r/).

|Library/Package|Piece of Code|What it's called| What it does|
|---------------|-------------|----------------|-------------|
| Base `R`| [`rowSums()`](https://www.rdocumentation.org/packages/base/versions/3.6.2/topics/rowSums)| Row sums|Calculates sums for each row|
| Base `R`| [`colSums()`](https://www.rdocumentation.org/packages/base/versions/3.6.2/topics/colSums)| Column sums| Calculates sums for each column|
| Base `R`| [`t()`](https://www.rdocumentation.org/packages/base/versions/3.5.1/topics/t) |Transpose| Returns the transpose of a matrix or data frame|
| Base `R`| [`prcomp()`](https://www.rdocumentation.org/packages/stats/versions/3.5.1/topics/prcomp)| Principal Components Analysis|Executes a principal components analysis on specified matrix or data frame|
| Base `R`| [`<-function(x) { <code> }`](http://adv-r.had.co.nz/Functions.html) | Function | Creates a function that would take the defined parameters as input and execute the commands within the curly braces |
| Base `R`| [`rowSums()`](https://rdrr.io/r/base/colSums.html)| Row sums|Calculates sums for each row|
| Base `R`| [`colSums()`](https://rdrr.io/r/base/colSums.html)| Column sums| Calculates sums for each column|
| Base `R`| [`t()`](https://rdrr.io/r/base/t.html) |Transpose| Returns the transpose of a matrix or data frame|
| Base `R`| [`prcomp()`](https://rdrr.io/r/stats/prcomp.html)| Principal Components Analysis|Executes a principal components analysis on specified matrix or data frame|
| Base `R`| [`<-function(x) { <code> }`](https://adv-r.hadley.nz/functions.html) | Function | Creates a function that would take the defined parameters as input and execute the commands within the curly braces |


### `ggplot2`

Read the `ggplot2` documentation [**here**](https://ggplot2.tidyverse.org/reference/).
Read the `ggplot2` documentation [**here**](https://ggplot2.tidyverse.org/).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious about this change. I think the link to the list of all functions may be more useful than the homepage for this use case. This may also apply to the earlier ggplot2 link in the intro cheatsheet (we should be consistent either way).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First, this is a general thing to come back to for consistency.

I much prefer presenting the overall landing page for the documentation, sans reference, because it allows them to hop anywhere in the ggplot2 docs without being strictly presented with an overwhelming list of functions, most of which will be unfamiliar to them. Maybe we need a third opinion on this one..

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Middle ground: we can have it all!

Read the ggplot2 package documentation here, as well as an overall reference for ggplot2 functions here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just noting here that you didn't implement the same changes as in the intro here, but I think that is fine. I also noticed that we only apparently add one new ggplot command here, which makes me wonder if we need it at all. Maybe just add geom_vline to the geom_hline section from the intro and remove it from the single cell doc?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just noting here that you didn't implement the same changes as in the intro here, but I think that is fine.

Can't hurt, will do.

Maybe just add geom_vline to the geom_hline section from the intro and remove it from the single cell doc?

Makes sense to me!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've decided to also delete the final description bit that suggests geom_vline() and friends can only be used on top of another geom.


| Library/Package| Piece of Code| What it's called| What it does |
|----------------|--------------|-----------------|--------------|
| `ggplot2`| [`geom_vline()`](https://ggplot2.tidyverse.org/reference/geom_abline.html)| geom vertical line| Adds ggplot2 layer with a vertical line plotted |

### `scran`, `scater`, `SingleCellExperiment`
Read the `scran` package documentation [**here**](https://www.rdocumentation.org/packages/scran/versions/1.10.2), and a vignette on its usage [**here**](https://bioconductor.org/packages/devel/bioc/vignettes/scran/inst/doc/scran.html).
Read the `scran` package documentation [**here**](https://rdrr.io/bioc/scran/), and a vignette on its usage [**here**](https://rdrr.io/bioc/scran/f/vignettes/scran.Rmd).

Read the `scater` package documentation [**here**](https://www.rdocumentation.org/packages/scater/versions/1.10.1), and a vignette on its usage [**here**](https://github.com/davismcc/scater/blob/master/vignettes/vignette-intro.Rmd).
Read the `scater` package documentation [**here**](https://rdrr.io/bioc/scater/), and a vignette on its usage [**here**](http://www.bioconductor.org/packages/release/bioc/vignettes/scater/inst/doc/overview.html).

Read the `SingleCellExperiment` package documentation [**here**](https://osca.bioconductor.org/), and a vignette on its usage [**here**](https://bioconductor.org/packages/devel/bioc/vignettes/SingleCellExperiment/inst/doc/intro.html).
Read the `SingleCellExperiment` package documentation (and e-book) [**here**](https://bioconductor.org/books/release/OSCA/), and a vignette on its usage [**here**](https://rdrr.io/bioc/SingleCellExperiment/f/vignettes/intro.Rmd).

In addition to the links above, [Amezquita et al.](https://www.biorxiv.org/content/biorxiv/early/2019/03/27/590562.full.pdf) is a useful paper on the single-cell analysis workflow involving the `SingleCellExperiment` object.

<br>

| Library/Package | Piece of Code | What it's called | What it does |
|----------------------|----------------------------|--------------------------------------------|--------------------------------------------------------------|
| `SingleCellExperiment` | [`SingleCellExperiment()`](https://bioconductor.org/packages/devel/bioc/vignettes/SingleCellExperiment/inst/doc/intro.html#2_creating_singlecellexperiment_instances) | Single Cell Experiment| Creates a `SingleCellExperiment` object |
| `SingleCellExperiment`| [`colData()`](https://bioconductor.org/packages/devel/bioc/vignettes/SingleCellExperiment/inst/doc/intro.html#5_extracting_coldata_and_rowdata) | Column Data | Extracts and stores cell-level metadata that describes features of the `SingleCellExperiment` object|
| `SingleCellExperiment`| [`rowData()`](https://bioconductor.org/packages/devel/bioc/vignettes/SingleCellExperiment/inst/doc/intro.html#5_extracting_coldata_and_rowdata) | Row Data | Extracts and stores gene-level metadata that describes features of the `SingleCellExperiment` object|
| `SingleCellExperiment`| [`logcounts()`](https://bioconductor.org/packages/release/bioc/vignettes/SingleCellExperiment/inst/doc/intro.html)| Log counts| Stores or extracts log-transformed single-cell experiment count data as an assay of the `SingleCellExperiment` object|
| `SingleCellExperiment`| [`counts()`](https://bioconductor.org/packages/release/bioc/vignettes/SingleCellExperiment/inst/doc/intro.html)| Counts| Stores or extracts raw single-cell experiment count data as an assay of the `SingleCellExperiment` object|
| `scran` | [`quickCluster()`](https://www.rdocumentation.org/packages/scran/versions/1.0.3/topics/Quick%20clustering) | Quick Clustering | Groups similar cells into clusters which are stored in the `SingleCellExperiment` object and are used for the calculation of size factors by `scran::computeSumFactors`|
| `scran` | [`computeSumFactors()`](https://www.rdocumentation.org/packages/scran/versions/1.0.3/topics/Deconvolution%20Methods) | Compute Sum Factors| Returns a numeric vector of computed sum factors for each cell cluster stored in the `SingleCellExperiment` object. The cluster-based size factors are deconvolved into cell-based size factors that are stored in the `SingleCellExperiment` object and used by the `scran::normalize` function for the normalization of each cell's gene expression profile|
| `scater`| [`normalize()`](https://www.rdocumentation.org/packages/scater/versions/1.0.4/topics/normalize)| Normalize | Returns the `SingleCellExperiment` object with normalized expression values for each cell, using the size factors stored in the object |
| `SingleCellExperiment` | [`SingleCellExperiment()`](https://bioconductor.org/packages/release/bioc/vignettes/SingleCellExperiment/inst/doc/intro.html) | Single Cell Experiment| Creates a `SingleCellExperiment` object |
| `SingleCellExperiment`| [`colData()`](https://bioconductor.org/packages/release/bioc/vignettes/SingleCellExperiment/inst/doc/intro.html#2_Creating_SingleCellExperiment_instances) | Column Data | Extracts and stores cell-level metadata that describes features of the `SingleCellExperiment` object|
| `SingleCellExperiment`| [`rowData()`](https://bioconductor.org/packages/release/bioc/vignettes/SingleCellExperiment/inst/doc/intro.html#2_Creating_SingleCellExperiment_instances) | Row Data | Extracts and stores gene-level metadata that describes features of the `SingleCellExperiment` object|
| `SingleCellExperiment`| [`logcounts()`](https://bioconductor.org/packages/release/bioc/vignettes/SingleCellExperiment/inst/doc/intro.html#3_Adding_low-dimensional_representations)| Log counts| Stores or extracts log-transformed single-cell experiment count data as an assay of the `SingleCellExperiment` object|
| `SingleCellExperiment`| [`counts()`](https://bioconductor.org/packages/release/bioc/vignettes/SingleCellExperiment/inst/doc/intro.html#4_Convenient_access_to_named_assays)| Counts| Stores or extracts raw single-cell experiment count data as an assay of the `SingleCellExperiment` object|
| `scran` | [`quickCluster()`](https://rdrr.io/bioc/scran/man/quickCluster.html) | Quick Clustering | Groups similar cells into clusters which are stored in the `SingleCellExperiment` object and are used for the calculation of size factors by `scran::computeSumFactors`|
| `scran` | [`computeSumFactors()`](https://rdrr.io/bioc/scran/man/computeSumFactors.html) | Compute Sum Factors| Returns a numeric vector of computed sum factors for each cell cluster stored in the `SingleCellExperiment` object. The cluster-based size factors are deconvolved into cell-based size factors that are stored in the `SingleCellExperiment` object and used by the `scran::normalize` function for the normalization of each cell's gene expression profile|
| `scran`| [`getTopHVGs()`](https://rdrr.io/bioc/scran/man/getTopHVGs.html)| Get top highly variable genes | Identify variable genes in a `SingleCellExperiment` object, based on variance |
| `scran`| [`modelGeneVar()`](https://rdrr.io/github/MarioniLab/scran/man/modelGeneVar.html)| model per gene variance | Model the per gene variance of a `SingleCellExperiment` object |
| `scran`| [`modelGeneVar()`](https://rdrr.io/bioc/scran/man/modelGeneVar.html)| model per gene variance | Model the per gene variance of a `SingleCellExperiment` object |
| `scran`| [`findMarkers()`](https://rdrr.io/bioc/scran/man/findMarkers.html)| Find marker genes | Find candidate marker genes for clusters of cells |
| `scater`| [`addPerCellQC()`](https://rdrr.io/bioc/scater/man/addPerCellQC.html)| Add per cell quality control | For a `SingleCellExperiment` object, calculate and add quality control per cell and store in `colData` |
| `scater`| [`logNormCounts()`](https://rdrr.io/bioc/scuttle/man/logNormCounts.html) | Normalize log counts| Returns the `SingleCellExperiment` object with normalized expression values for each cell, using the size factors stored in the object
| `scater`| [`addPerCellQC()`](https://rdrr.io/bioc/scuttle/man/addPerCellQC.html)| Add per cell quality control | For a `SingleCellExperiment` object, calculate and add quality control per cell and store in `colData` |
| `scater`| [`addPerFeatureQC()`](https://rdrr.io/bioc/scater/man/addPerCellQC.html)| Add per feature quality control | For a `SingleCellExperiment` object, calculate and add quality control per feature (genes usually) and store in `rowData`|
| `scater`| [`calculatePCA()`](https://bioconductor.org/packages/devel/bioc/manuals/scater/man/scater.pdf)| Calculate PCA | Calculates principal components analysis on a `SingleCellExperiment` object |
| `scater`| [`calculateUMAP()`](https://bioconductor.org/packages/devel/bioc/manuals/scater/man/scater.pdf)| Calculate UMAP | Calculates uniform manifold approximate projection on a `SingleCellExperiment` object |
Expand All @@ -73,7 +75,7 @@ Read the `purrr` documentation [**here**](https://purrr.tidyverse.org/).

### `stringr`

Read the `stringr` documentation [**here**](https://stringr.tidyverse.org/index.html)
Read the `stringr` documentation [**here**](https://stringr.tidyverse.org/).

| Library/Package| Piece of Code| What it's called| What it does |
|----------------|--------------|-----------------|--------------|
Expand All @@ -85,9 +87,8 @@ Documentation for each of these packages can be accessed by clicking the package
| Library/Package|Piece of Code| What it's called| What it does |
|----------------|-------------|-----------------|---------------|
| [`alevinQC`](http://www.bioconductor.org/packages/devel/bioc//vignettes/alevinQC/inst/doc/alevinqc.html) | [`alevinQCReport()`](http://www.bioconductor.org/packages/devel/bioc//vignettes/alevinQC/inst/doc/alevinqc.html#generate-qc-report) | Alevin QC Report | Produces a QC (quality check) report from the alevin output |
| [`dat`](https://cran.r-project.org/web/packages/dat/index.html)| [`DataFrame()`](https://www.rdocumentation.org/packages/dat/versions/0.5.0/topics/DataFrame)| Data frame | Not to be confused with [`data.frame()` from Base R. This is a slightly different data frame-like object needed for storing information in `SingleCellExperiment` object's `colData()`.|
| [`colorblindr`](https://www.rdocumentation.org/packages/colorblindr/versions/0.1.0)|[`scale_color_OkabeIto()`](https://www.rdocumentation.org/packages/colorblindr/versions/0.1.0/topics/scale_colour_OkabeIto) | OkabeIto Color Scale | When added as a layer to a plot, makes the plot colorblind friendly |
| [`Rtsne`](https://www.rdocumentation.org/packages/Rtsne/versions/0.15)| [`Rtsne()`](https://www.rdocumentation.org/packages/Rtsne/versions/0.15/topics/Rtsne)| T-Distributed Stochastic Neighbor Embedding using a Barnes-Hut Implementation | Reduces the dimensions of the specified matrix or data frame|
| `S4Vectors` | [`DataFrame()`](https://rdrr.io/bioc/S4Vectors/man/DataFrame-class.html)| Data frame | Not to be confused with `data.frame()` from Base R. This is a slightly different data frame-like object needed for storing information in `SingleCellExperiment` object's `colData()`.|
| [`Rtsne`](https://rdrr.io/cran/Rtsne/)| [`Rtsne()`](https://rdrr.io/cran/Rtsne/man/Rtsne.html)| T-Distributed Stochastic Neighbor Embedding using a Barnes-Hut Implementation | Reduces the dimensions of the specified matrix or data frame|
| [`tibble`](https://tibble.tidyverse.org/index.html)|[`as_tibble()`](https://tibble.tidyverse.org/reference/as_tibble.html) | As tibble | Coerce data.frame or matrix to a tibble |

<br>
Expand Down
Binary file modified module-cheatsheets/scRNA-seq-cheatsheet.pdf
Binary file not shown.