2249 haptophytes in the consensus tree; alternative branching positions for the haptophyte
2250 sequences are labelled with numbered boxes. The table below (ii) lists the probabilities for
2251 each alternative position under eight different tests performed with CONSEL. Alternative
2252 positions that are not rejected by a topology test are shaded. All possible trees in which the
2253 haptophyte sequences branch within the ochrophytes are clearly rejected under all
2254 conditions, confirming that its plastid genome is of non-ochrophyte origin. The legend at the
2255 bottom of panel B gives full names for each test performed.
2256

2257 **Fig. 9- figure supplement 2. Fast site removal and clade deduction analysis of plastid genome trees.** Panel A shows the support values obtained for Bayesian + Jones trees inferred from modified versions of the taxon-rich plastid multigene alignment from which the 13 fastest evolving site categories had been removed for four different branching relationships pertaining to the placements of haptophyte and hypogyristean sequences. The % of residues from the original alignment retained in each modified alignment are shown with grey bars. Panel B tabulates the support obtained for two different evolutionary relationships (haptophytes as a sister group to all cryptomonads, and as a sister group to all ochrophytes) in gene-rich (i) and taxon-rich (ii) alignments modified to remove all amino acids that occur at different frequencies in haptophytes to ochrophyte lineages, and modified to remove individual or pairs of CASH lineages. “x” indicates that the topology in question was not obtained.
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269

2270 **Fig. 9- figure supplement 3. Single-gene tree topologies associated with individual plastid-encoded genes.** These heatmaps show the first sister-groups identified to haptophytes, and members of the pelagophyte/ dictyochophyte clade, in single-gene trees of component genes included in concatenated trees of plastid-encoded proteins using both the gene-rich (i) and taxon-rich (ii) alignments. Topologies are given for trees inferred with MrBayes using the Jones substitution matrix, and RAxML trees inferred using JTT, under the same conditions as the multigene trees. The identity of the first sister-group is shaded according to the legend given below. Only three single-gene trees (labelled with black arrows) support any sister-group relationship between haptophytes and the pelagophyte/ dictyochophyte clade; however, in each case (explained beneath the legend) this topology is not robustly supported, either due to polyphyly of one of the constituent lineages, or conflicting topologies identified via alternative methods.
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282

2283 **Fig. 10- figure supplement 1. Complex origins of different ancestral ochrophyte HPPGs**
2284 Panel A shows the evolutionary positions of lineages with histories of secondary
2285 endosymbiosis in trees of ancestral ochrophyte HPPGs verified by combined BLAST top hit
2286 and single-gene tree analysis to be either of red algal (i) or green algal origin (ii). In both
2287 cases, in more than half of the constituent trees, haptophyte and cryptomonad sequences
2288 resolve as closer relatives to the ochrophytes than the red or green algal evolutionary
2289 outgroup, either due to resolving in the ochrophyte HPPG or forming a specific sister-group
2290 to the ochrophyte lineages. Panel B plots the distribution of cryptomonads (i) and
2291 haptophytes (ii) in trees for different categories of ancestral ochrophyte HPPG of verified
2292 evolutionary origin. HPPGs of green algal origin more frequently show internal or sister
2293 positions for the cryptomonad sequences than all other categories of HPPG, and in more
2294 than 50% of cases resolve internal or sister positions for the haptophyte sequences. This
2295 might be consistent with a green algal contribution in the endosymbiotic ancestor of
2296 cryptomonad, haptophyte and ochrophyte plastids.
2297

2298 **Fig. 10-figure supplement 2. Different scenarios for the origins of haptophyte plastids.**
2299 This schematic tree diagram shows different possibilities for the origins of the haptophyte
2300 plastid as predicted from the data within this study. No inference is made here regarding the
2301 ultimate origin of the ochrophyte plastid, although it is noted that the ochrophyte,
2302 cryptomonad and haptophyte plastids are likely to be closely related to one another within
2303 the red plastid lineages. First, a common ancestor of the pelagophytes and dictyochophytes
2304 was taken up by a common ancestor of the haptophytes (point 1), yielding a permanent
2305 plastid that contributed genes for a large number of plastid-targeted proteins in extant
2306 haptophytes. This plastid was subsequently replaced via serial endosymbiosis (point 2)
2307 yielding the current haptophyte plastid and plastid genome. This serial endosymbiosis event
2308 either involved a close relative of extant cryptomonads (2A) or a currently unidentified
2309 species that forms a sister-group in plastid gene trees to all extant ochrophytes, but is
2310 evolutionarily distinct from the pelagophytes (2B). It is possible that the haptophyte plastid
2311 may have been acquired through the secondary endosymbiosis of a different lineage of red
2312 algae to the ochrophyte, either via a cryptomonad intermediate (2C) or directly (2D).
2313
2314
A

<figure><img src="image_3.png" /></figure>

* Chrysista

* Hypogyristea

* Diatoms

C

11 ochrophyte genomes + 157 transcriptomes screened with SignalP3.0/ ASAFind or HECTAR

<figure><img src="image_4.png" /></figure>

Plastid-targeted proteins extracted

<figure><img src="image_5.png" /></figure>

Genomic plastid-targeted sequences BLASTed against modified uniref library (excluding lineages with a history of secondary endosymbiosis); top hit and e-value extracted

<figure><img src="image_6.png" /></figure>

Genomic plastid-targeted sequences BLASTed against all other ochrophyte genome plastid-targeted sequences

<figure><img src="image_7.png" /></figure>

Hits with e-value < uniref tophit added to HPPG

<figure><img src="image_8.png" /></figure>

Genomic plastid-targeted sequences BLASTed against all other ochrophyte plastid-targeted sequences; top hits and e-values from each sub-category extracted

<figure><img src="image_9.png" /></figure>

Hits with e-value < uniref tophit added to HPPG

<figure><img src="image_10.png" /></figure>

HPPGs with >2 shared chrysista, diatoms or hypogyristea merged

<figure><img src="image_11.png" /></figure>

HPPGs selected that contain either:

* ≥2 chrysista, ≥3 diatoms

* ≥2 chrysista, ≥2 hypogyristea

* ≥1 chrysista, ≥2 hypogyristea, ≥3 diatoms

<figure><img src="image_12.png" /></figure>

HPPGs aligned using MUSCLE and GeneIOUS; HPPGs that fail to align rejected

<figure><img src="image_13.png" /></figure>

Seed sequences for HPPGs BLASTed against uniref library (top 50 hits extracted); and 34 libraries generated from MMETSP + jgi for different eukaryotic lineages (top hit from each extracted)

<figure><img src="image_14.png" /></figure>

HPPGs realigned against outgroup sequences using MUSCLE and GeneIOUS; HPPGs that fail to align rejected

<figure><img src="image_15.png" /></figure>

Monophyly or paraphyly of HPPGs that pass second phase of alignment verified with 100 x RAxML trees

B

i)

<figure><img src="image_16.png" /></figure>

ii)

