This document has last been compiled on 2021-12-14 22:50:09.

## Reading in metadata from file: results/BT642Year2/data/leaf_meta.txt
## Reading in data from file: results/BT642Year2/data/leaf_normCounts.txt
## Reading in metadata from file: results/BT642Year2/data/root_meta.txt
## Reading in data from file: results/BT642Year2/data/root_normCounts.txt
## Total number of leaf samples: 125 
## Total number of genes in leaf samples: 22181 
## No additional bad samples to remove (probably removed during normalization)
## Removing the 13  samples identified as not part of the main experiment, from the leaf samples
## After filtering leaf samples: 112 samples, 22181 genes
## Total number of root samples: 133 
## Total number of genes in root samples: 23916 
## No additional bad samples to remove (probably removed during normalization)
## Removing the 13  samples identified as not part of the main experiment, from the root samples
## After filtering root samples: 120 samples, 23916 genes

Description

This analysis looks specifically at finding genes that have large, differential changes from time point to time point.

The analysis is done on root and leaf separately. We run the model with a fixed effect for each TP/condition/etc. and then query the following contrast for each time point (TP) i and Treatment (i.e. preflowering vs postflowering):

(TP i - TP (i-1))[430 Treatment] - (TP i - TP (i-1))[430 Control] (TP i - TP (i-1))[642 Treatment] - (TP i - TP (i-1))[642 Control]

To be able to further evaluate/filter these quantities, we also just test whether the individual differences are significant, i.e. whether the change in treatment is significant or the change in control is significant.

(TP i - TP (i-1))[430 Treatment] (TP i - TP (i-1))[430 Control] (TP i - TP (i-1))[642 Treatment] (TP i - TP (i-1))[642 Control]

This is to allow us to find those that are different combinations in the change in treatment and control.

We also do these same comparisons, controlling for genotype.

p-values are corrected using BH across all contrasts within a contrast group (4 different groups of contrasts, described above). Genes with a p-value smaller than 0.05 are considered as differentially expressed.

We calculate the difference for every pair of time points, but the interest is in particular pairs of time points, when drought starts or water is turned back on.

Calculating the DE of jumps

We calculate both the time point and the genotype difference with our function moaninDeJumpsContrast_tpDiff and moaninDeJumpsContrast_genoTPDiff for leaf and root, pre and post. Note that we calculate (and later save) the results for all genes.

Determine the direction of change

We determine the direction of the change (“+/-”), with “0” if the change is not significant. This creates variables ‘DirectionTreat’, ‘DirectionCtrl’ and ‘Direction’ (where the last is the combination of the first two).

In this report, Treat refers to the difference of the time point with the previous time point for treatment (i.e. drought), while Control columns are those on control. Combined refers to the difference of these differences (the one of relevance, because if control is also showing the same change between the time points, that is not of interest.)

(This is done for the tpDiff matrix, i.e. not the genotype difference results)

# DE_Jump for leaf, root, Preflowering, and Postflowering, with genotypes BT642 and RT430
tpDiff_leaf_pre <- moaninDeJumpsContrast_tpDiff("leaf","Preflowering",timepoints_before=timepoints_before_leaf_pre,timepoints_after=timepoints_after_leaf_pre)
## Sample type: leaf , Treat: Preflowering 
## Saving leaf preflowering results in results/BT642Year2/DE_jumps
tpDiff_leaf_post <- moaninDeJumpsContrast_tpDiff("leaf","Postflowering",timepoints_before=timepoints_before_leaf_post,timepoints_after=timepoints_after_leaf_post)
## Sample type: leaf , Treat: Postflowering 
## Saving leaf postflowering results in results/BT642Year2/DE_jumps
tpDiff_root_pre <- moaninDeJumpsContrast_tpDiff("root","Preflowering",timepoints_before=timepoints_before_root_pre,timepoints_after=timepoints_after_root_pre)
## Sample type: root , Treat: Preflowering 
## Saving root preflowering results in results/BT642Year2/DE_jumps
tpDiff_root_post <- moaninDeJumpsContrast_tpDiff("root","Postflowering",timepoints_before=timepoints_before_root_post,timepoints_after=timepoints_after_root_post)
## Sample type: root , Treat: Postflowering 
## Saving root postflowering results in results/BT642Year2/DE_jumps
# DE_Jump for leaf, root, Preflowering, and Postflowering, with genotype GenoDiff
if(! typeyear %in% c("BT642", "RT430")){
  genoTPDiff_leaf_pre <- moaninDeJumpsContrast_genoTPDiff("leaf","Preflowering",timepoints_before=timepoints_before_leaf_pre,timepoints_after=timepoints_after_leaf_pre)
  genoTPDiff_leaf_post <- moaninDeJumpsContrast_genoTPDiff("leaf","Postflowering",timepoints_before=timepoints_before_leaf_post,timepoints_after=timepoints_after_leaf_post)
  genoTPDiff_root_pre <- moaninDeJumpsContrast_genoTPDiff("root","Preflowering",timepoints_before=timepoints_before_root_pre,timepoints_after=timepoints_after_root_pre)
  genoTPDiff_root_post <- moaninDeJumpsContrast_genoTPDiff("root","Postflowering",timepoints_before=timepoints_before_root_post,timepoints_after=timepoints_after_root_post)
}

Save results of all genes to files

First we write all moanin results per timpoint and the combined results to a comma-deliminated file in results/BT642Year2/DE_jumps,

and similarly for root.

Significant results, per genotype

Note on significance: not all TPs have replication, reducing their ability to be significant, and further some TPs could have no data (e.g. they only had a single replicate, but that replicate was not processed). Also, the first drought time point in preflowering is compared to the control plot, so that the difference of the differences is just the difference between control and treatment in TP[i]. Here is a table of the replication at each time point, condition and genotype:

## , ,  = BT642
## 
##         
##          Control Postflowering Preflowering
##   Day014       1             0            2
##   Day021       3             0            2
##   Day028       2             0            3
##   Day035       3             0            2
##   Day042       2             0            3
##   Day049       3             0            2
##   Day056       3             0            3
##   Day058       3             0            3
##   Day059       2             0            3
##   Day061       2             0            2
##   Day063       3             3            3
##   Day065       2             2            0
##   Day068       3             3            0
##   Day070       3             3            3
##   Day077       3             3            3
##   Day084       3             3            3
##   Day091       3             3            3
##   Day105       2             3            3

Determining significance

In determining significance in the tables that follow, we count a gene as significant if it both has a significant difference in the treatment from TP[i] to TP[i-1] and that difference is significantly different from that seen in control (the difference of the differences is significant). For these summaries, we use the tpAdj, i.e. multiple testing correction done within each timepoint/contrast pair, but not more agressively across all the timepoints within a contrast (groupAdj).

