This document has last been compiled on 2021-12-15 02:02:26.

Data Entry

## Reading in metadata from file: results/RemapYear3/data/root_meta.txt
## Reading in data from file: results/RemapYear3/data/root_normCounts.txt
## Total number of root samples: 302 
## Total number of genes in root samples: 22573 
## No additional bad samples to remove (probably removed during normalization)
## Removing the 48  samples identified as not part of the main experiment, from the root samples
## After filtering root samples: 254 samples, 22573 genes

In this document, we find genes that are globally DE, meaning that we search for any difference between the expression of the gene. We do this via splines, where for each gene we fit a spline function to the expression levels within each condition and compare whether those splines are statistically different between the conditions.

Here we use “split-splines” meaning we fit a different spline function to before and after the watering change (first time point after Day 56 for Preflowering and first time point after Day 63 for post-flowering).

(Note that currently we are not expanding the postflowering condition points into control like Nelle did…)

Create Moanin Object

## Dimensions of data matrix restricting to designated timepoints: 22573 x 177 
## The unique time points are:
##       28, 42, 21, 35, 49, 56, 58, 59, 61, 63, 70, 77, 84, 91, 105 
## The conditions and number of samples are:
##      
##      Control.BT642      Control.RT430 Preflowering.BT642 Preflowering.RT430 
##                 43                 44                 45                 45
## Moanin object on 177 samples containing the following information:
## Group variable given by 'Group' with the following levels:
##      Control.BT642      Control.RT430 Preflowering.BT642 Preflowering.RT430 
##                 43                 44                 45                 45 
## Time variable given by 'Time.Point'
## Basis matrix with 32 basis_matrix functions
## Basis matrix was constructed with the following spline_formula
## ~Group:discont_basis(Time.Point, dfPre = 3, dfPost = 3, discont = pre_watering_time, intercept = TRUE, type = "bs") + 0 
## 
## Information about the data (a SummarizedExperiment object):
## class: SummarizedExperiment 
## dim: 22573 177 
## metadata(0):
## assays(1): ''
## rownames(22573): pg.00002 pg.00004 ... pg.41327 pg.41329
## rowData names(0):
## colnames(177): 0717184R18.1 0731186R13.1 ... 1002185R17 1002185R20
## colData names(66): Barcode Genotype ... Group WeeklyGroup

We separate out the results into genotype-differences, RT430, and BT642 results.

We save results into comma-deliminated file in results/RemapYear3/DE_splitsplines in the following files:

## Saving matrix of results on 22573 genes to comma-deliminated file in results/RemapYear3/DE_splitsplines.
## [1] "root_GenoDiff_Preflowering_splitsplinesDE_all.csv"
## [1] "root_RT430_Preflowering_splitsplinesDE_all.csv"
## [1] "root_BT642_Preflowering_splitsplinesDE_all.csv"

Summary of significant genes

## Number of significant genes:
##  BT642:   15786
##  RT430:   18460
##  GenoDiff:    4512

Visualization of BT642 Results

## Contrast matrix:
##                     Contrasts
## Levels               Preflowering.BT642-Control.BT642
##   Control.BT642                                    -1
##   Control.RT430                                     0
##   Preflowering.BT642                                1
##   Preflowering.RT430                                0

Volcano plots

We will plot volcano plots of the genes based on the calculated log-fold-change (lfc) and the adjusted p-value (qval).

volcano_plot_moanin(moanin_results_all, target, lfc_thres=1, pval_thres=0.05)

Splines for top 20 genes

Here we plot the spline fits for the top 20 genes.

top_de_genes <- plot_top_de_genes(moaninObj = moaninObj, moanin_results = moanin_results_all, target = target, n_top = 20,lfc_thres=1, pval_thres=0.05,drought=condition)
## 303 selected after filtering based on p-value and log fold change 
## Splines for the top 20 genes in RemapYear3, BT642 Preflowering:
top_de_genes
##                  pval         qval      lfc
## pg.35764 7.290134e-20 1.730391e-18 3.080529
## pg.13689 5.741961e-51 3.240332e-47 3.061100
## pg.00133 2.325117e-26 1.562050e-24 2.629821
## pg.32956 3.744239e-35 1.126916e-32 2.564576
## pg.16726 3.275252e-39 2.055559e-36 2.537955
## pg.12547 1.814466e-16 2.584097e-15 2.430261
## pg.13061 2.473573e-15 2.967087e-14 2.349871
## pg.25301 6.662021e-18 1.178541e-16 2.288272
## pg.37380 1.763441e-29 2.211453e-27 2.274008
## pg.37029 8.522946e-15 9.524182e-14 2.264997
## pg.27478 7.465399e-04 1.472017e-03 2.241422
## pg.12178 1.637881e-46 3.697189e-43 2.164976
## pg.25601 3.353140e-25 1.868899e-23 2.119885
## pg.22795 1.770116e-14 1.888319e-13 2.080822
## pg.26266 1.039251e-36 4.044658e-34 2.059692
## pg.10689 1.108170e-28 1.179940e-26 2.050779
## pg.36788 1.413226e-36 5.316792e-34 2.037793
## pg.00509 6.343328e-30 8.678057e-28 2.030758
## pg.33448 8.773454e-06 2.401397e-05 2.028064
## pg.30219 1.695071e-15 2.082502e-14 2.022637

