Main

In Heliconius, there is a major effect locus, Yb, that controls a diversity of colour pattern elements across the genus. It is the only locus in Heliconius that regulates all scale types and colours, including the diversity of white and yellow pattern elements in the two co-mimics H. melpomene and H. erato, and whole-wing variation in black, yellow, white, and orange/red elements in H. numata5,6,7. In addition, genetic variation underlying the Bigeye wing pattern mutation in Bicyclus anynana, melanism in the peppered moth, Biston betularia, and melanism and patterning differences in the silkmoth, Bombyx mori, have all been localized to homologous genomic regions8,9,10 (Fig. 1). Therefore, this genomic region appears to contain one or more genes that act as major regulators of wing pigmentation and patterning across the Lepidoptera.

Figure 1: A homologous genomic region controls a diversity of phenotypes across the Lepidoptera.
figure 1

Left, phylogenetic relationships29. Right, chromosome maps with colour pattern intervals in grey; coloured bars represent markers used to assign homology5,8,9,10 and the first and last genes from Fig. 2 are shown in red. In H. erato the HeCr locus controls the yellow hindwing bar phenotype (grey boxed races). In H. melpomene it controls both the yellow hindwing bar (HmYb, pink box) and the yellow forewing band (HmN, blue box). In H. numata it modulates black, yellow and orange elements on both wings (HnP), producing phenotypes that mimic butterflies in the genus Melinaea. Morphs/races of Heliconius species included in this study are shown with names. All images are by the authors or are in the public domain.

PowerPoint slide

Previous mapping of this locus in H. erato, H. melpomene and H. numata identified a genomic interval of about 1 Mb (refs 11, 12, 13) (Extended Data Table 1), which also overlaps with the 1.4-Mb region containing the carbonaria locus in B. betularia9 and a 100-bp non-coding region containing the Ws mutation in B. mori10 (Fig. 1). We used a population genomics approach to identify the single nucleotide polymorphisms (SNPs) that were most strongly associated with phenotypic variation within the approximately 1-Mb Heliconius interval. The diversity of wing patterning in Heliconius arises from divergence at wing pattern loci7, while convergent patterns generally involve the same loci and sometimes even the same alleles14,15,16. We used this pattern of divergence and sharing to identify SNPs associated with colour pattern elements across many individuals from a wide diversity of colour pattern phenotypes (Fig. 2).

Figure 2: Association analyses across the genomic region known to contain major colour pattern loci in Heliconius.
figure 2

a, Association in H. erato with the yellow hindwing bar (n = 45). Coloured SNPs are fixed for a unique state in H. erato demophoon (orange) or H. erato favorinus (purple). b, Genes in H. erato with direct homologues in H. melpomene. Genes are in different colours with exons (coding and UTRs) connected by lines. Grey bars are transposable elements. c, H. melpomene genes and transposable elements. Colours correspond to homologous H. erato genes and microRNAs30 are black. d, Association in the H. melpomene/timareta/silvaniform group with the yellow hindwing bar (red) and yellow forewing band (blue) (n = 49). e, Association in H. numata with the bicoloratus morph (n = 26); inversion positions13 shown below. In all cases black or dark coloured points are above the strongest associations found outside the colour pattern scaffolds (H. erato P = 1.63 × 10−5; H. melpomene P = 2.03 × 10−5 and P = 2.58 × 10−5 for hindwing bar and forewing band, respectively; H. numata P = 6.81 × 10−6). P values are from score tests for association.

PowerPoint slide

Source data

In three separate Heliconius species, our analysis consistently implicated the gene cortex as being involved in adaptive differences in wing colour pattern. In H. erato the strongest associations with the presence of a yellow hindwing bar were centred around the genomic region containing cortex (Fig. 2a). We identified 108 SNPs that were fixed for one allele in H. erato favorinus, and fixed for the alternative allele in all individuals lacking the yellow bar; the majority of these SNPs were in introns of cortex (Extended Data Table 2). Fifteen SNPs showed a similar fixed pattern for H. erato demophoon, which also has a yellow bar. These SNPs did not overlap with those in H. erato favorinus, consistent with the hypothesis that this phenotype evolved independently in the two disjunct populations17.

