scran_norm
Scaling normalization of single-cell data
Loading...
Searching...
No Matches
Public Attributes | List of all members
scran_norm::SanitizeSizeFactorsOptions Struct Reference

Options for sanitize_size_factors(). More...

#include <sanitize_size_factors.hpp>

Public Attributes

SanitizeAction handle_zero = SanitizeAction::ERROR
 
SanitizeAction handle_negative = SanitizeAction::ERROR
 
SanitizeAction handle_nan = SanitizeAction::ERROR
 
SanitizeAction handle_infinite = SanitizeAction::ERROR
 

Detailed Description

Options for sanitize_size_factors().

Member Data Documentation

◆ handle_zero

SanitizeAction scran_norm::SanitizeSizeFactorsOptions::handle_zero = SanitizeAction::ERROR

How should we handle zero size factors? If SANITIZE, they will be automatically set to the smallest valid size factor (or 1, if all size factors are invalid).

This approach is motivated by the observation that size factors of zero are typically generated from all-zero cells. By replacing the size factor with a finite value, we ensure that any all-zero cells are represented by all-zero columns in the normalized matrix, which is a reasonable outcome if those cells cannot be filtered out during upstream quality control.

We also need to handle cases where a zero size factor may be generated from a cell with non-zero rows, e.g., with MedianSizeFactors. By using a "relatively small" replacement value, we ensure that the normalized values reflect the extremity of the scaling.

◆ handle_negative

SanitizeAction scran_norm::SanitizeSizeFactorsOptions::handle_negative = SanitizeAction::ERROR

How should we handle negative size factors? If SANITIZE, they will be automatically set to the smallest valid size factor (or 1, if all size factors are invalid), following the same logic as SanitizeSizeFactorsOptions::handle_zero.

◆ handle_nan

SanitizeAction scran_norm::SanitizeSizeFactorsOptions::handle_nan = SanitizeAction::ERROR

How should we handle NaN size factors? If `SANITIZE, NaN size factors will be automatically set to 1, meaning that scaling is a no-op.

◆ handle_infinite

SanitizeAction scran_norm::SanitizeSizeFactorsOptions::handle_infinite = SanitizeAction::ERROR

How should we handle infinite size factors? If SANITIZE, infinite size factors will be automatically set to the largest valid size factor (or 1, if all size factors are invalid). This ensures that any normalized values will be, at least, finite; the choice of a relatively large replacement value reflects the extremity of the scaling.


The documentation for this struct was generated from the following file: