This function computes the PairwiseTest score for a given TAI
or TDI
pattern.
The pair test is a permutation test based on the following test statistic.
- A PhyloExpressionSet is partitioned into contrast pairs - contrast1 and contrast2 - based on prior biological knowledge. This prior knowledge could include sexual, ecological and genetic backgrounds.
- The mean TAI
or TDI
value for each of the two contrasts contrast1 and contrast2 are computed.
- The pairwise differences D_constrast = contrast1 - contrast2 is calculated as final test statistic of the pair test,
when the altHypothesis
is specified as "greater". When the altHypothesis
is specified as "less", sign of D_constrast is reversed.
This function pairScore computes the D_contrast value for a given TAI
or TDI
stored in the age_vals
argument.
Arguments
- age_vals
a numeric vector containing
TAI
orTDI
values for each developmental stage s.- contrast1
a numeric vector storing the numeric stage values that correspond to the query contrast.
- contrast2
a numeric vector storing the numeric stage values that correspond to the subject contrast.
- altHypothesis
a character string defining the alternative hypothesis used to quantify the statistical significance in the present phylotranscriptomics pattern. Possible values can be:
altHypothesis
="greater"
: contrast1 > contrast2altHypothesis
="less"
: contrast1 < contrast2
Examples
# read standard phylotranscriptomics data
data(PhyloExpressionSetExample)
data(DivergenceExpressionSetExample)
# Example PhyloExpressionSet:
# compute the TAI profile
TAIs <- TAI(PhyloExpressionSetExample)
# compute the pair score for the first two stages in the TAI profile
# we test whether TAI in contrast1 is greater than contrast 2.
pair_score <- pairScore(age_vals = TAIs,contrast1 = 1,contrast2 = 2,
altHypothesis="greater")
# Example DivergenceExpressionSet:
# compute the TDI profile
TDIs <- TDI(DivergenceExpressionSetExample)
# compute the pair score for the first two stages in the TDI profile
# we test whether TDI in contrast1 is greater than contrast 2.
pair_score <- pairScore(age_vals = TDIs,contrast1 = 1,contrast2 = 2,
altHypothesis="greater")
# compute pairScore() vector from bootMatrix()
apply(bootMatrix(PhyloExpressionSetExample,10),1,
pairScore,contrast1 = 1,contrast2 = 2, altHypothesis="greater")
#>
#> [ 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 ... ]
#>
#> 1 2 3 4 5 6
#> -0.028526151 -0.006892455 0.022419889 -0.013111729 -0.004702128 0.012870290
#> 7 8 9 10
#> -0.020414017 0.012626073 0.025709238 -0.015498190