glmmSeq

Myles Lewis, Katriona Goldmann, Elisabetta Sciacca, Cankut Cubuk, Anna Surace

2021-03-09

Lifecycle: Maturing License: MIT CRAN status Downloads 2021-03-09 GitHub issues Travis

glmmSeq

The aim of this package is to model gene expression with a general linear mixed model (glmm). The most widely used mainstream differential gene expression analysis tools (e.g Limma, DESeq2, edgeR) are all unable to fit mixed effects linear models. This package however fits negative binomial mixed effects models at individual gene level using the negative.binomial function from MASS and the glmer function in lme4 which enables random effect, as as well as mixed effects, to be modelled.

Installing from CRAN

install.packages("glmmSeq")

Installing from Github

devtools::install_github("KatrionaGoldmann/glmmSeq")

Installing Locally

Or you can source the functions individually:

functions = list.files("./R", full.names = TRUE)
invisible(lapply(functions, source))

But you will need to load in the additional libraries:

# Install CRAN packages
invisible(lapply(c("MASS", "car", "ggplot2", "ggpubr", "lme4", "methods",
                   "parallel", "plotly", "stats", "gghalves"),
                 function(p){
                   if(! p %in% rownames(installed.packages())) {
                     install.packages(p)
                   }
                   library(p, character.only=TRUE)
                 }))

# Install BioConductor packages
if (!requireNamespace("BiocManager", quietly = TRUE))
  install.packages("BiocManager")
invisible(lapply(c("qvalue"), function(p){
  if(! p %in% rownames(installed.packages())) BiocManager::install(p)
  library(p, character.only=TRUE)
}))

Overview

To get started, first we load in the package:

library(glmmSeq)
set.seed(1234)

This vignette will demonstrate the power of this package using a minimal example from the PEAC data set. Here we will focus on the synovial data from this cohort.

data(PEAC_minimal_load)

This data contains:

These are outlined in the following subsections.

Metadata

metadata$EULAR_binary  = NA
metadata$EULAR_binary[metadata$EULAR_6m %in%
                        c("Good responder", "Moderate responder" )] = "responder"
metadata$EULAR_binary[metadata$EULAR_6m %in% c("Non responder")] = "non_responder"
metadata = metadata[! is.na(metadata$EULAR_binary), ]

kable(head(metadata), row.names = F) %>% kable_styling()
SAMID PATID Timepoint EULAR_6m EULAR_binary
SAM20389187 PAT300 6 Good responder responder
SAM20389185 PAT209 6 Good responder responder
SAM20389181 PAT219 6 Moderate responder responder
SAM20389179 PAT211 6 Good responder responder
SAM20389177 PAT216 6 Good responder responder
SAM20389176 PAT212 6 Good responder responder

Count data