## Example lines of results after subsetting to the significant genes
##          timepoints                     Gene Genotype      lfc         pval
## 498   Day021-Day014 SbiBTX642.01G066900.v1.1    BT642 1.728041 2.984327e-06
## 3088  Day021-Day014 SbiBTX642.01G462900.v1.1    BT642 3.426633 4.015198e-06
## 6555  Day021-Day014 SbiBTX642.02G412100.v1.1    BT642 3.014640 2.701150e-05
## 7696  Day021-Day014 SbiBTX642.03G134700.v1.1    BT642 2.641950 8.729728e-06
## 8816  Day021-Day014 SbiBTX642.03G311000.v1.1    BT642 1.723696 2.469090e-06
## 13778 Day021-Day014 SbiBTX642.06G001100.v1.1    BT642 4.084256 2.993069e-05
##             qval Treat.lfc   Treat.pval Treat.tpAdj.pval   Ctrl.lfc   Ctrl.pval
## 498   0.01103256 0.9392779 5.071686e-05     0.0061138623 -0.7887631 0.003641435
## 3088  0.01272301 2.1871260 1.659541e-05     0.0024059012 -1.2395073 0.014189679
## 6555  0.04279586 2.0654141 5.412853e-06     0.0009307170 -0.9492256 0.074288065
## 7696  0.01936341 1.4933661 7.512389e-05     0.0082084878 -1.1485837 0.008110747
## 8816  0.01095338 1.0877234 3.450761e-06     0.0006486554 -0.6359724 0.016386353
## 13778 0.04425951 2.5765093 8.925493e-05     0.0094107962 -1.5077469 0.027937415
##       Ctrl.tpAdj.pval DirectionTreat DirectionCtrl    Direction
## 498        0.06781753         Treat+         Ctrl0 Treat+.Ctrl0
## 3088       0.14288610         Treat+         Ctrl0 Treat+.Ctrl0
## 6555       0.32968859         Treat+         Ctrl0 Treat+.Ctrl0
## 7696       0.10460587         Treat+         Ctrl0 Treat+.Ctrl0
## 8816       0.15352374         Treat+         Ctrl0 Treat+.Ctrl0
## 13778      0.20002576         Treat+         Ctrl0 Treat+.Ctrl0
## Example lines of results after subsetting to the significant genes, at the water change
##           timepoints                     Gene Genotype        lfc         pval
## 133120 Day058-Day056 SbiBTX642.01G005000.v1.1    BT642  3.9103808 7.979893e-07
## 133174 Day058-Day056 SbiBTX642.01G011500.v1.1    BT642  1.8668199 2.041081e-06
## 133356 Day058-Day056 SbiBTX642.01G034900.v1.1    BT642 -0.6994333 2.081291e-04
## 133440 Day058-Day056 SbiBTX642.01G047000.v1.1    BT642  1.1434263 1.136023e-04
## 133456 Day058-Day056 SbiBTX642.01G048800.v1.1    BT642 -1.5904623 8.392843e-05
## 133464 Day058-Day056 SbiBTX642.01G049800.v1.1    BT642 -2.2260066 3.173639e-06
##                qval  Treat.lfc   Treat.pval Treat.tpAdj.pval    Ctrl.lfc
## 133120 0.0008045546  3.4271359 1.096870e-08     2.432967e-06 -0.48324493
## 133174 0.0016767858  1.8021987 1.647469e-09     5.595803e-07 -0.06462118
## 133356 0.0246713942 -0.6770844 1.044539e-06     9.380130e-05  0.02234886
## 133440 0.0173780217  0.6893842 9.986091e-04     1.757948e-02 -0.45404208
## 133456 0.0146583981 -1.1398212 5.871460e-05     2.146406e-03  0.45064102
## 133464 0.0024273959 -1.9608504 3.847393e-08     6.938132e-06  0.26515622
##        Ctrl.pval Ctrl.tpAdj.pval DirectionTreat DirectionCtrl    Direction
## 133120 0.3282600       0.7106321         Treat+         Ctrl0 Treat+.Ctrl0
## 133174 0.7966004       0.9450453         Treat+         Ctrl0 Treat+.Ctrl0
## 133356 0.8599826       0.9630933         Treat-         Ctrl0 Treat-.Ctrl0
## 133440 0.0226463       0.3106479         Treat+         Ctrl0 Treat+.Ctrl0
## 133456 0.1023149       0.4792972         Treat-         Ctrl0 Treat-.Ctrl0
## 133464 0.3859619       0.7557693         Treat-         Ctrl0 Treat-.Ctrl0
## Example lines of results after subsetting to the significant genes, only water change at Day063-Day056
##           timepoints                     Gene Genotype       lfc         pval
## 310568 Day063-Day056 SbiBTX642.01G005000.v1.1    BT642  2.864509 1.410188e-04
## 310748 Day063-Day056 SbiBTX642.01G027900.v1.1    BT642 -2.562665 5.258120e-05
## 310865 Day063-Day056 SbiBTX642.01G043400.v1.1    BT642  2.615388 8.747704e-07
## 310912 Day063-Day056 SbiBTX642.01G049800.v1.1    BT642 -1.757357 1.442841e-04
## 310971 Day063-Day056 SbiBTX642.01G057700.v1.1    BT642 -2.143179 1.632150e-05
## 311252 Day063-Day056 SbiBTX642.01G094800.v1.1    BT642 -1.581844 6.757670e-05
##                qval Treat.lfc   Treat.pval Treat.tpAdj.pval    Ctrl.lfc
## 310568 0.0252252994  2.806584 9.989217e-07     1.142118e-04 -0.05792542
## 310748 0.0140518500 -1.708175 4.679046e-05     2.251322e-03  0.85448958
## 310865 0.0008371288  2.367672 4.998274e-10     2.358866e-07 -0.24771572
## 310912 0.0256029323 -1.992382 2.515563e-08     7.153552e-06 -0.23502515
## 310971 0.0060337857 -2.099525 5.374831e-08     1.295860e-05  0.04365462
## 311252 0.0156137374 -2.182492 1.139121e-11     1.263343e-08 -0.60064741
##         Ctrl.pval Ctrl.tpAdj.pval DirectionTreat DirectionCtrl    Direction
## 310568 0.90462556       0.9934386         Treat+         Ctrl0 Treat+.Ctrl0
## 310748 0.05959998       0.9430400         Treat-         Ctrl0 Treat-.Ctrl0
## 310865 0.48995302       0.9591537         Treat+         Ctrl0 Treat+.Ctrl0
## 310912 0.43658846       0.9591072         Treat-         Ctrl0 Treat-.Ctrl0
## 310971 0.88805297       0.9925016         Treat-         Ctrl0 Treat-.Ctrl0
## 311252 0.02295756       0.9412600         Treat-         Ctrl0 Treat-.Ctrl0

