tfStability aims to statistically evaluate the
stability of ReductiveHourglassTest
, FlatLineTest
,
ReverseHourglassTest
, EarlyConservationTest
, or
LateConservationTest
(all based on TAI
or TDI
computations) against different
data transformations.
The corresponding p-value quantifies the probability that a given TAI or TDI pattern (or any phylotranscriptomics pattern)
does not support the chosen test. A p-value < 0.05 indicates that the corresponding phylotranscriptomics pattern does
indeed support the chosen test.
Usage
tfStability(
ExpressionSet,
TestStatistic = "FlatLineTest",
transforms = c("none", "sqrt", "log2", "rank", "squared"),
modules = NULL,
permutations = 1000,
pseudocount = 1
)
Arguments
- ExpressionSet
a standard PhyloExpressionSet or DivergenceExpressionSet object.
- TestStatistic
a string defining the type of test statistics to be used to quantify the statistical significance the present phylotranscriptomics pattern. Possible values can be:
TestStatistic
="FlatLineTest"
: Statistical test for the deviation from a flat lineTestStatistic
="ReductiveHourglassTest"
: Statistical test for the existence of a hourglass shape (high-low-high pattern)TestStatistic
="ReverseHourglassTest"
: Statistical test for the existence of a reverse hourglass pattern (low-high-low pattern)TestStatistic
="EarlyConservationTest"
: Statistical test for the existence of a early conservation pattern (low-high-high pattern)TestStatistic
="LateConservationTest"
: Statistical test for the existence of a late conservation pattern (high-high-low pattern)
- transforms
a character vector of any valid function that transforms gene expression levels.
- modules
a list storing three elements: early, mid, and late. Each element expects a numeric vector specifying the developmental stages or experiments that correspond to each module. For example,
module
= list(early = 1:2, mid = 3:5, late = 6:7) divides a dataset storing seven developmental stages into 3 modules.- permutations
a numeric value specifying the number of permutations to be performed for the
FlatLineTest
,EarlyConservationTest
,LateConservationTest
,ReductiveHourglassTest
orReverseHourglassTest
.- pseudocount
any valid number to add to the expression matrix prior to log transformations.
Value
a vector object containing the vector elements:
p.value
: the p-value quantifying the statistical significance (depending on the chosen test) of the given phylotranscriptomics pattern under the given data transformation(s).
Details
An assessment for the stability of data transforms on the permutation test of choice.
For details, please consult tf
, ReductiveHourglassTest
,
FlatLineTest
, ReverseHourglassTest
,
LateConservationTest
or EarlyConservationTest
Examples
data(PhyloExpressionSetExample)
# perform the reductive hourglass test for a PhyloExpressionSet
# here the prior biological knowledge is that stages 1-2 correspond to module 1 = early,
# stages 3-5 to module 2 = mid (phylotypic module), and stages 6-7 correspond to
# module 3 = late
tfStability(ExpressionSet = PhyloExpressionSetExample,
TestStatistic = "ReductiveHourglassTest",
permutations = 100,
transforms = c("log2", "sqrt", "none"),
modules = list(early = 1:2, mid = 3:5, late = 6:7))
#> Proceeding with the ReductiveHourglassTest
#>
#> [ Number of Eigen threads that are employed on your machine: 12 ]
#>
#> [ Computing age assignment permutations for test statistic ... ]
#>
[=========================================] 100%
#> [ Computing variances of permuted transcriptome signatures ... ]
#>
#>
#> [ Number of Eigen threads that are employed on your machine: 12 ]
#>
#> [ Computing age assignment permutations for test statistic ... ]
#>
[=========================================] 100%
#> [ Computing variances of permuted transcriptome signatures ... ]
#>
#>
#> [ Number of Eigen threads that are employed on your machine: 12 ]
#>
#> [ Computing age assignment permutations for test statistic ... ]
#>
[=========================================] 100%
#> [ Computing variances of permuted transcriptome signatures ... ]
#>
#> log2 sqrt none
#> 8.884068e-02 2.620711e-06 1.421041e-08
# it is also possible to test the phylotranscriptomic pattern using rlog
# and vst transforms from DESeq2
library(DESeq2)
#> Loading required package: S4Vectors
#> Warning: package ‘S4Vectors’ was built under R version 4.4.1
#> Loading required package: stats4
#> Loading required package: BiocGenerics
#>
#> Attaching package: ‘BiocGenerics’
#> The following objects are masked from ‘package:stats’:
#>
#> IQR, mad, sd, var, xtabs
#> The following objects are masked from ‘package:base’:
#>
#> Filter, Find, Map, Position, Reduce, anyDuplicated, aperm, append,
#> as.data.frame, basename, cbind, colnames, dirname, do.call,
#> duplicated, eval, evalq, get, grep, grepl, intersect, is.unsorted,
#> lapply, mapply, match, mget, order, paste, pmax, pmax.int, pmin,
#> pmin.int, rank, rbind, rownames, sapply, setdiff, table, tapply,
#> union, unique, unsplit, which.max, which.min
#>
#> Attaching package: ‘S4Vectors’
#> The following object is masked from ‘package:utils’:
#>
#> findMatches
#> The following objects are masked from ‘package:base’:
#>
#> I, expand.grid, unname
#> Loading required package: IRanges
#> Warning: package ‘IRanges’ was built under R version 4.4.1
#> Loading required package: GenomicRanges
#> Loading required package: GenomeInfoDb
#> Loading required package: SummarizedExperiment
#> Loading required package: MatrixGenerics
#> Loading required package: matrixStats
#> Warning: package ‘matrixStats’ was built under R version 4.4.1
#>
#> Attaching package: ‘MatrixGenerics’
#> The following objects are masked from ‘package:matrixStats’:
#>
#> colAlls, colAnyNAs, colAnys, colAvgsPerRowSet, colCollapse,
#> colCounts, colCummaxs, colCummins, colCumprods, colCumsums,
#> colDiffs, colIQRDiffs, colIQRs, colLogSumExps, colMadDiffs,
#> colMads, colMaxs, colMeans2, colMedians, colMins, colOrderStats,
#> colProds, colQuantiles, colRanges, colRanks, colSdDiffs, colSds,
#> colSums2, colTabulates, colVarDiffs, colVars, colWeightedMads,
#> colWeightedMeans, colWeightedMedians, colWeightedSds,
#> colWeightedVars, rowAlls, rowAnyNAs, rowAnys, rowAvgsPerColSet,
#> rowCollapse, rowCounts, rowCummaxs, rowCummins, rowCumprods,
#> rowCumsums, rowDiffs, rowIQRDiffs, rowIQRs, rowLogSumExps,
#> rowMadDiffs, rowMads, rowMaxs, rowMeans2, rowMedians, rowMins,
#> rowOrderStats, rowProds, rowQuantiles, rowRanges, rowRanks,
#> rowSdDiffs, rowSds, rowSums2, rowTabulates, rowVarDiffs, rowVars,
#> rowWeightedMads, rowWeightedMeans, rowWeightedMedians,
#> rowWeightedSds, rowWeightedVars
#> Loading required package: Biobase
#> Welcome to Bioconductor
#>
#> Vignettes contain introductory material; view with
#> 'browseVignettes()'. To cite Bioconductor, see
#> 'citation("Biobase")', and for packages 'citation("pkgname")'.
#>
#> Attaching package: ‘Biobase’
#> The following object is masked from ‘package:MatrixGenerics’:
#>
#> rowMedians
#> The following objects are masked from ‘package:matrixStats’:
#>
#> anyMissing, rowMedians
tfStability(ExpressionSet = PhyloExpressionSetExample,
TestStatistic = "ReductiveHourglassTest",
permutations = 100,
transforms = c("log2", "sqrt", "none", "vst"),
modules = list(early = 1:2, mid = 3:5, late = 6:7))
#> Proceeding with the ReductiveHourglassTest
#>
#> [ Number of Eigen threads that are employed on your machine: 12 ]
#>
#> [ Computing age assignment permutations for test statistic ... ]
#>
[=========================================] 100%
#> [ Computing variances of permuted transcriptome signatures ... ]
#>
#>
#> [ Number of Eigen threads that are employed on your machine: 12 ]
#>
#> [ Computing age assignment permutations for test statistic ... ]
#>
[=========================================] 100%
#> [ Computing variances of permuted transcriptome signatures ... ]
#>
#>
#> [ Number of Eigen threads that are employed on your machine: 12 ]
#>
#> [ Computing age assignment permutations for test statistic ... ]
#>
[=========================================] 100%
#> [ Computing variances of permuted transcriptome signatures ... ]
#>
#> converting counts to integer mode
#> -- note: fitType='parametric', but the dispersion trend was not well captured by the
#> function: y = a/x + b, and a local regression fit was automatically substituted.
#> specify fitType='local' or 'mean' to avoid this message next time.
#> The phylotranscriptomic pattern may not follow an hourglass pattern (high-low-high).
#>
#> [ Number of Eigen threads that are employed on your machine: 12 ]
#>
#> [ Computing age assignment permutations for test statistic ... ]
#>
[=========================================] 100%
#> [ Computing variances of permuted transcriptome signatures ... ]
#>
#> log2 sqrt none vst
#> 1.218331e-01 1.121363e-07 1.008760e-09 9.057958e-01