tpm = tpm[, metadata$SAMID]
kable(head(tpm)) %>% kable_styling()
SAM20389176 SAM20389177 SAM20389178 SAM20389179 SAM20389185 SAM20389187 SAM24297965 SAM24297969 SAM24297977 SAM24297980 SAM24297982 SAM24297983 SAM24297984 SAM24297986 SAM24297987 SAM24297991 SAM24297994 SAM24297995 SAM24297996 SAM24297997 SAM24298029 SAM24298035 SAM24298052 SAM24298065 SAM24298074 SAM24298089 SAM24298092 SAM24298098 SAM24298100 SAM24298111 SAM24298112 SAM24298118 SAM24298120 SAM24298123 SAM24298125 SAM24298127 SAM24298133 SAM24298135 SAM24298136 SAM24298143 SAM24298148 SAM24298152 SAM24298157 SAM24298159 SAM24298160 SAM24298162 SAM24298163 SAM24298165 SAM9103802 SAM9103804 SAM9103805 SAM9103806 SAM9103807 SAM9103808 SAM9103809 SAM9103810 SAM9103811 SAM9103812 SAM9103813 SAM9103815 SAM9103816 SAM9103817 SAM9103818 SAM9103819 SAM9103820 SAM9103821 SAM9103822 SAM9103823 SAM9103824 SAM9103825 SAM9103826 SAM9103827 SAM9103828 SAM9103829 SAM9103830 SAM9103832 SAM9103833 SAM9103834 SAM9103835 SAM9103836 SAM9103837 SAM9103838 SAM9103839 SAM9103840 SAM9103843 SAM9103844 SAM9103845 SAM9103847 SAM9103849 SAM9103850 SAM9103851 SAM9103852 SAM9103853 SAM9103854 SAM9103856 SAM9103859 SAM9103860 SAM9103861 SAM9103862 SAM9103863 SAM9103865 SAM9103867 SAM9103868 SAM9103869 SAM9103870 SAM9103875 SAM9103876 SAM9103878 SAM9103880 SAM9103881 SAM9103885 SAM9103887 SAM9103888 SAM9103889 SAM9103890 SAM9103891 SAM9103892 SAM9103896 SAM9103897 SAM9103898 SAM9103901 SAM9103902 SAM9103904 SAM9103905
MS4A1 57.280078 2.123731 1.200281 15.742876 2.024451 1.622818 2.011160 0.580000 1.006783 0.391420 3.886618 2.746742 31.647637 20.16757 0.925393 3.4271907 3.130648 1.422480 63.14643 2.957004 0.295537 12.7877279 4.817494 15.874491 0.569317 4.429667 1.060991 2.1850700 5.321541 3.542383 1.676829 5.471954 29.942195 4.5519540 7.252108 1.9540320 12.947362 73.430132 2.364819 5.2372870 12.281007 17.637846 72.557856 2.379427 0.444729 89.042394 2.4190970 226.612930 8.01254 5.328680 0.7414830 4.669566 5.218332 0.0676825 26.0579080 77.100135 23.2918620 50.306168 5.24953 1.342645 0.511810 0.2428008 7.756002 1.020052 0.602854 0.2444728 2.047680 2.110914 0.683498 24.664095 1.9789030 0.1702800 3.910493 6.5513870 0.8342158 31.7618280 1.136854 17.98745 3.369558 8.577294 1.453945 41.031738 42.991580 27.58865 14.876902 21.6405734 42.049748 75.6557000 2.501497 3.560322 32.1091249 7.008288 0.746264 10.0969886 92.3355460 0.5157370 0.8011538 5.075003 1.979931 0.2068106 2.717007 0.984857 0.7771422 0.000000 8.2769093 1.261793 2.361150 2.372850 0.6968002 43.9459380 5.0257346 0.281387 0.4190982 1.716238 16.25508 1.9852750 26.591585 27.994183 1.325606 1.323197 12.47092 2.3049434 1.4901770 0.229867
ADAM12 0.972897 2.645153 1.166610 5.466742 1.110548 2.581805 0.658545 1.159264 0.462860 3.074193 10.947068 9.678026 1.205472 11.63376 1.772810 0.3506414 3.528288 17.416140 6.36844 2.232818 4.064450 0.2666618 2.113812 0.473972 1.222569 30.012798 0.181003 2.4554526 4.136035 13.961315 4.195791 3.629029 8.362213 0.6999296 7.894137 0.3268513 2.847538 7.015717 0.717947 0.4396555 1.141057 1.069326 1.895644 0.486478 14.504778 1.897848 0.9943284 4.140489 41.30644 8.812227 0.3317777 8.699836 8.323936 0.0292791 0.9615935 2.512841 0.8960788 3.766372 7.13890 1.917924 8.893462 0.0966324 1.550900 4.760995 1.769894 4.6901815 1.200418 1.392691 0.439077 0.658254 0.3610814 0.2501964 0.610416 0.6842673 2.8749874 0.6717734 16.374299 1.36295 8.725470 0.258386 0.214470 3.573125 2.086027 13.44347 4.007794 0.0338254 1.595552 0.9645215 1.913151 5.780085 0.7098401 5.242844 1.115879 0.6499524 0.5397263 0.2299409 0.7178614 0.535170 0.282374 0.2003997 2.202211 0.310417 2.0991998 0.215329 0.1962535 25.010318 2.970828 1.461817 2.6506093 0.6501276 0.9633052 8.715446 32.4636380 4.281851 0.83041 0.9840191 2.363019 0.314493 1.179129 0.656344 1.57062 0.4597666 0.4707508 4.727155
IGHV7-4-1 2158.300000 0.000000 1.030500 26.381700 0.000000 0.992885 0.644889 0.000000 0.000000 1.500990 4.945980 38.268000 55.570100 107.91600 0.000000 0.0000000 0.000000 1.080940 27.51650 0.205779 0.000000 21.4136000 6.121120 15.190300 0.000000 0.597722 0.000000 0.0844527 1228.620000 51.561100 1.149330 1.434460 3728.700000 6.3708500 1.553570 0.0000000 165.928000 30.714000 0.000000 5.5235500 0.770965 1603.290000 53.605000 16.063900 6.209400 1021.480000 0.2965720 85.466200 9.18953 41.191800 5.0514200 47.140500 42.541900 0.4660800 835.2970000 1929.760000 57.2972000 39.990700 0.00000 0.000000 0.411695 0.0000000 26.176100 1.033220 2.273400 0.0000000 11.443300 0.272802 0.000000 81.135100 0.7083360 0.0000000 1.298760 0.5145140 0.1260250 13.9310000 2.345910 77.63540 2.181890 63.096300 0.000000 6.473680 20.211900 347.99200 39.273300 2.3200600 584.705000 2147.2900000 242.387000 14.263100 52.4861000 0.399860 0.000000 0.7025670 11.2577000 0.6126850 4.5281300 155.926000 320.086000 1.3791200 1.587010 0.167711 0.0000000 0.000000 5.6540200 0.000000 0.000000 0.560530 1.2747600 50.6122000 5.3320100 0.000000 0.0000000 0.757454 132.98900 3.4184700 18.130100 3.085550 1.183940 0.277095 135.99100 0.7799880 0.6956290 0.000000
IGHV3-49 858.980000 2.093480 8.066680 345.493000 0.196831 0.000000 3.201300 0.000000 0.000000 0.000000 114.334000 17.150200 136.605000 1080.73000 0.196674 0.0000000 0.000000 0.931275 140.22000 0.000000 0.000000 202.4950000 60.114600 145.421000 0.145099 32.808500 1.207290 3.5942600 467.534000 55.301200 0.869369 14.462700 928.660000 64.4575000 0.430536 0.0000000 80.024800 53.191800 0.000000 35.4998000 0.303541 1002.870000 127.201000 634.856000 22.119900 975.855000 0.0000000 623.330000 129.50800 180.819000 29.8933000 183.605000 170.369000 0.2201470 403.4460000 384.597000 24.9283000 426.619000 1.08364 0.591472 4768.210000 0.0000000 93.669200 9.291720 0.607172 0.0000000 9.736200 1.132510 0.000000 175.472000 1.0305600 0.0885169 0.972741 12.5531000 0.8804760 163.1520000 1.764370 37.22090 15.345300 401.861000 0.575801 11.926900 45.198600 317.65400 523.093000 171.4520000 174.163000 5414.9000000 5.045300 386.829000 1190.5200000 4.854510 0.169181 15.7114000 415.2760000 0.1668720 0.1950730 34.623200 26.949400 2.3880600 2.021500 0.000000 0.0000000 0.000000 1.5027300 0.000000 1.783170 49.278100 1.1861700 99.7745000 10.0077000 0.000000 0.1908660 3.835610 22.31070 2.4220200 22.133600 440.657000 0.000000 0.000000 22.10260 5.3278400 0.5799090 0.210089
IGHV3-23 5180.460000 5.962460 23.445900 2349.850000 3.999940 0.715133 17.278900 0.000000 0.000000 1.437710 985.721000 123.982000 1374.860000 3568.60000 9.857240 0.5625450 2.900430 2.172310 5859.05000 1.102910 0.000000 502.8400000 366.704000 1793.510000 2.294430 97.123900 11.607200 8.1870600 1080.330000 411.058000 9.718060 114.608000 2306.720000 317.0130000 7.954070 2.7908400 865.088000 3563.990000 0.123914 23.4808000 4.896920 1681.420000 1929.860000 2241.850000 26.191600 5228.450000 4.1899600 2807.770000 1213.59000 387.839000 203.5700000 374.506000 374.388000 0.3392100 1359.9900000 1535.600000 118.7600000 2708.140000 4.59234 0.607162 93.584600 0.3873680 1273.530000 1.666060 5.899820 1.8143100 18.921500 17.654300 0.567110 1593.270000 0.7579240 0.2794190 6.994180 216.3070000 4.8487200 1286.5300000 12.741600 167.65000 115.720000 2142.700000 3.020540 79.259200 6471.240000 2508.41000 4077.530000 802.0710000 1884.330000 5188.7400000 296.555000 1696.260000 3027.5700000 215.969000 0.249956 79.7680000 338.8720000 2.2993700 5.4541000 214.318000 152.085000 9.7046700 11.809000 0.300002 0.0000000 0.000000 15.5774000 0.217214 4.113890 229.482000 14.7361000 1145.9400000 35.9383000 0.613331 5.6297400 4.861760 188.38500 94.7553000 297.408000 3505.310000 19.762300 0.860007 208.00400 54.3620000 52.5728000 0.785236
ADAM12.1 0.972897 2.645153 1.166610 5.466742 1.110548 2.581805 0.658545 1.159264 0.462860 3.074193 10.947068 9.678026 1.205472 11.63376 1.772810 0.3506414 3.528288 17.416140 6.36844 2.232818 4.064450 0.2666618 2.113812 0.473972 1.222569 30.012798 0.181003 2.4554526 4.136035 13.961315 4.195791 3.629029 8.362213 0.6999296 7.894137 0.3268513 2.847538 7.015717 0.717947 0.4396555 1.141057 1.069326 1.895644 0.486478 14.504778 1.897848 0.9943284 4.140489 41.30644 8.812227 0.3317777 8.699836 8.323936 0.0292791 0.9615935 2.512841 0.8960788 3.766372 7.13890 1.917924 8.893462 0.0966324 1.550900 4.760995 1.769894 4.6901815 1.200418 1.392691 0.439077 0.658254 0.3610814 0.2501964 0.610416 0.6842673 2.8749874 0.6717734 16.374299 1.36295 8.725470 0.258386 0.214470 3.573125 2.086027 13.44347 4.007794 0.0338254 1.595552 0.9645215 1.913151 5.780085 0.7098401 5.242844 1.115879 0.6499524 0.5397263 0.2299409 0.7178614 0.535170 0.282374 0.2003997 2.202211 0.310417 2.0991998 0.215329 0.1962535 25.010318 2.970828 1.461817 2.6506093 0.6501276 0.9633052 8.715446 32.4636380 4.281851 0.83041 0.9840191 2.363019 0.314493 1.179129 0.656344 1.57062 0.4597666 0.4707508 4.727155