Summary information of Significant results

Significant by time point

We show the tabulatation of the number of significant differences in each TP by genotype. Here the TP refers to the difference of that TP with the TP before it.

In leaf:

## Leaf, Pre
##                
##                 BT642
##   Day021-Day014     8
##   Day028-Day021     0
##   Day035-Day028     0
##   Day042-Day035     0
##   Day049-Day042     0
##   Day056-Day049     0
##   Day058-Day056   287
##   Day059-Day058     6
##   Day061-Day059     1
##   Day063-Day056   177
##   Day063-Day061     1
##   Day077-Day070     0
##   Day084-Day077     0
##   Day091-Day084     0
##   Day105-Day091     0
## Leaf, Post
##                
##                 BT642
##   Day065-Day063     0
##   Day068-Day065     0
##   Day070-Day063     0
##   Day070-Day065     0
##   Day070-Day068     0
##   Day077-Day070   906
##   Day084-Day077    56
##   Day091-Day084     0
##   Day105-Day091     0

We can repeat this with the root

## root, Pre
##                
##                 BT642
##   Day021-Day014    16
##   Day028-Day021     0
##   Day035-Day028     4
##   Day042-Day035     0
##   Day049-Day042     0
##   Day056-Day049     0
##   Day058-Day056  4567
##   Day059-Day058   307
##   Day061-Day059   161
##   Day063-Day056  1570
##   Day063-Day061     0
##   Day077-Day070     0
##   Day084-Day077     0
##   Day091-Day084     0
##   Day105-Day091    53
## root, Post
##                
##                 BT642
##   Day065-Day063     0
##   Day068-Day065     0
##   Day070-Day063   191
##   Day070-Day065     0
##   Day070-Day068     0
##   Day077-Day070     8
##   Day084-Day077     0
##   Day091-Day084    28
##   Day105-Day091    59

Broken down by the direction of change

We can further look at the direction of the change in treatment, where the direction is defined as above to either be an increase or a decrease (sign of the logFR of the treatment difference between the tps), and further categorized to be the same direction or opposite as the change

Leaf:

## Leaf, Pre
## , ,  = BT642
## 
##                
##                 Treat-.Ctrl- Treat-.Ctrl0 Treat+.Ctrl0
##   Day021-Day014            1            0            7
##   Day028-Day021            0            0            0
##   Day035-Day028            0            0            0
##   Day042-Day035            0            0            0
##   Day049-Day042            0            0            0
##   Day056-Day049            0            0            0
##   Day058-Day056            0          159          128
##   Day059-Day058            0            1            5
##   Day061-Day059            0            1            0
##   Day063-Day056            0          110           67
##   Day063-Day061            0            1            0
##   Day077-Day070            0            0            0
##   Day084-Day077            0            0            0
##   Day091-Day084            0            0            0
##   Day105-Day091            0            0            0
## Leaf, Post
## , ,  = BT642
## 
##                
##                 Treat-.Ctrl0 Treat+.Ctrl- Treat+.Ctrl0
##   Day065-Day063            0            0            0
##   Day068-Day065            0            0            0
##   Day070-Day063            0            0            0
##   Day070-Day065            0            0            0
##   Day070-Day068            0            0            0
##   Day077-Day070          298            3          605
##   Day084-Day077           44            0           12
##   Day091-Day084            0            0            0
##   Day105-Day091            0            0            0

Root:

