This document has last been compiled on 2021-12-14 21:18:16.
## Reading in metadata from file: results/BT642Year1/data/leaf_meta.txt
## Reading in data from file: results/BT642Year1/data/leaf_normCounts.txt
## Reading in metadata from file: results/BT642Year1/data/root_meta.txt
## Reading in data from file: results/BT642Year1/data/root_normCounts.txt
## Total number of leaf samples: 100
## Total number of genes in leaf samples: 21183
## No additional bad samples to remove (probably removed during normalization)
## There are no samples to remove beyond those used in the main experiment
## After filtering leaf samples: 100 samples, 21183 genes
## Total number of root samples: 96
## Total number of genes in root samples: 23595
## No additional bad samples to remove (probably removed during normalization)
## There are no samples to remove beyond those used in the main experiment
## After filtering root samples: 96 samples, 23595 genes
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.
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.
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/BT642Year1/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/BT642Year1/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/BT642Year1/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/BT642Year1/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)
}
First we write all moanin results per timpoint and the combined results to a comma-deliminated file in results/BT642Year1/DE_jumps,
leaf_Preflowering_jumpDE_all.csv
leaf_GenoDiff_Preflowering_jumpDE_all.csv
and similarly for root.
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 3 0 0
## Day021 3 0 3
## Day028 2 0 3
## Day035 3 0 3
## Day042 3 0 3
## Day049 1 0 1
## Day056 3 0 3
## Day063 3 3 3
## Day070 3 3 3
## Day077 3 3 3
## Day084 3 1 3
## Day091 3 3 3
## Day098 1 1 1
## Day105 3 3 3
## Day112 0 1 1
## Day119 3 3 3
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
## 577 Day028-Day021 SbiBTX642.01G079900.v1.1 BT642 -0.8158751 2.581689e-04
## 1143 Day028-Day021 SbiBTX642.01G162500.v1.1 BT642 1.4294866 1.335229e-03
## 1200 Day028-Day021 SbiBTX642.01G172400.v1.1 BT642 0.8220481 1.216296e-03
## 1390 Day028-Day021 SbiBTX642.01G203900.v1.1 BT642 -2.3673491 8.268766e-05
## 1424 Day028-Day021 SbiBTX642.01G208800.v1.1 BT642 -1.7221723 3.956675e-04
## 1634 Day028-Day021 SbiBTX642.01G244900.v1.1 BT642 -1.7093177 1.516419e-05
## qval Treat.lfc Treat.pval Treat.tpAdj.pval Ctrl.lfc
## 577 0.012289420 -0.5323336 3.535954e-04 0.03160427 0.2835414
## 1143 0.033472384 1.0216148 6.805770e-04 0.04789589 -0.4078718
## 1200 0.031652074 0.6354807 2.135937e-04 0.02393945 -0.1865674
## 1390 0.006103041 -1.6471182 5.678455e-05 0.01312865 0.7202309
## 1424 0.015873911 -1.2474352 1.374597e-04 0.01958361 0.4747371
## 1634 0.002398972 -0.9328655 2.867552e-04 0.02786393 0.7764522
## Ctrl.pval Ctrl.tpAdj.pval DirectionTreat DirectionCtrl Direction
## 577 0.074764762 0.22846826 Treat- Ctrl0 Treat-.Ctrl0
## 1143 0.200995385 0.41727664 Treat+ Ctrl0 Treat+.Ctrl0
## 1200 0.306090063 0.53625885 Treat+ Ctrl0 Treat+.Ctrl0
## 1390 0.085798695 0.24869646 Treat- Ctrl0 Treat-.Ctrl0
## 1424 0.170729944 0.37933421 Treat- Ctrl0 Treat-.Ctrl0
## 1634 0.005751539 0.04376251 Treat- Ctrl+ Treat-.Ctrl+
## Example lines of results after subsetting to the significant genes, at the water change
## timepoints Gene Genotype lfc pval
## 105920 Day063-Day056 SbiBTX642.01G000900.v1.1 BT642 -1.739083 2.583103e-04
## 105943 Day063-Day056 SbiBTX642.01G004300.v1.1 BT642 3.134662 1.346624e-03
## 105946 Day063-Day056 SbiBTX642.01G005000.v1.1 BT642 2.727266 4.270441e-04
## 105956 Day063-Day056 SbiBTX642.01G006300.v1.1 BT642 -1.089945 5.541343e-03
## 105960 Day063-Day056 SbiBTX642.01G006800.v1.1 BT642 -0.633946 4.071925e-03
## 105965 Day063-Day056 SbiBTX642.01G007300.v1.1 BT642 1.240911 2.006723e-05
## qval Treat.lfc Treat.pval Treat.tpAdj.pval Ctrl.lfc
## 105920 0.0054085774 -0.8964932 6.153515e-03 2.562675e-02 0.84258990
## 105943 0.0164602024 3.1532447 8.330431e-07 2.805461e-05 0.01858258
## 105946 0.0077782254 3.0625806 3.945433e-07 1.619692e-05 0.33531464
## 105956 0.0411867620 -0.8775533 1.689743e-03 9.668783e-03 0.21239213
## 105960 0.0336900523 -0.5561297 3.839048e-04 3.101714e-03 0.07781628
## 105965 0.0009531033 0.6834977 5.873064e-04 4.288491e-03 -0.55741330
## Ctrl.pval Ctrl.tpAdj.pval DirectionTreat DirectionCtrl Direction
## 105920 0.010321643 0.3548356 Treat- Ctrl0 Treat-.Ctrl0
## 105943 0.979908686 0.9992566 Treat+ Ctrl0 Treat+.Ctrl0
## 105946 0.501006923 0.8980632 Treat+ Ctrl0 Treat+.Ctrl0
## 105956 0.432866435 0.8700066 Treat- Ctrl0 Treat-.Ctrl0
## 105960 0.611464001 0.9272240 Treat- Ctrl0 Treat-.Ctrl0
## 105965 0.005011069 0.2801598 Treat+ Ctrl0 Treat+.Ctrl0
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
## Day028-Day021 87
## Day035-Day028 48
## Day042-Day035 1
## Day049-Day042 0
## Day056-Day049 0
## Day063-Day056 2821
## Day070-Day063 20
## Day077-Day070 1
## Day084-Day077 0
## Day091-Day084 0
## Day098-Day091 0
## Day105-Day098 0
## Leaf, Post
##
## BT642
## Day070-Day063 7
## Day077-Day070 0
## Day084-Day077 0
## Day091-Day084 0
## Day098-Day091 0
## Day105-Day098 0
We can repeat this with the root
## root, Pre
##
## BT642
## Day028-Day021 61
## Day035-Day028 4
## Day042-Day035 0
## Day049-Day042 0
## Day056-Day049 0
## Day063-Day056 3887
## Day070-Day063 0
## Day077-Day070 0
## Day084-Day077 0
## Day091-Day084 0
## Day098-Day091 0
## Day105-Day098 1
## root, Post
##
## BT642
## Day070-Day063 565
## Day077-Day070 2
## Day084-Day077 0
## Day091-Day084 2
## Day098-Day091 0
## Day105-Day098 0
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-.Ctrl+ Treat-.Ctrl0 Treat+.Ctrl-
## Day028-Day021 2 20 46 1
## Day035-Day028 2 6 10 4
## Day042-Day035 0 0 0 0
## Day049-Day042 0 0 0 0
## Day056-Day049 0 0 0 0
## Day063-Day056 0 3 1602 2
## Day070-Day063 0 0 20 0
## Day077-Day070 0 0 1 0
## Day084-Day077 0 0 0 0
## Day091-Day084 0 0 0 0
## Day098-Day091 0 0 0 0
## Day105-Day098 0 0 0 0
##
## Treat+.Ctrl+ Treat+.Ctrl0
## Day028-Day021 1 17
## Day035-Day028 1 25
## Day042-Day035 0 1
## Day049-Day042 0 0
## Day056-Day049 0 0
## Day063-Day056 0 1214
## Day070-Day063 0 0
## Day077-Day070 0 0
## Day084-Day077 0 0
## Day091-Day084 0 0
## Day098-Day091 0 0
## Day105-Day098 0 0
## Leaf, Post
## , , = BT642
##
##
## Treat-.Ctrl0 Treat+.Ctrl0
## Day070-Day063 1 6
## Day077-Day070 0 0
## Day084-Day077 0 0
## Day091-Day084 0 0
## Day098-Day091 0 0
## Day105-Day098 0 0
Root:
## root, Pre
## , , = BT642
##
##
## Treat-.Ctrl- Treat-.Ctrl+ Treat-.Ctrl0 Treat+.Ctrl-
## Day028-Day021 1 8 15 5
## Day035-Day028 0 0 0 0
## Day042-Day035 0 0 0 0
## Day049-Day042 0 0 0 0
## Day056-Day049 0 0 0 0
## Day063-Day056 0 645 1790 250
## Day070-Day063 0 0 0 0
## Day077-Day070 0 0 0 0
## Day084-Day077 0 0 0 0
## Day091-Day084 0 0 0 0
## Day098-Day091 0 0 0 0
## Day105-Day098 0 0 0 0
##
## Treat+.Ctrl+ Treat+.Ctrl0
## Day028-Day021 1 31
## Day035-Day028 0 4
## Day042-Day035 0 0
## Day049-Day042 0 0
## Day056-Day049 0 0
## Day063-Day056 0 1202
## Day070-Day063 0 0
## Day077-Day070 0 0
## Day084-Day077 0 0
## Day091-Day084 0 0
## Day098-Day091 0 0
## Day105-Day098 0 1
## root, Post
## , , = BT642
##
##
## Treat-.Ctrl+ Treat-.Ctrl0 Treat+.Ctrl0
## Day070-Day063 0 354 211
## Day077-Day070 1 1 0
## Day084-Day077 0 0 0
## Day091-Day084 0 0 2
## Day098-Day091 0 0 0
## Day105-Day098 0 0 0