View source: R/import_functs.R
import_data | R Documentation |
import_data()
imports data from a collection of R objects to create a sceptre_object
. Users can create either a standard sceptre
object or an ondisc
-backed sceptre
object; the latter is more appropriate for large-scale data. See Chapter 1 of the manual for more detailed information about this function.
import_data(
response_matrix,
grna_matrix,
grna_target_data_frame,
moi,
extra_covariates = data.frame(),
response_names = NA_character_,
use_ondisc = FALSE,
directory_to_write = NULL
)
response_matrix |
a matrix of response UMI counts, with responses in rows and cells in columns. The matrix should be of type |
grna_matrix |
a matrix of gRNA UMI counts, with gRNAs in rows and cells in columns. The matrix should be of type |
grna_target_data_frame |
a data frame containing columns |
moi |
a string indicating the MOI of the dataset, either "low" or "high". |
extra_covariates |
(optional) a data frame containing extra covariates (e.g., batch, biological replicate) beyond those that |
response_names |
(optional) a vector of human-readable response names; names with the prefix "MT-" are taken as mitochondrial genes and are used to compute the covariate |
use_ondisc |
(default |
directory_to_write |
(optional) a file path to a directory in which to write the backing |
an initialized sceptre_object
library(sceptredata)
data("lowmoi_example_data")
# 1. initialize a standard sceptre_object from R objects
sceptre_object <- import_data(
response_matrix = lowmoi_example_data$response_matrix,
grna_matrix = lowmoi_example_data$grna_matrix,
grna_target_data_frame = lowmoi_example_data$grna_target_data_frame,
extra_covariates = lowmoi_example_data$extra_covariates,
moi = "low"
)
# 2. initialize an ondisc-backed sceptre_object from R objects
sceptre_object <- import_data(
response_matrix = lowmoi_example_data$response_matrix,
grna_matrix = lowmoi_example_data$grna_matrix,
grna_target_data_frame = lowmoi_example_data$grna_target_data_frame,
extra_covariates = lowmoi_example_data$extra_covariates,
moi = "low",
use_ondisc = TRUE,
directory_to_write = tempdir()
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.