<figure><img src="image_17.png" /></figure>

Diatoms
Chrysista

Hypogyristea

<figure><img src="image_18.png" /></figure>

Number positive controls that pass threshold

<figure><img src="image_19.png" /></figure>

Number negative controls that pass threshold

iii)

<table><thead><tr><th></th><th>Chrys.</th><th>Hypo.</th><th>Diat.</th></tr></thead><tbody><tr><td>A</td><td>≥2</td><td></td><td>≥3</td></tr><tr><td>B</td><td>≥2</td><td>≥2</td><td></td></tr><tr><td>C</td><td>≥1</td><td>≥2</td><td>≥3</td></tr></tbody></table>

D

<table><thead><tr><th rowspan="2">HPPGs</th><th>Total</th><th>+ve</th><th>-ve</th><th>Total</th><th>+ve</th><th>-ve</th></tr><tr><th colspan="3">ASAFind</th><th colspan="3">HECTAR</th></tr></thead><tbody><tr><td>Total</td><td>7238</td><td>181</td><td>1970</td><td>2858</td><td>155</td><td>493</td></tr><tr><td>Passed HPPG assembly</td><td>924</td><td>104</td><td>7</td><td>291</td><td>65</td><td>3</td></tr><tr><td>Ancestral</td><td>731</td><td>102</td><td>2</td><td>278</td><td>60</td><td>2</td></tr></tbody></table>

Total ancestral homologous plastid-targeted protein groups (HPPGs)= 770

Total positive controls= 106

Total negative controls= 4
A

<table><thead><tr><td>Protein</td><td>Probable origin</td></tr></thead><tbody><tr><td>ER Heat Shock Protein</td><td>Host ER</td></tr><tr><td>Glycyl tRNA synthetase</td><td>Bacterial</td></tr><tr><td>Histidyl tRNA synthetase</td><td>Host cytoplasm</td></tr><tr><td>Methionyl tRNA synthetase</td><td>Bacterial</td></tr><tr><td>Leucyl tRNA synthetase</td><td>Host cytoplasm</td></tr><tr><td>Mitochondrial GroES chaperonin</td><td>Host mitochondria</td></tr><tr><td>Pyrophosphate-dependent phosphofructokinase</td><td>Symbiont cytoplasm</td></tr><tr><td>Peroxisomal membrane protein MPV17</td><td>Symbiont peroxisome</td></tr><tr><td>Prolyl tRNA-synthetase</td><td>Symbiont cytoplasm</td></tr><tr><td>Novel protein 1</td><td>Unknown</td></tr></tbody></table>

B

<figure><img src="image_20.png" /></figure>
A

<figure><img src="image_21.png" /></figure>

B

i)

<figure><img src="image_22.png" /></figure>

ii)

<figure><img src="image_23.png" /></figure>
<figure><img src="image_24.png" /></figure>

<figure><img src="image_25.png" /></figure>

<figure><img src="image_26.png" /></figure>

<figure><img src="image_27.png" /></figure>

<figure><img src="image_28.png" /></figure>
A

<table><thead><tr><th>Biological process</th><th>Identified</th><th>Plastid-encoded</th><th>Dispensible</th><th>Non-vertical</th></tr></thead><tbody><tr><td>Light-harvesting proteins</td><td>14</td><td>-</td><td>-</td><td>-</td></tr><tr><td>Photosynthesis</td><td>28</td><td>45</td><td>-</td><td>-</td></tr><tr><td>Central carbon metabolism</td><td>27</td><td>2</td><td>-</td><td>1</td></tr><tr><td>Lipid synthesis</td><td>16</td><td>-</td><td>-</td><td>-</td></tr><tr><td>Tetrapyrrole synthesis</td><td>24</td><td>1</td><td>1</td><td>-</td></tr><tr><td>Carotenoid synthesis</td><td>18</td><td>-</td><td>1</td><td>-</td></tr><tr><td>Fe-S cluster synthesis</td><td>8</td><td>2</td><td>-</td><td>-</td></tr><tr><td>Riboflavin synthesis</td><td>2</td><td>-</td><td>-</td><td>-</td></tr><tr><td>Glu/Gln/Asp/Lys synthesis</td><td>16</td><td>-</td><td>-</td><td>-</td></tr><tr><td>Phe/Trp/Tyr synthesis</td><td>13</td><td>-</td><td>-</td><td>2</td></tr><tr><td>Ile/Leu/Val synthesis</td><td>6</td><td>1</td><td>-</td><td>1</td></tr><tr><td>Ser/Cys synthesis</td><td>8</td><td>-</td><td>1</td><td>-</td></tr><tr><td>tRNA synthesis</td><td>22</td><td>-</td><td>-</td><td>-</td></tr><tr><td>Nucleotide synthesis</td><td>4</td><td>-</td><td>-</td><td>-</td></tr><tr><td>Ribosomal proteins</td><td>8</td><td>45</td><td>1</td><td>-</td></tr><tr><td>Translation initiation</td><td>7</td><td>2</td><td>-</td><td>-</td></tr><tr><td>Protein import complexes</td><td>8</td><td>4</td><td>-</td><td>-</td></tr><tr><td>Division</td><td>2</td><td>0</td><td>-</td><td>-</td></tr><tr><td>Clp protease complex</td><td>8</td><td>1</td><td>-</td><td>-</td></tr><tr><td>Total</td><td>239</td><td>103</td><td>4</td><td>4</td></tr></tbody></table>

B

<figure><img src="image_29.png" /></figure>

<figure><img src="image_30.png" /></figure>

C

<table><tr><td>Number protein pairs</td><td>313</td></tr><tr><td>Number protein pairs between HPPGs of clear evolutionary origin</td><td>95</td></tr><tr><td>Observed number protein pairs between HPPGs of same origin</td><td>44</td></tr><tr><td>Expected number protein pairs between HPPGs of same origin</td><td>41.05</td></tr><tr><td>Chi-squared P</td><td>0.541</td></tr></table>

D

i) *Phaeodactylum*

<figure><img src="image_31.png" /></figure>

ii) *Thalassiosira*

<figure><img src="image_32.png" /></figure>
A

<table><thead><tr><th>i) Chimeras inherited by the ochrophyte ancestor</th><th>Origin in ochrophytes</th><th>NTD</th><th>CTD</th></tr></thead><tbody><tr><td>PpiC-type peptidyl-prolyl cis-trans isomerase</td><td>Ambiguous</td><td>Firmicutes/ Proteobacteria</td><td>Cyanobacteria</td></tr><tr><td>Hypothetical protein</td><td>Red</td><td>Firmicutes</td><td>Cyanobacteria</td></tr><tr><td>Rieske 2Fe-2S region</td><td>Green</td><td>Cyanobacteria</td><td>Proteobacteria</td></tr><tr><td>Probable heme-binding protein</td><td>Red</td><td>Cyanobacteria</td><td>Proteobacteria</td></tr><tr><td>Acyl-CoA:diacylglycerol acyltransferase (DGAT)</td><td>Host</td><td>Cyanobacteria</td><td>Actinobacteria</td></tr><tr><td>Phenylalanyl-tRNA synthetase</td><td>Red</td><td>Cyanobacteria</td><td>Proteobacteria</td></tr></tbody></table>