Visualization of RT430 Results

## Contrast matrix:
##                     Contrasts
## Levels               Preflowering.RT430-Control.RT430
##   Control.BT642                                     0
##   Control.RT430                                    -1
##   Preflowering.BT642                                0
##   Preflowering.RT430                                1

Volcano plots

We will plot volcano plots of the genes based on the calculated log-fold-change (lfc) and the adjusted p-value (qval).

volcano_plot_moanin(moanin_results_all, target, lfc_thres=1, pval_thres=0.05)

Splines for top 20 genes

Here we plot the spline fits for the top 20 genes.

top_de_genes <- plot_top_de_genes(moaninObj = moaninObj, moanin_results = moanin_results_all, target = target, n_top = 20,lfc_thres=1, pval_thres=0.05,drought=condition)
## 620 selected after filtering based on p-value and log fold change 
## Splines for the top 20 genes in RemapYear3, RT430 Preflowering:
top_de_genes
##                  pval         qval      lfc
## pg.35764 9.219779e-21 1.386529e-19 3.385833
## pg.25301 7.653108e-28 3.504130e-26 2.861809
## pg.32956 2.496203e-35 4.769232e-33 2.834810
## pg.00133 3.985977e-25 1.166997e-23 2.709088
## pg.12547 4.607662e-22 8.469768e-21 2.698418
## pg.33448 4.625824e-08 1.206734e-07 2.690088
## pg.27478 4.178918e-08 1.095849e-07 2.627020
## pg.13061 2.478449e-20 3.453458e-19 2.618321
## pg.08105 6.705268e-25 1.884907e-23 2.613830
## pg.34352 8.277893e-21 1.259143e-19 2.435910
## pg.22795 5.133964e-17 4.384751e-16 2.432143
## pg.03815 1.046501e-09 3.347883e-09 2.431026
## pg.17660 5.896058e-26 2.028837e-24 2.342247
## pg.28230 1.883722e-15 1.286963e-14 2.323145
## pg.10689 2.534962e-36 6.023337e-34 2.293930
## pg.25378 1.580573e-13 8.291487e-13 2.279480
## pg.37029 2.245027e-12 1.012932e-11 2.258728
## pg.02043 1.260682e-31 1.242680e-29 2.215364
## pg.03814 2.415144e-08 6.521178e-08 2.189074
## pg.30219 2.177809e-17 1.971909e-16 2.175558

Visualization of Differences between genotypes

## Contrast matrix:
##                     Contrasts
## Levels               Preflowering.BT642-Control.BT642-Preflowering.RT430+Control.RT430
##   Control.BT642                                                                     -1
##   Control.RT430                                                                      1
##   Preflowering.BT642                                                                 1
##   Preflowering.RT430                                                                -1

Volcano plots

We will plot volcano plots of the genes based on the calculated log-fold-change (lfc) and the adjusted p-value (qval).

volcano_plot_moanin(moanin_results_all, target, lfc_thres=1, pval_thres=0.05)

Splines for top 20 genes

Here we plot the spline fits for the top 20 genes.

top_de_genes <- plot_top_de_genes(moaninObj = moaninObj, moanin_results = moanin_results_all, target = target, n_top = 20,lfc_thres=1, pval_thres=0.05,drought=condition)
## 40 selected after filtering based on p-value and log fold change 
## Splines for the top 20 genes in RemapYear3, BT642_vs_RT430 Preflowering:
top_de_genes
##                  pval         qval      lfc
## pg.25072 4.924338e-22 9.263090e-19 1.506480
## pg.25970 7.263190e-15 2.539290e-12 1.442546
## pg.19362 3.636481e-10 4.320331e-08 1.337061
## pg.38645 1.456736e-07 7.598054e-06 1.330297
## pg.06352 4.958071e-05 9.444601e-04 1.314457
## pg.36367 6.232789e-09 5.097564e-07 1.290755
## pg.30379 9.742452e-33 1.099582e-28 1.286972
## pg.02539 2.555702e-04 3.421649e-03 1.252072
## pg.13689 3.235727e-08 2.141938e-06 1.251212
## pg.17744 7.930248e-07 3.248811e-05 1.233842
## pg.13099 7.589966e-03 4.114141e-02 1.209350
## pg.19004 2.383833e-06 8.103955e-05 1.196556
## pg.25724 4.029862e-13 9.781298e-11 1.195962
## pg.36779 9.387190e-09 7.256748e-07 1.193267
## pg.25042 3.568607e-10 4.284796e-08 1.174867
## pg.17660 4.771380e-04 5.420451e-03 1.162019
## pg.40092 1.271973e-21 2.208635e-18 1.147023
## pg.33800 1.734430e-06 6.264206e-05 1.129107
## pg.13669 3.438398e-09 3.043723e-07 1.117702
## pg.04913 3.500963e-04 4.304316e-03 1.116281