Dispersion

Using negative binomial models requires gene dispersion estimates to be made. This can be achieved in a number of ways. A common way to calculate this for gene i is to use the equation:

Dispersioni = (variancei - meani)/meani2

This can be calculated using:

disp <- apply(tpm, 1, function(x){
  (var(x, na.rm=TRUE)-mean(x, na.rm=TRUE))/(mean(x, na.rm=TRUE)**2)
  })

head(disp)
##     MS4A1    ADAM12 IGHV7-4-1  IGHV3-49  IGHV3-23  ADAM12.1 
##  3.809307  2.386833 11.790220 10.959627  3.302796  2.386833

Alternatively DESeq2 (estimateDispersions) and edgeR (estimateCommonDisp) provide their own dispersion calculations which can also be passed in as a named vector.

Fitting Models

To fit a model for one gene over time we use a formula such as:

gene expression ~ fixed effects + random effects

In R the formula is defined by both the fixed-effects and random-effects part of the model, with the response on the left of a ~ operator and the terms, separated by + operators, on the right. Random-effects terms are distinguished by vertical bars (“|”) separating expressions for design matrices from grouping factors. For more information see the ?lme4::glmer.

In this case study we want to use time and response as fixed effects and the patients as random effects:

gene expression ~ time + response + (1 | patient)

To fit this model for all genes we can use the glmmSeq function. Note that this analysis can take some time, with 2 cores:

results <- glmmSeq(~ Timepoint * EULAR_6m + (1 | PATID),
                  id = "PATID",
                  countdata = tpm,
                  metadata = metadata,
                  dispersion = disp,
                  removeDuplicatedMeasures = FALSE,
                  removeSingles=FALSE,
                  cores = 1)
## 
## n=124 samples, 82 individuals
## Time difference of 7.928273 secs
## Errors in 4 gene(s):IL12A, FGF12, VIL1, IL26

or alternatively using two-factor classification with EULAR_binary:

results2 <- glmmSeq(~ Timepoint * EULAR_binary + (1 | PATID),
                  id = "PATID",
                  countdata = tpm,
                  metadata = metadata,
                  dispersion = disp,
                  removeDuplicatedMeasures = FALSE,
                  removeSingles=FALSE,
                  cores = 1)
## 
## n=124 samples, 82 individuals
## Time difference of 8.663553 secs
## Errors in 4 gene(s):IL12A, FGF12, VIL1, IL26

Outputs

This creates a GlmmSeq object which contains the following slots:

names(attributes(results))
##  [1] "formula"        "stats"          "predict"        "reducedFormula"
##  [5] "countdata"      "metadata"       "modelData"      "optInfo"       
##  [9] "errors"         "variables"      "class"

The variables used by the model are in the @modeldata:

kable(results@modelData) %>% kable_styling()
Timepoint EULAR_6m
0 Good responder
6 Good responder
0 Moderate responder
6 Moderate responder
0 Non responder
6 Non responder

The model fit statistics can be viewed in the @stats slot. To see the most significant interactions we can order by P_Timepoint.EULAR_6m:

stats = data.frame(results@stats)

kable(stats[order(stats$P_Timepoint.EULAR_6m), ]) %>%
  kable_styling() %>%
  scroll_box(width = "100%", height = "400px")
