Skip to content

Commit

Permalink
Add content to Marker Finding Vignette
Browse files Browse the repository at this point in the history
  • Loading branch information
lahuuki committed Aug 7, 2024
1 parent 515ec51 commit 3fd3c02
Showing 1 changed file with 61 additions and 26 deletions.
87 changes: 61 additions & 26 deletions vignettes/Marker_Finding.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,39 @@ bib <- c(
)
```

# Basics
# Introduction

## Install `DeconvoBuddies`
## What are Marker Genes?

### How can we select marker genes?

## The MeanRatio Method

## Goals of this Vignette

We will be demonstrating how to use `DeconvoBuddies` tools when finding cell
type marker genes in single cell RNA-seq data via the MeanRatio method.

`R` is an open-source statistical environment which can be easily modified to enhance its functionality via packages. `r Biocpkg("DeconvoBuddies")` is a `R` package available via the [Bioconductor](http://bioconductor.org) repository for packages. `R` can be installed on any operating system from [CRAN](https://cran.r-project.org/) after which you can install `r Biocpkg("DeconvoBuddies")` by using the following commands in your `R` session:
1. Install and load required packages
2. Download DLPFC snRNA-seq data
3. Find MeanRatio marker genes with `DeconvoBuddies::get_mean_ratio()`
4. Find 1vALL marker genes with `DeconvoBuddies::findMarkers_1vALL()`
5. Compare marker gene selection
6. Visualize marker genes expression with `DeconcoBuddies::plot_gene_express()`
and related functions

# 1. Install and load required packages

`R` is an open-source statistical environment which can be easily
modified to enhance its functionality via packages.
`r Biocpkg("DeconvoBuddies")` is a `R` package available via the
[Bioconductor](http://bioconductor.org) repository for packages. `R` can
be installed on any operating system from
[CRAN](https://cran.r-project.org/) after which you can install
`r Biocpkg("DeconvoBuddies")` by using the following commands in your
`R` session:

## Install `DeconvoBuddies`

```{r "install", eval = FALSE}
if (!requireNamespace("BiocManager", quietly = TRUE)) {
Expand All @@ -66,37 +94,44 @@ BiocManager::install("DeconvoBuddies")
BiocManager::valid()
```

## Required knowledge

`r Biocpkg("DeconvoBuddies")` is based on many other packages and in particular in those that have implemented the infrastructure needed for dealing with RNA-seq data (EDIT!). That is, packages like `r Biocpkg("SummarizedExperiment")` (EDIT!).
## Load Other Packages

If you are asking yourself the question "Where do I start using Bioconductor?" you might be interested in [this blog post](http://lcolladotor.github.io/2014/10/16/startbioc/#.VkOKbq6rRuU).

## Asking for help

As package developers, we try to explain clearly how to use our packages and in which order to use the functions. But `R` and `Bioconductor` have a steep learning curve so it is critical to learn where to ask for help. The blog post quoted above mentions some but we would like to highlight the [Bioconductor support site](https://support.bioconductor.org/) as the main resource for getting help: remember to use the `DeconvoBuddies` tag and check [the older posts](https://support.bioconductor.org/tag/DeconvoBuddies/). Other alternatives are available such as creating GitHub issues and tweeting. However, please note that if you want to receive help you should adhere to the [posting guidelines](http://www.bioconductor.org/help/support/posting-guide/). It is particularly critical that you provide a small reproducible example and your session information so package developers can track down the source of the error.

## Citing `DeconvoBuddies`

We hope that `r Biocpkg("DeconvoBuddies")` will be useful for your research. Please use the following information to cite the package and the overall approach. Thank you!

```{r "citation"}
## Citation info
citation("DeconvoBuddies")
```{r "load_packages", message=FALSE, warning=FALSE}
library("spatialLIBD")
library("DeconvoBuddies")
library("SummarizedExperiment")
library("SingleCellExperiment")
library("dplyr")
library("tidyr")
library("tibble")
library("ggplot2")
```

# Quick start to using `DeconvoBuddies`
# 2. Download DLPFC snRNA-seq data.
```{r "load snRNA-seq"}
## Use spatialLIBD to fetch the snRNA-seq dataset
sce_path_zip <- fetch_deconvo_data("sce")
```{r "start", message=FALSE}
library("DeconvoBuddies")
```
## unzip and load the data
sce_path <- unzip(sce_path_zip, exdir = tempdir())
sce <- HDF5Array::loadHDF5SummarizedExperiment(
file.path(tempdir(), "sce_DLPFC_annotated")
)
Edit this as you see fit =)
# lobstr::obj_size(sce)
# 172.28 MB
Here is an example of you can cite your package inside the vignette:
## exclude Ambiguous cell type
sce <- sce[, sce$cellType_broad_hc != "Ambiguous"]
sce$cellType_broad_hc <- droplevels(sce$cellType_broad_hc)
* `r Biocpkg("DeconvoBuddies")` `r Citep(bib[["DeconvoBuddies"]])`
dim(sce)
## Check the broad cell type distribution
table(sce$cellType_broad_hc)
## We're going to subset to the first 5k genes to save memory
sce <- sce[seq_len(5000), ]
```


# Reproducibility
Expand Down

0 comments on commit 3fd3c02

Please sign in to comment.