Previous work has suggested that alleles at the Yb locus are shared between H. melpomene, the closely related species H. timareta, and the more distantly related species H. elevatus, resulting in mimicry among these species18. Across these species, the strongest associations with the yellow hindwing bar phenotype were again found at cortex (Fig. 2d, Extended Data Fig. 1a and Extended Data Table 3). Similarly, the strongest associations with the yellow forewing band were found around the 5′ untranslated regions (UTRs) of cortex and HM00036, an orthologue of the wash gene in Drosophila melanogaster. A single SNP about 17 kb upstream of cortex (the closest gene) was perfectly associated with the yellow forewing band across all H. melpomene, H. timareta and H. elevatus individuals (Extended Data Figs 1a, 2 and Extended Data Table 3). We found no fixed coding sequence variants at cortex in larger samples (14–38 individuals) of H. melpomene aglaope and H. melpomene amaryllis (Extended Data Fig. 3 and Supplementary Information), which differ in Yb-controlled phenotypes19, suggesting that functional variants are likely to be regulatory rather than coding. We found extensive transposable element variation around cortex but it is unclear whether any of these are associated with phenotypic differences (Extended Data Fig. 3, Extended Data Table 4 and Supplementary Information).

Finally, large inversions at the P supergene locus in H. numata (Fig. 1) are associated with different morphs13. There is a steep increase in genotype-by-phenotype association at the breakpoint of inversion 1, consistent with the role of these inversions in reducing recombination (Fig. 2e). However, the bicoloratus morph can recombine with all other morphs across one or the other inversion, permitting finer-scale association mapping of this region. As in H. erato and H. melpomene, this analysis showed a narrow region of associated SNPs corresponding exactly to the cortex gene (Fig. 2e), again with the majority of SNPs being found in introns (Extended Data Table 2). This associated region does not correspond to any other known genomic feature, such as an inversion or inversion breakpoint.

To determine whether sequence variants around cortex were regulating its expression, we investigated gene expression across the Yb locus. We used a custom designed microarray including probes from all predicted genes in the H. melpomene genome18 as well as probes tiled across the central portion of the Yb locus, focusing on two naturally hybridizing H. melpomene races (plesseni and malleti) that differ in Yb-controlled phenotypes7. cortex was the only gene across the entire interval to show significant differences in expression both between races with different wing patterns (false discovery rate (FDR) adjusted t-test P = 6.09 × 10−7) and between wing sections with different pattern elements (FDR adjusted t-test P = 0.00224; Fig. 3). This finding was reinforced in the tiled probe set, where we observed strong differences in the expression of cortex exons and introns but few differences outside this region (Extended Data Table 2). cortex expression was higher in H. melpomene malleti than in H. melpomene plesseni in all three wing sections used (but not eyes) (Fig. 3c and Extended Data Fig. 4c). When different wing sections were compared within each race, cortex expression in H. melpomene malleti was higher in the distal section that contains the Yb-controlled yellow forewing band than in the proximal section, consistent with cortex producing this band. In contrast, H. melpomene plesseni, which lacks the yellow band, had higher cortex expression in the proximal forewing section than in the distal section (Fig. 3f and Extended Data Fig. 4j). Differences in expression were found in pupal wings only on days 1 and 3 but not on days 5 or 7 (Extended Data Fig. 4), similar to the pattern observed previously for the transcription factor optix20.

Figure 3: Differential gene expression across the genomic region known to contain major colour pattern loci in H. melpomene.
figure 3

af, Expression differences in day 3 pupae, for all genes in the Yb interval (a, d) and tiling probes spanning the central portion of the interval (b, c, e, f). Expression is compared between races for each wing region (ac) and between proximal and distal forewing sections for each race (df). c, f, Magnitude and direction of expression difference (log2 fold change) for tiling probes showing significant differences (P ≤ 0.05); probes in known cortex exons shown in dark colours. Gene HM00052 was differentially expressed between other races in RNA-seq data (Supplementary Information) but is not differentially expressed here. P values are based on FDR-adjusted t-statistics.

PowerPoint slide

Differential expression was not confined to the exons of cortex; the majority of differentially expressed probes in the tiling array corresponded to cortex introns (Fig. 3). This differential expression of introns does not appear to be due to transposable element variation (Extended Data Table 2), but may be due to elevated background transcription and unidentified splice variants. PCR with reverse transcription (RT–PCR) revealed a diversity of splice variants (Extended Data Fig. 5), and their sequenced products included eight non-constitutive exons and six variable donor/acceptor sites, but we did not exhaustively sequence all transcripts (Supplementary Information). We cannot rule out the possibility that some of the differentially expressed intronic regions could be distinct non-coding RNAs. However, quantitative RT–PCR (qRT–PCR) in other hybridizing races with divergent Yb alleles (aglaope/amaryllis and rosina/melpomene) also identified differences in cortex expression and allele-specific splicing differences between both pairs of races (Extended Data Figs 1, 5 and Supplementary Information).

