run_downsampling: Run one downsampling iteration on Tasic et al. dataset

View source: R/cell_type_DE.R

run_downsamplingR Documentation

Run one downsampling iteration on Tasic et al. dataset

Description

Function designed to pack random cell downsampling code to ease running multiple iterations of this process during acorde benchmarking. Each of these iterations includes three steps: randomly selecting a number of cells form the specified cell types, subsetting the expression matrix and creating an SCE object including ZINBWaVE weights for DE testing (see cell_type_DE).

Usage

run_downsampling(data, id_table, downsampling_ct, cell_no, isoform_col = NULL)

Arguments

data

A data.frame or tibble object including isoforms as rows and cells as columns. Isoform IDs should be included in an independent column, not defined as rownames.

id_table

A data frame including two columns named cell and cell_type, in which correspondence between cell ID and cell type should be provided.

downsampling_ct

A character vector including one or more cell type names (matching those in id_table$cell_type) to be targeted by downsampling.

cell_no

A numeric indicating the number of cells to be randomly sampled during downsampling. Should be the same for all targeted cell types.

isoform_col

Name of the column in data that contains isoform IDs. Otherwise, isoform identifiers will be assumed to be defined as rownames, and this argument will not need to be provided.

Value

An SCE object containing the data after downsampling in assay(counts = data) and id_table as metadata in the colData() slot. This format corresponds to the input of cell_type_DE.


ConesaLab/acorde documentation built on Feb. 25, 2024, 4:16 a.m.