Dispersion AIC logLik X.Intercept. Timepoint EULAR_6mModerate.responder EULAR_6mNon.responder Timepoint.EULAR_6mModerate.responder Timepoint.EULAR_6mNon.responder Chisq_Timepoint Chisq_EULAR_6m Chisq_Timepoint.EULAR_6m P_Timepoint P_EULAR_6m P_Timepoint.EULAR_6m
IGHV3-23 3.3027961 1593.0590 -788.5295 6.9262304 -0.0215078 0.0997026 -0.8471469 -0.2984190 -0.3876322 13.1925140 17.4394412 9.1548998 0.0002811 0.0001633 0.0102811
CXCL13 4.4660422 959.9637 -471.9819 3.5516201 -0.0473594 0.4857026 -1.4712542 -0.2975730 0.1047646 3.4682631 4.0657827 5.7515509 0.0625570 0.1309563 0.0563724
FGF14 0.2872392 377.5484 -180.7742 -0.0846561 0.1142763 -0.0436742 0.9233238 -0.0060532 -0.1725240 5.4493318 5.2131725 5.5994700 0.0195758 0.0737860 0.0608262
IL24 0.4155746 379.2127 -181.6063 0.3687999 -0.0372936 0.2134646 -0.7684268 -0.1075741 0.1371621 2.0849707 0.9956656 5.4593533 0.1487551 0.6078466 0.0652404
MS4A1 3.8093073 906.3589 -445.1795 2.7363666 0.0427532 0.1933006 -1.7237593 -0.2038145 0.1809461 0.0049259 5.5587788 5.3302146 0.9440465 0.0620764 0.0695919
ADAM12 2.3868333 640.7189 -312.3594 1.6569079 -0.1244486 -0.2683597 -0.5047247 -0.0327808 0.2707610 2.6104311 2.2758496 5.2166162 0.1061629 0.3204834 0.0736591
ADAM12.1 2.3868333 640.7189 -312.3594 1.6569079 -0.1244486 -0.2683597 -0.5047247 -0.0327808 0.2707610 2.6104311 2.2758496 5.2166162 0.1061629 0.3204834 0.0736591
EMILIN3 2.7625162 528.4283 -256.2141 1.0154229 0.1272457 -2.0741731 -0.8821688 0.2842837 0.0876341 16.5796035 9.8531384 4.8332169 0.0000467 0.0072513 0.0892237
IL2RG 0.8347024 1085.4440 -534.7220 3.5077340 -0.0589870 0.2548411 -0.6157069 -0.0918822 0.0807571 6.9724941 3.0903991 4.7478250 0.0082772 0.2132693 0.0931157
BLK 1.0371455 535.8205 -259.9102 0.9663982 0.0131474 0.2764801 -0.6306272 -0.1498604 0.0461178 0.6731950 2.2189269 4.4277592 0.4119399 0.3297358 0.1092759
IL16 0.2425014 983.9339 -483.9670 3.2768523 -0.0127286 -0.1331579 -0.3364260 0.0359209 0.0933265 1.0896291 0.3921672 4.3943844 0.2965534 0.8219435 0.1111147
HHIP 1.0446253 542.0779 -263.0390 0.7998605 -0.0255812 -0.1533630 0.5663556 0.1638981 0.0188249 1.0934166 4.2629838 4.3792523 0.2957154 0.1186601 0.1119586
PADI4 2.0172113 477.1472 -230.5736 0.2320863 0.1339818 0.3673813 0.1562910 -0.2058310 -0.1080089 0.7832539 0.2228554 3.4690157 0.3761478 0.8945561 0.1764870
IGHV5-10-1 5.5957132 1106.1781 -545.0891 5.0306946 -0.0275690 0.3457428 -0.0560540 -0.2750020 0.0151389 2.8639863 0.5652944 3.4525938 0.0905828 0.7537857 0.1779421
IGHV1-69 6.2152001 1158.0375 -571.0187 4.5052837 0.0180432 1.0678763 0.3278999 -0.1708809 -0.3766340 2.2586026 4.5435186 3.4524908 0.1328739 0.1031306 0.1779513
IGHV3OR16-8 4.4993425 733.0175 -358.5088 2.9395309 -0.1192854 -0.2209965 -0.3440447 -0.1869965 0.1329159 5.8384035 2.1613238 2.9610767 0.0156800 0.3393708 0.2275152
LILRA5 0.8305244 796.0071 -390.0035 2.1304753 -0.0351868 0.3077720 -0.0538474 -0.0580985 0.0755745 1.9096622 0.9372458 2.5647399 0.1670008 0.6258636 0.2773791
PHOSPHO1 1.5733094 703.2596 -343.6298 1.4569268 0.0922208 0.0654148 0.0650941 -0.1375254 -0.0836019 0.5097114 1.0304948 2.3320027 0.4752638 0.5973528 0.3116105
IGHV2-70D 6.5374752 859.1875 -421.5937 3.7263964 -0.1261725 0.3457869 -0.8728989 -0.2318758 -0.2476121 10.5286552 5.7308583 2.2849410 0.0011754 0.0569587 0.3190299
S100B 3.9481236 1077.7038 -530.8519 2.6698463 -0.0067776 0.4409051 -0.0676109 -0.1007246 0.1585118 0.0389506 0.6756114 2.2578866 0.8435466 0.7133339 0.3233748
IGHJ3P 4.8490468 1090.3858 -537.1929 4.9831232 -0.0882769 -0.0437042 -1.6508369 -0.2056270 -0.0230868 6.0730131 9.4919376 2.0243244 0.0137263 0.0086866 0.3634323
IGHV7-4-1 11.7902202 1104.6904 -544.3452 5.3345103 -0.0899331 0.3334435 -2.6497956 -0.2880871 -0.3013929 5.6235230 16.8346318 1.9424757 0.0177210 0.0002210 0.3786141
LILRB3 0.4796774 951.9280 -467.9640 2.8953372 -0.0256229 0.2114848 -0.1435780 -0.0177522 0.0661034 0.7544800 1.3484459 1.8302213 0.3850615 0.5095522 0.4004723
IL36RN 32.9093454 505.0952 -244.5476 0.9057895 -0.3418558 -1.8590998 -1.0185521 0.5059219 0.0149058 0.7531148 0.5765788 1.7843893 0.3854918 0.7495447 0.4097555
IGHV3OR16-12 12.2236993 543.2450 -263.6225 1.5129747 -0.0194325 -0.6073243 -0.9450945 -0.3160110 -0.1266408 1.7838038 4.0451191 1.6042093 0.1816829 0.1323164 0.4483843
IGLV4-3 13.9281756 582.9962 -283.4981 1.1862192 0.0675748 -0.4837409 -1.0268216 -0.3237485 -0.2029098 0.4605785 3.8919980 1.5672905 0.4973537 0.1428444 0.4567380
PPIL4 0.1775771 791.0085 -387.5043 2.2894351 -0.0009748 -0.0624655 -0.0234200 0.0368889 0.0433462 1.6046046 0.4293014 1.4464362 0.2052519 0.8068232 0.4851883
IGHV3-49 10.9596275 1275.0774 -629.5387 5.7635602 -0.1751975 -0.4705135 0.4518065 -0.2322771 -0.2525210 9.2011674 2.5207179 1.4086043 0.0024186 0.2835522 0.4944535
IGHV5-78 5.6330433 572.8413 -278.4206 1.0630323 0.0326067 -0.0398070 0.6148507 -0.1918736 -0.1387014 0.6329633 1.6933202 1.3829978 0.4262704 0.4288448 0.5008248
EMILIN2 0.2104306 1030.8966 -507.4483 3.4282169 -0.0457832 0.1907900 0.2159081 0.0340239 0.0350085 3.1793234 10.2965904 1.3015293 0.0745756 0.0058093 0.5216467
IGHV1OR15-4 4.1963691 738.2411 -361.1205 2.4925096 -0.0925928 0.8616508 -0.8866376 -0.1439346 0.0160006 4.9657186 6.1505860 1.2737898 0.0258546 0.0461761 0.5289323
IL2RA 1.1277696 549.5752 -266.7876 1.3430124 -0.1276954 0.0285663 -0.7903833 -0.0052488 0.1095742 8.0761400 2.6784029 1.2265220 0.0044852 0.2620549 0.5415819
SAA1 28.7676713 969.6984 -476.8492 3.3639673 -0.2949087 -1.3730551 -0.6174878 -0.0532121 0.4262878 1.9946321 2.8931504 1.1897213 0.1578574 0.2353750 0.5516394
IGHV1OR21-1 7.9239118 360.2362 -172.1181 -0.7429909 0.1012918 1.1516429 -0.9438997 -0.2107916 -0.1667169 0.0008964 4.9235157 1.1080680 0.9761153 0.0852849 0.5746271
IL36G 56.0970863 598.3896 -291.1948 0.9983391 -0.4010838 -2.2326598 -1.8715276 0.5457769 0.1893660 0.5363511 0.6910030 1.1050434 0.4639489 0.7078653 0.5754967
CXCL9 7.7996077 1122.5907 -553.2954 4.1831439 -0.1657152 -0.1505769 -1.9470605 -0.0707887 0.1806196 3.3804785 4.2806510 1.0857505 0.0659729 0.1176166 0.5810751
EAF2 0.5830950 728.8727 -356.4364 2.1048581 -0.0800130 0.2331011 -0.3584361 -0.0420156 0.0294982 11.5743100 3.3330960 1.0034640 0.0006687 0.1888980 0.6054811
CXCL11 4.2907312 566.3559 -275.1780 1.4333300 -0.0948409 -0.1022289 -1.4166330 -0.1100212 0.0730420 3.2350723 4.5849951 0.9991072 0.0720771 0.1010139 0.6068015
IGHV7-27 14.7128235 482.1077 -233.0538 0.9619082 -0.4127032 -0.3547718 -0.9275208 0.0685698 0.3214532 6.5603478 0.0683485 0.9273903 0.0104276 0.9664031 0.6289553
IGHJ6 6.8944257 1230.8013 -607.4007 6.0438683 -0.1072691 -0.2061507 -0.0272608 -0.1385014 -0.1440965 5.1377090 0.9531899 0.7426115 0.0234115 0.6208940 0.6898330
FGFR2 4.6280323 487.8466 -235.9233 0.8562658 -0.0744748 -0.9483749 -1.1838893 0.1227855 0.1126538 0.0291470 3.1683898 0.7101298 0.8644401 0.2051129 0.7011279
CILP 3.3041502 1182.0474 -583.0237 3.5711693 0.1366744 -0.8980250 0.2091389 0.0745440 -0.0556912 6.5358604 3.2720046 0.6787109 0.0105721 0.1947571 0.7122292
SAA2 60.6352181 876.5325 -430.2662 2.4771413 -0.3818037 -2.0207011 -1.8018215 0.1289360 0.3609603 1.2574824 1.1808521 0.3122998 0.2621282 0.5540912 0.8554309
IGHV7-40 16.0741956 496.1990 -240.0995 1.3965106 -0.3059743 -1.0354266 -1.8729133 0.0262291 0.0936549 4.7202821 2.8408064 0.0671455 0.0298089 0.2416166 0.9669846
FGFRL1 0.4941874 711.8804 -347.9402 1.8341910 0.0390384 -0.2544570 -0.0557792 0.0123566 0.0062930 3.2011550 1.9197044 0.0502174 0.0735863 0.3829495 0.9752039
FGF2 0.5378909 513.6488 -248.8244 0.6276046 0.0867638 0.1511292 0.0584818 0.0023201 0.0033362 9.1779051 0.6579514 0.0022173 0.0024495 0.7196605 0.9988920