Finally, in situ hybridization of cortex in final instar larval hindwing discs showed expression in wing regions fated to become black in the adult wing, most strikingly in their correspondence to the black patterns on adult H. numata wings (Fig. 4). In contrast, the array results from pupal wings were suggestive of higher expression in non-melanic regions. This may suggest that cortex is upregulated at different time-points in wing regions fated to become different colours.

Figure 4: In situ hybridizations of cortex in hindwings of final instar larvae.
figure 4

a, b, H. numata tarapotensis (replicated three times in the lab). Adult wing shown in a; coloured points indicate landmarks, yellow arrows highlight adult pattern elements corresponding to cortex staining. c, d, H. melpomene rosina (replicated twice in the lab). Adult wing shown in c; staining patterns in other H. melpomene races (meriana, n = 11, and aglaope, n = 6) appeared similar. The probe used was complementary to the cortex isoform with the longest open reading frame (also the most common; see Extended Data Fig. 5).

PowerPoint slide

Overall, cortex shows significant differential expression and is the only gene in the candidate region to be consistently differentially expressed in multiple race comparisons and between differently patterned wing regions. Coupled with the strong genotype-by-phenotype associations across multiple independent lineages (Extended Data Table 1), these findings strongly implicate cortex as a major regulator of colour and pattern. However, we have not excluded the possibility that other genes in this region also influence pigmentation patterning. A prominent role for cortex is also supported by studies in other taxa; our identification of distant 5′ untranslated exons of cortex (Supplementary Information) suggests that the 100-bp interval containing the Ws mutation in B. mori is likely to be within an intron of cortex and not in intergenic space, as previously thought10. In addition, fine mapping and gene expression also suggest that cortex controls melanism in the peppered moth4.

It seems likely that cortex controls pigmentation patterning by controlling scale cell development. The cortex gene falls in an insect-specific lineage within the fzy (also known as Cdc20/fizzy) family of cell-cycle regulators (Extended Data Fig. 6a). The phylogenetic tree of this gene family highlighted three major orthologous groups, two of which have highly conserved functions in cell-cycle regulation, mediated through interaction with the anaphase-promoting complex/cyclosome (APC/C)3,21. The third group, containing cortex proteins, is evolving rapidly, with low amino acid identity between D. melanogaster and H. melpomene cortex (14.1%), contrasting with much higher identities for orthologues between these species in the other two groups (fzy, 47.8% and rap (also known as fzr, cdh1, rap/Fzr), 47.2%; Extended Data Fig. 6a). D. melanogaster cortex acts through a similar mechanism to fzy to control meiosis in the female germ line22,23,24. H. melpomene cortex also has some conservation of the fizzy family C-box and IR (isoleucine–arginine) tail elements (Supplementary Information) that mediate binding to the APC/C23, suggesting that it may have retained a cell-cycle function, although we found that expressing H. melpomene cortex in D. melanogaster wings produced no detectable effect (Extended Data Fig. 6 and Supplementary Information).

Previously identified butterfly wing patterning genes have been transcription factors or signalling molecules20,25. Developmental rate has long been thought to play a role in lepidopteran patterning26,27, but cortex was not a likely a priori candidate, because its Drosophila orthologue has a highly specific function in meiosis23. The recruitment of cortex to wing patterning appears to have occurred before the major diversification of the Lepidoptera and this gene has repeatedly been targeted by natural selection1,7,9,28 to generate both cryptic4 and aposematic patterns.

Methods

No statistical methods were used to predetermine sample size.

H. erato Cr reference

Cr is the homologue of Yb in H. erato (Fig. 1). An existing reference for this region was available in three pieces31 (467,734 bp, 114,741 bp and 161,149 bp; GenBank KC469893.1). We screened the same bacterial artificial chromosome (BAC) library used previously11,31 using described procedures11 with probes designed to the ends of the existing BAC sequences and the HmYb BAC reference sequence. Two BACs (04B01 and 10B14) were identified as spanning one of the gaps and sequenced using Illumina 2 × 250-bp paired-end reads collected on the Illumina MiSeq. The raw reads were screened to remove vector and Escherichia coli bases. The first 50,000 read pairs were taken for each BAC and assembled individually with the Phrap32 software and manually edited with consed33. Contigs with discordant read pairs were manually broken and properly merged using concordant read data. Gaps between contig ends were filled using an in-house finishing technique in which the terminal 200 bp of the contig ends were extracted and queried against the unused read data for spanning pairs, which were added using the addSolexaReads.perl script in the consed package. Finally, a single reference contig was generated by identifying and merging overlapping regions of the two consensus BAC sequences.

