SPARSim_estimation: Estimate Parameters From Real Datasets by SPARSim

View source: R/19-SPARSim.R

SPARSim_estimationR Documentation

Estimate Parameters From Real Datasets by SPARSim

Description

This function is used to estimate useful parameters from a real dataset by using SPARSim_estimate_parameter_from_data function in SPARSim package.

Usage

SPARSim_estimation(ref_data, verbose = FALSE, other_prior = NULL, seed)

Arguments

ref_data

A count matrix. Each row represents a gene and each column represents a cell.

verbose

Logical.

other_prior

A list with names of certain parameters. Some methods need extra parameters to execute the estimation step, so you must input them. In simulation step, the number of cells, genes, groups, batches, the percent of DEGs are usually customed, so before simulating a dataset you must point it out. See Details below for more information.

seed

An integer of a random seed.

Details

In SPARSim, the information of cell group condition can be input if neccessary by other_prior = list(group.condition = xxx). Note that the cell group condition must be an integer vactor (e.g. 1, 2, 3, ...) to specify which condition that each cell belongs to. See Examples below for more.

Value

A list contains the estimated parameters and the results of execution detection.

References

Baruzzo G, Patuzzi I, Di Camillo B. SPARSim single cell: a count data simulator for scRNA-seq data. Bioinformatics, 2020, 36(5): 1468-1475. https://doi.org/10.1093/bioinformatics/btz752

Gitlab URL: https://gitlab.com/sysbiobig/sparsim

Examples

## Not run: 
ref_data <- simmethods::data

# 1) Estimation without cell group information
estimate_result <- simmethods::SPARSim_estimation(
  ref_data = ref_data,
  other_prior = NULL,
  verbose = TRUE,
  seed = 111
)

# 2) Estimation with cell group information (Note that an integer vector to specify
# which condition that each cell belongs to)
group_condition <- as.numeric(simmethods::group_condition)
estimate_result <- simmethods::SPARSim_estimation(
  ref_data = ref_data,
  other_prior = list(group.condition = group_condition),
  verbose = TRUE,
  seed = 111
)

# 3) Users can also utilize spike-in genes to estimate parameters. In this case, users
## must input dilution.factor and volume (nanoliter) parameters. Note that the
## reference matrix must contain spike-in gene counts.
ref_data <- simmethods::data

group_condition <- as.numeric(simmethods::group_condition)
estimate_result <- simmethods::SPARSim_estimation(
  ref_data = ref_data,
  other_prior = list(group.condition = group_condition,
                     dilution.factor = 50000,
                     volume = 0.01),
  verbose = TRUE,
  seed = 111
)
## check spike-in parameters
spikein_params <- estimate_result[["estimate_result"]][["SPARSim_spikein_parameter"]]

## End(Not run)


duohongrui/simmethods documentation built on June 17, 2024, 10:49 a.m.