-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME.Rmd
70 lines (54 loc) · 1.54 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# Crescendo
<!-- badges: start -->
<!-- badges: end -->
Implementation of the Crescendo algorithm, which allows investigators to remove the effects of confounding factors by directly correcting gene expression count data.
## Installation
Install the current version of Crescendo from [GitHub](https://github.com/) with:
``` r
# install.packages("devtools")
devtools::install_github("immunogenomics/crescendo")
```
# Usage/Demos
## Quick-start code
The following code uses Crescendo to correct gene expression in 3 slices of spatial transcriptomics data.
```{r}
library(crescendo)
# Load dataset with metadata, raw gene counts, and Harmony clusters (result from running the Harmony algorithm)
obj <- readRDS(system.file("extdata", "pbmc_4gene_obj.rds", package = "crescendo"))
# Set which genes to correct and parameters for coorrection
batch_var <- 'batch'
genes_use <- c('TRAC', 'MS4A1')
prop <- 0.05
min_cells <- 50
mc.cores <- NULL
lambda <- NULL
alpha <- 0
# Run Crescendo
corr_counts <- crescendo(
Ycounts = obj$exprs_raw,
meta_data = obj$meta_data,
R = obj$R,
batch_var = 'batch',
genes_use = genes_use,
prop = prop,
min_cells = min_cells,
lambda = lambda,
alpha = alpha,
mc.cores = mc.cores,
return_obj = FALSE,
verbose = FALSE
# verbose = TRUE
)
```