<table><thead><tr><th>ii) Chimeras endogenous to ochrophytes</th><th>NTD</th><th>CTD</th></tr></thead><tbody><tr><td>Calmodulin and related proteins/ Tic20</td><td>Unknown</td><td>Red algae</td></tr><tr><td>DHBP synthase/ GTP cyclohydrolase</td><td>Aplastidic stramenopiles</td><td>Actinobacteria/ Red algae</td></tr></tbody></table>

B

<figure><img src="image_33.png" /></figure>
A

GFP

Mitotracker

Chlorophyll

Bright-field

Merge

<figure><img src="image_34.png" /><figcaption>*Phaeodactylum histidyl-tRNA synthetase*</figcaption></figure>

<figure><img src="image_35.png" /></figure>

<figure><img src="image_36.png" /></figure>

<figure><img src="image_37.png" /></figure>

<figure><img src="image_38.png" /><figcaption>*Phaeodactylum prolyl-tRNA synthetase*</figcaption></figure>

<figure><img src="image_39.png" /></figure>

<figure><img src="image_40.png" /></figure>

<figure><img src="image_41.png" /></figure>

<figure><img src="image_42.png" /></figure>

<figure><img src="image_43.png" /><figcaption>*Nannochloropsis histidyl-tRNA synthetase*</figcaption></figure>

<figure><img src="image_44.png" /></figure>

<figure><img src="image_45.png" /></figure>

<figure><img src="image_46.png" /></figure>

<figure><img src="image_47.png" /></figure>

<figure><img src="image_48.png" /><figcaption>*Nannochloropsis prolyl-tRNA synthetase*</figcaption></figure>

<figure><img src="image_49.png" /></figure>

<figure><img src="image_50.png" /></figure>

<figure><img src="image_51.png" /></figure>

<figure><img src="image_52.png" /></figure>

<figure><img src="image_53.png" /></figure>

B

<figure><img src="image_54.png" /></figure>

C

<table><thead><tr><th>tRNA synthetase</th><th>Cytoplasmic isoform</th><th>Dual-targeted isoform</th></tr></thead><tbody><tr><td>Ser</td><td>Aplastidic stram</td><td>Prokaryotic</td></tr><tr><td>Ala</td><td>Aplastidic stram</td><td>Aplastidic stram</td></tr><tr><td>Trp, Arg, Asn, Asp, Val</td><td>Aplastidic stram</td><td>Red algal</td></tr></tbody></table>
A

<figure><img src="image_55.png" /></figure>

B

i) Hypogyristea

<figure><img src="image_56.png" /></figure>

C

<figure><img src="image_57.png" /></figure>

ii) Haptophytes

<figure><img src="image_58.png" /></figure>

D

<figure><img src="image_59.png" /></figure>

E

<figure><img src="image_60.png" /></figure>

■ Plastid targeting prediction found for > 2/3 haptophyte sequences in gene family

■ Expected number of gene families
A

<figure><img src="image_61.png" /></figure>

B

<figure><img src="image_62.png" /></figure>

**Key to support values**

● Support value 1.0 in all MrBayes consensus trees; > 80% all ML best trees

Other nodes
MrBayes: GTR/Jones/WAG
RAxML: GTR/JTT/WAG

C

<figure><img src="image_63.png" /><figcaption>ii) taxon-rich dataset</figcaption></figure>

<figure><img src="image_64.png" /></figure>
A

Stramenopile host

Red lineage symbiont

<figure><img src="image_65.png" /></figure>

<figure><img src="image_66.png" /></figure>

B

Endosymbiotic intermediates

<figure><img src="image_67.png" /></figure>

C

Proteins
previously
encoded in red
plastid

Ochrophyte ancestor

<figure><img src="image_68.png" /></figure>

Chimeric proteins
of endosymbiont
and host origin

<figure><img src="image_69.png" /></figure>

Nucleus

Mitochondrion

Red lineage plastid

Putative green plastid

LGT from green algae

LGT from prokaryotes

Uniquely plastid-targeted proteins

Uniquely mitochondria-targeted proteins

Uniquely other (e.g. ER)-targeted proteins

<figure><img src="image_70.png" /></figure>

Dual mitochondria and plastid-targeted proteins

Different proteins that are nucleus-encoded and plastid-targeted in ochrophytes

Chimeric/fusion plastid proteins

<figure><img src="image_71.png" /></figure>

Proteins of acquired from endosymbiont (regardless of origin)

<figure><img src="image_72.png" /></figure>

Proteins acquired from host (regardless of origin)

Proteins endogenous to red algae

<figure><img src="image_73.png" /></figure>

Proteins endogenous to stramenopile host

<figure><img src="image_74.png" /></figure>

Proteins acquired from green algae

<figure><img src="image_75.png" /></figure>

Proteins acquired from prokaryotes
<figure><img src="image_76.png" /><figcaption>Fig. 1 - figure supplement 1. Overview of eukaryotic diversity.</figcaption></figure>

This figure, adapted from a previous review³, profiles the diversity of different eukaryotic nuclear lineages. Each grey ellipse corresponds to one major clade, or “supergroup” of eukaryotes. A brown ellipse within the stramenopile clade delineates the ochrophyte lineages. Dashed lines denote uncertain taxonomic relationship. For each taxon, a type species (defined either by the presence of a complete genome, extensive transcriptome library, or of particular anthropic significance) is given in brackets. Taxa that lack plastids are labelled in grey, and taxa with plastids are shaded according to the evolutionary origin of that plastid lineage.
<figure><img src="image_77.png" /><figcaption>**Fig. 2- figure supplement 1- Exemplar ochrophyte plastid protein alignments.** This figure shows untrimmed GeneLOUS alignments for two ancestral HPPGs of unusual provenance. In each case the full length of the protein (labelled i) and N-terminal region only (ii) are shown, demonstrating the broad conservation of the N-terminus position. Sequences for which exemplar targeting constructs (*Phaeodactylum tricornutum*, *Nannochloropsis gaditana*, *Glenodinium foliaceum*) are shown at the top of each alignment.</figcaption></figure>

<figure><img src="image_78.png" /></figure>

Key

<figure><img src="image_79.png" /></figure>

ASAFAP motif

<figure><img src="image_80.png" /></figure>

Conserved domain

<figure><img src="image_81.png" /></figure>

Position of PCR reverse primer
<figure><img src="image_82.png" /><figcaption>Fig. 2- figure supplement 2. Tree of ochrophyte glycyl-tRNA synthetase sequences.</figcaption></figure>

