Learn R Programming

edgeR (version 3.8.6)

diffSpliceDGE: Test for Differential Exon Usage

Description

Given a negative binomial generalized log-linear model fit at the exon level, test for differential exon usage between experimental conditions.

Usage

diffSpliceDGE(fit.exon, coef=ncol(fit.exon$design), geneid, exonid=NULL, verbose=TRUE)

Arguments

fit.exon
an DGEGLM fitted model object produced by glmFit. Rows should correspond to exons.
coef
integer indicating which coefficient of the generalized linear model is to be tested for differential exon usage. Defaults to the last coefficient.
geneid
gene identifiers. Either a vector of length nrow(fit.exon) or the name of the column of fit.exon$genes containing the gene identifiers. Rows with the same ID are assumed to belong to the same gene.
exonid
exon identifiers. Either a vector of length nrow(fit.exon) or the name of the column of fit.exon$genes containing the exon identifiers.
verbose
logical, if TRUE some diagnostic information about the number of genes and exons is output.

Value

diffSpliceDGE produces an object of class DGELRT containing the component design from fit.exon plus the following new components:
comparison
character string describing the coefficient being tested.
coefficients
numeric vector of coefficients on the natural log scale. Each coefficient is the difference between the log-fold-change for that exon versus the average log-fold-change for the rest exons within the same gene.
exon.F
numeric vector of F-statistics for exons.
exon.df.test
numeric vector of testing degrees of freedom for exons.
exon.df.prior
numeric vector of prior degrees of freedom for exons.
exon.df.residual
numeric vector of residual degrees of freedom for exons.
exon.p.value
numeric vector of p-values for exons.
genes
data.frame of exon annotation
genecolname
character string giving the name of the column of genes containing gene IDs.
exoncolname
character string giving the name of the column of genes containing exon IDs.
gene.df.test
numeric vector of testing degrees of freedom for genes.
gene.df.prior
numeric vector of prior degrees of freedom for genes.
gene.df.residual
numeric vector of residual degrees of freedom for genes.
gene.Simes.p.value
numeric vector of Simes' p-values for genes.
gene.F
numeric vector of F-statistics for gene-level test.
gene.F.p.value
numeric vector of F-test p-values for genes.
gene.genes
data.frame of gene annotation.
The information and testing results for both exons and genes are sorted by geneid and by exonid within gene.

Details

This function tests for differential exon usage for each gene for a given coefficient of the generalized linear model.

Testing for differential exon usage is equivalent to testing whether the exons in each gene have the same log-fold changes as the other exons in the same gene. At exon-level, each exon is compared to the average of all other exons for the same gene using quasi-likelihood F-tests. At gene-level, two different tests are provided. The first is converting exon-level p-values to gene-level p-values by Simes method. The other is an F-test for differences between the exon log-fold-changes within each gene.

Examples

Run this code
# Gene exon annotation
Gene <- paste("G", 1:10, sep="")
Gene <- rep(Gene, each=10)
Exon <- paste("Ex", 1:10, sep="")
Gene.Exon <- paste(Gene, Exon, sep=".")
genes <- data.frame(GeneID=Gene, Gene.Exon=Gene.Exon)

design <- model.matrix(~c(0,0,0,1,1,1))
mu <- matrix(20, 100, 6)
mu[1,4:6] <- 200
counts <- matrix(rnbinom(600,mu=mu,size=20),100,6)

y <- DGEList(counts=counts, lib.size=rep(1e6,6), genes=genes)
gfit <- glmFit(y, design, dispersion=0.05)

ds <- diffSpliceDGE(gfit, geneid="GeneID")
topSpliceDGE(ds)
plotSpliceDGE(ds)

Run the code above in your browser using DataLab