And the final model output can be seen in the @predict slot:

predict = data.frame(results@predict)
kable(predict) %>%
  kable_styling() %>%
  scroll_box(width = "100%", height = "400px")
y_0_Good.responder y_6_Good.responder y_0_Moderate.responder y_6_Moderate.responder y_0_Non.responder y_6_Non.responder LCI_0_Good.responder LCI_6_Good.responder LCI_0_Moderate.responder LCI_6_Moderate.responder LCI_0_Non.responder LCI_6_Non.responder UCI_0_Good.responder UCI_6_Good.responder UCI_0_Moderate.responder UCI_6_Moderate.responder UCI_0_Non.responder UCI_6_Non.responder
MS4A1 15.4308165 19.9431525 18.7213987 7.1227910 2.7527690 10.5360538 7.9625955 8.9351955 8.7951367 2.8438939 0.8666209 3.2776121 29.903578 44.512661 39.8505199 17.839678 8.744005 33.868690
ADAM12 5.2430737 2.4848599 4.0090258 1.5607585 3.1650953 7.6145225 3.0564310 1.2556603 2.1477788 0.6986118 1.2485649 2.9810515 8.994092 4.917356 7.4832137 3.486868 8.023475 19.449833
IGHV7-4-1 207.3711699 120.8936982 289.4416564 29.9590775 14.6540192 1.4004008 65.3970905 29.6990215 77.3265693 6.1184250 2.0882184 0.1732586 657.564454 492.113394 1083.4112151 146.695649 102.834203 11.319047
IGHV3-49 318.4801588 111.3162675 198.9486411 17.2566816 500.3794569 38.4383545 104.6913401 28.7559785 55.7175554 3.7239091 76.9398536 5.4212860 968.844333 430.912530 710.3786500 79.967865 3254.225077 272.538119
IGHV3-23 1018.6468233 895.3223526 1125.4441239 165.0704816 436.6288407 37.4963628 553.0991511 425.9526166 559.6809998 71.2379749 156.1071323 12.7550310 1876.049436 1881.904427 2263.1185918 382.496329 1221.243012 110.229228
ADAM12.1 5.2430737 2.4848599 4.0090258 1.5607585 3.1650953 7.6145225 3.0564310 1.2556603 2.1477788 0.6986118 1.2485649 2.9810515 8.994092 4.917356 7.4832137 3.486868 8.023475 19.449833
FGFRL1 6.2600677 7.9123207 4.8536647 6.6068284 5.9204459 7.7710100 4.7139419 5.5527755 3.4711111 4.4772678 3.7199380 4.8005258 8.313307 11.274509 6.7868935 9.749290 9.422652 12.579579
IL36G 2.7137709 0.2445920 0.2910324 0.6933905 0.4176179 0.1172444 0.2170874 0.0102678 0.0149928 0.0208486 0.0055144 0.0010136 33.924361 5.826484 5.6493652 23.060988 31.626951 13.562097
BLK 2.6284602 2.8442030 3.4655742 1.5259247 1.3990187 1.9964342 1.6711287 1.6699346 2.1723695 0.8179981 0.6497646 0.8845585 4.134214 4.844196 5.5286196 2.846518 3.012250 4.505920
SAA1 28.9036343 4.9259402 7.3222102 0.9068187 15.5876588 34.2865867 4.7589635 0.5459538 0.9271455 0.0726073 0.7472653 1.4383526 175.546644 44.444944 57.8277741 11.325591 325.152406 817.303099
CILP 35.5581467 80.7385072 14.4854436 51.4419882 43.8295475 71.2509119 16.2290486 34.8247509 5.5330672 19.8083899 14.1851657 21.9409063 77.908559 187.186021 37.9225606 133.593803 135.425223 231.380254
EMILIN3 2.7605305 5.9233185 0.3468891 4.0977018 1.1425403 4.1476108 1.5238404 2.9422519 0.1391718 1.8393015 0.3883307 1.4893484 5.000871 11.924779 0.8646297 9.129096 3.361564 11.550471
EMILIN2 30.8216346 23.4183023 37.3005036 34.7594362 38.2492888 35.8547740 26.1163237 19.0658281 30.9317177 27.7297939 29.0472628 26.8691853 36.374689 28.764388 44.9806112 43.571128 50.366470 47.845322
IGHJ6 421.5204343 221.4626140 342.9955778 78.4996712 410.1846660 90.7777197 166.8044082 71.5215892 118.8051988 21.9641557 86.1969809 17.7890258 1065.196528 685.746639 990.2425785 280.557034 1951.941453 463.240342
CXCL9 65.5716818 24.2605770 56.4055200 13.6473243 9.3566139 10.2318954 25.6217668 7.7250239 19.2558246 3.7333260 1.9062353 1.9440541 167.812216 76.190780 165.2270286 49.888346 45.926242 53.852249
IGHV3OR16-12 4.5402166 4.0405465 2.4735402 0.3305456 1.7645227 0.7345045 1.3871319 0.9541968 0.6310958 0.0544198 0.2332516 0.0831814 14.860568 17.109694 9.6948847 2.007732 13.348419 6.485785
IGHV1OR21-1 0.4756891 0.8735061 1.5047880 0.7800895 0.1850942 0.1250000 0.1640883 0.2551313 0.4878065 0.1920435 0.0234608 0.0118235 1.379015 2.990668 4.6419775 3.168759 1.460303 1.321517
IGHV1-69 90.4940122 100.8407932 263.2647053 105.2284572 125.6102127 14.6090153 39.1224687 36.3742640 100.9595887 33.2326853 30.6221412 3.3209850 209.321306 279.562098 686.4955172 333.196915 515.245665 64.265069
IL2RA 3.8305652 1.7804035 3.9415681 1.7752003 1.7378158 1.5587776 2.4586500 0.9805427 2.4585738 0.9473283 0.8221425 0.6940844 5.968003 3.232737 6.3190942 3.326551 3.673334 3.500709
IGHV2-70D 41.5291831 19.4794769 58.6849465 6.8475685 17.3483513 1.8418858 17.5554665 6.8230881 21.9351827 2.0741872 4.0570480 0.3822414 98.241368 55.612651 157.0045252 22.606057 74.183320 8.875395
IGHV5-10-1 153.0392713 129.7073516 216.2504866 35.1987836 144.6968051 134.2978336 69.0689479 49.2964920 87.0779578 11.7684684 37.9178238 33.1550370 339.096212 341.281831 537.0391558 105.277453 552.172127 543.986970
S100B 14.4377496 13.8624111 22.4378966 11.7721734 13.4938676 33.5367082 7.3603691 6.1088394 10.4090698 4.6551503 4.3383205 10.3189229 28.320402 31.457111 48.3673577 29.770052 41.971187 108.994980
IL24 1.4459983 1.1560840 1.7900875 0.7505556 0.6705702 1.2208949 0.9913052 0.7064529 1.2028927 0.4029263 0.3042418 0.6083370 2.109251 1.891889 2.6639229 1.398106 1.477984 2.450261
IGHV3OR16-8 18.9069756 9.2425575 15.1580904 2.4129328 13.4031026 14.5453175 7.9531254 2.9247322 6.1936376 0.7720537 3.7873232 2.3834654 44.947578 29.207757 37.0973765 7.541243 47.432751 88.764142
FGFR2 2.3543526 1.5059393 0.9120056 1.2186634 0.7206342 0.9061504 1.1059254 0.5881636 0.3635659 0.4145333 0.1798984 0.2201692 5.012070 3.855820 2.2877674 3.582681 2.886706 3.729443
FGF14 0.9188282 1.8239454 0.8795628 1.6837250 2.3132829 1.6309814 0.6194672 1.2553788 0.5559633 1.0912793 1.4315047 0.9309326 1.362857 2.650018 1.3915140 2.597804 3.738219 2.857457
IGHJ3P 145.9294371 85.9238565 139.6890608 23.9506478 28.0022900 14.3550764 69.5763508 34.8979795 59.8817475 8.6220899 8.0187190 3.8707879 306.072399 211.556922 325.8594563 66.530683 97.787221 53.236764
FGF2 1.8731183 3.1524727 2.1787119 3.7181892 1.9859282 3.4099108 1.3226215 2.1603409 1.4843050 2.4553518 1.1148063 1.9895726 2.652741 4.600239 3.1979851 5.630529 3.537754 5.844216
IL16 26.4922505 24.5443305 23.1893789 26.6515715 18.9239104 30.6923703 22.0171113 19.5738524 18.7966646 20.6568290 13.8270770 22.0982763 31.876995 30.776985 28.6086552 34.386026 25.899500 42.628736
LILRA5 8.4188674 6.8165553 11.4529494 6.5439138 7.9775228 10.1650340 6.0676387 4.5509979 7.9247368 4.1388744 4.5880186 5.7510782 11.681204 10.209943 16.5519755 10.346486 13.871101 17.966703
CXCL11 4.1926376 2.3733081 3.7852093 1.1073046 1.0168372 0.8921720 2.0502493 0.9773910 1.6665069 0.3863877 0.2772872 0.2256339 8.573694 5.762884 8.5975098 3.173298 3.728833 3.527710
IGHV7-40 4.0410744 0.6444646 1.4348840 0.2678341 0.6210133 0.1737184 1.0393115 0.1158874 0.2972869 0.0342709 0.0575135 0.0109821 15.712596 3.583951 6.9256077 2.093179 6.705513 2.747930
PHOSPHO1 4.2927466 7.4651960 4.5829437 3.4921380 4.5814744 4.8246311 2.7323671 4.3765034 2.7397020 1.8598925 2.1483398 2.1927668 6.744216 12.733716 7.6662984 6.556845 9.770292 10.615386
EAF2 8.2059388 5.0773027 10.3600725 4.9817820 5.7340498 4.2347873 6.1881199 3.5389317 7.5464233 3.3094486 3.5042660 2.4804598 10.881727 7.284402 14.2227778 7.499180 9.382657 7.229879
IGHV5-78 2.8951366 3.5207456 2.7821536 1.0699634 5.3542090 2.8329403 1.2727185 1.3028278 1.0857429 0.3274884 1.3674312 0.6672736 6.585758 9.514419 7.1291084 3.495762 20.964531 12.027377
CXCL13 34.8697642 26.2446828 56.6744031 7.1544019 8.0073983 11.2999349 14.6381577 8.3352256 23.8847020 2.2140161 2.2187918 2.4851700 83.063763 82.635241 134.4788800 23.118832 28.897902 51.380199
IGHV7-27 2.6166850 0.2199596 1.8351688 0.2327794 1.0349855 0.5986292 0.7088892 0.0365949 0.4088840 0.0310600 0.1101386 0.0547428 9.658830 1.322104 8.2366739 1.744568 9.725879 6.546189
PPIL4 9.8693612 9.8118081 9.2717262 11.5012368 9.6409068 12.4316267 8.1596430 7.7856655 7.4481440 8.8778623 6.9976017 9.0173357 11.937323 12.365234 11.5417891 14.899809 13.282706 17.138692
IGLV4-3 3.2746770 4.9119346 2.0187496 0.4340637 1.1728042 0.5206835 0.9213353 1.0568763 0.4689059 0.0674872 0.1332037 0.0495259 11.639095 22.828689 8.6911893 2.791810 10.326060 5.474135
IL36RN 2.4738843 0.3181140 0.3854629 1.0315744 0.8933628 0.1256239 0.3555073 0.0273436 0.0390226 0.0700976 0.0329337 0.0028729 17.215126 3.700925 3.8075793 15.180925 24.233443 5.493256
IL2RG 33.3725611 23.4251968 43.0591679 17.4154947 18.0298207 20.5456196 23.7872716 15.5093748 29.4695846 10.8576341 10.3837321 11.1844654 46.820327 35.381171 62.9154420 27.934212 31.306127 37.741856
IGHV1OR15-4 12.0915832 6.9375787 28.6215636 6.9240148 4.9822021 3.1465877 6.0326477 2.9609086 12.9808099 2.6445149 1.5211000 0.8964845 24.235857 16.255145 63.1080732 18.128837 16.318676 11.044267
HHIP 2.2252305 1.9086059 1.9088433 4.3771542 3.9204878 3.7647380 1.4755043 1.1439895 1.1795002 2.5990500 2.0568519 1.9140608 3.355904 3.184274 3.0891752 7.371724 7.472694 7.404808
PADI4 1.2612286 2.8178576 1.8211490 1.1833769 1.4745861 1.7232541 0.7179245 1.5016010 0.9838220 0.5416104 0.5824369 0.6648280 2.215689 5.287904 3.3711216 2.585587 3.733287 4.466726
SAA2 11.9071766 1.2048065 1.5784450 0.3461905 1.9646612 1.7337024 0.8677898 0.0489094 0.0779061 0.0087142 0.0235481 0.0170209 163.381572 29.678500 31.9806447 13.753172 163.914970 176.590672
LILRB3 18.0895994 15.5117842 22.3499024 17.2286133 15.6701735 19.9782091 14.1467334 11.4744912 16.9193936 12.2779743 10.3257194 12.9944710 23.131390 20.969597 29.5234068 24.175414 23.780845 30.715282