This tree shows the consensus unrooted Bayesian topology for a 95 taxa x 487 aa alignment of glycyl tRNA synthetase sequences. The font colour of each sequences corresponds to the taxonomic origin (see legend below for details) and are labelled with the taxonomic identifiers previously defined in Table S1. Sequences labelled with chl_ possess apparent plastid targeting sequences recognisable by CASH lineage plastids. The ancestral ochrophyte plastidic isoform, of apparent chlamydiobacterial origin, is labelled with a blue ellipse. Black circles at each node denote posterior probabilities of 1.0 in Bayesian inferences with three different substitution matrices (GTR, Jones, and WAG), and grey circles indicate posterior probabilities of 0.8 with at least two of these matrices. Support values for all remaining nodes, using both Bayesian and RAxML analysis, is provided in the form

MrBayes posterior probabilities: GTR/Jones/WAG
RAxML best tree likelihoods: GTR/JTT/WAG
<caption>Figure 2- figure supplement 3.
Tree of ochrophyte pyrophosphate
dependent phosphofructo-1-
kinase sequences.</caption>

This tree shows the consensus Bayesian topology inferred for a 94 taxa x 449 aa alignment of pyrophosphate-dependent PFK, with taxa and support values shown as per Fig. 2, figure supplement 2. The ancestral ochrophyte plastid isoform, of probable aplastidic stramenopile origin, is labelled with a cyan ellipse.

<figure><img src="image_83.png" /></figure>
<caption>Figure 2- figure supplement 4. Tree of a novel ochrophyte plastid-targeted protein.</caption>

This tree shows the consensus Bayesian topology inferred for a 16 taxa x 103 aa alignment of a plastid-targeted protein seemingly restricted to ochrophytes and one dinoflagellate lineage. Taxa are labelled and support values are shown as per fig. 2- figure supplement 2.

<figure><img src="image_84.png" /></figure>
<figure><img src="image_85.png" /><figcaption>Fig. 2- figure supplement 5. Multipartite *Phaeodactylum* plastid-targeted proteins. This figure shows the localisation of GFP overexpression constructs for copies of seven proteins from the diatom *Phaeodactylum tricornutum* that are of non-plastid origin, but show multipartite localisation to the plastid and one other organelle (the mitochondria, or in the case of the “ER heat shock protein” to the endoplasmic reticulum).</figcaption></figure>
<figure><img src="image_86.png" /><figcaption>**Fig. 2- figure supplement 6.**Heterologous expression constructs of multipartite plastid-targeted proteins. This figure shows the localisation of GFP overexpression constructs for copies of two proteins from the dinotom *Glenodinium foliaceum* (Panel A), and three proteins from the eustigmatophyte *Nannochloropsis gaditana* (Panel B) that are of non-plastid origin, but show multipartite localisation to the plastid and one other organelle, per Fig. 2, figure supplement 5.</figcaption></figure>
<figure><img src="image_87.png" /><figcaption>**Fig. 2- figure supplement 7. Exemplar control images for confocal microscopy.** This figure shows fluorescence patterns for wild-type *Phaeodactylum tricornutum* cells (i), and transformant *Phaeodactylum* cells expressing GFP that has not been fused to any N-terminal targeting sequence (ii), both visualised under the same conditions used for all other transformant cultures.</figcaption></figure>
<figure><img src="image_88.png" /><figcaption>**Fig. 4- figure supplement 1. Sampling richness associated with ancestral HPPGs of green algal origin.** This figure shows the number of sub-different archaeplastid orthologues for ancestral HPPGs verified by combined BLAST top hit and single-gene tree analysis to be of either green algal origin (green bars) or red algal origin (red bars), for which glaucophyte orthologues could also be identified.</figcaption></figure>
<figure><img src="image_89.png" /><figcaption>**Fig.4- figure supplement 2. Heatmaps of nearest sister-groups of ancestral HPPGs of verified green origin.** This figure shows the specific topologies of single gene trees for HPPGs verified to be of green origin by combined BLAST and phylogenetic analysis. **Panel A** shows a reference topology of evolutionary relationships between green lineages, defined as per Leliaert et al. 2011. Six ancestral nodes that might correspond to the origin point of ochrophyte HPPGs are labelled with coloured boxes. **Panel B** shows the presence and absence of each green sub-category in the immediate sister-group to the ochrophyte HPPG in each single tree of HPPGs of verified origin. HPPGs are grouped by the inferred origin point within the green algae, with the number of HPPGs identified for each origin point given with round brackets.</figcaption></figure>
<figure><img src="image_90.png" /><figcaption>**Fig. 4- figure supplement 3. Specific origins of green HPPGs as inferred from BLAST top hit analyses.** These charts show (i) the number of BLAST top hits against each of the individual green sub-categories from HPPGs for which a green origin was identified both from BLAST top hit and single-gene tree analysis, and (ii) the total number of non-redundant sequences from each green sub-category included in the BLAST library.</figcaption></figure>
**Fig. 4- figure supplement 4. Earliest evolutionary origins of shared plastid residues.** This figure shows the number of residues in the concatenated alignment of HPPGs of verified green origin, which have been subsequently vertically inherited in all major photosynthetic eukaryotes that are present in green algae and ochrophytes, and are not found in red algae and glaucophytes. Residues are divided by inferred origin point, and are shown as per fig. 4, panel D. The values here a calculated as the earliest possible origin point for each uniquely shared residue, in which all gapped and missing positions within the alignment are treated as potential identities. 100 of the 147 residues inferred to have originated within green algae in this analysis originated either within a common ancestor of all chlorophytes, or in a common ancestor of all chlorophytes excluding the basally divergent lineages *Prasinoderma*, *Prasinococcus* and *Nephroselmis*.

<figure><img src="image_91.png" /></figure>
Fig. 4- figure supplement 5. Origins and HECTAR based targeting tests of proteins encoded by conserved ochrophyte gene clusters. Panel A shows the most probably evolutionary origin, identified using BLAST top hit analysis, for 7140 conserved gene clusters inferred to have been present in the last common ochrophyte ancestor. Panel B shows the number of these gene families that are predicted by HECTAR to encode proteins targeted to the plastid, subdivided by probable evolutionary origin, and the number expected to be present in each category assuming a random distribution of plastid-targeted proteins across the entire dataset, independent of evolutionary origin. Categories inferred to be significantly enriched above the expected values are labelled with black arrows.

<figure><img src="image_92.png" /><figcaption>B</figcaption></figure>

<figure><img src="image_93.png" /></figure>
<caption>Fig. 5- figure supplement 1. Reconstructed metabolism pathways and core biological processes in the ancestral ochrophyte plastid.</caption>

This figure tabulates each of the ancestral ochrophyte HPPGs corresponding to 350 central plastid metabolism and other biological processes. The "origin" column shows the probable evolutionary source for each HPPG as defined by combined BLAST tophit and single-gene tree analysis. The origin of each ancestral HPPG is either assigned a "high confidence" value (in which the same origin was robustly supported both by single-gene tree and by BLAST tophit analysis) or a "low confidence" value (in the absence of robust and consistent support through both techniques; corresponding to the tree sister-group if one could be clearly assigned, or the BLAST tophit identity if not). A dash indicates the corresponding protein was not identified in the ancestral HPPG dataset due to either being plastid-encoded or alternative reasons; detailed explanations for the enzymes that are neither plastid-encoded nor detected in the ancestral HPPG dataset are provided in figure supplement 2.

