Phenotypic data
We randomly selected individuals from each habitat type for phenotyping and genome sequencing from the frozen subset of the long-term monitoring samples. Individuals were thawed, weighed on an electronic balance (wet mass, nearest mg) and their total length (TL) measured using a ruler (to the nearest mm). The right pectoral fin was then cut and stored in 96% ethanol for DNA isolation. We measured traits typically under selection in stickleback: body size, defence traits (armour plate number and length of spines) and dietary traits (gill raker morphology and gut length) . Specifically, for each individual we measured the following 10 traits: total length (TL), total gut length (gut length), number of lateral armour plates (plate number), length of the first dorsal spine (DS1), length of the second dorsal spine (DS2), length of the pelvic spine (PS), length of the second gill raker on the first gill arch (GRL2), length of third gill raker on the first gill arch (GRL3), gap width between second and third gill rakers (GRW), and number of long gill rakers on the first gill arch (GRN) (see below). Note that we measured the second and third gill rakers, rather than the first (which is usually used in studies of stickleback trophic phenotype), because in some cases gill arches broke during dissection. After measurement of TL, each individual was dissected to remove the stomach and the gut, and any tapeworm (Schistocephalus solidus) parasites. Gut length (from the sphincter at the end of the oesophagus to the end of the digestive tract) was measured (to the nearest mm) using a ruler.
To aid morphological measurements, fish were stained with alizarine red using standard protocols (Millet et al. 2013). Fish were bleached using a 1:1 ratio of 3% H2O2 and 1% KOH and then stained in a solution of alizarin red and 1% KOH . After staining, digital images were taken of the left side of the fish with a Canon EOS 600D digital camera, with mm paper for scale. From these images, plate number was counted and the length of the spines (DS1, DS2 and PS) measured to the nearest hundredth of a millimetre. After imaging, we dissected the first gill arch and, where necessary, re-stained before mounting it between two glass plates and photographing using a digital camera (Nikon Coolpix 4500) mounted to a stereomicroscope (Leica MZ12) with mm paper for scale. We used the digital images of gill arches to measure GRL2, GRL3 and GRW (in mm) and counted GRN. All measurements were taken from the digital images were done using segmented tool in ImageJ .