To fill the remaining gap (between positions 800,387 and 848,446) we used the overhanging ends to search the scaffolds from a preliminary H. erato genome assembly of five Illumina paired-end libraries with different insert sizes (250, 500, 800, 4,300 and 6,500 bp) from two related H. erato demophoon individuals. We identified two scaffolds (scf1869 and scf1510) that overlapped and spanned the gap (using 12,257 bp of the first scaffold and 35,803 bp of the second).

The final contig was 1,009,595 bp in length, of which 2,281 bp were unknown (N). The HeCr assembly was verified by aligning to the HmYb genome scaffold (HE667780) with mummer and blast. The HeCr contig was annotated as described previously31 with some minor modifications. Briefly this involved first generating a reference-based transcriptome assembly with existing H. erato RNA-sequenced (RNA-seq) wing tissue (GenBank accession SRA060220). We used Trimmomatic34 (v0.22), and FLASh35 (v1.2.2) to prepare the raw sequencing reads, checking the quality with FastQC36 (v0.10.0). We then used the Bowtie/TopHat/Cufflinks37,38,39 pipeline to generate transcripts for the unmasked reference sequence. We generated gene predictions with the MAKER pipeline40 (v2.31). Homology and synteny in gene content with the H. melpomene Yb reference were identified by aligning the H. melpomene coding sequences to the H. erato reference with BLAST. Homologous genes were present in the same order and orientation in H. erato and H. melpomene (Fig. 2b, c). Annotations were manually adjusted if genes had clearly been merged or split in comparison to H. melpomene (which has been extensively manually curated12). In addition, H. erato cortex was manually curated from the RNA-seq data and using Exonerate41 alignments of the H. melpomene protein and mRNA transcripts, including the 5′ UTRs.

Genotype-by-phenotype association analyses

Information on the individuals used and ENA accessions for sequence data are given in Supplementary Table 1. We used shotgun Illumina sequence reads from 45 H. erato individuals from 7 races that were generated as part of a previous study31 (Supplementary Information). Reads were aligned to an H. erato reference containing the Cr contig and other sequenced H. erato BACs11,31 with BWA42, which has previously been found to work better than Stampy43 (which was used for the alignments in the other species) with an incomplete reference sequence31. The parameters used were as follows: maximum edit distance (n), 8; maximum number of gap opens (o), 2; maximum number of gap extensions (e), 3; seed (l), 35; maximum edit distance in seed (k), 2. We then used Picard tools to remove PCR and optical duplicate sequence reads and GATK44 to re-align indels and call SNPs using all individuals as a single population. Expected heterozygosity was set to 0.2 in GATK. 132,397 SNPs were present across Cr. A further 52,698 SNPs not linked to colour pattern loci were used to establish background association levels.

For the H. melpomene/H. numata clade we used previously published sequence data from 19 individuals from enrichment sequencing targeting the Yb region, the unlinked HmB/D region that controls the presence or absence of red colour pattern elements, and ~1.8 Mb of non-colour pattern genomic regions45, as well as 9 whole-genome shotgun-sequenced individuals18,46. We added targeted sequencing and shotgun whole-genome sequencing of an additional 47 individuals (Supplementary Information). Alignments were performed using Stampy43 with default parameters except for substitution rate which was set to 0.01. We again removed duplicates and used GATK to re-align indels and call SNPs with expected heterozygosity set to 0.1.

The analysis of H. melpomene/timareta/silvaniform included 49 individuals, which were aligned to v1.1 of the H. melpomene reference genome with the scaffolds containing Yb and HmB/D swapped with reference BAC sequences18, which contained fewer gaps of unknown sequence than the genome scaffolds. The Yb region contained 232,631 SNPs and a further 370,079 SNPs were used to establish background association levels.

The H. numata analysis included 26 individuals aligned to unaltered v1.1 of the H. melpomene reference genome, because the genome scaffold containing Yb is longer than the BAC reference, making it easier to compare the inverted and non-inverted regions in this species. We tested for associations at 262,137 SNPs on the Yb scaffold with the H. numata bicoloratus morph, which had a sample size of 5 individuals.

