PlotSignatureTransformed: Plot evolutionary signatures across transcriptomes and...

View source: R/PlotSignatureTransformed.R

PlotSignatureTransformedR Documentation

Plot evolutionary signatures across transcriptomes and RNA-seq transformations

Description

PlotSignatureTransformed aims to statistically evaluate the stability of ReductiveHourglassTest, FlatLineTest, ReverseHourglassTest, EarlyConservationTest, or LateConservationTest (all based on TAI or TDI computations) against different data transformations AND plot the resulting TAI profiles using PlotSignature. 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

PlotSignatureTransformed(
  ExpressionSet,
  measure = "TAI",
  TestStatistic = "FlatLineTest",
  transforms = c("none", "sqrt", "log2", "rank", "squared"),
  modules = NULL,
  permutations = 1000,
  pseudocount = 1,
  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 or DivergenceExpressionSet object.

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 line

  • TestStatistic = "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. Available options are:

  • transforms = "none" : No transformation (absolute expression)

  • transforms = "log2" : Computes binary (i.e., base 2) logarithms, log_{2}{X}.

  • transforms = "log" : Computes natural logarithms, log_{e}{X}.

  • transforms = "log10" : Computes common logarithms (i.e., base 10), log_{10}{X}.

  • transforms = "sqrt" : Computes the (principle) square root, \sqrt{X}.

  • transforms = "vst" : (Quickly) estimates dispersion trend and applies a variance stabilizing transformation (please make sure that the DESeq2 package is installed).

  • transforms = "rlog" : (Robustly) estimates dispersion trend and applies a variance stabilizing transformation (please make sure that the DESeq2 package is installed).

  • transforms = "rank" : Ranks genes from lowest to highest based on their expression levels, at each condition (e.g., developmental stage). The gene's expression value is replaced by its sample rank or average ranks in case of ties.

  • transforms = "squared": Computes the square, X^2.

modules

a list storing three elements for the ReductiveHourglassTest, EarlyConservationTest, LateConservationTest, or ReverseHourglassTest: 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 or ReverseHourglassTest.

pseudocount

any valid number to add to the expression matrix prior to log transformations.

p.value

a boolean value specifying whether the p-value of the test statistic shall be printed within the plot area.

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 (between [0,1]). Default is alpha = 0.1.

y.ticks

number of ticks on the y-axis. Default is ticks = 3.

Details

Visualisation and assessment for the stability of data transforms on the permutation test of choice. For details, please consult the main function PlotSignature, as well as tf, ReductiveHourglassTest, FlatLineTest, ReverseHourglassTest, LateConservationTest or EarlyConservationTest.

In most cases, users can replace PlotSignature simply with PlotSignatureTransformed to obtain the multi-panel plot with different transformations to visualise the stability of the pattern observed with PlotSignature.

Value

a ggplot object containing the following information for each visualised transcriptome indices: p.value : the p-value quantifying the statistical significance (depending on the chosen test) of the given phylotranscriptomics pattern.

Author(s)

Jaruwatana Sodai Lotharukpong

References

Lotharukpong JS et al. (2023) (unpublished)

See Also

PlotSignature,tfStability, FlatLineTest, ReverseHourglassTest, EarlyConservationTest, ReductiveHourglassTest, LateConservationTest

Examples

## Not run: 
data(PhyloExpressionSetExample)

# Flat line test
PlotSignatureTransformed(ExpressionSet = PhyloExpressionSetExample,
                    TestStatistic = "FlatLineTest",
                    transforms = c("none", "log2", "sqrt", "rank", "squared"))

# Reductive hourglass test
PlotSignatureTransformed(ExpressionSet = PhyloExpressionSetExample,
                     TestStatistic = "ReductiveHourglassTest",
                     transforms = c("none", "log2", "sqrt", "rank", "squared"),
                     modules = list(early = 1:2, mid = 3:5, late = 6:7))

library(DESeq2)
PlotSignatureTransformed(ExpressionSet = PhyloExpressionSetExample,
                     TestStatistic = "ReductiveHourglassTest",
                     transforms = c("none", "log2", "sqrt", "vst", "rank", "squared"),
                     modules = list(early = 1:2, mid = 3:5, late = 6:7))

## End(Not run)


HajkD/myTAI documentation built on April 6, 2024, 7:47 p.m.