Execute the core EM algorithm for transcript quantification with full parameter control. This is the main quantification phase that integrates short-read and optional long-read data.

mpaqt_postquant(
  index,
  sr_counts,
  lr_counts = NULL,
  prequant = NULL,
  prior_model = NULL,
  do_umi_correction = FALSE,
  umi_correction_timing = "post",
  normalize = "tpm",
  max_iter = 100L,
  tolerance = 1e-04,
  prior_start = 50L,
  convergence_start = 25L,
  compute_uncertainty = FALSE,
  verbose = TRUE
)

Arguments

index

An mpaqt_index object

sr_counts

An mpaqt_counts_sr object with short-read EC counts

lr_counts

An mpaqt_counts_lr object with long-read counts (optional)

prequant

An mpaqt_prequant object with positional weights (optional)

prior_model

Prior specification: NULL (none), "shrinkage" (empirical), "long_read" (from LR data), or a list with mean and precision vectors

do_umi_correction

Normalize each transcript P matrix so its x values sum to 1 before running EM. This is mainly intended for UMI-based single-cell data.

umi_correction_timing

When do_umi_correction = TRUE and positional weights are used, normalize transcript probabilities either before applying positional weights ("pre") or after weighting ("post", default).

normalize

Normalization method: "tpm" (default), "depth", or "none"

max_iter

Maximum EM iterations (default: 100)

tolerance

Convergence tolerance (default: 1e-4)

prior_start

Iteration to start using prior (default: 25)

convergence_start

Iteration to start checking convergence (default: 25)

compute_uncertainty

Compute uncertainty estimates (default: FALSE)

verbose

Print progress messages (default: TRUE)

Value

An mpaqt_quant_result object with full quantification results

Details

Post-quantification performs the main EM algorithm that estimates transcript abundances. It can optionally use:

  • Positional weights from pre-quantification to correct for positional bias

  • Long-read data for improved isoform disambiguation

  • Prior information for regularization

  • UMI correction to renormalize P matrices for single-cell data

Prior Models

  • NULL: No prior, pure maximum likelihood

  • "shrinkage": Empirical Bayes shrinkage toward grand mean

  • "long_read": Use long-read counts as informative prior

  • Custom list: User-specified prior mean and precision

Normalization

  • "tpm": Transcripts per million (standard)

  • "depth": Sequencing depth normalized (raw counts / total * 1e6)

  • "none": Return raw abundance estimates

Examples

if (FALSE) { # \dontrun{
# Basic quantification
result <- mpaqt_postquant(
    index = idx,
    sr_counts = sr
)

# With long reads and bias correction
result <- mpaqt_postquant(
    index = idx,
    sr_counts = sr,
    lr_counts = lr,
    prequant = prequant
)

# With custom prior
result <- mpaqt_postquant(
    index = idx,
    sr_counts = sr,
    prior_model = list(
        mean = gene_means,
        precision = 1/gene_vars
    )
)
} # }