Qvalues

The qvalues from each of the pvalue columns can be calculated using glmmQvals. This will output a significance table based on the cut-off (default p=0.05) and add qvalue columns to the @stats slot:

results <- glmmQvals(results, pi0=1)
## 
## q_Timepoint
## -----------
## Not Significant     Significant 
##              36              10 
## 
## q_EULAR_6m
## ----------
## Not Significant     Significant 
##              44               2 
## 
## q_Timepoint:EULAR_6m
## --------------------
## Not Significant 
##              46

Individual Genes

Similarly you can run the script for an individual gene:

MS4A1glmm <- glmmSeq(~ Timepoint * EULAR_6m + (1 | PATID),
                     id = "PATID",
                     countdata = tpm["MS4A1", ],
                     metadata = metadata,
                     dispersion = disp,
                     verbose=FALSE)

or to view the lmer fit alone using glmmGene:

MS4A1fit <- glmmGene(~ Timepoint * EULAR_6m + (1 | PATID),
                     gene = "MS4A1",
                     id = "PATID",
                     countdata = tpm,
                     metadata = metadata,
                     dispersion = disp['MS4A1'])
## boundary (singular) fit: see ?isSingular
MS4A1fit
## Generalized linear mixed model fit by maximum likelihood (Laplace
##   Approximation) [glmerMod]
##  Family: Negative Binomial(0.2625)  ( log )
## Formula: count ~ Timepoint + EULAR_6m + (1 | PATID) + Timepoint:EULAR_6m
##    Data: data
##  Offset: offset
##       AIC       BIC    logLik  deviance  df.resid 
##  906.3589  928.9212 -445.1795  890.3589       116 
## Random effects:
##  Groups Name        Std.Dev.
##  PATID  (Intercept) 0       
## Number of obs: 124, groups:  PATID, 82
## Fixed Effects:
##                          (Intercept)                             Timepoint  
##                              2.73637                               0.04275  
##           EULAR_6mModerate responder                 EULAR_6mNon responder  
##                              0.19330                              -1.72376  
## Timepoint:EULAR_6mModerate responder       Timepoint:EULAR_6mNon responder  
##                             -0.20381                               0.18095  
## optimizer (bobyqa) convergence code: 0 (OK) ; 0 optimizer warnings; 1 lme4 warnings

