detect_sparse: Filter isoforms by maximum cell type-level proportion of...

View source: R/filtering.R

detect_sparseR Documentation

Filter isoforms by maximum cell type-level proportion of zeros

Description

For convenience, acorde includes a function to assist lenient filtering of isoforms based on the proportion of zero expression values across cell types. Based on this criteria, a minimum number of cells must have non-zero expression in at least one cell type.

Usage

detect_sparse(data, id_table, ct_proportion = 0.2, isoform_col = NULL)

Arguments

data

A data.frame or tibble object including isoforms as rows and cells as columns. Isoform IDs can be included as row names (data.frame) or as an additional column (tibble).

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. The number of rows should be equal to the total number of cell columns in data, and the order of the cell column should match column (i.e. cell) order in data.

ct_proportion

A numeric indicating the minimum proportion of cells with non-zero expression that will be allowed per cell type. Isoforms with a non-zero value proportion below the threshold in all cell types will be flagged as sparse. Defaults to 0.2 (i.e. 20%).

isoform_col

When a tibble is provided in data, a character object indicating the name of the column in which isoform IDs are specified. Otherwise, isoform identifiers will be assumed to be defined as rownames, and this argument will not need to be provided.

Value

A tibble containing two columns, the first one including transcript IDs, and the second containing logical values specifying whether the isoform was flagged as sparse (considering the provided threshold of cell type proportion with non-zero expression).


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