Skip to contents

Computes per-sample size factors using DESeq2's median ratio method to normalize for sequencing depth differences across samples. Size factors are estimated from conserved orthologous splice junctions and applied to both splicedIn and splicedOut counts.

Usage

estSizeFactors(se, minCounts = 5)

Arguments

se

SummarizedExperiment. Object from findOSJ containing:

assays$counts

Matrix of orthologous splice junction counts (orthologous splice junctions x sample-states).

rowRanges

GRanges with species-specific donor/acceptor coordinates.

colData

Sample metadata with state (splicedIn/splicedOut), speciesID, and id columns.

minCounts

Numeric. Minimum average splicedIn count across samples for a orthologous splice junction to be included in size factor estimation. Default: 5.

Value

The input SummarizedExperiment with updated sizeFactor column in colData. Size factors are identical for splicedIn and splicedOut states of the same sample.

Details

The function performs the following steps:

  1. Filters to orthologous splice junctions with defined donor/acceptor positions in all species (i.e., conserved orthologous splice junctions present in all species of the orthogroup).

  2. Removes orthologous splice junctions with average splicedIn count below minCounts.

  3. Selects one representative orthologous splice junction per orthogroup (highest average count) to avoid pseudoreplication.

  4. Estimates size factors using DESeq2's median ratio method.

  5. Assigns the same size factor to both splicedIn and splicedOut states for each sample.

Normalization Strategy

Size factors are estimated only from conserved orthologous splice junctions (present in all species) to ensure comparability across the phylogeny. Using one orthologous splice junction per orthogroup prevents highly expressed genes from dominating the normalization.

See also

findOSJ to create the input SummarizedExperiment, runDS for differential splicing analysis (next step), estimateSizeFactors for the underlying method.

Examples

if (FALSE) { # \dontrun{
# After creating the SummarizedExperiment
se <- findOSJ(data, cov = coverage)

# Estimate size factors
se <- estSizeFactors(se, minCounts = 5)

# Check the estimated size factors
colData(se)[, c("sampleID", "state", "sizeFactor")]
} # }