We measured associations between genotype and phenotype using a score test (qtscore) in the GenABEL package in R (ref. 47). This was corrected for background population structure using a test specific inflation factor (λ) calculated from the SNPs unlinked to the major colour pattern controlling loci (described above), as the colour pattern loci are known to have a different population structure from the rest of the genome14,15,18. We used a custom perl script to convert GATK vcf files to Illumina SNP format for input to GenABEL47. GenABEL does not accept multiallelic sites, so the script also converted the genotype of any individuals for which a third (or fourth) allele was present to a missing genotype (with these defined as the lowest frequency alleles). Custom R scripts were used to identify sites showing perfect associations with calls for >75% of individuals.

Microarray gene expression analyses

We designed a Roche NimbleGen microarray (12 × 135K format) with probes for all annotated H. melpomene genes18 and tiling of the central portion of the Yb BAC sequence contig that was previously identified as showing the strongest differentiation between H. melpomene races45. In addition to the HmYb tiling array probes there were 6,560 probes tiling HmAc (a third unlinked colour pattern locus) and 10,716 probes tiling HmB/D, again distanced on average at 10-bp intervals. The whole-genome gene expression array contained 107,898 probes in total.

This array was interrogated with Cy3-labelled double-stranded cDNA generated from total RNA (with a SuperScript double-stranded cDNA synthesis kit (Invitrogen) and a one-colour DNA labelling kit (Niblegen)) from four pupal developmental stages of H. melpomene plesseni and malleti. Pupae were from captive stocks maintained in insectary facilities in Gamboa, Panama. Tissue was stored in RNA later (Ambion) at −80°C before RNA extraction. RNA was extracted using TRIzol (Invitrogen) followed by purification with RNeasy (Qiagen) and DNase treated with DNA-free (Ambion). Quantification was performed using a Qubit 2.0 fluorometer (Invitrogen) and purity and integrity assessed using a Bioanalyzer 2100 (Agilent). Samples were randomized and each hybridized to a separate array. The HmYb probe array contained 9,979 probes distanced on average at 10 bp. The whole-genome expression array contained on average 9 probes per annotated gene in the genome (v.1.1 (ref. 18)) as well as any transcripts not annotated but predicted from RNA-seq evidence.

Background corrected expression values for each probe were extracted using NimbleScan software (v.2.3). Analyses were performed with the LIMMA package implemented in R/Bioconductor48. The tiling array and whole-genome data sets were analysed separately. Expression values were extracted and quantile-normalized, log2-transformed, quality controlled and analysed for differences in expression between individuals and wing regions. P values were adjusted for multiple hypothesis testing using the false discovery rate (FDR) method49.

In situ hybridization

H. numata and H. melpomene larvae were reared in a greenhouse at 25–30 °C and sampled at the last instar. In situ hybridizations were performed according to previously described methods25 with a cortex riboprobe synthesized from a 831-bp cDNA amplicon from H. numata. Wing discs were incubated in a standard hybridization buffer containing the probe for 20–24 h at 60 °C. For secondary detection of the probe, wing discs were incubated in a 1:3,000 dilution of anti-digoxigenin alkaline phosphatase Fab fragments and stained with BM Purple for 3–6 h at room temperature. Stained wing discs were photographed with a Leica DFC420 digital camera mounted on a Leica Z6 APO stereomicroscope.

De novo assembly of short read data in H. melpomene and related taxa

To better characterize indel variation from the short-read sequence data used for the genotype-by-phenotype association analysis, we performed de novo assemblies of a subset of H. melpomene individuals and related taxa with a diversity of phenotypes (Extended Data Fig. 2). Assemblies were performed using the de novo assembly function of CLCGenomics Workbench v.6.0 under default parameters. The assembled contigs were then BLASTed against the Yb region of the H. melpomene melpomene genome18, using Geneious v.8.0. The contigs identified by BLAST were then concatenated to generate an allele sequence for each individual. Occasionally two unphased alleles were generated when two contigs were matched to a given region. If more than two contigs of equal length matched then this was considered an unresolvable repeat region and replaced with Ns. The assembled alleles were then aligned using the MAFFT alignment plugin in Geneious v.8.0.

Long-range PCR targeted sequencing of cortex in H. melpomene aglaope and H. melpomene amaryllis

