testForDiffUsage {JunctionSeq} | R Documentation |
This function runs the hypothesis tests for differential junction usage.
This function is called internally by the runJunctionSeqAnalyses
function, and thus for most purposes users should not need to call this
function directly. It may be useful to advanced users performing non-standard
analyses.
testForDiffUsage( jscs, test.formula0 = formula(~ sample + countbin), test.formula1 = formula(~ sample + countbin + condition : countbin), method.GLM = c(c("advanced","DESeq2-style"), c("simpleML","DEXSeq-v1.8.0-style")), dispColumn="dispersion", nCores=1, keep.hypothesisTest.fit = FALSE, meanCountTestableThreshold = "auto", optimizeFilteringForAlpha = 0.01, method.cooksFilter = TRUE, cooksCutoff, pAdjustMethod = "BH", verbose = TRUE)
jscs |
A |
test.formula0 |
The formula for the null hypothesis. Note that the condition to be tested must be named "condition". |
test.formula1 |
The formula for the alternative hypothesis. Note that the condition to be tested must be named "condition". |
method.GLM |
Character string. Can be used to apply alternative methodologies or implementations. Intended for advanced users who have strong opinions about the underlying statistical methodologies. The default is "advanced" or, equivalently, "DESeq2-style". This uses the model test methodology used by DESeq2 and DEXSeq v1.12.0 or higher. The alternative method is "simpleML" or, equivalently, "DEXSeq-v1.8.0-style". This uses a simpler maximum-likelihood-based method used by the original DESeq and by some earlier versions of DEXSeq (v1.8.0 or less). |
dispColumn |
Character value. The name of the |
nCores |
Either an integer or a BiocParallelParam object. Either way, this determines The number of cores to use. Note that multicore functionality may not be available on all platforms. If parallel execution is not available then JunctionSeq will automatically fallback to single-core execution. See the BiocParallel package for more information. |
keep.hypothesisTest.fit |
Logical value. If |
meanCountTestableThreshold |
"auto" or Numeric value. Features with a total mean normalized count of less than this value will be excluded from the analyses. If left as the default ("auto"), then the cutoff threshold will be determined automatically using the DESeq2 independent filtering method. |
optimizeFilteringForAlpha |
Numeric value between 0 and 1. If |
method.cooksFilter |
Logical value. if |
cooksCutoff |
The cook's cutoff threshold to use. |
pAdjustMethod |
The p-adjustment method to use with the |
verbose |
if TRUE, send debugging and progress messages to the console / stdout. |
A JunctionSeqCountSet, with hypothesis test results included.
data(exampleDataSet,package="JctSeqData");
jscs <- testForDiffUsage(jscs);
## > Using single-core execution.
## -------> testJunctionsForDiffUsage: Starting hypothesis test iteration. (Thu Mar 30 17:21:25 2017)
## using supplied model matrix
## found results columns, replacing these
## -------> testJunctionsForDiffUsage: Finished hypothesis test iteration. (Thu Mar 30 17:21:26 2017)
## -------> testJunctionsForDiffUsage: Finished compiling hypothesis test results. (Thu Mar 30 17:21:26 2017)
## ---> tJfDU(): No non-NA maxCooks values. Ignoring cooks.
## > Performing final p.adjust filtering.
## > No cook's cutoffs found.
## > Automatically selecting a filtering threshold of 0.113841548108117 to optimize results at the alpha < 0.01 significance level.
## > (Filtering 0 out of 482 "testable" features, using baseMean < 0.113841548108117)
## > (Rejected H0 for 13 out of 482 features at alpha < 0.01)
## > Final p.adjust filtering complete.
## Not run:
##D ########################################
##D #Set up example data:
##D decoder.file <- system.file(
##D "extdata/annoFiles/decoder.bySample.txt",
##D package="JctSeqData");
##D decoder <- read.table(decoder.file,
##D header=TRUE,
##D stringsAsFactors=FALSE);
##D gff.file <- system.file(
##D "extdata/cts/withNovel.forJunctionSeq.gff.gz",
##D package="JctSeqData");
##D countFiles <- system.file(paste0("extdata/cts/",
##D decoder$sample.ID,
##D "/QC.spliceJunctionAndExonCounts.withNovel.forJunctionSeq.txt.gz"),
##D package="JctSeqData");
##D ########################################
##D #Advanced Analysis:
##D
##D #Make a "design" dataframe:
##D design <- data.frame(condition = factor(decoder$group.ID));
##D #Read the QoRTs counts.
##D jscs = readJunctionSeqCounts(countfiles = countFiles,
##D samplenames = decoder$sample.ID,
##D design = design,
##D flat.gff.file = gff.file
##D );
##D #Generate the size factors and load them into the JunctionSeqCountSet:
##D jscs <- estimateJunctionSeqSizeFactors(jscs);
##D #Estimate feature-specific dispersions:
##D jscs <- estimateJunctionSeqDispersions(jscs);
##D #Fit dispersion function and estimate MAP dispersion:
##D jscs <- fitJunctionSeqDispersionFunction(jscs);
##D #Test for differential usage:
##D jscs <- testForDiffUsage(jscs);
##D #Estimate effect sizes and expression estimates:
##D jscs <- estimateEffectSizes( jscs);
##D
## End(Not run)