Differential expression analysis between experimental groups
Differences in normalized transcript abundance levels were tested using a generalized linear model (glmQFit and glmQLFTest), with log2-transformed transcript abundance as the response variable with a genome-wide false discovery rate (FDR) of 0.05 with the function “Toptags ”. The results of the gene expression differences are presented as centred and scaled heatmaps, plotted with gplots (Warnes et al. 2020). The groups that were compared was: comparison 1) saltwater control (SwC) vs. saltwater ecotype exposed to freshwater (SwFw); comparison 2) freshwater control vs. freshwater ecotype exposed to saltwater (FwSw); comparison 3) controls (FwC- SwC) and comparison 4) transcripts that are significantly different between controls, and similarly expressed within ecotype; all freshwater ecotypes vs. all saltwater ecotypes (FwC_FwSw vs. SwC_SwFw) (Figure 2b ). Comparison 3 identify transcripts that are differentially expressed between the control groups, and to a lesser extent between comparison 1 and comparison 2, but where expression patterns within ecotype and salinity change do not differsignificantly. Comparison 4 identifies genes that are similarly expressed within salinity of origin (the ecotype ) independently of treatment. The transcripts in comparison 4 were extracted from the transcripts identified in comparison 3, by calculating the average expression for each transcript within each group (SwC, SwFw, FwC, FwSw) and extracting the genes that had less than 0.4 CMP differential expression between the respective control and exposed group. Overlapping genes in the four comparisons were identified and extracted with the package Venn-diagrams (Gao 2019).