1. Introduction {#sec1}
===============

It has long been recognised the role that "good nutrition" plays in human health, with both under-nutrition and obesity resulting in disease ([@bib46]; [@bib48]; [@bib59]). Poor nutrition can also impact the response to parasites, with evidence for both energy and protein deficits reducing the ability to fight infection ([@bib36]; [@bib17]; [@bib11]). Studies have shown that starvation can compromise immune capability across a broad range of host taxa. For example, laboratory mice were found to have fewer T cells in the spleen and thymus during starvation, with numbers recovering once feeding was reinstated ([@bib75]). Furthermore, injection with *Listeria monocytogenes* during starvation reduced the ability of the mice to develop antibodies against this bacterium ([@bib75]). Food restriction, rather than starvation can have similar effects. Food-restricted Yellow-legged gulls, *Larus cachinnans*, were found to have reduced cell-mediated immunity ([@bib3]) and mice on a long-term calorie-restricted diet were found to die more rapidly from sepsis after gut puncture than those fed *ad libitum* ([@bib3]). Comparable responses have been shown in invertebrates; bumble bees died more rapidly during starvation if their immune systems were stimulated by artificial parasites, suggesting that mounting an immune response is energetically costly ([@bib47]). Similarly, starved bumble bees were more likely to die from a gut parasite, *Crithida bombi,* than hosts with adequate nutrition ([@bib7]).

However, nutrition is much more complex than simply a source of energy, being a vital mixture of macro- (carbohydrates, fats and proteins) and micro-nutrients (vitamins and minerals), the amount and balance of which determine an animal\'s fitness ([@bib63]). Several studies have examined how shifting the balance of macronutrients in the diet affects immune responses and the outcome of infection, without restricting the availability of calories ([@bib22]; [@bib39]; [@bib53]; [@bib55], [@bib56]). For example, caterpillars of the armyworms, *Spodoptera littoralis* and *Spodoptera exempta*, show improved immune responses and markedly higher survival after viral infection ([@bib39]; [@bib56]) and bacterial infection ([@bib55]) when their diet is heavily protein-biased. Furthermore, when given the opportunity, infected caterpillars will "self-medicate" with protein, significantly improving their chances of survival ([@bib39]; [@bib55], [@bib56]).

The studies above strongly suggest that it is the source of the energy in the diet that is key to the response to parasites, rather than the availability of energy *per se*. However, neither food restriction, nor the manipulation of macronutrient balance alone can determine the relative importance of either on host-parasite interactions. To address properly the role of nutrient availability on immunity, both the balance of nutrients in the diet and their quantity need to be simultaneously manipulated. The Geometric Framework for Nutrition (GFN) is a state-space model that allows the association of particular nutrient intakes with outcomes of interest ([@bib62]), for example, immunity ([@bib53], [@bib54]). With the GFN, animals are restricted to diets in which both the balance and availability of nutrients are manipulated, forcing intakes over a wide region of nutrient space, encompassing both over- and under-nutrition, and thereby allowing the additive and interactive effects of specific nutrients on traits of interest to be modelled ([@bib62]).

The GFN approach has highlighted that the fundamental life-history trade-off between fecundity and longevity is mediated by nutrients across taxa, with longevity generally peaking at low-protein, high-carbohydrate ratios, whilst fecundity tends to peak at much higher relative protein intakes; as such, no diet can maximize both traits (*Drosophila*: ([@bib40]; [@bib31]); Field crickets: ([@bib44]); Queensland Fruit fly: ([@bib15]); Mice ([@bib64])). Similarly, using the GFN, it was found that different immune responses peak in different regions of nutrient space, thereby indicating a nutrient-mediated trade-off within the immune system, and, as for fecundity and longevity, no single diet could maximize multiple immune responses ([@bib10]). In a recent study, mice were restricted to one of 25 diets varying in their ratio of proteins, fats and carbohydrates and energy density, and their innate immune capacity was measured. It was shown that the balance of T cells indicative of healthy ageing was achieved on a low protein:NPE diet (non-protein energy i.e. carbohydrate plus fat), irrespective of calorie intake ([@bib38]). However, this powerful approach has not yet been taken to assess an animal\'s immune response to a pathogenic challenge.

Insects have a comparatively simple yet effective immune system that has numerous parallels to the innate immune response of vertebrates ([@bib82]; [@bib81]; [@bib73]). It comprises cellular and humoral components that work together to fight invading pathogens. Hemocytes show phagocytic activity against microparasites, much like vertebrate macrophages, and can respond to macroparasites by forming a multi-layered envelope around the invader, in a process called encapsulation, which is subsequently melanised via the action of the phenoloxidase (PO) enzyme ([@bib23]). Phenoloxidase is stored in hemocytes in the form of an inactive precursor, Pro-phenoloxidase (PPO), which is activated upon detection of non-self ([@bib21]). This recognition occurs via the detection of pathogen-associated molecular patterns (PAMPs) such as the peptidoglycan or the lipopolysaccharide components of fungal and bacterial cell walls. Detection stimulates either the *Toll* (fungi and gram-positive bacteria) or IMD pathways (Gram-negative bacteria), via host *pattern recognition receptors* (PRRs) that result in the bespoke production of antimicrobial peptides and the upregulation of constitutive lysozymes, which form the humoral component of the response ([@bib42]; [@bib73]).

The strength of the immune response can be measured using standard functional assays of antimicrobial activity or PPO activity in the hemolymph, and the strength of the encapsulation response or phagocytosis can be measured against synthetic parasites injected into the haemocoel (see ([@bib74]) and references therein). These functional responses have been shown to be indicative of the ability of the animal to fight off parasites (e.g. [@bib39]; [@bib52]; [@bib55]) and so are arguably meaningful measures of immune investment. However, gene expression is also often used as a proxy for investment in specific traits, e.g. immunity ([@bib18]; [@bib30]; [@bib76]), but few of these studies consider how well the expression of the gene of interest predicts the functional response under the conditions in which they are tested.

There has been a great deal of research examining how well gene transcripts relate to protein abundance across individual genes, but with contradictory findings ([@bib43]). This is not surprising as there are numerous steps between gene expression and the production of the protein, all of which can change the relationship between the two. In cell culture, under steady-state conditions, mRNA transcripts correlate well with protein abundance, typically explaining between 40 and 80% of the variation ([@bib12]; [@bib33]; [@bib43]). However, multiple factors can affect this relationship. Upregulation of gene expression in response to a perturbation is expected to change the abundance of proteins concordantly, but there can be a delay in this process, such that there is a time lag between mRNA levels and protein abundance, the length of which may differ between genes ([@bib19]; [@bib33]). Some genes are constitutively transcribed and translation of the protein occurs only when the correct conditions are met, known as "translation on demand" ([@bib27]), meaning that there is no correlation between mRNA and protein levels most of the time. The majority of ecological studies consider gene expression in whole animals, which are hugely more variable than cell cultures, and so we can expect the relationship between gene expression and protein abundance to be further weakened in natural systems. One aspect of variation in whole animals is the availability of resources. Protein production is costly, consuming ∼50% of the ATP in growing yeast cells ([@bib69]), so we can expect the availability of energy and amino acids to affect the speed and efficacy of translation ([@bib43]). This means that the relationship between the expression of a gene and its protein is likely to change with the resource levels of the animal. To our knowledge, there are no studies comparing how the mRNA-protein relationship changes across nutrient space.

Here we address this gap using a model insect, *Spodoptera littoralis*, (Lepidoptera: Noctuidae), a generalist herbivore. We take a GFN approach, restricting caterpillars to diets that vary in their P:C ratio and energy content, thereby covering a large region of nutrient space. We then challenge the immune system by injecting caterpillars with live or dead bacteria, and measure the expression of 9 genes (5 immune, 4 non-immune), and 3 functional immune responses, which are transcribed by two of the immune genes (PPO and lysozyme) in the hemolymph, thus allowing us to associate gene expression and functional immune responses to nutrient intake, and importantly, to assess how well gene expression predicts the immune response specifically associated with those genes under different dietary conditions.

2. Material and methods {#sec2}
=======================

2.1. Host and pathogen cultures {#sec2.1}
-------------------------------

The *Spodoptera littoralis* culture was established from eggs collected near Alexandria in Egypt in 2011. The colony was reared using single pair matings with around 150 pairs established each generation. Following mating of unrelated adult moths; eggs were laid within 2 days with larvae hatching after a further 3 days. *Spodoptera littoralis* spend approximately 2 weeks in the larval stage, about 7 days of which are spent in the 5th and 6th instars. Larvae were reared individually from the 2nd instar on a semi-artificial wheat germ-based diet ([@bib57]) in 25 ml polypots until the final larval instar (6th), at which point they were used in the experiments as described below. Insects were maintained at 27°C under a 12:12 light: dark photo regime.

Bacteria were originally supplied by the laboratory of Givaudan and colleagues (Montpellier University, France; *Xenorhabdus nematophila* F1D3 GFP labelled, see ([@bib60])). Pure *X. nematophila* F1D3 stocks were stored at −20°C in Eppendorf tubes (500 μl of *X. nematophila* F1D3 in nutrient broth with 500 μl of glycerol). Vortexing ensured that all *X. nematophila* F1D3 cells were coated in glycerol. To revive the stocks for use, 100 μl was added to 10 ml nutrient broth, and incubated at 28°C for up to 48 h (generally stocks had grown sufficiently after 24 h). On the day of experimental bacterial challenge, a sub-culture of the stock was carried out, with 1 ml of the original stock added to 10 ml of nutrient broth and placed in a shaker-incubator for approximately 4 h. This ensured that the bacteria were in log phase prior to challenge. Following the sub-culture, a 1 ml sample was checked for purity under the microscope by looking for non-fluorescent cells, which would indicate contamination. The clean sample was then used to produce a serial dilution in nutrient broth from which the total cell count was determined with fluorescence microscopy, using a haemocytometer with improved Neubauer ruling. The remaining culture was diluted with nutrient broth to the appropriate concentration required for the bacterial challenge. The heat-killed treatment group was established by autoclaving the bacteria for 30 min at 121°C.

2.2. Diet manipulation {#sec2.2}
----------------------

The aim of the experiments was to tease apart the importance of relative and absolute nutrient effects on immune gene expression and immune protein activity. Therefore, larvae were fed on one of 20 chemically-defined diets that varied in both the protein to carbohydrate (P:C) ratio and calorie density based on ([@bib61]) ([Table 1](#tbl1){ref-type="table"}). This comprised five P:C ratios (5:1, 2:1, 1:1, 1:2, 1:5) and four calorie densities (326, 612, 756 and 1112 kJ/100 g diet; the remainder of the diet comprising indigestible cellulose (See [Table S1](#appsec1){ref-type="sec"} for information about the specific ingredients for each diet). Thus, the 20 diets could be described with respect to the absolute amount of proteins or carbohydrates, by their sum (calorie density), by their ratio (P:C) or by their interaction (P\*C). In addition, the absolute amounts of food eaten by the larvae on each diet were recorded so the absolute amount of protein or carbohydrate eaten as opposed to amounts offered could also be used. We were therefore able to define 30 alternative models for describing the relationship between the trait of interest (e.g. Toll expression), and host diet ([Table 1](#tbl1){ref-type="table"}). These were then compared using an information theoretic approach by comparing *AIC*~*c*~ values and other model metrics ([@bib8]; [@bib71]).Table 1Nutritional composition of the 20 chemically-defined diets.Table 1DietProteinCarbsFatsCelluloseMicro-nutrientsEnergyRatioP:C(g/100 g diet)(g/100 g diet)(g/100 g diet)(g/100 g diet)(g/100 g diet)(kJ/100 g diet)(%)**1**10.552.51.133.03.011120.171:5**2**7.035.01.154.03.07560.171:5**3**5.628.01.162.43.06120.171:5**4**2.814.01.179.23.03260.171:5**5**21.042.01.133.03.011120.331:2**6**14.028.01.154.03.07560.331:2**7**11.222.41.162.43.06120.331:2**8**5.611.21.179.23.03260.331:2**9**31.531.51.133.03.011120.501:1**10**21.021.01.154.03.07560.501:1**11**16.816.81.162.43.06120.501:1**12**8.48.41.179.23.03260.501:1**13**42.021.01.133.03.011120.672:1**14**28.014.01.154.03.07560.672:1**15**22.411.21.162.43.06120.672:1**16**11.25.61.179.23.03260.672:1**17**52.510.51.133.03.011120.835:1**18**35.07.01.154.03.07560.835:1**19**28.05.61.162.43.06120.835:1**20**14.02.81.179.23.03260.835:1[^1]

2.3. Bacterial challenge {#sec2.3}
------------------------

*Xenorhabdus nematophila* is a highly pathogenic Gram-negative bacterium. In the wild, this species relies on the entomopathogenic nematode *Steinernema carpocapsae*, which vectors *X. nematophila,* to gain access to an insect host, where it rapidly multiplies, generally causing death within 24--48 h ([@bib20]; [@bib26]). However, in the lab we can circumvent the requirement for the nematode by injecting *X. nematophila* directly into the insect haemocoel ([@bib26]).

**Experiment 1:** Within 24 h of moulting to the 6th instar, 400 larvae were divided into 20 groups (n = 20 per group), placed individually into 90 mm diameter Petri dishes and provided with ∼1.5 g of one of the 20 chemically-defined diets ([Table 1](#tbl1){ref-type="table"}). Within each diet, 10 larvae were allocated to the control group and 10 were assigned to the bacteria-challenged group. Following 24 h feeding on the assigned diets (at time, t = 0), 200 larvae were handled then replaced on their diet (control) whilst 200 larvae were injected with 5 μl of a heat killed LD50 dose of *X. nematophila* (averaging 1272 *X. nematophila* cells per ml nutrient broth) using a microinjector (Pump 11 Elite Nanomite) fitted with a Hamilton syringe (gauge = 0.5 mm). The syringe was sterilised in ethanol prior to use and the challenge was applied to the left anterior proleg. Every 24 h up to 72 h (i.e. 48 h post infection), larvae were transferred individually to clean 90 mm Petri dishes containing 1.5--1.8 g of their assigned chemically-defined diet. 96 h after moulting into L6, the larvae had either pupated or were placed on semi-artificial diet until death or pupation. The amount of food eaten each day was determined by weighing the wet mass of the chemically-defined diet provided each day to the caterpillars, as well as weighing uneaten control diets each day (3 control diets per diet). The uneaten diet and control diet were then dried to a constant mass (for approx. 72 h), allowing the consumption per larva to be estimated.

**Experiment 2**: The set up for this experiment was identical to Experiment 1, except that each of the 400 larvae was injected with 5 μl of either a heat-killed (control) or live LD50 dose of *X. nematophila* (averaging 1272 *X. nematophila* cells per ml nutrient broth).

2.4. Hemolymph sampling {#sec2.4}
-----------------------

Following challenge, hemolymph samples were obtained from all caterpillars at 20 h post infection. Hemolymph samples were obtained by piercing the cuticle next to the first proleg near the head with a sterile needle and allowing released hemolymph to bleed directly into an Eppendorf tube. Immediately following hemolymph sampling, 30 μl of fresh hemolymph was added to a sterile ice-cooled Eppendorf containing 350 μl of lysis buffer (RLT + Beta mercaptoethanol -- 100:1) for later RNA extraction and qPCR analysis (Expts 1 and 2). The remainder of the hemolymph extracted was stored in a separate Eppendorf for further immune assays (Expt 2 only). All hemolymph samples were stored at −80 °C prior to processing.

2.5. Gene expression (Expts 1 and 2) {#sec2.5}
------------------------------------

RNA was extracted from hemolymph samples using Qiagen RNeasy mini kit following the manufacturers instructions with a final elution volume of 40 μl. Extracts were quantified using the Nanodrop 2000 and diluted to 0.5 μg/μl for cDNA synthesis. Prior to cDNA synthesis a genomic DNA elimination step was carried out by combining 12 μl RNA (0.5 μg total RNA) plus 2 μl DNA wipeout solution and incubating at 42 °C for 2 min. cDNA synthesis was carried out using Qiagen Quantitect Reverse Transcription kit in a final reaction volume of 20 μl following the manufacturer\'s instructions, cDNA synthesis was carried out for 30 min at 42 °C followed by 3 min incubation at 95 °C and stored at −20 °C. cDNA was diluted 1:5 for use as a qPCR template.

Primers and probes were synthesised by Primer Design and qPCR was performed in a reaction volume of 10 μl with 1x Taqman FAST Universal PCR Master mix (Thermo Fisher), 0.25 μM of each primer, 0.3 μM probe and 2 μl of a 1:5 dilution of cDNA. qPCR was carried on the ABI 7500 FAST, cycling parameters included an initial denaturation at 95 °C for 20 s followed by 40 cycles of denaturation at 95 °C, 3 s and annealing at 60 °C for 30 s. All PCRs were run in duplicate (see [Table 2](#tbl2){ref-type="table"}).Table 2Primer and probe sequences used for the qPCR analysis of immune gene expression.Table 2GenePrimers (5′--3′)Probe (5′--3′)Amplicon sizes (bp)EfficienciesTollFOR: AATGCTCGTGTTATCATGATCAAA\
REV: CGTGATCGTAGCCAGCGTTTVIC-CTGGACCACCACTAACGTCGTCGATTG-TAMRA7693.8%PPOFOR: GCTGTGTTGCCGCAGAATG\
REV: AAATCCGTGGCGGTGTAGTCVIC-CCGCGTATCCCGATCATCATCCC-TAMRA6797.4%LysozymeFOR: TGTGCACAAATGCTGTTGGA\
REV:CGAACTTGTGACGTTTGTAGATCTTCVIC-ACATCACCCTAGCTTCTCAGTGCGCC-TAMRA7696.6%RelishFOR: TCAACATAACAACACGGAGGAA\
REV: ATCAGGTACTAGGCAACTCATATC6FAM -CCCACAAATTACTTGAAGATGAACAGGACCC-TAMRA8295.3%MoricinFOR: GGCGCAGCGATTGGTAAA\
REV:GGTTTGAAGAAGGAATAGACATCATGVIC-TCTCCGGGCGATTAACATAGCCAGC- TAMRA7791.4%EF1FOR: TCAAGAACATGATCACTGGAACCT\
REV: CCAGCGGCGACAATGAG6FAM -CCAGGCCGATTGCGCCGT-TAMRA9494.0%ArylphorinFOR: CGTCAGATGCAGTCTTTAAGATCTTC\
REV: TGCACGAACCAGTCCAGTTCVIC-AATACCACGCCAATGGCTATCCGGTT-TAMRA11296.7%ArmadilloFOR: TGCACCAGCTGTCCAAGAAG\
REV: AAAGCGGCAACCATTTGC6FAM-AAGCTTCTCGCCATGCTATTATGAACTCGC-TAMRA7092.8%TubulinFOR: CGTGGAGCCCTACAACTCTATCC\
REV: GCCTCGTTGTCGACCATGA6FAM-ACCACCCACACCACCCTTGAGCAC-TAMRA81100%

We selected five immune genes, three from the Toll immune pathway: Toll, Prophenoloxidae (PPO), which is the precursor of the phenoloxidase enzyme (PO), responsible for production of melanin during the encapsulation response, and lysozyme, which produces the antimicrobial lysozyme enzyme, active against Gram positive bacteria. We also selected two genes from the IMD immune pathway, Moricin, which produces the AMP Moricin, active against Gram positive and negative bacteria, and Relish, which activates transcription of AMP genes ([@bib42]; [@bib73]). We also selected three non-immune genes, Tubulin, a component of the cytoskeleton responsible for organelle and chromosomal movement. Armadillo (b-catenin), which facilitates protein-protein interactions and EF1, an elongation factor that facilitates protein synthesis. These genes were selected, due to robust amplification, from a pool of potential endogenous controls that were tested in pilot studies. We also selected Arylphorin, which is primarily characterised as a storage protein ([@bib66]), however, it is up-regulated in response to bacterial infection and also in response to non-pathogenic bacteria in the diet of *Trichoplusia ni* caterpillars ([@bib18]) and so we did not have an *a priori* expectation as to its behaviour in this species.

2.6. Lysozyme assays (Expt 2 only) {#sec2.6}
----------------------------------

Bacterial agar plates were used to determine lytic activity. These were made by mixing 1.5% water agar and 1.5% freeze-dried *Micrococcus luteus* (Merck: M3770) in potassium phosphate buffer, in a 2:1 ratio. 10 ml plates of the resulting solution were poured and 2 mm diameter holes punched in each plate. Each hole was filled with 1 ml of ethanol saturated with phenylthiourea (PTU) in order to prevent melanisation of the samples. The ethanol evaporates, leaving the PTU in the hole. Following defrosting and vortexing of the stored hemolymph, each well was the filled with 1 μl of hemolymph, with two technical replicates per sample. The plates were incubated at 30°C for 24 h, and the clear zones around the samples were measured using digital callipers. Lytic activity (mg/ml) was then calculated from a serial dilution of a hen egg white lysozyme (Merck: 62971; Standard series 0.01, 0.05, 0.1, 0.5, 1 and 2 mg per ml in water).

2.7. Phenoloxidase assays (Expt 2 only) {#sec2.7}
---------------------------------------

Following defrosting of the hemolymph samples, 10 μl of hemolymph was added to 450 μl of NaCac buffer (1.6 g NaCac and 0.556 g CaCl~2~ l^−1^ sterile distilled water). The solution was then split into two Eppendorfs (each containing 225 μl), in order to carry out assays for both proPO and PO activity. To one Eppendorf, 25 μl of NaCac buffer was added (PO assay), and to the other, 25 μl of 20 mg per ml chymotrypsin in NaCac buffer was added (proPO activated). The samples were vortexed and incubated at 25 °C for 1 h. 90 μl of each solution was placed in a well of a 96-well microplate with 90 μl of 10 mM dopamine as a substrate. Two technical replicates were carried out per sample. Readings were taken every 15 s for 10 min at 490 nm and 25 °C using a Tecan infinite m200pro plate reader with Magellan software (V7.2). This range accounted for the linear stage of the reaction. The maximum rate of reaction was then used as an approximation of PO and proPO level. While many researchers still use L-dopa as a substrate for PO reactions, for insect POs, dopamine is the preferred substrate over L-dopa, it is the natural substrate for insects, it is more soluble than L-dopa and unlike L-dopa, is not subject to spontaneous darkening ([@bib65]).

3. Statistical analyses {#sec3}
=======================

3.1. Gene expression and food consumption {#sec3.1}
-----------------------------------------

All statistical analyses were conducted using the *R* statistical package version 3.2.2 (R Core Team, 2018). Gene expression data were normalised using NORMA-Gene ([@bib25]), a data driven approach that normalises gene expression relative to other genes in the dataset rather than to specifically identified reference genes. It is particularly suited to data sets with limited numbers of assayed genes. Normalised gene expression data were then standardised using the mean (μ) and standard deviation (σ) of each trait (Z = (X- μ) ⁄ σ) prior to analysis. The two experiments, run at different times, had only one treatment in common, (1 -- handled vs heat-killed bacteria, 2- heat-killed vs live bacteria). For ease of interpretation, we wanted to analyse both experiments in a single model. To test the validity of this approach, we first compared the gene expression data and the data for the total amount of food consumed across both experiments for the heat-killed treatment only. There was no significant difference between any of the measures across experiments, with the exception of the total amount of food eaten, and expression of the Moricin gene. Therefore, all data were analysed in a single model, with the exception of those two response variables, where data from the two experiments were analysed separately.

Data were analysed for each gene separately using linear mixed-effects models in the packages *lme4* ([@bib5]) and *lmerTest* ([@bib37]). For each gene, the plate that the samples were run on was included as a random effect. A comparison was made of 90 candidate models for each gene, which comprised 30 models covering different combinations of dietary attributes ([Table 3](#tbl3){ref-type="table"}), either alone, with bacterial treatments added or with bacterial treatment interacting with the dietary traits. AIC values were corrected for finite sample sizes (AIC~c~) to establish the most parsimonious models including likely nutritional attributes driving the observed data. AIC~c~ values and *Akaike weights* were estimated using the *MuMin* package ([@bib4]). The relative weight of evidence in favour of one model over another (evidence ratio) is determined by dividing the *Akaike weight* of one model by another ([@bib8]). In each case, the residuals from the best model were visually inspected for deviations from normality. Gene expression for Lysozyme, Arylophorin, PPO, EF1 and Tubulin were Tukey transformed prior to reanalysis using the package *rcompanion* ([@bib45]). For visualisation of the effects of the immune challenge treatment and diet on gene expression ([Fig. 2](#fig2){ref-type="fig"}, [Fig. 3](#fig3){ref-type="fig"}, [Fig. 4](#fig4){ref-type="fig"}, [Fig. 5](#fig5){ref-type="fig"}), residuals from the null model, containing just the random plate effect (Model 1, [Table 3](#tbl3){ref-type="table"}), were plotted as thin plate splines using the package *fields* ([@bib50]). Food consumption data were analysed in the same way as the gene expression data, except only the first 20 models were used to explain consumption ([Table 3](#tbl3){ref-type="table"}).Table 3Terms included in each of the basic models describing different attributes of the diet or the amount of protein or carbohydrate consumed.Table 3ModelTerms included in modelPCP^2^C^2^CoRCo^2^R^2^PeCePe^2^Ce^2^12X3XX4X5XX6XX7XXX8XXX9XXXX10X\*X11X\*XXX12X13XX14X15XX16XX17XXX18XXX19X\*X20X\*XXX21X22XX23X24XX25XX26XXX27XXX28XXXX29X\*X30X\*XXX[^2]Fig. 1The total amount of food eaten by caterpillars that were either (a) handled or (b) injected with dead bacteria (Experiment 1) or (d) injected with dead bacteria versus (e) live bacteria (Experiment 2). Blue colours indicate low consumption and red colours high consumption. Colours are standardised within each experiment and are not comparable across experiments. Numbers on the contour lines indicate z values for consumption. Intake arrays indicating total consumption across the diets are shown separately for (c) experiment 1 and (f) experiment 2. (For interpretation of the references to colour in this figure legend, the reader is referred to the Web version of this article.)Fig. 1Fig. 2Mean gene expression (+/− SE) for each of the immune genes and non-immune genes in response to immune challenge treatment, relative to the 'handled' controls. Genes are grouped by immune pathway Toll (blue zone: Toll, PPO, Lysozyme and Moricin), IMD (pink zone: Moricin and Relish) or classified as non-immune genes (grey zone; Arylophorin, EF1, Armadillo and Tubulin). The black dashed line represents gene expression in the handled group. Residuals from the model accounting for the random effects of 'plate' are plotted against treatment. All models were re-run on untransformed data for ease of visualisation. (For interpretation of the references to colour in this figure legend, the reader is referred to the Web version of this article.)Fig. 2Fig. 3Variation in Moricin expression across diets in hemolymph of caterpillars subject to different immune challenge treatments, (a) handled only, (b) injected with dead bacteria (Expt 1), (c) injected with dead bacteria (Expt 2) and (d) injected with live bacteria. Blue colours indicate low gene expression and red colours high gene expression. Colours are standardised within each experiment and are not comparable across experiments. (For interpretation of the references to colour in this figure legend, the reader is referred to the Web version of this article.)Fig. 3Fig. 4Variation in immune gene expression across diets in hemolymph of caterpillars subject to different immune challenge treatments, (a--c) Toll, (d--f) PPO, (g--i) Lysozyme and (j--l) Relish. All figures in the first column are for the handled treatment, column 2 includes those injected with dead bacteria and column 3, those injected with live bacteria. Blue colours indicate low gene expression and red colours high gene expression. (For interpretation of the references to colour in this figure legend, the reader is referred to the Web version of this article.)Fig. 4Fig. 5Variation in non-immune gene expression across diets in hemolymph of caterpillars subject to different immune challenge treatments, (a--c) Arylophorin, (d--f) EF1, (g--i) Armadillo and (j--l) Tubulin. All figures in the first column are for the handled treatment, column 2 includes those injected with dead bacteria and column 3, those injected with live bacteria. Blue colours indicate low gene expression and red colours high gene expression. (For interpretation of the references to colour in this figure legend, the reader is referred to the Web version of this article.)Fig. 5

3.2. Physiological immune responses {#sec3.2}
-----------------------------------

The same approach was taken for the physiological immune measurements, lysozyme, PPO and PO activity, except for these variables, standard linear fixed effects models were run as data were collected in a single experiment. The same set of 90 models as described above were fitted, with the addition of 180 extra models that included the additive and interactive effects of the expression of the relevant gene, after correction for the plate to plate variation (residuals from the null model containing the random effect of plate only) -- the lysozyme gene for lysozyme activity and the PPO gene for PPO and PO activity.

3.3. Survival {#sec3.3}
-------------

Time to death was analysed for experiment 2, where larvae were injected with dead or live bacteria only. Data were analysed using Cox\'s proportional hazard models in the package *survival* ([@bib67]). The same sets of models as described above were fitted ([Table 3](#tbl3){ref-type="table"}), with the addition of 180 extra models that included the additive and interactive effects of Moricin gene expression, after correction for the plate to plate variation (residuals from the null model containing the random effect of plate only). For visualisation of the effects of the immune challenge treatment on survival (dead vs live bacteria), predicted curves for low and high levels of Moricin gene expression were generated using the package *Survminer* ([@bib34]) using ggplot2 ([@bib72]). The effects of diet on time to death were plotted as thin plate splines using the package *fields* ([@bib50]).

4. Results {#sec4}
==========

4.1. How does consumption vary across diets and bacterial challenge treatments? {#sec4.1}
-------------------------------------------------------------------------------

The total amount of food consumed varied across the diets. For experiment 1, comparing handled caterpillars versus those injected with heat-killed bacteria, the best model predicting consumption was model   20 (Co\*R + Co^2^+R^2^), but this was indistinguishable from the same model that included the additive effects of treatment (Treatment +    Co\*R + Co^2^+R^2^, delta = 1.34).

For experiment 2, comparing dead and live bacterial injections, the best model predicting consumption was model 20 (Co\*R + Co^2^+R^2^), but as for the handled versus dead treatments in experiment 1, this model was indistinguishable from the same model that included the additive effects of treatment (Treatment + Co\*R + Co^2^+R^2^, delta = 0.51).

For all treatment groups, it can be seen that consumption tended to increase as the calorie density of the diet decreased ([Fig. 1](#fig1){ref-type="fig"}a,b,d,e), suggesting that food dilution constrained caterpillars from being able to take in sufficient nutrients, as expected, and that on the more calorie-dense diets caterpillars over-consumed nutrients. However, this increase in total consumption was more extreme on the high-protein than on the low-protein diets, suggesting that caterpillars were willing to overeat protein to gain limiting carbohydrates.

Overall consumption tended to decrease with treatment - dead-bacteria treated caterpillars ate less than handled, and live-bacteria treated caterpillars ate less than dead-bacteria treated ([Fig. 1](#fig1){ref-type="fig"}a vs b and d vs e). However, inspection of the intake arrays ([Fig. 1](#fig1){ref-type="fig"}c,e), suggests that consumption was most reduced in both dead and live bacteria treatments on the highest protein diets.

4.2. How does immune gene expression vary across diets and bacterial challenge treatments? {#sec4.2}
------------------------------------------------------------------------------------------

For the immune genes (Toll, PPO, Lysozyme, Moricin and Relish), injection with dead bacteria resulted in up-regulation of gene expression relative to handled caterpillars ([Fig. 2](#fig2){ref-type="fig"}). In contrast, injection with live bacteria either did not up-regulate gene expression relative to controls (Toll, PPO and Lysozyme), or did not up-regulate it as strongly (Moricin and Relish) ([Fig. 2](#fig2){ref-type="fig"}). For the non-immune genes (Arylophorin, EF1, Armadillo and Tubulin), the variation in expression levels was lower; for Arylophorin, EF1 and Armadillo, live bacteria triggered the down-regulation of gene expression relative to handled caterpillars, whilst there was no effect for Tubulin ([Fig. 2](#fig2){ref-type="fig"}). For Arylophorin, Armadillo and Tubulin, injection with dead bacteria up-regulated gene expression relative to handled caterpillars but there was no effect for EF1 ([Fig. 2](#fig2){ref-type="fig"}). The best supported model for every gene tested was model 30, with the bacterial treatment interacting with the amount of protein and carbohydrate eaten (Treatment\*(Pe\*Ce + Pe^2^+Ce^2^)). However, although the fit of these models was generally good (r^2^ \> 0.26--0.86), with the exception of Moricin, the amount of variation explained by the fixed part of the model was very low (r^2^ \< 0.12; [Table 4](#tbl4){ref-type="table"}; [Fig. 3](#fig3){ref-type="fig"}, [Fig. 4](#fig4){ref-type="fig"}, [Fig. 5](#fig5){ref-type="fig"}). This means that the majority of the variation in gene expression was caused by variation across plates. For Moricin, when comparing the handled and dead treatments, 74% of the variation explained by the model was explained by the fixed terms due to the massive up-regulation of Moricin in the bacteria-injected larvae relative to handled controls ([Fig. 2](#fig2){ref-type="fig"}, [Fig. 3](#fig3){ref-type="fig"}a,b). The difference between the dead and live treatment groups was much smaller and comparable to the other immune genes ([Table 4](#tbl4){ref-type="table"}, [Fig. 3](#fig3){ref-type="fig"}c and d).Table 4The best model selected by AICc to explain variation in gene expression across the diet and bacterial treatments.Table 4GeneBest ModelR^2^ fixedR^2^ bothTollTreat\*300.0590.717PPOTreat\*300.0350.715LysozymeTreat\*300.1040.736RelishTreat\*300.1200.378Moricin (1)Treat\*300.7410.741Moricin (2)Treat\*300.0970.264ArylphorinTreat\*300.0890.275EF1Treat\*300.0230.862ArmadilloTreat\*300.0340.696TubulinTreat\*300.0400.855

Variation in the expression of all of the genes was explained by main and interactive effects of the amount of protein and carbohydrate eaten, and in interaction with the bacterial treatment, suggesting that the response to diet for each gene differed across treatments. A visualisation of these response surfaces ([Fig. 3](#fig3){ref-type="fig"}, [Fig. 4](#fig4){ref-type="fig"}, [Fig. 5](#fig5){ref-type="fig"}) shows that, for the immune genes, whilst there is general up-regulation between handled and dead bacterial challenges, the response surfaces are fairly flat, i.e. diet does not explain much variation in gene expression. However, for the live challenge, expression tends to peak at moderate protein but high carbohydrate intake, which corresponds to the highest intakes on the 33% protein diet for Toll, PPO, Lysozyme and Relish, and on the 17% protein diet for Moricin ([Fig. 3](#fig3){ref-type="fig"}, [Fig. 4](#fig4){ref-type="fig"}). In contrast, the non-immune genes (Arylphorin, EF1, Armadillo and Tubulin), show a consistently weak response to the dietary manipulation, with much flatter surfaces on average than those shown by the immune genes (compare [Fig. 4](#fig4){ref-type="fig"} with [Fig. 5](#fig5){ref-type="fig"}).

4.3. Does immune gene expression predict physiological immune responses? {#sec4.3}
------------------------------------------------------------------------

For the Lysozyme and PPO genes, we simultaneously measured functional lytic and PPO (and PO) activity in the hemolymph, allowing us to determine how well gene expression predicts the functional immune response. We had lytic and PO data only for Experiment 2, where larvae were challenged with live or dead bacteria.

For PPO activity, AICc could not discriminate between several of the diet models, with seven being equally well supported (delta \<2; [Table 5](#tbl5){ref-type="table"}). Of these models, the top six contained protein and protein squared with additive or interactive effects of bacterial treatment or gene expression ([Table 5](#tbl5){ref-type="table"}). For the models that included treatment, the estimates show that PPO activity increased with live bacterial infection. For PO activity, AICc could not discriminate between 11 different models (delta \<2; [Table 6](#tbl6){ref-type="table"}). However, the top three models were the same as for PPO, with protein plus protein squared with additive or interactive effects of PPO gene expression. Only two of the models contained treatment effects and both in interaction with diet components. For lytic activity in the hemolymph, three models were equally well supported, all of which contained Lysozyme gene expression interacting with dietary components, which were either protein and protein squared, as for PO and PPO, or the P:C ratio ([Table 7](#tbl7){ref-type="table"}); none of the models contained treatment, suggesting that lysozyme activity is up-regulated in response to the presence of bacteria and not whether they are alive or dead. As for gene expression, the overall explanatory power of the models was quite low, (r^2^ \< 0.12; [Table 5](#tbl5){ref-type="table"}, [Table 6](#tbl6){ref-type="table"}, [Table 7](#tbl7){ref-type="table"}).Table 5The best models selected by AICc to explain variation in PPO activity in the hemolymph. GE represents gene expression for the PPO gene. Treat represents the immune challenge treatment.Table 5ModeldfLog LikelihoodAICcdeltaweightR^2^34−432.120872.40.000.0780.093GE+35−431.259872.70.340.0660.098GE\*37−429.321873.00.640.0570.109Treat+35−431.737873.71.300.0410.095Treat + GE\*38−428.617873.71.340.0400.113Treat + GE+36−430.716873.71.340.0400.10175−431.938874.11.700.0330.094Table 6The best models selected by AICc to explain variation in PO activity in the hemolymph. GE represents gene expression for the PPO gene. Treat represents the immune challenge treatment.Table 6ModeldfLog LikelihoodAICcdeltaweightR^2^GE\*37−425.954866.30.000.0620.092GE+35−428.058866.30.040.0610.08034−429.363866.90.580.0470.072GE+165−428.350866.90.620.0460.078GE+97−426.378867.10.850.0410.090164−429.513867.20.880.0400.071GE + Treat\*1710−423.239867.20.930.0350.108Treat\*179−424.471867.51.260.0330.100GE+176−427.775867.81.550.0290.081GE+108−425.777868.01.750.0260.093GE+196−427.887868.01.770.0260.081Table 7The best models selected by AICc to explain variation in lytic activity in the hemolymph. GE represents gene expression for the lysozyme gene.Table 7ModeldfLog LikelihoodAICcdeltaweightR^2^GE\*157647.521−1280.70.000.2080.072GE\*189649.465−1280.30.340.1760.080GE\*35644.526−1278.91.820.0840.051

For ease of comparison, all 3 physiological immune traits were plotted against the protein content of the diet, as this model was common to all three traits, and the expression of the relevant gene, which featured in the majority of the selected models ([Table 5](#tbl5){ref-type="table"}, [Table 6](#tbl6){ref-type="table"}, [Table 7](#tbl7){ref-type="table"}). The effect of treatment was excluded as it did not feature in the majority of the models. For each trait, activity in the hemolymph tended to increase with gene expression, as we might expect, but this was strongly moderated by the protein content of the diet ([Fig. 6](#fig6){ref-type="fig"}). For PO and PPO activity, on low protein diets enzyme activity was low and there was little correspondence between gene expression and the physiological response, but as the protein content of the diet increased, this relationship became more linear ([Fig. 6](#fig6){ref-type="fig"}a and b). For lytic activity the pattern was different in that enzyme activity increased strongly with the protein and less strongly with lysozyme gene expression up to about 45% protein, thereafter there was consistently high lytic activity across all levels of gene expression ([Fig. 6](#fig6){ref-type="fig"}c).Fig. 6Physiological immune responses vary with the protein content of the diet and the expression of the relevant gene. (a) PPO and (b) PO activity in the hemolymph in response to PPO gene expression and (c) lysozyme activity in the hemolymph in response to lysozyme gene expression. Blue colours indicate low activity and red colours high activity. (For interpretation of the references to colour in this figure legend, the reader is referred to the Web version of this article.)Fig. 6

4.4. Does immune gene expression predict survival? {#sec4.4}
--------------------------------------------------

Survival was reduced in the live bacterial treatment group relative to those injected with dead bacteria (Hazard ratios 1.25--1.31 for models without treatment interactions, [Table 8](#tbl8){ref-type="table"}), however, this effect was moderated by Moricin expression ([Fig. 7](#fig7){ref-type="fig"} a,b). In the dead-bacteria treatment group, Moricin did not explain time to death, but in the live-bacteria treatment group, larvae with high levels of Moricin expression had an increased risk of death relative to those with low expression ([Fig. 7](#fig7){ref-type="fig"} a,b; Hazard ratios 1.20--1.24 for models without GE interactions, [Table 8](#tbl8){ref-type="table"}). Of the top 5 models, 4 included the additive and interactive effects of protein and carbohydrate eaten as well as their squared terms ([Table 8](#tbl8){ref-type="table"}). To visualise the effects of diet on survival we plotted thin-plate splines for time to death against the amount of protein and carbohydrate consumed. The patterns differed between dead and live bacterial treatments. Time to death was overall shorter in the live treatment (note the shift of colour towards orange and blue). However, whilst time to death was affected by both protein and carbohydrate consumption in the dead treatment, with peak survival on high protein/low carbohydrate, in the live treatment, time to death appeared to be solely explained by protein consumption (note the near-vertical contours). Low-protein diets resulted in the most rapid deaths and high-protein diets extended the time to death.Table 8The best models selected by AICc to explain variation in survival after bacterial (dead or live) injection. GE represents gene expression for the Moricin gene.Table 8ModeldfLog LikelihoodAICcdeltaweightR^2^Treat + GE\*3012−1662.9173350.80.000.1390.127Treat\*GE\*3023−1650.8233351.10.300.1200.186Treat + GE+307−1668.7153351.80.990.0850.098Treat + GE+207−1668.8643352.11.290.0730.097GE\*3011−1664.7963352.41.610.0620.118Fig. 7Survival for larvae injected with either dead (a,c) or live (b,d) *X. nematophila* bacteria. Predicted survival curves (a,b) are plotted for model Treat\*GE\*30. Protein eaten and carbohydrate eaten were set at mean values for each coefficient and Moricin gene expression was set as either low (lower quartile) or high (upper quartile). To visualise the effects of diet on survival, time to death in hours post injection (c,d) is plotted as thin plate splines against the amount of protein and carbohydrate consumed. Blue colours indicate a short time to death and red colours a slow time to death. (For interpretation of the references to colour in this figure legend, the reader is referred to the Web version of this article.)Fig. 7

5. Discussion {#sec5}
=============

Previous work has shown that immune responses can be strongly affected by the amount and/or balance of nutrients in the diet e.g. ([@bib16]; [@bib29]; [@bib35]; [@bib38]; [@bib39]; [@bib49]; [@bib55]; [@bib58]; [@bib68]; [@bib70]). However, most of these studies covered only a relatively small region of nutrient space ([@bib16]; [@bib29]; [@bib39]; [@bib49]; [@bib55]; [@bib58]; [@bib70]) and/or only tested innate responses (e.g.([@bib16]; [@bib29]; [@bib38]; [@bib39]; [@bib49]; [@bib55]; [@bib70]) or the response to an artificial pathogen or immune stimulant ([@bib10]). Here we addressed this gap by looking at both gene expression, functional immune responses and survival after both dead and live pathogen challenges over a broad region of nutrient space. Our major findings are that whilst functional immune responses (PPO, PO and lytic activity in the hemolymph) change as expected in response to the dietary manipulation, showing a clear elevation as the protein content of the diet increases, gene expression is much less predictable ([Fig. 3](#fig3){ref-type="fig"}, [Fig. 4](#fig4){ref-type="fig"}). Despite this, expression of the PPO and Lysozyme genes did predict PPO/PO and Lysozyme activity in the hemolymph, but this relationship was strongly dependent on the amount of protein in the diet ([Fig. 6](#fig6){ref-type="fig"}), suggesting that using immune gene expression as an indicator of the efficacy of the immune response may be reliable only under specific dietary conditions. Furthermore, expression of the most responsive gene to infection (Moricin) strongly modulated survival, with high levels of expression resulting in reduced survival after bacterial infection, suggesting that expression is a marker of bacterial load or 'sickness' as opposed to an indication of a robust immune response.

Our dietary manipulation was successful in inducing caterpillars to consume over a large region of nutrient space, allowing us to independently assess the effects of macronutrient composition and the calorie content of the diet on immunity. There was evidence for compensatory feeding; caterpillars did not consume the same amount of every diet. As expected, caterpillars ate more as the calorie density of the food decreased ([Fig. 1](#fig1){ref-type="fig"}), but this varied across diets, such that consumption was highest on the high protein diets, suggesting that caterpillars were willing to over-eat protein to gain limiting carbohydrates. However, as has been found in previous studies ([@bib1]; [@bib2]; [@bib13]; [@bib41]; [@bib56]), we found some evidence for illness-induced anorexia. Caterpillars injected with live *X. nematophila* showed suppressed food consumption across all diets ([Fig. 1](#fig1){ref-type="fig"}e -- note the shift of colours towards oranges and blues). Interestingly, injection with dead *X. nematophila* did not induce this response, which suggests that it is not the triggering of an immune response that causes this change in consumption, but the presence of an actively replicating pathogen..

In insects, two major pathways are triggered in response to microbial infection; typically, genes in the Toll pathway respond to infection by fungi and Gram-positive bacteria, whilst genes in the IMD pathway respond to Gram-negative bacteria ([@bib6]). Moricin and Lysozyme are triggered by Toll in Lepidoptera (e.g. ([@bib78]), but Moricin has also been shown to respond to Gram-negative bacteria and so may also be triggered by IMD ([@bib24]). Of the 5 immune genes we tested, only the IMD genes, Moricin and Relish, were significantly up-regulated in response to infection with both dead and live bacteria. For the Toll genes (Toll, PPO and Lysozyme), gene expression was up-regulated by dead bacteria but not by live bacteria ([Fig. 2](#fig2){ref-type="fig"}). However, even for Moricin and Relish, up-regulation was much stronger in response to dead than live bacteria. This may reflect a general down-regulation of gene expression during an active infection, as the non-immune genes typically show reduced gene expression in response to the live infection compared to the controls. This may be driven by illness-induced anorexia, with reduced consumption resulting in lower metabolic activity and consequently lower gene expression. However, there is evidence that *X. nematophila* can inhibit Cecropin, Attacin and Lysozyme gene expression ([@bib32]; [@bib51]). It may be that, rather than specifically inhibiting AMP gene expression, *X. nematophila* inhibits the expression of all genes.

As Moricin was most strongly up-regulated in response to infection, we tested how its expression correlated with time to death in challenged caterpillars (dead vs live injection, Expt 2 only). Whilst Moricin expression had negligible effects on survival in the dead bacterial treatment, high levels of expression were indicative of an *increased* risk of death after live infection. Thus, high expression levels were not a good indicator of immune capacity, but rather signalled heavy bacterial loads or low tolerance. Distinguishing between these hypotheses would require data on bacterial loads at different time points after infection. Survival was also strongly affected by diet, with the longest survival times occurring on the highest protein diets after live-bacteria infection. High-protein diets have been implicated in increased survival after viral infection in this species ([@bib39]) and after either bacterial or viral infection in the congener, *Spodoptera exempta* ([@bib55], [@bib56]). However, none of these diets are associated with the highest gene expression for any immune gene, suggesting that high-protein diets may reduce the burden of infection via mechanisms other than improving the immune response.

*X. nematophila* is a Gram-negative bacterium, and is clearly triggering Moricin and Relish expression, but as Toll is only marginally up-regulated in response, it is probably the IMD pathway that is controlling this response. Another possible explanation for why live bacteria appear to trigger a down-regulation of gene expression is that our sampling protocol (20 h post-challenge) did not allow us to catch peak expression levels (note that bacterial loads tend to peak in *S. littoralis* at around 24 h). Expression of lysozyme and PPO in the Glanville fritillary butterfly was not up-regulated 24 h after injection with *M. luteus* cells ([@bib76]), whilst in the silkworm, up-regulation of lysozyme in response to fungal infection occurred in two peaks, from 9 to 18 h, and then between 30 and 48 h ([@bib28]). This may be a fungal-specific response, or it might mean that we would have seen higher gene expression had we assayed over an extended time period. It is also possible that the timing of gene expression peaks earlier after live, rather than dead bacterial injection, further studies would be required to elucidate the time course of gene expression for the different genes to be certain of this. However, as non-immune genes also appear to follow the same pattern, reduced expression in response to live vs dead bacteria, the hypothesis that infection results in down-regulation of gene expression in general is a reasonable assumption.

Arylphorin is primarily characterised as a storage protein ([@bib66]), however, it is up-regulated in response to bacterial infection and also in response to non-pathogenic bacteria in the diet of *Trichoplusia ni* caterpillars ([@bib18]). It has been shown to bind to fungal conidia in *Galleria mellonella* hemolymph, potentially working in coordination with antimicrobial peptides ([@bib14]). The lack of up-regulation here may be due to the use of a Gram-negative bacterial challenge; the up-regulation in *T. ni* was in response to a mixture of *E. coli* (G-ve) and *Micrococcus luteus* (G + ve), so it is not clear if both or just one of the bacteria caused the response. Another possibility is that Arylphorin levels are already expressed at maximal levels and cannot be further up-regulated. In *T. ni* caterpillars, Arylphorin is the most abundant protein in the hemolymph during the final instar ([@bib80]). Its levels are known to increase throughout the final instar in *Spodoptera litura* ([@bib77]), and the point at which gene expression was measured here was 48--72 h into the final instar, which is shortly before pupation. The pattern of gene regulation for Arylphorin looks more like that shown by the non-immune genes, with little or no up-regulation in response to dead bacteria and down-regulation in response to live bacteria. Further studies would be required to assess the role of Arylphorin as a putative immune gene in this species.

For two of the immune genes, PPO and Lysozyme, we were able to simultaneously measure the activity of the relevant protein in the hemolymph as a measure of the functional immune response. Thus, we were able to assess how well gene expression predicts functional immune activity and whether this relationship changes with the diet. Here, we found that for each functional immune response, PPO activity, PO activity and lysozyme activity, expression of the relevant gene does predict the response, but only at certain intakes of protein ([Fig. 6](#fig6){ref-type="fig"}). For example, PPO and PO activity increase linearly with the expression of the PPO gene, but only above ∼30% dietary protein ([Fig. 6](#fig6){ref-type="fig"}). This suggests that the availability of dietary protein limits the translation of PPO mRNA into PPO protein, and the activation of PPO into PO. In contrast, the expression of the gene is not limited by protein availability, and so gene expression can be high when dietary protein is low, but it is ineffective as it does not result in a comparable functional immune response. The lytic response is also affected by dietary protein, however, in this case, the relationship between gene expression and lytic activity is consistently weak and above 45% protein maximal lytic activity is achieved at low gene expression, and increased expression does not improve the response. As for PPO, this suggests that protein limits the translation of lysozyme up to about 45% protein.

These results are not surprising when you consider the costs associated with the production of protein. It is estimated that only 10% of the energetic costs of protein production are spent on transcription; translation is much more energetically expensive and relies on the availability of amino acids to build the relevant protein ([@bib69]). It is likely, therefore, that whilst transcription of immune genes might still be up-regulated in response to infection under low protein conditions, the translation of the protein might be reduced, impairing the correlation between mRNA and protein abundance. It is also possible that gene expression would be a better predictor of the functional response at different time points, if there is a lag between gene expression and protein translation. Again, this would require further investigation. However, given the much stronger relationship between the physiological immune responses and protein availability, it still seems likely that the relationship between the two will differ across diets. Our results suggest that caution should be used when interpreting gene expression as a measure of "investment" into a particular trait, or as a measure of the strength of a particular immune response. It is surprisingly common in ecological studies for gene expression to be used in this way without any attempt to correlate the expression of a gene with the production of the functional protein ([@bib79]). If dietary protein levels are limiting, then gene expression may be a poor indicator of the immune capacity of an animal. Here we have tested this just with immune genes for which we have good functional assays of the active protein, but it seems likely that this would also be true of other classes of genes, for which gene expression is routinely used as an indicator of an organism\'s investment.

In summary, as expected, immune challenge with a live Gram-negative bacterium up-regulated immune genes in the IMD pathway, though all immune genes were up-regulated to a certain extent by the challenge with dead bacteria. While functional immune responses (PO, PPO and Lysozyme) typically improved with the protein content of the diet, gene expression varied non-linearly with diet composition. However, the expression of PPO and Lysozyme genes predicted PPO/PO and Lysozyme activity, but only when the availability of dietary protein was not limiting, suggesting that using gene expression as an indicator of investment in a trait is unlikely to be reliable, unless its relationship with diet is known.

Author contributions {#appsec3}
====================

KW, JAS, SCC, FP and SJS conceived the idea, RH, CER, JR, JAS & YT carried out the experiments, SCC analysed the data and wrote the first draft of the paper, all authors commented on and approved the final manuscript.

Appendix A. Supplementary data {#appsec1}
==============================

The following are the supplementary data related to this article:Multimedia component 1Multimedia component 1Multimedia component 2Multimedia component 2

This study was funded by a standard research grant awarded to KW, JAS and SJS by the UK\'s *Biotechnology and Biological Sciences Research Council* (BB/I02249X/1). SCC was supported by a *Natural Environment Research Council* Fellowship (NE/H014225/2). We are grateful to Alain Givaudan and colleagues (Montpellier University, France) for gifting the *Xenorhabdus nematophila* F1D3 bacteria, and to Esmat Hegazi for his support with *Spodoptera littoralis*. We thank Phill Nott for technical assistance. We thank the editor and two anonymous referees whose comments greatly improved the manuscript.

Supplementary data related to this article can be found at [https://doi.org/10.1016/j.ibmb.2019.04.009](10.1016/j.ibmb.2019.04.009){#intref0010}.

[^1]: See [Table S1](#appsec1){ref-type="sec"} for information about the specific ingredients for each diet.

[^2]: The table shows the terms included in each of the 30 basic models covering the different dietary attributes. These models were also run including treatment as an additive or interactive effect, giving 90 models in total. **P** (protein) = grams of protein offered, **C** (carbohydrate) = grams of carbohydrate offered, **Co** (concentration) = percentage of the diet that comprises digestible nutrients (17%, 34%, 42%, 63%), **R** (ratio) = percentage of protein in the digestible component of the diet (17%, 50% or 83%); **Pe** (protein eaten) = grams of protein eaten, **Ce** (carbohydrate eaten) = grams of carbohydrate eaten. For Pe and Ce this was calculated over the first 48 h. Asterisks indicate interactions between terms (e.g. Models 10 and 11 include the interaction between protein and carbohydrate offered). Each of variables was also included as a squared term (e.g. **P**^**2**^). These 30 models were modified by including additive or interactive effects of treatment (base 90 models for all analyses). For the physiological traits and survival, the base 90 models were modified with the additive or interactive effects of expression of the relevant genes (180 models).