## root, Pre
## , ,  = BT642
## 
##                
##                 Treat-.Ctrl- Treat-.Ctrl+ Treat-.Ctrl0 Treat+.Ctrl-
##   Day021-Day014           11            0            1            0
##   Day028-Day021            0            0            0            0
##   Day035-Day028            0            0            3            0
##   Day042-Day035            0            0            0            0
##   Day049-Day042            0            0            0            0
##   Day056-Day049            0            0            0            0
##   Day058-Day056            9            1         1673            3
##   Day059-Day058            0            0          199            0
##   Day061-Day059            0            0           90            0
##   Day063-Day056            0            0          729            0
##   Day063-Day061            0            0            0            0
##   Day077-Day070            0            0            0            0
##   Day084-Day077            0            0            0            0
##   Day091-Day084            0            0            0            0
##   Day105-Day091            1            6           46            0
##                
##                 Treat+.Ctrl+ Treat+.Ctrl0
##   Day021-Day014            3            1
##   Day028-Day021            0            0
##   Day035-Day028            0            1
##   Day042-Day035            0            0
##   Day049-Day042            0            0
##   Day056-Day049            0            0
##   Day058-Day056            4         2877
##   Day059-Day058            0          108
##   Day061-Day059            0           71
##   Day063-Day056            0          841
##   Day063-Day061            0            0
##   Day077-Day070            0            0
##   Day084-Day077            0            0
##   Day091-Day084            0            0
##   Day105-Day091            0            0
## root, Post
## , ,  = BT642
## 
##                
##                 Treat-.Ctrl+ Treat-.Ctrl0 Treat+.Ctrl0
##   Day065-Day063            0            0            0
##   Day068-Day065            0            0            0
##   Day070-Day063            0          127           64
##   Day070-Day065            0            0            0
##   Day070-Day068            0            0            0
##   Day077-Day070            0            1            7
##   Day084-Day077            0            0            0
##   Day091-Day084            0           10           18
##   Day105-Day091            4           48            7
## Example lines of results after subsetting to the significant genes, only water change at Day063-Day056
##           timepoints                     Gene Genotype       lfc         pval
## 310568 Day063-Day056 SbiBTX642.01G005000.v1.1    BT642  2.864509 1.410188e-04
## 310748 Day063-Day056 SbiBTX642.01G027900.v1.1    BT642 -2.562665 5.258120e-05
## 310865 Day063-Day056 SbiBTX642.01G043400.v1.1    BT642  2.615388 8.747704e-07
## 310912 Day063-Day056 SbiBTX642.01G049800.v1.1    BT642 -1.757357 1.442841e-04
## 310971 Day063-Day056 SbiBTX642.01G057700.v1.1    BT642 -2.143179 1.632150e-05
## 311252 Day063-Day056 SbiBTX642.01G094800.v1.1    BT642 -1.581844 6.757670e-05
##                qval Treat.lfc   Treat.pval Treat.tpAdj.pval    Ctrl.lfc
## 310568 0.0252252994  2.806584 9.989217e-07     1.142118e-04 -0.05792542
## 310748 0.0140518500 -1.708175 4.679046e-05     2.251322e-03  0.85448958
## 310865 0.0008371288  2.367672 4.998274e-10     2.358866e-07 -0.24771572
## 310912 0.0256029323 -1.992382 2.515563e-08     7.153552e-06 -0.23502515
## 310971 0.0060337857 -2.099525 5.374831e-08     1.295860e-05  0.04365462
## 311252 0.0156137374 -2.182492 1.139121e-11     1.263343e-08 -0.60064741
##         Ctrl.pval Ctrl.tpAdj.pval DirectionTreat DirectionCtrl    Direction
## 310568 0.90462556       0.9934386         Treat+         Ctrl0 Treat+.Ctrl0
## 310748 0.05959998       0.9430400         Treat-         Ctrl0 Treat-.Ctrl0
## 310865 0.48995302       0.9591537         Treat+         Ctrl0 Treat+.Ctrl0
## 310912 0.43658846       0.9591072         Treat-         Ctrl0 Treat-.Ctrl0
## 310971 0.88805297       0.9925016         Treat-         Ctrl0 Treat-.Ctrl0
## 311252 0.02295756       0.9412600         Treat-         Ctrl0 Treat-.Ctrl0