<figure><img src="image_94.png" /></figure>
<table><caption>Fig. 5- figure supplement 2. Core plastid metabolism proteins not identified within the ancestral HPPG dataset.</caption><thead><tr><th>Enzyme</th><th>Pathway</th><th>Distribution</th><th>Probable explanation</th><th>References</th></tr></thead><tbody><tr><td>Sedoheptulose-bis-phosphatase</td><td>CBB cycle</td><td>Multiple isoforms</td><td>Functionally conserved, but with different LGT events in different ochrophyte lineages</td><td>Fig. supplement 3</td></tr><tr><td>Transaldolase</td><td>CBB cycle</td><td>Hypogyristea and diatoms</td><td>Functionally complemented by sedoheptulose-bis-phosphatase/fructose-bisphosphate aldolase</td><td>Kroth et al., 2008</td></tr><tr><td>Isopropylmalate dehydrogenase</td><td>Leucine biosynthesis</td><td>Multiple isoforms</td><td>Functionally conserved, but with different LGT events in different ochrophyte lineages</td><td>Fig. supplement 4</td></tr><tr><td>3-dehydroquinate synthase</td><td>Shikimate biosynthesis</td><td>Multiple isoforms</td><td>Functionally conserved, but with different LGT events in different ochrophyte lineages</td><td>Fig. supplement 5</td></tr><tr><td>Shikimate kinase</td><td>Shikimate biosynthesis</td><td>Multiple isoforms</td><td>Functionally conserved, but with different LGT events in different ochrophyte lineages</td><td>Fig. supplement 6</td></tr><tr><td>APS kinase</td><td>Fe-S cluster biosynthesis</td><td>Not found</td><td>Functionally dispensible; may be complemented by PAPS reductase</td><td>Gutierrez-Marcos et al. 1996</td></tr><tr><td>Magnesium protoporphyrin IX methylmonoester cyclase</td><td>Chlorophyll biosynthesis</td><td>Not found</td><td>Not known to be essential for chlorophyll metabolism outside of green lineage</td><td>Tanaka and Tanaka 2007</td></tr><tr><td>Isopentenyl diphosphate isomerase</td><td>Carotenoid biosynthesis</td><td>Not found</td><td>Dispensible for isoprenoid metabolism</td><td>Ershov et al. 2000; Rohdich et al. 2002</td></tr><tr><td>rps15</td><td>Ribosomal small subunit</td><td>Not found</td><td>Not known outside of green lineage</td><td>Green 2011</td></tr></tbody></table>
<figure><img src="image_95.png" /><figcaption>Red_Bang_Unidentified_sp_CCMP1999_1
Red_Bang_Unidentified_sp_CCMP1999_2
Red_Cyan_Galdieria_sulphuraria_1
Red_Cyan_Galdieria_sulphuraria_2</figcaption></figure>

Red isoform

<figure><img src="image_96.png" /><figcaption>Fig 5 - figure supplement 3.
Tree of ochrophyte sedoheptulose-7-bisphosphatase sequences.</figcaption></figure>

This figure shows the consensus Bayesian topology inferred for a 218 taxa x 303aa alignment of sedoheptulose-7-bisphosphatase sequences, shown as per fig. 2, figure supplement 2. Two different ochrophyte plastid isoforms- one restricted to chrysista, and of probable red algal origin, and one found in hypogyristea and diatoms, of probable green algal origin- are shown respectively by red and green ellipses.

Green isoform
<figure><img src="image_97.png" /><figcaption>Fig. 5- figure supplement 4. Tree of ochrophyte 3-dehydroquinate synthase sequences.</figcaption></figure>

This figure shows the consensus Bayesian topology inferred for a 324 taxa x 387 aa alignment of 3-dehydroquinate synthase, shown as per fig. 2, figure supplement 2. Three ochrophyte plastid isoforms are shown with coloured ellipses: a probable bacterial isoform restricted to pelagophytes and dictyochophytes (blue ellipse), and two isoforms of ambiguous red/green origin found respectively in raphiodophytes and eustigmatophytes, and in diatoms (green ellipses with red borders).
<figure><img src="image_98.png" /><figcaption>Fig5 - figure supplement 5. Tree of ochrophyte isopropylmalate dehydrogenase sequences.</figcaption></figure>

This tree shows the consensus Bayesian phylogeny inferred for a 202 taxa x 592 aa alignment of isopropyl malate dehydrogenase sequences, shown as per fig. 2-figure supplement 2. Two ochrophyte plastid isoforms are shown with coloured ellipses: an isoform of green algal origin restricted to diatoms and hypogyristea (green ellipse), and a red algal isoform found in diatoms, pelagophytes and xanthophytes (red ellipse).
<figure><img src="image_99.png" /><figcaption>**Fig. 5- figure supplement 6. Tree of ochrophyte shikimate kinase sequences**</figcaption></figure>

This figure shows the consensus Bayesian topology inferred for a 127 taxa x 262 aa alignment of shikimate kinase sequences. The WAG Bayesian topology was excluded from the consensus due to non-convergence between the two chains, hence the tree is produced from the consensus of GTR and Jones substitution matrices only, but is otherwise presented identically to fig. 2, figure supplement 2. Two distinct ochrophyte plastid isoforms are shown with coloured ellipses: a green algal isoform conserved across diatoms, dictyochophytes and raphidophytes (red ellipse), and a pelagophyte isoform of uncertain origin (grey ellipse).
<caption>Fig. 5- figure supplement 7. KOG classes associated with different categories of HPPGs.</caption>

These pie charts profile the distribution of different KOG classes across (i) all HPPGs except for those with general function predictions only, or without any clear KOG function, (ii) the same, but restricted to ancestral HPPGs and (iii) the same, for ancestral HPPGs of unambiguous red, green, prokaryotic and aplastidic stramenopile origin as identified by combined BLAST tophit and single-gene tree analysis. KOG classes that occur at elevated frequency in the ancestral HPPG dataset compared to the complete HPPG dataset, and one KOG class enriched in the prokaryotic HPPG dataset compared to the ancestral HPPG dataset (chi-squared test, P< 0.05) are labelled with horizontal arrows.

