Plot evolutionary signatures across transcriptomes, removing top level genes
Source:R/PlotSignatureGeneQuantiles.R
PlotSignatureGeneQuantiles.Rd
PlotSignatureGeneQuantiles is used to investigate the robustness of a transcriptomic index signal to removing the most highly expressed genes from the given expression set. The resulting perturbed signal is plotted for different quantile probability thresholds defining the set of top level genes.
Usage
PlotSignatureGeneQuantiles(
ExpressionSet,
quantiles = c(1, 0.99, 0.95, 0.9, 0.8),
gene.selection.criterion = "mean",
measure = "TAI",
TestStatistic = "FlatLineTest",
modules = NULL,
permutations = 1000,
p.value = TRUE,
shaded.area = FALSE,
xlab = "Ontogeny",
ylab = "Transcriptome Index",
main = "",
lwd = 4,
alpha = 0.1,
y.ticks = 3
)
Arguments
- ExpressionSet
a standard PhyloExpressionSet, DivergenceExpressionSet or PolymorphismsExpressionSet object.
- quantiles
a numeric vector of quantile probabilities (between [0,1])
- gene.selection.criterion
a string defining the criterion by which genes should be selected Possible values can be:
gene.selection.criterion
="mean"
: Sort the genes by the mean of their gene expression (equivalently, by their total expression counts across stages)gene.selection.criterion
="variance"
: Sort the genes by the variance of their gene expression across stages
- measure
type of transcriptome index that shall be computed. E.g.
measure = "TAI"
(Transcriptome Age Index)measure = "TDI"
(Transcriptome Divergence Index)measure = "TPI"
(Transcriptome Polymorphism Index)
- 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)
- modules
a list storing three elements for the
ReductiveHourglassTest
,EarlyConservationTest
,LateConservationTest
, orReverseHourglassTest
: early, mid, and late. Each element expects a numeric vector specifying the developmental stages or experiments that correspond to each module. For example:modules
=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
.- p.value
a boolean value specifying whether the p-value of the test statistic shall be printed within the legend, for each expression set.
- shaded.area
a boolean value specifying whether a shaded area shall be drawn for the developmental stages defined to be the presumptive phylotypic period.
- xlab
label of x-axis.
- ylab
label of y-axis.
- main
figure title.
- lwd
line width.
- alpha
transparency of the shaded area and error ribbon (between [0,1]). Default is
alpha = 0.1
.- y.ticks
number of ticks on the y-axis. Default is
ticks = 3
.
Value
a ggplot object visualising the transcriptome index of the expression set, together with its standard deviation per stage, obtained by permuting the gene ages. For each quantile probability threshold, the resulting perturbed signal is shown as a separate profile. The profiles are shown on the same axes, so that they can be readily compared. Optionally, the p-value of each profile, with respect to the choice of statistic, is shown.
Examples
data(PhyloExpressionSetExample)
# Flat line test, select top expressed genes
PlotSignatureGeneQuantiles(ExpressionSet = PhyloExpressionSetExample,
quantiles=c(1.0, 0.99, 0.95, 0.90, 0.80),
main="Excluding top level genes by total
expression using different thresholds",
gene.selection.criterion="mean")
#>
#> [ 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 ... ]
#>
#>
#> Total runtime of your permutation test: 0.128 seconds.
#>
#> -> We recommended using at least 20000 permutations to achieve a sufficient permutation test.
#>
#> [ 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 ... ]
#>
#>
#> Total runtime of your permutation test: 0.127 seconds.
#>
#> -> We recommended using at least 20000 permutations to achieve a sufficient permutation test.
#>
#> [ 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 ... ]
#>
#>
#> Total runtime of your permutation test: 0.122 seconds.
#>
#> -> We recommended using at least 20000 permutations to achieve a sufficient permutation test.
#>
#> [ 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 ... ]
#>
#>
#> Total runtime of your permutation test: 0.118 seconds.
#>
#> -> We recommended using at least 20000 permutations to achieve a sufficient permutation test.
#>
#> [ 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 ... ]
#>
#>
#> Total runtime of your permutation test: 0.103 seconds.
#>
#> -> We recommended using at least 20000 permutations to achieve a sufficient permutation test.
# Flat line test, select top genes by variance of expression
PlotSignatureGeneQuantiles(ExpressionSet = PhyloExpressionSetExample,
main="Excluding top level genes by variance of
expression using different thresholds",
quantiles=c(1.0, 0.99, 0.95, 0.90, 0.80),
gene.selection.criterion="variance")
#>
#> [ 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 ... ]
#>
#>
#> Total runtime of your permutation test: 0.131 seconds.
#>
#> -> We recommended using at least 20000 permutations to achieve a sufficient permutation test.
#>
#> [ 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 ... ]
#>
#>
#> Total runtime of your permutation test: 0.133 seconds.
#>
#> -> We recommended using at least 20000 permutations to achieve a sufficient permutation test.
#>
#> [ 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 ... ]
#>
#>
#> Total runtime of your permutation test: 0.127 seconds.
#>
#> -> We recommended using at least 20000 permutations to achieve a sufficient permutation test.
#>
#> [ 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 ... ]
#>
#>
#> Total runtime of your permutation test: 0.118 seconds.
#>
#> -> We recommended using at least 20000 permutations to achieve a sufficient permutation test.
#>
#> [ 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 ... ]
#>
#>
#> Total runtime of your permutation test: 0.095 seconds.
#>
#> -> We recommended using at least 20000 permutations to achieve a sufficient permutation test.