View source: R/import_from_cellranger.R
create_odm_from_cellranger | R Documentation |
odm
object from Cell Rangercreate_odm_from_cellranger()
initializes an odm
object, taking as input the output of one or more calls to Cell Ranger count. The number of odm
objects returned corresponds to the number of modalities in the input data. Additionally, the cell-wise covariate data frame is computed and returned. create_odm_from_cellranger()
supports the Cell Ranger modalities "Gene Expression", "CRISPR Guide Capture", and "Antibody Capture".
create_odm_from_cellranger(
directories_to_load,
directory_to_write,
write_cellwise_covariates = TRUE,
chunk_size = 1000L,
compression_level = 3L,
grna_target_data_frame = NULL
)
directories_to_load |
a character vector specifying the locations of the directories to load. Each directory should contain the files "matrix.mtx.gz" and "features.tsv.gz" (and optionally "barcodes.tsv.gz", which is ignored). |
directory_to_write |
a string indicating the directory in which to write the backing .odm files. |
write_cellwise_covariates |
(optional; default |
chunk_size |
(optional; default |
compression_level |
(optional; default |
grna_target_data_frame |
(optional) a data frame mapping each gRNA ID to its target. Relevant only if the CRISPR modality is present within the data. (See note.) |
a list containing the odm object(s) and cellwise covariates.
The grna_target_data_frame
is relevant only for CRISPR screen data (i.e., data for which the "CRISPR Guide Capture" modality is present). In single-cell CRISPR screens, gRNAs are delivered to cells via a viral vector. Some recent single-cell CRISPR screens involve a special design in which each viral vector harbors multiple gRNAs. For example, Replogle 2022 conducted a screen in which each viral vector contained two gRNAs, each targeting the same site. In such screens, users may wish to "collapse" the gRNA count matrix by summing over the UMI counts of gRNAs contained on the same vector. To do so, users can pass the argument grna_target_data_frame
, which is a data frame containing two columns: grna_id
and vector_id
. grna_id
should coincide with the gRNA IDs as contained within the features.tsv
file, and vector_id
should be a string indicating the vector to which a given gRNA ID belongs. The expression vectors of gRNAs contained within the same vector are summed.
The arguments chunk_size
and compression_level
control the extent to which the backing .odm
files are compressed, with higher values corresponding to smaller file sizes (albeit possibly longer read and write times).
library(sceptredata)
directories_to_load <- paste0(
system.file("extdata", package = "sceptredata"),
"/highmoi_example/gem_group_", c(1, 2)
)
directory_to_write <- tempdir()
out_list <- create_odm_from_cellranger(
directories_to_load = directories_to_load,
directory_to_write = directory_to_write,
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.