qSVA: A wrapper function used to perform qSVA in one step.

View source: R/qSVA.R

qSVAR Documentation

A wrapper function used to perform qSVA in one step.

Description

A wrapper function used to perform qSVA in one step.

Usage

qSVA(
  rse_tx,
  type = c("cell_component", "top1000", "top1500"),
  sig_transcripts = NULL,
  mod,
  assayname
)

Arguments

rse_tx

A RangedSummarizedExperiment-class object containing the transcript data desired to be studied.

type

a character string specifying which model you would like to use from the sets of signature transcripts identified by the qsvaR package. This can be omitted if a custom set of transcripts is provided to sig_transcripts.

sig_transcripts

A list of transcript IDs that are associated with degradation signal. Specifying a character() input with ENSEMBL transcript IDs (whose values should match entries in rownames(rse_tx)). This argument provides a custom list of transcripts for adjusting for degradation; this should be used instead of the type argument.

mod

Model Matrix with necessary variables the you would model for in differential expression

assayname

character string specifying the name of the assay desired in rse_tx

Value

matrix with k principal components for each sample

Examples

## First we need to define a statistical model. We'll use the example
## rse_tx data. Note that the model you'll use in your own data
## might look different from this model.
mod <- model.matrix(~ mitoRate + Region + rRNA_rate + totalAssignedGene + RIN,
    data = colData(rse_tx)
)

## To ensure that the results are reproducible, you will need to set a
## random seed with the set.seed() function. Internally, we are using
## sva::num.sv() which needs a random seed to ensure reproducibility of the
## results.
set.seed(20230621)
qSVA(rse_tx = rse_tx, type = "cell_component", mod = mod, assayname = "tpm")


LieberInstitute/qsvaR documentation built on Nov. 9, 2024, 2:07 p.m.