lin_reg: Linear Regression of Principal Components

Description Usage Arguments Value

View source: R/lin_reg.R

Description

Calculates Linear Regression of Principal Components 1 and 2 of the data to see if the batch is correlated to the data.

Usage

1
2
3
4
5
6
7
8
lin_reg(
  exprData,
  batch.info,
  batch = "Batch",
  NameString = "",
  when = "",
  return.plot = FALSE
)

Arguments

exprData

A matrix containing gene expression data. Row names should be samples and column names should be genes.

batch.info

A data frame containing the samples names and details of the batch they belong to.

batch

Title of the batch the data is being corrected for.

when

String indicating when the linear regression analysis is taking place (before batch correction or after batch correction?). Values should be either "before" or "after".

return.plot

Should the plot be returned as an object to the environment? If FALSE, plot is saved to a pdf file, if TRUE, plot is returned to the environment. Default = FALSE

Value

Returns the p-value associated with first ten principal components after linear regression analysis. If return.plot=TRUE, plots showing batch effects are also returned.


jankinsan/BatchEC documentation built on Sept. 9, 2021, 8:12 p.m.