We generated two long-range PCR products covering 88.8% of the 1,344-bp coding region of cortex (excluding 67 bp at the 5′ end and 83bp at the 3′ end; see Supplementary Information). A product spanning coding exons 5–9 (the final exon) was obtained from 29 H. melpomene amaryllis individuals and 29 H. melpomene aglaope individuals; a product spanning coding exons 2–5 was obtained from 32 H. melpomene amaryllis individuals and 14 H. melpomene aglaope individuals. In addition, a product spanning exons 4–6 was obtained from six H. melpomene amaryllis and five H. melpomene aglaope individuals that failed to amplify one or both of the larger products. Long-range PCR was performed using Extensor long-range PCR mastermix (Thermo Scientific) following the manufacturer’s guidelines with a 60 °C annealing temperature in a 10–20-μl volume. The product spanning coding exons 5–9 was obtained with primers HM25_long_F1 and HM25_long_R4 (see Supplementary Table 2 for primer sequences); the product spanning coding exons 2–5 was obtained with primers HM25_long_F4 and HM25_long_R2; the product spanning exons 4–6 was obtained with primers 25_ex5-ex7_r1 and 25_ex5-ex7_f1. Products were pooled for each individual, including five additional products from the Yb locus and seven products in the region of the HmB/D locus. They were then cleaned using QIAquick PCR purification kit (QIAgen) before being quantified with a Qubit Fluorometer (Life Technologies) and pooled in equimolar amounts for each individual, taking into account variation in the length and number of PCR products included for each individual (because of some PCR failures, that is, proportionally less DNA was included if some PCR products were absent for a given individual).

Products were pooled within individuals (including additional products for other genes not analysed here) and then quantified and pooled in equimolar amounts for each individual within each race. The pooled products for each race (H. melpomene aglaope and amaryllis) were then prepared as two separate libraries with molecular identifiers and sequenced on a single lane of an Illumina GAIIx. Analysis was performed using Galaxy and the history is available at https://usegalaxy.org/u/njnadeau/h/long-pcr-final. Reads were quality filtered with a minimum quality of 20 required over 90% of the read, which resulted in 5% of reads being discarded. Reads were then quality trimmed to remove bases with quality less than 20 from the ends. They were then aligned to the target regions using the fosmid sequences from known races45 with sequence from the Yb BAC walk12 used to fill any gaps. Alignments were performed with BWA v.0.5.6 (ref. 42) and converted to pileup format using Samtools v.0.1.12 before being filtered on the basis of quality (≥20) and coverage (≥10). BWA alignment parameters were as follows: fraction of missing alignments given 2% uniform base error rate (aln -n) 0.01; maximum number of gap opens (aln -o) 2; maximum number of gap extensions (aln -e) 12; disallow long deletion within 12 bp towards the 3′-end (aln -d); number of first subsequences to take as seed (aln -l) 100. We then calculated coverage and minor allele frequencies for each race and the difference between these using custom scripts in R50.

Sequencing and analysis of H. melpomene fosmid clones

Fosmid libraries had previously been made from single individuals of three H. melpomene races (rosina, amaryllis and aglaope) and several clones overlapping the Yb interval had been sequenced45. We extended the sequencing of this region, particularly the region overlapping cortex, by sequencing an additional four clones from H. melpomene rosina (1051_83D21, accession KU514430; 1051_97A3, accession KU514431; 1051_65N6, accession KU514432; 1051_93D23, accession KU514433), two clones from H. melpomene amaryllis (1051_13K4, accession KU514434; 1049_8P23, accession KU514435) and three clones from H. melpomene aglaope (1048_80B22, accession KU514437; 1049_19P15, accession KU514436; 1048_96A7, accession KU514438). These were sequenced on a MiSeq 2000, and assembled using the de novo assembly function of CLCGenomcs Workbench v.6.0. The individual clones (including existing clones 1051-143B3, accession FP578990; 1049-27G11, accession FP700055; and 1048-62H20, accession FP565804) were then aligned to the BAC and genome scaffold18 references using the MAFFT alignment plugin of Geneious v.8.0. Regions of general sequence similarity were identified and visualized using MAUVE51. We merged overlapping clones from the same individual if they showed no sequence differences, indicating that they came from the same allele. We identified transposable elements using nBLAST with an insect transposable element list downloaded from Repbase Update52, including known Heliconius-specific transposable elements53.

5′ RACE, RT–PCR and qRT–PCR

