a (Fig. 1*A*) | Normally distributed | Student’s *t* test | 0.0005 |

b (Fig. 1*B*) | Normally distributed | One-way ANOVA | <0.0001 |

c (Fig. 1*E*) | Normally distributed | One-way ANOVA | 0.0007 |

d (Fig. 1*F*) | Normally distributed | Two-way ANOVA | Bacterial strain <0.0001 |

| | | Worm strain 0.8379 |

e (Fig. 1*G*) | Normally distributed | Student’s *t* test | 0.2824 |

f (Fig. 1*H*) | Normally distributed | One-way ANOVA | 0.0003 |

g (Fig. 1*I*) | Normally distributed | Two-way ANOVA | Strain 0.8493 |

| | | Time |

h (Fig. 2*A*) | Normally distributed | One-way ANOVA | <0.0001 |

i (Fig. 2*B*) | Normally distributed | One-way ANOVA | <0.0001 |

j (Fig. 2*C*) | Normally distributed | One-way ANOVA | <0.0001 |

k (Fig. 3*A*) | Normally distributed | One-way ANOVA | <0.0001 |

l (Fig. 3*B*) | Normally distributed | One-way ANOVA | <0.0001 |

m (Fig. 4*A*) | Normally distributed | One-way ANOVA | 0.0034 |

n (Fig. 4*B*)o (Fig. 4*C*)p (Fig. 4*D*) | Normally distributedNormally distributedNormally distributed | One-way ANOVAOne-way ANOVAOne-way ANOVA | <0.00010.0074<0.0001 |

q (Fig. 5*A*) | Normally distributed | Two-way ANOVA | Worm strain 0.0217 |

r (Fig. 5*B*)s (Fig. 5*C*) | Normally distributedNormally distributed | Two-way ANOVATwo-way ANOVA | Training cond. 0.0013Worm strain 0.0986Training cond. 0.6410Worm strain 0.1643Training cond. <0.0001 |