# Session Info

## [1] "2021-12-15 02:03:29 PST"
## R version 4.1.2 (2021-11-01)
## Platform: x86_64-pc-linux-gnu (64-bit)
## Running under: Ubuntu 20.04 LTS
## 
## Matrix products: default
## BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
## LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/liblapack.so.3
## 
## locale:
##  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
##  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
##  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
##  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
##  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
## [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
## 
## attached base packages:
## [1] stats4    splines   stats     graphics  grDevices utils     datasets 
## [8] methods   base     
## 
## other attached packages:
##  [1] moanin_1.1.2                topGO_2.44.0               
##  [3] SparseM_1.81                GO.db_3.13.0               
##  [5] AnnotationDbi_1.56.1        graph_1.72.0               
##  [7] SummarizedExperiment_1.24.0 Biobase_2.54.0             
##  [9] GenomicRanges_1.46.0        GenomeInfoDb_1.30.0        
## [11] IRanges_2.28.0              S4Vectors_0.32.2           
## [13] BiocGenerics_0.40.0         MatrixGenerics_1.6.0       
## [15] matrixStats_0.61.0          MASS_7.3-54                
## [17] reshape2_1.4.4              forcats_0.5.1              
## [19] stringr_1.4.0               purrr_0.3.4                
## [21] readr_2.0.2                 tidyr_1.1.4                
## [23] tibble_3.1.6                tidyverse_1.3.1            
## [25] dplyr_1.0.7                 ggplot2_3.3.5              
## [27] knitr_1.36                  rmarkdown_2.11             
## [29] SCF_4.1.0                  
## 
## loaded via a namespace (and not attached):
##  [1] bitops_1.0-7           fs_1.5.0               bit64_4.0.5           
##  [4] lubridate_1.8.0        httr_1.4.2             tools_4.1.2           
##  [7] backports_1.3.0        bslib_0.3.1            utf8_1.2.2            
## [10] R6_2.5.1               DBI_1.1.1              colorspace_2.0-2      
## [13] withr_2.4.2            gridExtra_2.3          tidyselect_1.1.1      
## [16] bit_4.0.4              compiler_4.1.2         cli_3.1.0             
## [19] rvest_1.0.2            xml2_1.3.2             DelayedArray_0.20.0   
## [22] sass_0.4.0             scales_1.1.1           digest_0.6.28         
## [25] XVector_0.34.0         pkgconfig_2.0.3        htmltools_0.5.2       
## [28] highr_0.9              limma_3.50.0           dbplyr_2.1.1          
## [31] fastmap_1.1.0          rlang_0.4.12           readxl_1.3.1          
## [34] rstudioapi_0.13        RSQLite_2.2.8          jquerylib_0.1.4       
## [37] generics_0.1.1         jsonlite_1.7.2         gtools_3.9.2          
## [40] RCurl_1.98-1.5         magrittr_2.0.1         GenomeInfoDbData_1.2.7
## [43] Matrix_1.3-4           Rcpp_1.0.7             munsell_0.5.0         
## [46] fansi_0.5.0            viridis_0.6.2          lifecycle_1.0.1       
## [49] edgeR_3.36.0           stringi_1.7.5          yaml_2.2.1            
## [52] ClusterR_1.2.5         zlibbioc_1.40.0        plyr_1.8.6            
## [55] blob_1.2.2             grid_4.1.2             crayon_1.4.2          
## [58] lattice_0.20-45        Biostrings_2.60.2      haven_2.4.3           
## [61] KEGGREST_1.34.0        hms_1.1.1              locfit_1.5-9.4        
## [64] pillar_1.6.4           reprex_2.0.1           glue_1.5.0            
## [67] evaluate_0.14          modelr_0.1.8           png_0.1-7             
## [70] vctrs_0.3.8            tzdb_0.2.0             cellranger_1.1.0      
## [73] gtable_0.3.0           assertthat_0.2.1       cachem_1.0.6          
## [76] xfun_0.28              broom_0.7.10           viridisLite_0.4.0     
## [79] memoise_2.0.0          gmp_0.6-2.1            ellipsis_0.3.2