Title: | Negative Binomial Additive Model for RNA-Seq Data |
---|---|
Description: | High-throughput sequencing experiments followed by differential expression analysis is a widely used approach to detect genomic biomarkers. A fundamental step in differential expression analysis is to model the association between gene counts and covariates of interest. NBAMSeq a flexible statistical model based on the generalized additive model and allows for information sharing across genes in variance estimation. |
Authors: | Xu Ren [aut, cre], Pei Fen Kuan [aut] |
Maintainer: | Xu Ren <[email protected]> |
License: | GPL-2 |
Version: | 1.23.0 |
Built: | 2024-10-30 08:27:33 UTC |
Source: | https://github.com/bioc/NBAMSeq |
This function makes an example NBAMSeqDataSet
makeExample(n = 200, m = 30)
makeExample(n = 200, m = 30)
n |
number of genes |
m |
number of samples |
a NBAMSeqDataSet object
Love, M.I., Huber, W., Anders, S. (2014) Moderated estimation of fold change and dispersion for RNA-seq data with DESeq2. Genome Biology, 15:550. https://doi.org/10.1186/s13059-014-0550-8
gsd = makeExample()
gsd = makeExample()
This function makes plots to visualize nonlinear associations.
makeplot(object, phenoname, genename, ...)
makeplot(object, phenoname, genename, ...)
object |
a NBAMSeqDataSet object |
phenoname |
the name of nonlinear variable to be visualized |
genename |
the name of gene to be visualized |
... |
additional arguments provided to |
the plot made by plot.gam() function
gsd = makeExample(n = 3, m = 10) gsd = NBAMSeq(gsd) makeplot(gsd, "pheno", "gene3", main = "gene10")
gsd = makeExample(n = 3, m = 10) gsd = NBAMSeq(gsd) makeplot(gsd, "pheno", "gene3", main = "gene10")
This function performs differential expression analysis based on negative binomial additive model.
NBAMSeq(object, gamma = 2.5, parallel = FALSE, fitlin = FALSE, BPPARAM = bpparam(), ...)
NBAMSeq(object, gamma = 2.5, parallel = FALSE, fitlin = FALSE, BPPARAM = bpparam(), ...)
object |
a NBAMSeqDataSet object |
gamma |
a number greater or equal to 1. Increase gamma to create
smoother models. Default gamma is 2.5. See |
parallel |
either TRUE or FALSE indicating whether parallel should be used. Default is FALSE |
fitlin |
either TRUE or FALSE indicating whether linear model should be fitted. Default is FALSE |
BPPARAM |
|
... |
additional arguments provided to |
a NBAMSeqDataSet object
Love, M.I., Huber, W., Anders, S. (2014) Moderated estimation of fold change and dispersion for RNA-seq data with DESeq2. Genome Biology, 15:550. https://doi.org/10.1186/s13059-014-0550-8
gsd = makeExample(n = 3, m = 10) gsd = NBAMSeq(gsd)
gsd = makeExample(n = 3, m = 10) gsd = NBAMSeq(gsd)
Accessor functions and replace methods for NBAMSeqDataSet object
For getDesign()
: accessor to the design formula
For getsf()
: accessor to the size factors
Replace methods for NBAMSeqDataSet object
For setsf()
: replace size factors
getDesign(theObject) ## S4 method for signature 'NBAMSeqDataSet' getDesign(theObject) getsf(theObject) ## S4 method for signature 'NBAMSeqDataSet' getsf(theObject) setsf(theObject) <- value ## S4 replacement method for signature 'NBAMSeqDataSet,numeric' setsf(theObject) <- value
getDesign(theObject) ## S4 method for signature 'NBAMSeqDataSet' getDesign(theObject) getsf(theObject) ## S4 method for signature 'NBAMSeqDataSet' getsf(theObject) setsf(theObject) <- value ## S4 replacement method for signature 'NBAMSeqDataSet,numeric' setsf(theObject) <- value
theObject |
a NBAMSeqDataSet object |
value |
the values to be included in the object |
For getDesign()
: design formula
For getsf()
: size factor
For setsf()
: NBAMSeq object
Love, M.I., Huber, W., Anders, S. (2014) Moderated estimation of fold change and dispersion for RNA-seq data with DESeq2. Genome Biology, 15:550. https://doi.org/10.1186/s13059-014-0550-8
## For getDesign() ## gsd = makeExample() design_gsd = getDesign(gsd) ## For getsf() ## gsd = makeExample() sf = getsf(gsd) ## For setsf() ## n = 100 m = 50 gsd = makeExample(n = n, m = m) sf = sample(1:5, m, replace = TRUE) setsf(gsd) = sf
## For getDesign() ## gsd = makeExample() design_gsd = getDesign(gsd) ## For getsf() ## gsd = makeExample() sf = getsf(gsd) ## For setsf() ## n = 100 m = 50 gsd = makeExample(n = n, m = m) sf = sample(1:5, m, replace = TRUE) setsf(gsd) = sf
NBAMSeqDataSet constructor
NBAMSeqDataSet(countData, colData, design, ...)
NBAMSeqDataSet(countData, colData, design, ...)
countData |
a matrix or data frame contains gene count |
colData |
a |
design |
a mgcv type design. e.g. |
... |
optional arguments passed to |
a NBAMSeqDataSet object
n = 100 ## n stands for number of genes m = 20 ## m stands for sample size countData = matrix(rnbinom(n*m, mu=100, size=1/3), ncol = m) mode(countData) = "integer" colnames(countData) = paste0("sample", 1:m) rownames(countData) = paste0("gene", 1:n) pheno = runif(m, 20, 80) colData = data.frame(pheno = pheno) rownames(colData) = paste0("sample", 1:m) gsd = NBAMSeqDataSet(countData = countData, colData = colData, design = ~s(pheno))
n = 100 ## n stands for number of genes m = 20 ## m stands for sample size countData = matrix(rnbinom(n*m, mu=100, size=1/3), ncol = m) mode(countData) = "integer" colnames(countData) = paste0("sample", 1:m) rownames(countData) = paste0("gene", 1:n) pheno = runif(m, 20, 80) colData = data.frame(pheno = pheno) rownames(colData) = paste0("sample", 1:m) gsd = NBAMSeqDataSet(countData = countData, colData = colData, design = ~s(pheno))
NBAMSeqDataSet
is a class inherited from
SummarizedExperiment
.
It is used to store the count matrix, colData, and design formula
in differential expression analysis.
design
a mgcv-type design formula
Martin Morgan, Valerie Obenchain, Jim Hester and Hervé Pagès (2018). SummarizedExperiment: SummarizedExperiment container. R package version 1.12.0.
This function pulls out result from NBAMSeqDataSet object
returned by NBAMSeq
results(object, name, contrast, indepfilter = TRUE, alpha = 0.1, pAdjustMethod = "BH", parallel = FALSE, BPPARAM = bpparam(), ...)
results(object, name, contrast, indepfilter = TRUE, alpha = 0.1, pAdjustMethod = "BH", parallel = FALSE, BPPARAM = bpparam(), ...)
object |
a NBAMSeqDataSet object returned by |
name |
the name of nonlinear variable or continuous linear variable |
contrast |
a character of length 3. 1st element: name of factor variable; 2nd element: name of numerator level; 3rd element: name of denominator level. contrast = c("group", "treatment", "control") means comparing treatment vs control for group variable. |
indepfilter |
either TRUE or FALSE indicating whether independent filtering should be performed. Default is TRUE. |
alpha |
significant threhold for declaring genes as differentially expressed. Default is 0.1. |
pAdjustMethod |
pvalue adjustment method. Default is "BH". See
|
parallel |
either TRUE or FALSE indicating whether parallel should be used. Default is FALSE. |
BPPARAM |
|
... |
additional arguments provided to |
a DataFrame which contains the result
Love, M.I., Huber, W., Anders, S. (2014) Moderated estimation of fold change and dispersion for RNA-seq data with DESeq2. Genome Biology, 15:550. https://doi.org/10.1186/s13059-014-0550-8
gsd = makeExample(n = 3, m = 10) gsd = NBAMSeq(gsd) res = results(gsd, name = "pheno")
gsd = makeExample(n = 3, m = 10) gsd = NBAMSeq(gsd) res = results(gsd, name = "pheno")