This has the advantage of increased model flexibility.

Paired Plots

For variables which are paired according to an ID (the random effect), we can view the model using paired plots. In this case the samples can be paired over time.

Plots can be viewed using either ggplot or base graphics. We can start looking at the gene with the most significant interaction IGHV3-23:

plotColours <- c("skyblue", "goldenrod1", "mediumseagreen")
modColours <- rep(c("dodgerblue3", "goldenrod3", "seagreen4"), each=2)

pairedPlot(glmmResult=results,
           geneName = "IGHV3-23",
           x1Label = "Timepoint",
           x2Label="EULAR_6m",
           xTitle="Time",
           IDColumn = "PATID",
           graphics = "ggplot",
           colours = plotColours,
           modelColour = modColours,
           modelLineColour = modColours,
           fontSize=10,
           x2Offset = 8,
           logTransform=TRUE,
           addViolin = TRUE,
           pairedOnly = FALSE)

Or using base graphics, with or without the model fit overlaid:

oldpar <- par()
par(mfrow=c(1, 2))

p1 = pairedPlot(glmmResult=results2,
                geneName = "FGF14",
                x1Label = "Timepoint",
                x2Label="EULAR_binary",
                IDColumn = "PATID",
                graphics="base",
                fontSize=0.65,
                colours=c("coral", "mediumseagreen"),
                modelSize = 1)

