edgeRcommand: Export an DGEList, designMatrix, and contrastMatrix to files...

View source: R/edgeR-slurm-lsf.R

edgeRcommandR Documentation

Export an DGEList, designMatrix, and contrastMatrix to files and return the command to run the edgeR script

Description

Export an DGEList, designMatrix, and contrastMatrix to files and return the command to run the edgeR script

Usage

edgeRcommand(
  dgeList,
  designMatrix,
  contrastMatrix,
  outdir = "edgeR_output",
  outfilePrefix = "an-unnamed-project-",
  mps = FALSE,
  limmaVoom = FALSE,
  appendGmt = NULL,
  debug = FALSE,
  rootPath = "/pstore/apps/bioinfo/geneexpression/",
  contrastAnno = NULL
)

Arguments

dgeList

An DGEList object with counts, genes, and samples

designMatrix

The design matrix to model the data

contrastMatrix

The contrast matrix matching the design matrix

outdir

Output directory of the edgeR script. Default value "edgeR_output".

outfilePrefix

Prefix of the output files, for instance a reasonable name of the project, to identify the files uniquely. The files will be written in file.path(OUTDIR, 'input_data').

mps

Logical, whether molecular-phenotyping analysis is run.

limmaVoom

Logical, whether the limma-voom model is run instead of the edgeR model

appendGmt

NULL or character string, path to an additional GMT file besides the default GMT file used to perform gene-set analysis. The GMT file must exist.

debug

Logical, if TRUE, the source code of Rscript is used instead of the installed version.

rootPath

Character, the root path of the script

contrastAnno

A data.frame or NULL, contrast annotation.

Note

Following checks are done internally:

  • The design matrix must have the same number of rows as the columns of the count matrix.

  • The contrast matrix must have the same number of rows as the columns of the design matrix.

  • Row names of the design matrix match the column names of the expression matrix. In case of suspect, the program will stop and report.

The output file names start with the outfilePrefix, followed by '-' and customed file suffixes.

Examples


 mat <- matrix(rnbinom(100, mu=5, size=2), ncol=10)
 rownames(mat) <- sprintf("gene%d", 1:nrow(mat))
 myFac <- gl(2,5, labels=c("Control", "Treatment"))
 y <- edgeR::DGEList(counts=mat, group=myFac)
 myDesign <- model.matrix(~myFac); colnames(myDesign) <- levels(myFac)
 myContrast <- limma::makeContrasts(Treatment, levels=myDesign)
 edgeRcommand(y, designMatrix=myDesign, contrastMatrix=myContrast,
     outfilePrefix="test", outdir=tempdir())


bedapub/ribiosNGS documentation built on Feb. 10, 2025, 12:34 a.m.