rna_seq_dea: RNA-Seq statistical analysis

View source: R/rnaseqdea.R

rna_seq_deaR Documentation

RNA-Seq statistical analysis

Description

Helper function for RNA-Seq statistical analysis

Usage

rna_seq_dea(
  data,
  cls,
  com,
  stats.method = "stats_TSPM",
  norm.method = "TMM",
  ep = 0,
  ...
)

Arguments

data

a data frame with gene x replicate format

cls

a vector for class/group information

com

a character string for comparison

stats.method

statistical analysis methods for RNA-Seq

norm.method

normalisation method

ep

an integer for plotting ellipse. 1 and 2 for plotting overall and group ellipse, respectively. Otherwise, none. This is for PCA and MDS plot.

...

further parameters to stats.method

Value

a list with contents:

  • ma.p MA plot

  • volcano.p volcano plot

  • hist.p histogram

  • data.s normalised data set with highly expressed variables

  • mad.p MAD plot

  • pca PCA values

  • pca.p PCA plot

  • box.p boxplot

Examples

## data set from R package 'pasilla' 
dn <- system.file("extdata/pasilla_gene_counts.tsv", package = "rnaseqdea")
data <- read.table(dn, header = TRUE, row.names = 1, quote = "", comment.char = "")
cls <- c("untreated", "untreated", "untreated", "untreated", 
         "treated", "treated", "treated")
cls <- as.factor(cls)

if (TRUE) {
  keep <- rowSums(data) > 6000
} else {
  ## Filter low expression tags
  ## cpms <- edgeR::cpm(data)
  cpms <- t(t(data) / (1e-6 * colSums(data)))
  keep <- rowSums(cpms > 0.5) >= 2            # from edgeR workflow
}
sum(keep)
data <- data[keep, ]

res <- rna_seq_dea(data, cls, com = levels(cls), stats.method = "stats_edgeR",
                   norm.method = "DESeq", ep = 2)
names(res)									 
head(res$stats)
res$rej.num
dim(res$data)
dim(res$data.s)

res$ma.p
res$volcano.p
res$hist.p
res$mds.p
res$pca.p

wanchanglin/rnaseqdea documentation built on June 2, 2025, 1:05 a.m.