All tissues used for gene expression analyses were dissected from individuals from captive stocks derived from wild-caught individuals of various races of H. melpomene (aglaope, amaryllis, melpomene, rosina, plesseni and malleti) and F2 individuals from a H. melpomene rosina (female) × H. melpomene melpomene (male) cross. Experimental individuals were reared at 28–31 °C. Developing wings were dissected and stored in RNAlater (Ambion Life Technologies). RNA was extracted using a QIAgen RNeasy Mini kit following the manufacturer’s guidelines and treated with TURBO DNA-free DNase kit (Ambion Life Technologies) to remove remaining genomic DNA. RNA quantification was performed with a Nanodrop spectrophotometer, and the RNA integrity was assessed using the Bioanalyzer 2100 system (Agilent).

Total RNA was thoroughly checked for DNA contamination by performing PCR for EF1α (using primers ef1-a_RT_for and ef1-a_RT_rev, Supplementary Table 2) with 0.5 μl of RNA extract (50 ng–1 μg of RNA) in a 20-μl reaction using a polymerase enzyme that is not functional with RNA template (BioScript, Bioline Reagents Ltd). If a product amplified within 45 cycles then the RNA sample was re-treated with DNase.

Single-stranded cDNA was synthesized using BioScript MMLV Reverse Transcriptase (Bioline Reagents Ltd) with random hexamer (N6) primers and 1 μg of template RNA from each sample in a 20-μl reaction volume following the manufacturer’s protocol. The resulting cDNA samples were then diluted 1:1 with nuclease-free water and stored at −80 °C.

5′ RACE (rapid amplification of cDNA ends) was performed using RNA from hindwing discs from one H. melpomene aglaope and one H. melpomene amaryllis final instar larvae with a SMARTer RACE kit from Clonetech. The gene-specific primer used for the first round of amplification was anchored in exon 4 (fzl_raceex5_R1; Supplementary Table 2). Secondary PCR of these products was then performed using a primer in exon 2 (HM25_long_F2; Supplementary Table 2) and the nested universal primer A. Other isoforms were detected by RT–PCR using primers within exons 2 and 9 (gene25_for_full1 and gene25_rev_ex3). We identified isoforms from 5′ RACE and RT–PCR products by cutting individual bands from agarose gels and if necessary by cloning products before Sanger sequencing. Cloning of products was performed using TOPO TA (Invitrogen) or pGEM-T (Promega) cloning kits. Sanger sequencing was performed using BigDye terminator v3.1 (Applied Biosystems) run on an ABI13730 capillary sequencer. Primers fzl_ex1a_F1 and fzl_ex4_R1 were used to confirm expression of the furthest 5′ UTR. For isoforms that appeared to show some degree of race specificity, we designed isoform-specific PCR primers spanning specific exon junctions (Extended Data Figs 2, 4 and Supplementary Table 2) and used these to either qualitatively (RT–PCR) or quantitatively (qRT–PCR) assess differences in expression between races.

We performed qRT–PCR using SensiMix SYBR green (Bioline Reagents Ltd) with 0.2–0.25 μM of each primer and 1 μl of the diluted product from the cDNA reactions. Reactions were performed in an Opticon 2 DNA engine (MJ Research) with the following cycling parameters: 95 °C for 10 min; 35–50 × (95 °C for 15 s, 55–60 °C for 30 s, 72 °C for 30 s); 72 °C for 5 min. Melting curves were generated between 55 °C and 90 °C with readings taken every 0.2 °C for each of the products to check that a single product was generated. At least one product from each set of primers was also run on a 1% agarose gel to check that a single product of the expected size was produced and the identity of the product was confirmed by direct sequencing (see Supplementary Table 2 for details of primers for each gene). We used two housekeeping genes (EF1A and RPS3A) for normalization and all results were taken as averages of triplicate PCR reactions for each sample.

Ct values were defined as the point at which fluorescence crossed a threshold (RCt) adjusted manually to be the point at which fluorescence rose above the background level. Amplification efficiencies (E) were calculated using a dilution series of clean PCR products. Starting fluorescence, which is proportional to the starting template quantity, was calculated as R0 = RCt(1 + E)−Ct. Normalized values were then obtained by dividing R0 values for the target loci by R0 values for EF1α and RPS3A. Results from both of these controls were always very similar, so the results presented are normalized to the mean of EF1A and RPS3A. All results were taken as averages of triplicate PCR reactions. If one of the triplicate values was more than one cycle away from the mean then this replicate was excluded. Similarly any individuals that were more than two s.d. away from the mean of all individuals for the target or normalization genes were excluded (these are not included in the numbers of individuals reported). Statistical significance was assessed by Wilcoxon rank sum tests performed in R (ref. 50).

