colPrinComp1: First Principal Component (PC1) Gene Signature

View source: R/utils.R

colPrinComp1R Documentation

First Principal Component (PC1) Gene Signature

Description

[Experimental]

This helper function returns the first principal component from an assay stored as a matrix.

Usage

colPrinComp1(x, center = TRUE, scale = TRUE)

Arguments

x

(matrix)
containing numeric data with genes in rows and samples in columns, no missing values are allowed.

center

(flag)
whether the variables should be zero centered.

scale

(flag)
whether the variables should be scaled to have unit variance.

Value

A numeric vector containing the principal component values for each column in x.

Examples

object <- hermes_data %>%
  add_quality_flags() %>%
  filter() %>%
  normalize() %>%
  assay("counts")

colPrinComp1(object)

insightsengineering/hermes documentation built on Sept. 19, 2024, 9:06 p.m.