<figure><img src="image_100.png" /></figure>
Fig. 5- figure supplement 8. Coregulation of genes incorporated into HPPGs of different origin in the model diatom *Phaeodactylum tricornutum*. Panel A shows boxplots of the correlation coefficients between the expression profiles of genes encoding members of ancestral HPPGs of red algal origin (i), green algal origin (ii), prokaryotic origin (iii) or host origin (iv), compared to genes encoding members of other HPPGs. Each HPPG is separated by evolutionary origin on the x-axis of each graph: for example, the box labelled "green algae" on the "red algae" graph shows the correlation coefficients between genes encoding members of ancestral HPPGs of red origin, and ancestral HPPGs of green origin. Panel B shows the P value statistics of mean separation calculated when comparing genes encoding members of ancestral HPPGs of the same origin (shown by row) to members of ancestral HPPGs of different origin (shown by column). For example, the intersect between the "red" row and "green" column shows the difference in mean correlation coefficient between pairs of genes that both encode members of ancestral HPPGs of red origin, and gene pairs of which one encodes an ancestral HPPG member of red origin, and the other an ancestral HPPG member of green origin. None of the P values calculated are significant, i.e. there are no categories of ancestral HPPG in which the internal correlation coefficients of gene expression are any different to those observed across the dataset as a whole.

<figure><img src="image_101.png" /></figure>

<table><thead><tr><th></th><th>Red</th><th>Green</th><th>Prokaryotic</th><th>Host</th></tr></thead><tbody><tr><th>Red</th><td></td><td>0.393</td><td>-0.945</td><td>0.491</td></tr><tr><th>Green</th><td>-0.555</td><td></td><td>-0.780</td><td>0.905</td></tr><tr><th>Prokaryotic</th><td>-0.358</td><td>-0.432</td><td></td><td>0.564</td></tr><tr><th>Host</th><td>-0.925</td><td>0.598</td><td>-0.475</td><td></td></tr></tbody></table>
Fig. 5- figure supplement 9. Coregulation of genes incorporated into HPPGs of different origin in the model diatom *Thalassiosira pseudonana*. Boxplots (Panel A) and P value statistics (Panel B) are shown as per Fig. 5- figure supplement 8. Only two of the correlation value ANOVA tests (comparison of red-red and red-host correlations, and prokaryotic-prokaryotic and prokaryotic-host correlations, shaded in green) reveal a significantly higher correlation coefficient between pairs of genes encoding members of HPPG of the same evolutionary origin than pairs of genes encoding members of HPPGs with different evolutionary origins. These differences most probably reflect the extremely weak correlation coefficients associated with genes encoding HPPGs of host origin to all other genes considered (compare “Host” category on boxplots i, ii and iii to all other categories); however, detailed comparison of the correlation values between genes encoding ancestral HPPGs of host origin and genes encoding ancestral HPPGs of different evolutionary origin (Panel A, boxplot iv; Panel B, bottom row) reveals no specific difference in the pairwise correlation values observed between genes encoding ancestral HPPGs of host origin, and genes encoding ancestral HPPGs of all other origins within the dataset.

A i) Red algae

<figure><img src="image_102.png" /></figure>

iii) Prokaryotes

<figure><img src="image_103.png" /></figure>

ii) Green algae

<figure><img src="image_104.png" /></figure>

iv) Host

<figure><img src="image_105.png" /></figure>

B

<table><thead><tr><th></th><th>Red</th><th>Green</th><th>Prokaryotic</th><th>Host</th></tr></thead><tbody><tr><th>Red</th><td></td><td>0.296</td><td>-0.833</td><td>0.005</td></tr><tr><th>Green</th><td>-0.376</td><td></td><td>-0.564</td><td>0.093</td></tr><tr><th>Prokaryotic</th><td>0.279</td><td>0.473</td><td></td><td>0.019</td></tr><tr><th>Host</th><td>-0.951</td><td>0.478</td><td>0.323</td><td></td></tr></tbody></table>
**Fig. 6- figure supplement 1. Alignments of an ochrophyte-specific riboflavin biosynthesis fusion protein. Panel A** shows alignments of the full length (i) and cyclohydrolase domain only (ii) of a plastid-targeted GTP cyclohydrolase II/ 3,4-dihydroxy-2-butanone 4-phosphate synthase conserved across the ochrophytes. Coloured bars adjacent to each sequence correspond to the phylogenetic identity of the sequence. The cyclohydrolase domain of the ochrophyte protein is positioned in the N-terminal region, and the synthase domain in the C-terminal region. Three uniquely shared residues at the N-terminus of the cyclohydrolase domain confirm that it has been inherited from the aplastidic stramenopile ancestor of the ochrophytes.

A) i) Full sequence length

<figure><img src="image_106.png" /></figure>

ii) Cyclohydrolase domain only

<figure><img src="image_107.png" /></figure>

<figure><img src="image_108.png" /></figure>
<figure><img src="image_109.png" /><figcaption>Fig. 6- figure supplement 2. Origins of ochrophyte plastid 3,4-dihydroxy-2-butanone 4-phosphate synthase. This figure shows the consensus Bayesian topology inferred for a 22 taxa x 206 aa alignment of 3,4-dihydroxy-2-butanone 4-phosphate synthase domains from different lineages, inferred using Jones and WAG matrices, and shown as per fig. 2, figure supplement 2. The ochrophyte plastid isoforms branch with red algal and actinobacterial sequences.</figcaption></figure>
<figure><img src="image_110.png" /><figcaption>Fig. 7- figure supplement 1. Experimental verification of additional ochrophyte dual-targeted proteins. Panel A shows Mitotracker-orange stained *Phaeodactylum tricornutum* lines expressing four additional dual-targeted proteins (glycyl-, leucyl-, and methionyl-tRNA synthetases, and a predicted mitochondrial GroES-type chaperone) from *Phaeodactylum tricornutum*, and a dual-targeted histidyl-tRNA synthetase from *Glenodinium foliaceum*. Panel B shows control images that confirm an absence of crosstalk between GFP and mitotracker: wild-type *Phaeodactylum* cells stained with mitotracker, and cells expressing the *Glenodinium* histidyl-tRNA synthetase-GFP fusion construct and visualised with the mitotracker laser and channel in the absence of mitotracker stain.</figcaption></figure>

<figure><img src="image_111.png" /></figure>
Fig. 7- figure supplement 2. Comparison of different in silico targeting prediction programmes for the identification of dual-targeted ochrophyte proteins. Panel A shows Mitofates scores for ochrophyte proteins verified experimentally to be dual targeted in this and a previous study⁹. Panel B shows Mitofates scores for all ochrophyte proteins for which a subcellular localisation has been identified in previous studies. The red lines in each graph show the Mitofates default cutoff (0.385) and the green lines indicate our chosen cutoff (0.35). Panel C compares different in silico targeting prediction algorithms with respect to predicted mitochondrial localization by experimentally validated localization. Mitofates strikes the best balance between high true positives and low false positives.

A

<figure><img src="image_112.png" /></figure>

B

Mitofates prediction score

<figure><img src="image_113.png" /></figure>

C

