plotPCsVar: Regression Analysis between PCs and unwanted variation

View source: R/pc_reg_corr.R

plotPCsVarR Documentation

Regression Analysis between PCs and unwanted variation

Description

This function is a part of the data analysis functionality of tcgaCleaneR. R2 values of fitted linear models are used to quantity the strength of the (linear) relationships between a single quantitative source of unwanted variation such as sample (log) library size or tumor purity and global sample summary statistics such as the first k PCs. The function runs linear regression between unwanted variations in TCGA RNA-seq like library size and purity with PCs from computePCA. The output is a linear plot that compares the three assays in SummarizedExperiment TCGA Cancer data across n PCs and R-sq. For variable like Time which is not continuous, dummy variables are used to run vector correlation stats::cancor between dummy time variable and n PCs with the same linear output.

Usage

plotPCsVar(pca.data, data, type, nPCs)

Arguments

pca.data

list: PCA output from computePCA.

data

S4 data object

type

character: The response variable to lm model. groups included are 'librarysize', 'purity' and 'time'.

nPCs

numeric: Number of PCs that needs to be used for regression

Value

Linear Plot the compares the correlation between library size (or Purity, time) and PCs across three datasets. When output is stored in a object the user can also access values used to plot the linear graphs.

Examples

## Not run: 
plotPCsVar(pca.data, data = brca.data, type = "purity", nPCs = 10)
df <- plotPCsVar(pca.data, data = brca.data, type = "time", nPCs = 8)
df

## End(Not run)

AbhishekSinha28/tgcapkg documentation built on May 3, 2022, 7:40 a.m.