calculateBsFoldChange | R Documentation |
Given count data for binding sites and background regions this function will
compute fold-changes between two condition for each binding site. Computation
is based on DESeq
using the Likelihood ratio test to
disentangle transcription level changes from binding site level changes.
calculateBsFoldChange(
object,
fitType = "local",
sfType = "ratio",
minReplicatesForReplace = 10,
independentFiltering = TRUE,
alpha = 0.05,
pAdjustMethod = "BH",
minmu = 0.5,
filterFun = NULL,
use.lfc.shrinkage = FALSE,
type = c("ashr", "apeglm", "normal"),
svalue = FALSE,
apeAdapt = TRUE,
apeMethod = "nbinomCR",
match.geneID = "geneID",
quiet = TRUE,
veryQuiet = FALSE,
replaceNegative = FALSE,
removeNA = FALSE
)
object |
a |
fitType |
either "parametric", "local", "mean", or "glmGamPoi" for the
type of fitting of dispersions to the mean intensity.
See |
sfType |
either "ratio", "poscounts", or "iterate" for the type of size
factor estimation. See |
minReplicatesForReplace |
the minimum number of replicates required in
order to use replaceOutliers on a sample. See |
independentFiltering |
logical, whether independent filtering should be
applied automatically. See |
alpha |
the significance cutoff used for optimizing the independent
filtering. See |
pAdjustMethod |
he method to use for adjusting p-values. See
|
minmu |
lower bound on the estimated count. See
|
filterFun |
an optional custom function for performing independent
filtering and p-value adjustment. See |
use.lfc.shrinkage |
logical; whether to compute shrunken log2 fold
changes for the DESeq results. See |
type |
if 'ashr', 'apeglml' or 'normal' should be used for fold change
shrinkage. See |
svalue |
logical, should p-values and adjusted p-values be replaced with
s-values when using apeglm or ashr. See |
apeAdapt |
logical, should apeglm use the MLE estimates of LFC to adapt
the prior. See |
apeMethod |
what method to run apeglm, which can differ in terms of
speed. See |
match.geneID |
character; the name of the column with the gene ID in the binding sites meta columns used for matching binding sites to genes |
quiet |
logical; whether to print messages or not |
veryQuiet |
logical; whether to print messages or not |
replaceNegative |
logical; force negative counts to be replaces by 0. Be careful when using this, having negative counts can point towards problems with the gene annotation in use. |
removeNA |
logical; force binding sites with any NA value to be removed. Be careful when using this, having negative counts can point towards problems with the gene annotation in use. |
Fold-changes per binding sites are corrected for transcript level changes. Essentially, background counts are used to model transcript level changes, which are then used to compute fold-changes per binding site, which are corrected for the observed transcript level changes. This is done by using a Likelihood ratio test comparing the full model (~condition + type + condition:type) to the reduced model (~condition + type).
Fold-changes for the transcript level changes are modeled explicitly in a
second round of the DESeq
workflow, using the default
Wald test to compare changes between the conditions (~condition). Counts
attributed to binding sites are removed from the gene level counts.
Results from both calculation rounds can be filtered and further manipulated
with parameters given in the DESeq2 framework
(see results
, lfcShrink
).
This function is intended to be used right after a call of filterBsBackground
.
a BSFDataSet
object, with results from the
DESeq
analysis added to the meta columns of the
binding site ranges.
calculateBsBackground
,
filterBsBackground
,
plotBsBackgroundFilter
,
DESeq
# load clip data
files <- system.file("extdata", package="BindingSiteFinder")
load(list.files(files, pattern = ".rda$", full.names = TRUE))
load(list.files(files, pattern = ".rds$", full.names = TRUE)[1])
# make example dataset
bds = makeBindingSites(bds, bsSize = 7)
bds = assignToGenes(bds, anno.genes = gns)
bds = imputeBsDifferencesForTestdata(bds)
bds = calculateBsBackground(bds, anno.genes = gns)
# calculate fold changes - no shrinkage
bds = calculateBsFoldChange(bds)
# calculate fold changes - with shrinkage
bds = calculateBsFoldChange(bds, use.lfc.shrinkage = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.