<table><thead><tr><th rowspan="2">validated localization</th><th colspan="4">% predicted mitochondrially targeted</th></tr><tr><th>mitofates &gt;0.35</th><th>mitoprot &gt;0.9</th><th>targetP &gt;0.9</th><th>targetP &gt;0.7</th></tr></thead><tbody><tr><td>mitochondrion</td><td>70</td><td>70</td><td>40</td><td>60</td></tr><tr><td>mitochondrion and plastid</td><td>67</td><td>83</td><td>42</td><td>83</td></tr><tr><td>plastid</td><td>4</td><td>11</td><td>0</td><td>2</td></tr><tr><td>PPC</td><td>3</td><td>9</td><td>6</td><td>9</td></tr><tr><td>endomembrane or secreted</td><td>8</td><td>17</td><td>4</td><td>4</td></tr></tbody></table>
**Fig. 8- figure supplement 1. Origin of proteins of ochrophyte origin in different CASH lineages.** This figure profiles the evolutionary origins of proteins inferred by single-gene phylogenetic analysis to have been transferred from the ochrophytes into other lineages that have acquired plastids through secondary or more complex endosymbioses. Proteins are divided into the three major ochrophyte lineages (i.e. diatoms, chrysista, and hypogyristea); all remaining proteins (inferred to have been acquired from an ancestor of multiple ochrophyte lineages, or of ambiguous but clearly ochrophyte origin) are grouped as a final category. The haptophyte proteins that could be attributed to a specific ochrophyte lineage are particularly skewed (100/178 proteins) to origins within the hypogyristea.

<figure><img src="image_114.png" /></figure>
<figure><img src="image_115.png" /><figcaption>**Fig.8- figure supplement 2. Heatmaps of nearest sister-groups to haptophytes in ancestral ochrophyte HPPG trees.** This figure shows the specific ochrophyte lineages implicated in the origin of haptophyte plastid-targeted proteins, as inferred from the nearest ochrophyte sister-groups to haptophytes in trees of 242 haptophyte proteins of probable ochrophyte origin from combined BLAST top hit and single-gene tree analysis. At the top a schematic tree diagram of the ochrophytes is shown as per fig. 1, with six major nodes in ochrophyte evolution labelled with coloured boxes. The heatmap below shows the specific distribution of sister-groups in each tree, shown as per figure 4- figure supplement 2.</figcaption></figure>
<figure><img src="image_116.png" /><figcaption>Fig. 8- figure supplement 3. Internal evolutionary affinities of haptophyte plastid-targeted proteins incorporated into ancestral ochrophyte HPPGs. This figure profiles the evolutionary origins of haptophyte plastid-targeted proteins incorporated into ancestral ochrophyte HPPGs by BLAST top hit analysis. Separate values are provided for query sequences from each of the three haptophyte sub-categories (pavlovophytes, prymnesiophytes, isochrysidales) considered within the analysis. Only sequences for which a consistent origin could be identified by both BLAST top hit and single-gene tree analysis are included. For each haptophyte lineage > 50% of the sequences verified by combined analysis to be of a specific ochrophyte origin have either pelagophyte or dictyochophyte top hits.</figcaption></figure>
<figure><img src="image_117.png" /><figcaption>**Fig. 8- figure supplement 4. Evidence for gene transfer from pelagophytes and dictyochyophytes into haptophytes. Panel A** shows the next deepest sister groups identified for haptophyte proteins of hypogyristean origin in single-gene trees. The pie chart (i) compares the number of single-gene trees in which the combined clade of hatpohyte and hypogyristean proteins resolves within a larger clade comprising the ochrophyte HPPG, compared to the number that resolves in external positions, either with other lineages or as a sister-group to all other sequences within the HPPG clade. Sequences for which no clear next deepest sister group affinity could be identified are listed as "not determined". The heatmap (ii) shows the specific sister-group sequences associated with 65 HPPGs in which the haptophyte sequences specifically resolve with the pelagophyte/ dictyochophyte clade and for which a clear internal or external position for the haptophyte/ hypogyristean group relative to the remaining ochrophyte HPPG clade could be identified. Both analyses indicate a clear bias for haptophyte sequences branching within a deeper ochrophyte clade, not just restricted to the immediate sister-groups. **Panel B** tabulates the BLAST next best hits for haptophyte sequences for which a phylogenetically consistent (>3 consecutive top hits) top hit to hypogyristea could be identified, and pelagophyte/ dictyochophyte sequences for which a phylogenetically consistent top hit to haptophytes could be identified. In each case either the largest number of sequences, or (in the case of pavlovophytes) the joint largest number of sequences for which a phylogenetically consistent next best hit could be identified resolved with diatoms, indicating that these sequences were probably present in a common ancestor of diatoms and hypogyristea, and subsequently transferred to haptophytes.</figcaption></figure>

<figure><img src="image_118.png" /></figure>
Fig. 8- figure supplement 5. Earliest possible origin points of uniquely conserved sites in haptophyte plastid-targeted proteins. This figure shows the total number of residues that are uniquely shared between a 37 proteins that have clearly been transferred between the ochrophytes and haptophytes, and are of subsequently entirely vertical origin, assuming the earliest possible origin point for each residue (i.e. in which gapped or missing positions were interpreted as identities). 87/128 of the uniquely shared residues inferred to originate within the ochrophytes were congruent to gene transfers between the haptophytes and pelagophyte and dictyochophyte clade; of these, slightly more than half (46) are inferred to have originated in a common ancestor of all hypogyristea and diatoms, consistent with the gene transfer having occurred from an ancestor of the pelagophytes and dictyochophytes into the haptophytes, rather than the converse.

<figure><img src="image_119.png" /></figure>
<figure><img src="image_120.png" /><figcaption>**Fig. 8- figure supplement 6. Evolutionary origin of ancestral haptophyte genes.** This figure shows the most likely evolutionary origin assigned by BLASTp top hit analysis to the 12728 conserved gene families inferred to have been present in the last common haptophyte ancestor.</figcaption></figure>
<figure><img src="image_121.png" /><figcaption>Fig. 9- figure supplement 1. Alternative topology tests of plastid genome trees. Tests were performed with the RAxML + JTT trees inferred for the gene-rich (panel A) and taxon-rich (panel B) plastid-encoded protein alignments. In each case, a schematic diagram of the tree topology obtained is given (i). The black box corresponds to the branch position of haptophytes in the consensus tree; alternative branching positions for the haptophyte sequences are labelled with numbered boxes. The table below (ii) lists the probabilities for each alternative position under eight different tests performed with CONSEL. Alternative positions that are not rejected by a topology test are shaded. All possible trees in which the haptophyte sequences branch within the ochrophytes are clearly rejected under all conditions, confirming that its plastid genome is of non-ochrophyte origin. The legend at the bottom of panel B gives full names for each test performed.</figcaption></figure>

<figure><img src="image_122.png" /></figure>

* AU - approximately unbiased test

* NP & BP - bootstrap probabilities for the selection

* PP - bayesian posterior probability (using BIC)

* KH - Kishino-Hasegawa test

* SH - Shimodaira-Hasegawa test

