This function computes the EarlyConservationTest score for a given TAI
or TDI
pattern.
The reductive early conservation test is a permutation test based on the following test statistic.
- A set of developmental stages is partitioned into three modules - early, mid, and late - based on prior biological knowledge.
- The mean TAI
or TDI
value for each of the three modules T_early, T_mid, and T_late are computed.
- The two differences D1 = T_mid - T_early and D2 = T_late - T_early are calculated.
- The minimum D_min of D1 and D2 is computed as final test statistic of the reductive early conservation test.
This function ecScore computes the D_min 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.- early
a numeric vector storing the numeric stage values that correspond to the early phase of development.
- mid
a numeric vector storing the numeric stage values that correspond to the middle phase of development.
- late
a numeric vector storing the numeric stage values that correspond to the late phase of development.
- profile.warn
a boolean value indicating whether a warning is printed when a low-mid-high pattern isn't followed.
Examples
# read standard phylotranscriptomics data
data(PhyloExpressionSetExample)
data(DivergenceExpressionSetExample)
# Example PhyloExpressionSet:
# compute the TAI profile
TAIs <- TAI(PhyloExpressionSetExample)
# compute the early conservation score for the TAI profile
ec_score <- ecScore(age_vals = TAIs,early = 1:2,mid = 3:5,late = 6:7)
# Example DivergenceExpressionSet:
# compute the TDI profile
TDIs <- TDI(DivergenceExpressionSetExample)
# compute the early conservation score for the TDI profile
ec_score <- ecScore(age_vals = TDIs,early = 1:2,mid = 3:5,late = 6:7)
# compute ecScore() vector from bootMatrix()
apply(bootMatrix(PhyloExpressionSetExample,10),1,ecScore,early = 1:2,mid = 3:5,late = 6:7)
#>
#> [ 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.05681366 -0.02292928 -0.05911419 -0.04578738 -0.02225435 -0.02986441
#> 7 8 9 10
#> 0.01308162 -0.03649770 0.04031555 -0.04323258
# get warning if the expected pattern isn't followed
ec_score <- ecScore(age_vals = TAIs,early = 1:2,mid = 3:5,late = 6:7,profile.warn=TRUE)
#> The phylotranscriptomic pattern may not follow an early conservation pattern (low-mid-high or low-high-high).