pairScore: Compute the Pairwise Difference in TAI Score

View source: R/pairScore.R

pairScoreR Documentation

Compute the Pairwise Difference in TAI Score

Description

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.

Usage

pairScore(age_vals, contrast1, contrast2, altHypothesis = NULL)

Arguments

age_vals

a numeric vector containing TAI or TDI 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 > contrast2

  • altHypothesis = "less" : contrast1 < contrast2

Value

a numeric value representing the pair score.

Author(s)

Hajk-Georg Drost and Jaruwatana Sodai Lotharukpong

See Also

PairwiseTest, TAI, TDI

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")
 

drostlab/myTAI documentation built on Aug. 21, 2024, 7:10 a.m.