k_qsvs: Apply num.sv algorithm to determine the number of pcs to be...

View source: R/k_qsvs.R

k_qsvsR Documentation

Apply num.sv algorithm to determine the number of pcs to be included

Description

Apply num.sv algorithm to determine the number of pcs to be included

Usage

k_qsvs(rse_tx, mod, assayname)

Arguments

rse_tx

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

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

integer representing number of pcs to be included

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)
k_qsvs(rse_tx, mod, "tpm")

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