PCA related functions used in quality control.

QCPCA(
  deobj,
  var.genes = NULL,
  remove.sample = NULL,
  transform.method = c("rlog", "vst", "ntd"),
  batch = NULL,
  raw.deobj = NULL,
  min.count = 10,
  colby = NULL,
  legend.pos = c("bottom", "top", "left", "right", "none"),
  outlier.detection = TRUE,
  rpca.method = c("PcaGrid", "PcaHubert"),
  k = 2,
  ...
)

Arguments

deobj

Object created by DESeq2 or edgeR.

var.genes

Select genes with larger variance for PCA analysis. Default: all genes.

remove.sample

Sample(s) to remove. Default: NULL.

transform.method

Data transformation methods, chosen from rlog, vst and ntd. Default: rlog.

batch

Batch column to conduct batch correction. Default value is NULL, do not conduct batch correction.

raw.deobj

Object created by DESeq2 or edgeR before filtering with counts. Default: NULL.

min.count

A feature is considered to be detected if the corresponding number of read counts is > min.count. By default, min.count = 10.

colby

Group information to color samples. Default: NULL.

legend.pos

Position of legend ('top', 'bottom', 'left', 'right', 'none'). Default: bottom.

outlier.detection

Logical value. If TRUE, conduct outlier detection with robust PCA. Default: TRUE.

rpca.method

Robust PCA method, chosen from PcaGrid, PcaHubert. Default: PcaGrid.

k

Number of principal components to compute, for PcaGrid, PcaHubert. Default: 2.

...

Parameter for PcaGrid, PcaHubert.

Value

List contains all step plots, final PCA results, final deobj.

Examples

library(DESeq2) library(DEbPeak) count.file <- system.file("extdata", "snon_count.txt", package = "DEbPeak") meta.file <- system.file("extdata", "snon_meta.txt", package = "DEbPeak") count.matrix <- read.table(file = count.file, header = TRUE, sep = "\t") meta.info <- read.table(file = meta.file, header = TRUE) dds <- DESeq2::DESeqDataSetFromMatrix(countData = count.matrix, colData = meta.info, design = ~condition)
#> Warning: some variables in design formula are characters, converting to factors
keep.genes <- rowSums(DESeq2::counts(dds, normalized = FALSE)) >= 10 dds <- dds[keep.genes, ] pcs_res <- QCPCA( deobj = dds, var.genes = NULL, remove.sample = NULL, transform.method = "rlog", outlier.detection = TRUE, rpca.method = "PcaGrid" )
#> Conduct PCA analysis!
#> Differential expression analysis with DESeq2!
#> Use all genes for PCA!
#> Conduct outlier detection!
#> Differential expression analysis with DESeq2!
#> Use all genes for PCA!
#> Detecting 2 outlier(s): KO3,WT1
#> Differential expression analysis with DESeq2!
#> Use all genes for PCA!