-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path21-MC_construction_discrete.Rmd
50 lines (33 loc) · 1.49 KB
/
21-MC_construction_discrete.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
# Constructing metacells {#Metacell-construction-chapter}
In this chapter, we will demonstrate metacell construction using three different methods: SuperCell in R, MetaCell-2 (MC2) and SEACells in Pyhton.
For this, we will first use a dataset of bone marrow cells from the SeuratData package. This dataset contains around 30K cells and is an example of a dataset with well defined cell types.
For an example of more continuous data, see chapter \@ref(MC-continuous).
```{r include=FALSE}
TO_CACHE <- FALSE
```
```{python true-import, message=FALSE, warning=FALSE, include=FALSE, result=FALSE}
# This is true import section that is executed, but not displayed as it simultaneously load MC2 and SEACells.
# As MC2 and SEACells workflow displayed in separate files, while indeed they run in the same file/session (due to fact that in bookdown one and only one chapter per Rmd file)
# The following import chunks, specific to SEACells and MC2 are not executed, although displayed for users.
import os
import numpy as np
import pandas as pd
import anndata as ad
import scanpy as sc
import matplotlib.pyplot as plt
import seaborn as sns
import metacells as mc
import SEACells
import random
import warnings
warnings.filterwarnings('ignore')
```
## SuperCell (R) {#SuperCell-construction}
```{r, child='./sub_pages/21-supercell.Rmd'}
```
## MC2 (Python) {#MC2-construction}
```{r, child = './sub_pages/21-mc2.Rmd'}
```
## SEACells (Python) {#SEACells-construction}
```{r child='./sub_pages/21-seacells.Rmd'}
```