RNA-seq analysis of H. melpomene amaryllis/aglaope

RNA-seq data for hindwings from three developmental stages had previously been obtained for two individuals of each race at each stage (12 individuals in total) and used in the annotation of the H. melpomene genome18 (deposited in ENA under study accessions ERP000993 and PRJEB7951). Four samples were multiplexed on each sequencing lane with the fifth instar larval and day 2 pupal samples sequenced on a GAIIx sequencer and the day 3 pupal wings sequenced on a Hiseq 2000 sequencer.

Two methods were used for alignment of reads to the reference genome and inferring read counts: Stampy43 and RSEM (RNaseq by Expectation Maximisation)54. In addition we used two different R/Bioconductor packages for estimation of differential gene expression: DESeq55 and BaySeq56. Read bases with quality scores <20 were trimmed with FASTX-Toolkit (http://hannonlab.cshl.edu/fastx_toolkit/index.html). Stampy was run with default parameters except for mean insert size, which was set to 500, s.d. 100, and substitution rate, which was set to 0.01. Alignments were filtered to exclude reads with mapping quality <30 and sorted using Samtools57. We used the HT seq-count script with HTseq58 to infer counts per gene from the BAM files.

RSEM54 was run with default parameters to infer a transcriptome and then map RNA-seq reads against this using Bowtie37 as an aligner. This was run with default parameters except for the maximum number of mismatches, which was set to 3.

Annotation and alignment of fizzy family proteins

In the arthropod genomes, some fizzy family proteins were found to be poorly annotated based on alignments to other family members. In these cases annotations were improved using well-annotated proteins from other species as references in the program Exonerate41 and the outputs were manually curated. Specifically, the annotation of B. mori rap (also known as fzr) was extended based on alignment of Danaus plexippus rap; the annotation of B. mori fzy was altered based on alignment of D. melanogaster and D. plexippus fzy; H. melpomene fzy was identified as part of the annotated gene HMEL017486 on scaffold HE671623 (Hmel v.1.1) based on alignment of D. plexippus fzy; the Apis mellifera rap annotation was altered based on alignment of D. melanogaster rap; the annotation of Acyrthosiphon pisum rap was altered based on alignment of D. melanogaster rap. No one-to-one orthologues of D. melanogaster fzr2 were found in any of the other arthropod genera, suggesting that this gene is Drosophila-specific. Multiple sequence alignment of all the fizzy family proteins was then performed using the Expresso server59 within T-coffee60, and this alignment was used to generate a neighbour joining tree in Geneious v.8.1.7.

Expression of H. melpomene cortex in D. melanogaster wings

D. melanogaster cortex is known to generate an irregular microchaete phenotype when ectopically expressed in the posterior compartment of the adult fly wing24. We performed the same assay using H. melpomene cortex to test whether this functionality was conserved. Following the methods of Swan and Schüpbach24, we created an upstream activating sequence (UAS)–GAL4 construct using the coding region for the long isoform of H. melpomene cortex, plus a Drosophila cortex version to act as positive control. The haemagglutinin (HA)-tagged H. melpomene UAS-cortex expression construct was generated using cDNA reverse transcribed (Revert-Aid, Thermo-Scientific) from RNA extracted (Qiagen RNeasy) from pre-ommochrome pupal wing material. An HA-tagged D. melanogaster UAS–cortex version was also constructed24. Expression was driven by the hsp70 promoter. Constructs were injected into ϕC31-attP40 flies (25709, Bloomington Stock Centre; Cambridge University Genetics Department, UK, fly injection service) by site-directed insertion into CII via an attB site in the construct. Homozygous transgenic flies were crossed with w,y′;enGAL4;UAS–GFP flies (gift from M. Landgraf laboratory, Cambridge University Zoology Department) to drive expression in the engrailed posterior domain of the wing, and adult offspring wings were photographed (Extended Data Fig. 6b–d). Expression of the construct was confirmed by immunohistochemistry (using the standard Drosophila protocol) against an HA tag inserted at the N terminus of the protein, using final instar larval wing discs with mouse anti-HA and goat anti-mouse alexa-fluor 568 secondary antibodies (Abcam), imaged by Leica SP5 confocal (Extended Data Fig. 6e).