p2 = pairedPlot(glmmResult=results,
                geneName = "EMILIN3",
                x1Label = "Timepoint",
                x2Label="EULAR_6m",
                IDColumn = "PATID",
                addModel=TRUE,
                graphics="base",
                fontSize=0.65,
                colours=plotColours)

par(oldpar)

Model plots

Alternatively to plot the model fits alone you can use the modelPlot function:

library(ggpubr)
## Loading required package: ggplot2
p1 <- modelPlot(results,
                "ADAM12",
                x1Label="Timepoint",
                x2Label="EULAR_6m",
                xTitle="Time",
                fontSize=8,
                x2Offset=6,
                overlap=FALSE,
                graphics="ggplot",
                colours = plotColours)

p2 <- modelPlot(results,
                "ADAM12",
                x1Label="Timepoint",
                x2Label="EULAR_6m",
                xTitle="Time",
                fontSize=8,
                x2Offset=1,
                addErrorbars = FALSE,
                overlap=TRUE,
                graphics="ggplot",
                colours = plotColours)

ggarrange(p1, p2, ncol=2, common.legend = T, legend="bottom")

Fold Change Plots

The comparative fold change (for x1Label variables) between conditions (x2Label and x2Values variables) can be plotted using fcPlots for all genes to highlight significance.

(By setting graphics=“plotly” this can be viewed interactively)

# Genes to label:
labels = c('MS4A1', 'FGF14', 'IL2RG', 'IGHV3-23', 'ADAM12', 'FGFRL1', 'IL36G', 
           'BLK', 'SAA1', 'CILP', 'EMILIN3', 'EMILIN2', 'IGHJ6', 
           'CXCL9', 'CXCL13')

fcPlot(glmmResult=results,
       x1Label="Timepoint",
       x2Label="EULAR_6m",
       x2Values=c("Good responder", "Non responder"),
       pCutoff=0.1,
       labels=labels,
       useAdjusted = FALSE,
       plotCutoff = 1)

Genes on the x-y plane, such as IGHJ6, will have associations in the same direction whereas genes on the x=-y axis have association in opposite directions, such as ADAM12. This allows us to pick out genes of potential interest which we can have another closer look at:

p1 <- pairedPlot(glmmResult=results,
                 geneName = "ADAM12",
                 x1Label = "Timepoint",
                 x2Label="EULAR_6m",
                 IDColumn = "PATID",
                 graphics="ggplot",
                 colours = "grey60",
                 modelColour = rep(plotColours, each=2),
                 modelLineColour =rep(plotColours, each=2),
                 addViolins=FALSE,
                 fontSize=8,
                 logTransform=T) + theme(plot.subtitle=element_text(size=9))

p2 <- pairedPlot(glmmResult=results,
                 geneName = "IGHJ6",
                 x1Label = "Timepoint",
                 x2Label="EULAR_6m",
                 IDColumn = "PATID",
                 graphics="ggplot",
                 addViolins = FALSE,
                 colours = c("blue"),
                 fontSize=8,
                 modelSize=0.1,
                 logTransform=T) + theme(plot.subtitle=element_text(size=9))

ggarrange(p1, p2, ncol=2)

Or flipping the x1 and x2 labels we can look at the fold change between response at different time points. This might be interesting to see if there are differences at certain time points which are not present at others.

fcPlot(glmmResult=results,
       x2Label="Timepoint",
       x1Label="EULAR_6m",
       x1Values=c("Good responder", "Non responder"),
       labels=labels,
       pCutoff=0.1,
       useAdjusted = F,
       plotCutoff = 1,
       graphics="ggplot")

MA plots

An MA plot is an application of a Bland–Altman plot. The plot visualizes the differences between measurements taken in two samples, by transforming the data onto M (log ratio) and A (mean average) scales, then plotting these values.

maPlots <- maPlot(results,
                  x1Label="Timepoint",
                  x2Label="EULAR_6m",
                  x2Values=c("Good responder", "Non responder"),
                  colours=c('grey', 'midnightblue',
                             'mediumseagreen', 'goldenrod'),
                  labels=labels,
                  graphics="ggplot")

maPlots$combined

maPlots <- maPlot(results,
                  x2Label="Timepoint",
                  x1Label="EULAR_6m",
                  x1Values=c("Good responder", "Non responder"),
                  colours=c('grey', 'midnightblue',
                             'mediumseagreen', 'goldenrod'),
                  labels=labels,
                  graphics="ggplot")

maPlots$combined

Citing glmmSeq

glmmSeq was developed by the bioinformatics team at the Experimental Medicine & Rheumatology department and Centre for Translational Bioinformatics at Queen Mary University London.

If you use this package please cite as:

citation("glmmSeq")
## 
## To cite package 'glmmSeq' in publications use:
## 
##   Myles Lewis, Katriona Goldmann and Elisabetta Sciacca (NA). glmmSeq:
##   General Linear Mixed Models for Gene-Level Differential Expression. R
##   package version 0.0.1. https://github.com/KatrionaGoldmann/glmmSeq
## 
## A BibTeX entry for LaTeX users is
## 
##   @Manual{,
##     title = {glmmSeq: General Linear Mixed Models for Gene-Level Differential Expression},
##     author = {Myles Lewis and Katriona Goldmann and Elisabetta Sciacca},
##     note = {R package version 0.0.1},
##     url = {https://github.com/KatrionaGoldmann/glmmSeq},
##   }

References

Statistical software used in this package:

  1. lme4: Douglas Bates, Martin Maechler, Ben Bolker, Steve Walker (2015). Fitting Linear Mixed-Effects Models Using lme4. Journal of Statistical Software, 67(1), 1-48. doi: 10.18637/jss.v067.i01.

  2. car: John Fox and Sanford Weisberg (2019). An {R} Companion to Applied Regression, Third Edition. Thousand Oaks CA: Sage. URL: https://socialsciences.mcmaster.ca/jfox/Books/Companion/

  3. MASS: Venables, W. N. & Ripley, B. D. (2002) Modern Applied Statistics with S. Fourth Edition. Springer, New York. ISBN 0-387-95457-0

  4. qvalue: John D. Storey, Andrew J. Bass, Alan Dabney and David Robinson (2020). qvalue: Q-value estimation for false discovery rate control. R package version 2.22.0. https://github.com/StoreyLab/qvalue