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.1257453      1  0.0671578  0.7994976              0.13851574           -0.13851574                1.7524086              0.5706432 0.13851574 1.752409         0.5145677       0.4854323              0.5851042            0.4148958              0.4456696            0.5543304 -64.62743 -63.01814
## 2 CARHR000660_H 1.0000000      1  1.0000000  1.0000000              0.05785510           -0.05785509                1.3678354              0.7310821 0.05785510 1.367835         0.2535746       0.7464254              0.2815327            0.7184673              0.2193108            0.7806892 -31.63977 -31.90169
## 3 CARHR000770_H 1.0000000      1  1.0000000  1.0000000              0.00042667           -0.00042667                1.0041632              0.9958542 0.00042667 1.004163         0.8931450       0.1068550              0.8953420            0.1046580              0.8948587            0.1051413 -53.31894 -53.65784
## 4 CARHR000890_H 0.7523488      1  0.7059717  1.0000000             -0.07999806            0.07999806                0.7076250              1.4131778 0.07999806 1.413178         0.5882221       0.4117779              0.5494622            0.4505378              0.6321275            0.3678725 -41.38102 -41.42952
## 5 CARHR001940_H 1.0000000      1  1.0000000  1.0000000             -0.04958549            0.04958549                0.8155551              1.2261587 0.04958549 1.226159         0.5514201       0.4485799              0.5273460            0.4726540              0.5761417            0.4238583 -57.12549 -57.46951
## 6 CARHR003740_H 0.3571554      1  0.2709275  1.0000000             -0.08852804            0.08852804                0.6771142              1.4768559 0.08852804 1.476856         0.3603599       0.6396401              0.3148542            0.6851458              0.4043972            0.5956028 -75.30201 -74.68230

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