calc.het.feat: Calculate Age-related Expression and Heterogeneity Changes...

Description Usage Arguments Value Examples

View source: R/heterogeneity.R

Description

Calculate Age-related Expression and Heterogeneity Changes for Gene

Usage

1
2
calc.het.feat(exprs, age, modex = "linear",
  het_change_met = "spearman")

Arguments

exprs

a numeric vector with the expression values, ordered the same as age vector

age

a numeric vector, where the names correspond to samples (the same as colnames of the given matrix).

modex

expression change calculation method. 'linear' or 'loess', defaults to 'linear'

het_change_met

heterogeneity change calculation method. 'LR', for 'linear regression', or and correlation method accepted by cor.test() function.

Value

a list with i) summary results with the effect size and p value for expression level and heterogeneity changes, ii) residuals from expr~age model, which corresponds to unexplained variance, iii) expression values passed into the function.

Examples

1
2
3
4
5
6
7
myexp <- rnorm(n = 20, mean = sample(1:3, 1), sd = sample(c(1, 3), 1))
agevec <- sample(20:80,20)
het_result <- calc.het.feat(myexp, agevec)
head(het_result$summary) # summary statistics
het_result$residuals # heterogeneity values: residuals
het_result$expression  # input expression values
all(myexp == het_result$expression)

mdonertas/hetAge documentation built on Jan. 2, 2020, 12:53 a.m.