2 Quick Start

The following example illustrates the complete workflow for HOBIT, from loading the data to performing the statistical test.

# gene expression
gexp <- read.table("data/c_flexuosa.0516.mini.txt.gz",
                   header = TRUE, sep = "\t", row.names = 1)

# experimental groups
group <- c("wet", "wet", "wet", "dry", "dry", "dry")

# mapping table to organize gene expression into homeolog expression
mapping_table <- read.table("data/c_flexuosa.homeolog.txt.gz",
                            header = TRUE, sep = "\t")

# data preparation
x <- newExpMX(gexp, group, mapping_table)

# normalization
x <- norm_counts(x)

# statistical test
x_output <- hobit(x)
head(x_output)
##            gene    pvalue qvalue raw_pvalue raw_qvalue D__C_hirsuta__(dry-wet) D__C_amara__(dry-wet) OR__C_hirsuta__(dry/wet) OR__C_amara__(dry/wet)        Dmax    ORmax theta0__C_hirsuta theta0__C_amara theta1__C_hirsuta__dry theta1__C_amara__dry theta1__C_hirsuta__wet theta1__C_amara__wet logLik_H0 logLik_H1
## 1 CARHR000190_H 0.1233256      1 0.06541479  0.7656442             0.135262370          -0.135262370                1.7271228              0.5789976 0.135262370 1.727123         0.5139389       0.4860611              0.5834637            0.4165363              0.4460479            0.5539521 -64.49956 -62.84965
## 2 CARHR000660_H 1.0000000      1 1.00000000  1.0000000             0.053684855          -0.053684855                1.3411438              0.7456322 0.053684855 1.341144         0.2533909       0.7466091              0.2769508            0.7230492              0.2212910            0.7787090 -31.81579 -32.06581
## 3 CARHR000770_H 1.0000000      1 1.00000000  1.0000000            -0.002602245           0.002602245                0.9721639              1.0286332 0.002602245 1.028633         0.8930171       0.1069829              0.8936688            0.1063312              0.8960575            0.1039425 -53.30633 -53.69221
## 4 CARHR000890_H 0.7696578      1 0.72625945  1.0000000            -0.084993555           0.084993555                0.6983480              1.4319519 0.084993555 1.431952         0.5863827       0.4136173              0.5442493            0.4557507              0.6292444            0.3707556 -41.19201 -41.26375
## 5 CARHR001940_H 1.0000000      1 1.00000000  1.0000000            -0.048105955           0.048105955                0.8195665              1.2201572 0.048105955 1.220157         0.5520396       0.4479604              0.5294441            0.4705559              0.5774278            0.4225722 -57.14303 -57.51374
## 6 CARHR003740_H 0.3542458      1 0.26803105  1.0000000            -0.089427170           0.089427170                0.6749970              1.4814881 0.089427170 1.481488         0.3601068       0.6398932              0.3143448            0.6856552              0.4038831            0.5961169 -75.39992 -74.78379

The following example demonstrates the workflow for HomeoRoq. Compared to HOBIT, the only difference is that the statistical test is performed using the homeoroq() function instead of hobit().

gexp <- read.table("data/c_flexuosa.0516.mini.txt.gz",
                   header = TRUE, sep = "\t", row.names = 1)
group <- c("wet", "wet", "wet", "dry", "dry", "dry")
mapping_table <- read.table("data/c_flexuosa.homeolog.txt.gz",
                            header = TRUE, sep = "\t")

x <- newExpMX(gexp, group, mapping_table)
x <- norm_counts(x)
x_output <- homeoroq(x)
head(x_output)
##            gene   pvalue qvalue sumexp__wet__C_hirsuta sumexp__wet__C_amara sumexp__dry__C_hirsuta sumexp__dry__C_amara ratio__wet__C_hirsuta ratio__dry__C_hirsuta   ratio_sd
## 1 CARHR000190_H 0.238925      1              383.26142            475.04089              419.43533            285.21986             0.4465343             0.4689173 0.11000959
## 2 CARHR000660_H 0.939075      1               14.57256             46.19000               15.95469             40.22082             0.2398279             0.2567345 0.04073867
## 3 CARHR000770_H 0.989575      1              385.98379             44.96460              850.62370             95.35341             0.8956613             0.9497932 0.01737532
## 4 CARHR000890_H 0.523750      1              181.89090            107.32037               12.38467             10.08555             0.6289205             0.1034599 0.12263357
## 5 CARHR001940_H 0.979025      1              110.98129             81.00309              318.05281            285.09804             0.5780746             0.7970132 0.05006071
## 6 CARHR003740_H 0.197725      1             1549.17077           2270.28481             1179.77571           2596.99673             0.4055999             0.3419580 0.05277229