Given metacells (usually from RNA data), project ATAC counts to get a McPeaks object
Source:R/project_on_mc.R
project_atac_on_mc.Rd
Given cell to metacell association, summarise atac counts to generate a McPeaks object.
project_atac_on_mc_from_metacell1
projects given a metacell1 'mc' object, while project_atac_on_mc_from_h5ad
uses the output of the 'metacells' python package (metacell2).
Usage
project_atac_on_mc(
atac,
cell_to_metacell = NULL,
metadata = NULL,
min_int_frac = 0.5,
mc_size_eps_q = 0.1,
id = NULL,
description = NULL,
rm_zero_peaks = TRUE,
ignore_metacells = c(-1, -2)
)
project_atac_on_mc_from_metacell1(
atac,
scdb,
mc_id,
metadata = NULL,
id = NULL,
description = NULL
)
project_atac_on_mc_from_h5ad(
atac,
h5ad_file,
min_int_frac = 0.5,
metadata = NULL,
id = NULL,
description = NULL
)
Arguments
- atac
an ScPeaks object
- cell_to_metacell
a data frame with a column named "cell_id" with cell id and another column named "metacell" with the metacell the cell is part of.
- metadata
(optional) per-metacell metadata. A data frame with a column called 'metacell' and additional metacell annotations.
- min_int_frac
(optional) minimal expected fraction of intersection of barcodes (cell names) in ScPeaks
- mc_size_eps_q
(optional) quantile of MC size (in UMIs) to scale the number of UMIs per metacell. \(egc_ij\) would then be the fraction of peak i in metacell j multiplied by the
mc_size_eps_q
quantile of metacell sizes.- id
an identifier for the object, e.g. "pbmc". If NULL - the id would be taken from the scATAC object
atac
.- description
an identifier for the object, e.g. "pbmc". If NULL - the description would be taken from the scATAC object
atac
- rm_zero_peaks
remove peaks without any reads (all-zero peaks). Default: TRUE
- ignore_metacells
a vector of metacells to ignore. Default: -1, -2 (the "outliers" metacell in the metacell2 python package).
- scdb
a metacell1
scdb
path- mc_id
id of the metacell object within
scdb
- h5ad_file
name of an h5ad file which is the output of 'metacells' python package.
Examples
if (FALSE) {
atac_sc <- import_from_10x("pbmc_data", genome = "hg38")
data(cell_to_metacell_pbmc_example)
atac_mc <- project_atac_on_mc(atac_sc, cell_to_metacell_pbmc_example)
}