SDA_counts_preproc: Preprocess Raw Count Matrix for SDA

SDA_counts_preprocR Documentation

Preprocess Raw Count Matrix for SDA

Description

This function preprocesses a raw gene expression count matrix by performing basic quality control checks, computing library sizes, and visualizing feature distributions per cell/sample. It returns a list containing the filtered expression matrix and selected features.

Usage

SDA_counts_preproc(rawCountMat, minLibrarySize = 1)

Arguments

rawCountMat

A numeric matrix or sparse matrix where rows represent features (genes) and columns represent cells/samples.

minLibrarySize

Integer. Minimum library size threshold for filtering (default: 1).

Details

The function checks if the number of cells/samples exceeds recommended limits for SDA (Sparse Decomposition of Arrays). It then calculates total features per cell, generates a density plot with peak estimation, and returns the input data along with feature metadata.

Value

A list containing:

GEX

Preprocessed count matrix (same as input for now).

featuresToUse

Vector of feature (gene) names included in preprocessing.

minLibrarySize

The minimum library size threshold used.

Examples

## Not run: 
if(requireNamespace("Matrix", quietly = TRUE)) {
    raw_counts <- Matrix::Matrix(rpois(1000, lambda = 10), nrow = 100, ncol = 10, sparse = TRUE)
    processed_data <- SDA_counts_preproc(raw_counts)
    str(processed_data)
}

## End(Not run)

eisascience/scCustFx documentation built on June 2, 2025, 3:59 a.m.