* WKH & WSH - weighted versions of the above two tests
Fig. 9- figure supplement 2. Fast site removal and clade deduction analysis of plastid genome trees. Panel A shows the support values obtained for Bayesian + Jones trees inferred from modified versions of the taxon-rich plastid multigene alignment from which the 13 fastest-evolving site categories had been removed for four different branching relationships pertaining to the placements of haptophyte and hypogyristean sequences. The % of residues from the original alignment retained in each modified alignment are shown with grey bars. Panel B tabulates the support obtained for two different evolutionary relationships (haptophytes as a sister group to all cryptomonads, and as a sister group to all ochrophytes) in gene-rich (i) and taxon-rich (ii) alignments modified to remove all amino acids that occur at different frequencies in haptophytes to ochrophyte lineages, and modified to remove individual or pairs of CASH lineages. "x" indicates that the topology in question was not obtained.

<figure><img src="image_123.png" /></figure>

B

<table><thead><tr><th>Topology</th><th>Tree</th><th>No glycines</th><th>No variant aa</th><th>No diatoms</th><th>No chrysista</th><th>No cryptomonads</th><th>No diatoms + chrysista</th><th>No diatoms + cryptomonads</th><th>No chrysista + cryptomonads</th></tr></thead><tbody><tr><td colspan="10" style="text-align: left; font-weight: bold;">i) Gene-rich alignment</td></tr><tr><td>cryptomonads + haptophytes</td><td>MrBayes</td><td>1</td><td>1</td><td>1</td><td>1</td><td>x</td><td>x</td><td>x</td><td>x</td></tr><tr><td>cryptomonads + haptophytes</td><td>RAxML</td><td>95</td><td>97</td><td>98</td><td>62</td><td>x</td><td>30</td><td>x</td><td>x</td></tr><tr><td>haptophytes + ochrophytes</td><td>MrBayes</td><td>x</td><td>x</td><td>x</td><td>x</td><td>1</td><td>x</td><td>1</td><td>1</td></tr><tr><td>haptophytes + ochrophytes</td><td>RAxML</td><td>x</td><td>x</td><td>x</td><td>x</td><td>100</td><td>x</td><td>100</td><td>100</td></tr><tr><td colspan="10" style="text-align: left; font-weight: bold;">ii) Taxon-rich alignment</td></tr><tr><td>cryptomonads + haptophytes</td><td>MrBayes</td><td>1</td><td>0.84</td><td>1</td><td>1</td><td>x</td><td>x</td><td>x</td><td>x</td></tr><tr><td>cryptomonads + haptophytes</td><td>RAxML</td><td>35</td><td>x</td><td>x</td><td>x</td><td>x</td><td>x</td><td>x</td><td>x</td></tr><tr><td>haptophytes + ochrophytes</td><td>MrBayes</td><td>x</td><td>x</td><td>x</td><td>x</td><td>1</td><td>1</td><td>1</td><td>1</td></tr><tr><td>haptophytes + ochrophytes</td><td>RAxML</td><td>x</td><td>x</td><td>43</td><td>73</td><td>100</td><td>69</td><td>100</td><td>100</td></tr></tbody></table>
<figure><img src="image_124.png" /></figure>

**Fig. 9- figure supplement 3. Single-gene tree topologies associated with individual plastid-encoded genes.** These heatmaps show the first sister-groups identified to haptophytes, and members of the pelagophyte/ dictyochophyte clade, in single-gene trees of component genes included in concatenated trees of plastid-encoded proteins using both the gene-rich (i) and taxon-rich (ii) alignments. Topologies are given for trees inferred with MrBayes using the Jones substitution matrix, and RAxML trees inferred using JTT, under the same conditions as the multigene trees. The identity of the first sister-group is shaded according to the legend given below. Only three single-gene trees (labelled with black arrows) support any sister-group relationship between haptophytes and the pelagophyte/ dictyochophyte clade; however, in each case (explained beneath the legend) this topology is not robustly supported, either due to polyphyly of one of the constituent lineages, or conflicting topologies identified via alternative methods.

<figure><img src="image_125.png" /></figure>
**Fig. 10- figure supplement 1. Complex origins of different ancestral ochrophyte HPPGs Panel A** shows the evolutionary positions of lineages with histories of secondary endosymbiosis in trees of ancestral ochrophyte HPPGs verified by combined BLAST top hit and single-gene tree analysis to be either of red algal (i) or green algal origin (ii). In both cases, in more than half of the constituent trees, haptophyte and cryptomonad sequences resolve as closer relatives to the ochrophytes than the red or green algal evolutionary outgroup, either due to resolving in the ochrophyte HPPG or forming a specific sister-group to the ochrophyte lineages. **Panel B** plots the distribution of cryptomonads (i) and haptophytes (ii) in trees for different categories of ancestral ochrophyte HPPG of verified evolutionary origin. HPPGs of green algal origin more frequently show internal or sister positions for the cryptomonad sequences than all other categories of HPPG, and in more than 50% of cases resolve internal or sister positions for the haptophyte sequences. This might be consistent with a green algal contribution in the endosymbiotic ancestor of cryptomonad, haptophyte and ochrophyte plastids.

A

i) Red algal HPPGs

<figure><img src="image_126.png" /></figure>

Red algae- absent/ undefined

Red algae-external to ochrophytes

Red algae-sister to ochrophytes

Red algae- internal to ochrophytes

ii) Green algal HPPGs

<figure><img src="image_127.png" /></figure>

Green algae-absent/ undefined

Green algae-external to ochrophytes

Green algae-sister to ochrophytes

Green algae- internal to ochrophytes

B

i) Cryptomonads

<figure><img src="image_128.png" /></figure>

Undefined

External

Sister to ochrophytes

Internal

ii) Haptophytes

<figure><img src="image_129.png" /></figure>

Undefined

External

Sister to ochrophytes

Internal

Prokaryotes
Green algae
Aplastidic stramenopiles
Red algae
<figure><img src="image_130.png" /><figcaption>**Fig. 10 -figure supplement 2. Different scenarios for the origins of haptophyte plastids.** This schematic tree diagram shows different possibilities for the origins of the haptophyte plastid as predicted from the data within this study. No inference is made here regarding the ultimate origin of the ochrophyte plastid, although it is noted that the ochrophyte, cryptomonad and haptophyte plastids are likely to be closely related to one another within the red plastid lineages. First, a common ancestor of the pelagophytes and dictyochophytes was taken up by a common ancestor of the haptophytes (point 1), yielding a permanent plastid that contributed genes for a large number of plastid-targeted proteins in extant haptophytes. This plastid was subsequently replaced via serial endosymbiosis (point 2) yielding the current haptophyte plastid and plastid genome. This serial endosymbiosis event either involved a close relative of extant cryptomonads (2A) or a currently unidentified species that forms a sister-group in plastid gene trees to all extant ochrophytes, but is evoluitonarily distinct from the pelagophytes (2B). It is possible that the haptophyte plastid may have been acquired through the secondary endosymbiotis of a different lineage of red algae to the ochrophyte, either via a cryptomonad intermediate (2C) or directly (2D).</figcaption></figure>