\subsection*{Multifarious DNA tile system design.}

Prior theoretical proposals\autocite{Murugan2015-ps,Zhou2015-ym} for multifarious mixtures require each component to accept multiple strongly binding partners at each binding site. However, in DNA tile assembly, each binding site can usually only bind its Watson-Crick complement, and not an arbitrary set of other domains.
Hence, we used an alternate approach: we assumed three structures made of entirely unique tiles and ran a merging algorithm that attempted to reuse tiles in a roughly checkerboard pattern across structures. The algorithm accepted merges if consequences for unintentional binding between other tiles were minimal. After determining the abstracted shared and tile layout in this way, we designed DNA sequences reflecting this layout. 


The three target shapes were drawn on a 24 $\times$ 24 single-stranded tile (SST) molecular canvas\autocite{wei_complex_2012}, at an abstract level, with each location in each shape initially a being unique tile with four abstract binding sites referred to as `glues'. (After sequence design, matching glues will correspond to binding pairs of complementary sequence domains.) Edges of the shapes used a special `null glue' that is intended to have no valid binding partner.  In total, this initial design had 2,706 glues, and 1,456 tiles. The three shapes were then processed through a `merging' algorithm that attempted to reuse the same tiles in different shapes.  Randomly choosing two tiles in two different shapes (with null glues on the same sides of each tile, if any), each step of the algorithm attempted to make the two tiles identical by reusing the same four glues in both, and propagating the changes in the glues to all places they occurred within all shapes, starting with the neighboring tiles (e.g., \efigref{extfig:merging}[a]).  To avoid having these changes create undesired growth pathways, for example, allowing chimera of multiple shapes, the modified set was checked after each trial merging step for two criteria from algorithmic self-assembly (\efigref{extfig:merging}[b]).  The self-healing criterion requires that, for any correct subassembly of any shape, while attachments of the wrong tile for a particular location may take place by one bond, only the correct tile can attach by two or more bonds\autocite{winfree_self-healing_2006}.  The second-order sensitivity criterion requires that, for any correct subassembly of any shape, if an incorrect attachment by one bond takes place, the incorrectly attached tile will not create a neighborhood where an additional incorrect tile can attach by two bonds, and thus the initial error will be likely to fall off\autocite{evans_optimizing_2018}.  These two criteria, which are trivially satisfied when every tile and bond is unique to a particular location, continue to be satisfied after each merging step. Thus, we ensure that there is at least a minimum barrier to continued incorrect growth in a regime where tile attachment by two or more bonds is favorable, and attachment by one bond is unfavorable, which is the case close to the melting temperature of most DNA tile assembly systems\autocite{winfree_simulations_1998,evans_physical_2017}.

The algorithm repeatedly merged tiles that satisfied the two criteria until no further acceptable merges were possible.  As each merge could affect the acceptability of later merges by changing the glues around each tile, in order to guide the algorithm toward a sequence of merges more likely to be compatible, the algorithm was initially restricted to considering an alternating `checkerboard' subset of tiles, which, apart from edges, were likely to be merge-able. After exhausting possible merges of these subsets, the algorithm then attempted merges using all tiles in the system.  After repeating this stochastic algorithm multiple times, and selecting the system with the smallest number of tiles, the final resulting system had 698 binding domains and 917 tiles, with 371 of tiles shared between at least two shapes (\efigref{extfig:merging}[c]).



After the assignment of abstract binding domains to each tile by the merging algorithm, the sequences for the binding domains, and thus tiles themselves, were generated using the sequence design software of Woods and Doty et al\autocite{woods_doty_diverse_2019}.  Tiles used a standard SST motif, with alternating 10 and 11 nt binding domains, designed to have similar binding strengths. Following Woods and Doty et al\autocite{woods_doty_diverse_2019}, we set a target range of -8.9 to -9.2~kcal/mol for a single domain at 53\,\ensuremath{^\circ\text{C}}\xspace, which was between the melting temperature and growth temperature for their system.  Null binding domains on the edges of shapes, not intended to bind to any other tiles, were assigned poly-T sequences.

\subsection*{Models of nucleation.}

To model the dependence of the nucleation rates of the three shapes on patterns of unequal concentration, we developed a simple nucleation model based on the stochastic generation of possible nucleation pathways and critical nuclei.  The model estimates nucleation rates by analyzing stochastic paths generated in a greedy manner by making single-tile additions starting from a particular monomer in the system. At each step, all favorable attachments are added and then an unfavorable attachment is performed with probability weighted by the relative free-energy differences of the available tile attachment positions. When multiple favorable attachments are available, the most favorable attachment is made deterministically. This procedure is repeated for many paths over all possible initial positions within the shape considered, and the barrier (highest free energy state visited in `growing' a full structure) is recorded for each path. A nucleation rate is estimated by assuming an equilibrium occupation of this barrier state (Arrenhius' approximation \autocite{frenkel}) and summing over the kinetics of the available attachments from this state. See \efigref{extfig:nucleation} and \sisgm for a detailed discussion.  The approximations here could be improved by running fully reversible simulations, e.g., using Forward Flux Sampling \autocite{Allen2005-ve}.


\subsection*{Fluorophore labels, DNA synthesis, and growth.}

Sites for fluorophore and quencher modifications were chosen to avoid edges, modify only unshared tiles, and provide a reasonable distribution of locations on each shape.  Fluorophores were chosen for spectral compatibility and temperature stability\autocite{you_measuring_2011}.  ROX, ATTO550, and ATTO647N were paired with Iowa Black RQ, and FAM was paired with Iowa Black FQ.  Both fluorophore and quencher modifications were made on the 5' ends of tiles; to sufficiently co-localize fluorophores and quenchers, one tile in the label pair used a reversed orientation (\figref{fig:flagscan}[a]).  Fluorophore labels are discussed in detail in \sifluorophores.

Tiles without fluorophore or quencher modifications were ordered unpurified (desalted) and normalized to 400~\ensuremath{\text{\textmu M}}\xspace in TE buffer (Integrated DNA Technologies).  Strands with fluorophore or quencher modifications were ordered HPLC-purified and normalized to 100~\ensuremath{\text{\textmu M}}\xspace. 
Individual tiles were mixed, in the concentration patterns used for experiments, using an Echo 525 acoustic liquid handler (Beckman Coulter). Samples used TEMg buffer (TE buffer with 12.5~mM~MgCl$_2$) in a total volume of $\sim$ 20~\ensuremath{\text{\textmu L}}\xspace.  Flag experiments used a 50~nM base concentration of unenhanced tiles, and an 880~nM concentration of enhanced concentration tiles, while pattern recognition experiments employed tiles with nominal concentrations between 16.67~nM to 450~nM, which were then quantized into ten discrete values to simplify mixing and conserve material (see \sipatmix).  Fluorophore and quencher-modified tile locations always had tiles mixed at the lowest concentration used in the experiment.
Given that unpurified synthetic oligonucleotides typically have less than 40\% to 60\% of the molecules being full length, it is remarkable (though consistent with Woods and Doty et al\autocite{woods_doty_diverse_2019}) that this did not prevent successful pattern recognition by nucleation.

For flag experiments, and pattern recognition of trained images, four samples were prepared per concentration pattern: one sample for each shape with all four fluorophore labels on only that shape, to monitor growth of multiple regions on each shape, and an additional sample with one fluorophore on each shape: ROX, ATTO550 (`five'), and ATTO647N (`six') on H, A, and M respectively.  For pattern recognition of test images, for experiment size reasons, only the lattermost sample was prepared.\setbox0\vbox{\autocite{xgrow}\autocite{schulman_programmable_2009}}


After transferring 20~\ensuremath{\text{\textmu L}}\xspace to PCR tubes, samples were grown in an mx3005p quantitative PCR (qPCR) machine (Agilent), in order to provide a program of controlled temperature over time while monitoring fluorescence.  Growth protocols began with a ramp from 71\,\ensuremath{^\circ\text{C}}\xspace to 53\,\ensuremath{^\circ\text{C}}\xspace over 40 minutes to ensure any potentially preexisting complexes were melted, and then a slower ramp from 53\,\ensuremath{^\circ\text{C}}\xspace to an initial growth temperature at 1\,\ensuremath{^\circ\text{C}}\xspace per hour.  At this point, three different protocols were used.  For constant temperature flag growth experiments, the growth temperature was 47\,\ensuremath{^\circ\text{C}}\xspace, and this was held for 51 hours.  For temperature ramp flag growth, the initial growth temperature was 48\,\ensuremath{^\circ\text{C}}\xspace, which was reduced over 100 hours to 46\,\ensuremath{^\circ\text{C}}\xspace.  For pattern recognition, a ramp from 48\,\ensuremath{^\circ\text{C}}\xspace to 45\,\ensuremath{^\circ\text{C}}\xspace over 150 hours was used.  For constant temperature experiments, fluorescence readings were taken every 12 minutes, and for other experiments, every 30 minutes.  After the growth period, temperature was lowered to 39\,\ensuremath{^\circ\text{C}}\xspace at 1\,\ensuremath{^\circ\text{C}}\xspace per 26 minutes.  See \sitprots for temperature protocols plotted as a function of time. Because of the small sample size and long experiment duration, great care to avoid evaporation was necessary.  Once protocols were finished, samples were stored at room temperature until ready for AFM imaging.

AFM imaging was performed using a FastScan AFM (Bruker) in fluid tapping mode.  To achieve better images, two techniques were combined: sample warming to prevent nonspecific clumping of structures, and washing with Na-supplemented buffer to prevent smaller material, such as unbound, single DNA tile strands, from adhering to the mica surface.  Each sample was diluted 50x into TEMg buffer with an added 100~mM~NaCl, then warmed to approximately 40\,\ensuremath{^\circ\text{C}}\xspace for 15 minutes.  50~\ensuremath{\text{\textmu L}}\xspace of the sample mix was deposited on freshly-cleaved mica, then left for two minutes.  As much liquid as possible was pipetted off of the mica and discarded, then immediately replaced with Na-supplemented buffer again, and mixed by pipetting up and down.  This washing process of buffer removal and addition was repeated twice with added-Na buffer, then once with TEMg buffer to remove remaining Na, before imaging was performed in TEMg buffer.  As adhesion of DNA to mica is dependent upon the ratio of monovalent and divalent cations in the imaging buffer, this process was meant to ensure that unbound tiles were removed during the washing process where Na and Mg were present, while imaging itself took place with only Mg, so that the lattice structures would be more strongly adhered to the surface, resulting in better image quality.

\subsection*{Fluorescence and AFM data analysis.}

Fluorophore signals are known to be affected by extraneous factors such as temperature, pH, secondary structure, and the local base sequence near the fluorophore\autocite{you_measuring_2011}, which complicates quantitative interpretation of absolute fluorescence levels.
Our own control experiments also illustrated effects due to partial assembly intermediates as well as due to the total amount of single stranded DNA in solution (\sifluorophores).
For this reason, the fluorescence of each fluorophore was normalized to the maximum raw fluorescence value of that fluorophore in that particular sample, and the \emph{time} at which the fluorescence signal decreased by 10\% was then 
used as a measure of the extent of nucleation that appears less sensitive to these artifacts (\efigref{extfig:fluorophores}).
The duration between the point of 10\% quenching and the end of the growth segment of the experiment was defined as the `growth time' for that fluorophore label; the growth time was defined as 0 in the event of quenching never reaching 10\%.  For concentration patterns with four samples with different fluorophore arrangements, the total growth time of a shape was defined as the average of the growth time of the five total fluorophore labels on the shape across the four samples (four in the shape-specific sample, and one in the each-shape sample), while for concentration patterns with only one sample, the growth time of the corresponding fluorophore label was used.  As the position of the fluorophore within the shape, relative to where nucleation occurs, has a substantial influence on growth time measurements, the considerable variability in these measurements relative to the true nucleation kinetics must be acknowledged.

For flag experiments, AFM imaging was done only for qualitative confirmation of the selective nucleation and growth indicated by fluorescence results.  For pattern recognition and equal-concentration experiments, however, shapes in AFM images were uniformly quantified.  At least one sample of each of the patterns had three 5 $\times$ 5 $\mum$  images taken under comparable conditions.  The sample corresponding with each image was blinded, and structures were counted independently by each of the four authors, classifying structures as either ``nearly complete'' or ``clearly identifiable'' examples of each of the three shapes.  For the purposes of analysing pattern-dependent nucleation and growth, no clear distinction between the number of nearly complete and clearly identifiable shapes was found, and so the two categories were summed.  Counts were averaged across the three images, then averaged across the counts of the four authors, to obtain a count per shape per 25 $\mum^2$ region for each pattern. 
Each author used their own, subjective, interpretation of ``nearly complete'' and ``clearly identifiable'' structures, and the total number of structures counted in each image differed by up to $\pm 50\%$ for different authors.  However, the ratios of different shapes in each image counted by each author remained within 5\% of the mean ratios for most images, and across all images, no author had a bias of more than $\pm 4\%$ toward identifying a particular shape more or less often than average.


To measure the selectivity of patterns, the fraction of on-target shape growth time, and AFM counts, compared to the sum of shape growth times and AFM counts, was used.  The total growth times, and total AFM counts, of the on-target shapes were used to measure overall shape growth.
 





\subsection*{Pattern recognition training.}

Images for pattern recognition were selected from several sources, rescaled to 30 $\times$ 30, discretized to 10 grayscale values, and adjusted so that the number of pixels with each value was consistent across all images (see \siimages for details).  Each pixel's grayscale value, $0 \le p_n \le 1$, was converted to the concentration $c_i$ for the corresponding tile $t_i$ using an exponential formula, $c_i = c e^{3\;p_n\ln 3}$, where the base concentration is $c=16.67$~nM. The intention of the numbers used was to make the average tile concentration 60~nM for each image.  As each image had 900 pixels and there are 917 tiles in the system, 17 tiles did not have their concentrations set by any pixel; these tile concentrations were uniformly set to the lowest concentration, and the assignment of these tiles was used to ensure that fluorophore label locations did not vary in concentration.

The tile-pixel assignment was optimized through a simple hill-climbing algorithm, starting from a random assignment, where random modifications to the assignment map are attempted at each step and accepted if the move increases the efficacy of the map. This efficacy was quantified through a heuristic function that accounts for relative nucleation rates, location of nucleation sites (with emphasis given to locations that succeeded in the flag experiments shown in \figref{fig:flagscan}[d]), and satisfaction of constraints related to the fluorescent reporters. Because the nucleation algorithm described above is costly, a simplistic model of nucleation based upon the Boltzmann-weighted sum of concentrations over a $k \times k$ window swept over each structure (similar to the model employed in Zhong et al\autocite{zhong_associative_2017}) was used to evaluate relative nucleation rates for a majority of the optimization steps. The more detailed but computationally costly model described above was then employed for an additional several hours in hopes of improving the mapping.  The window-based nucleation model (along with all constraints about nucleation location and fluorescent reporters) is also employed to explore the capacity of this map training procedure in \efigref{extfig:capacity}.  Details of the pattern recognition training and the window-based nucleation model are discussed in \sialltraining.




\printbibliography[segment=2,check=onlynew]

\end{methods}

\begin{addendum}
	\item[Acknowledgements.]
	We thank Michael Brenner, Jehoshua Bruck, Aaron Dinner, David Doty, Deborah K. Fygenson,  Stanislas Leibler, Richard M. Murray, Lulu Qian, Paul W. K. Rothemund, Petr \v{S}ulc, Chris Thachuk, Grigory Tikhomirov, Damien Woods, and Zorana Zeravcic.  Ting Zhu, Thomas Ouldridge, Salvador Buse, Matthew Alexander, Mohini Misra, Anna Lapteva also provided valuable feedback on early drafts.
   \item[Funding.]
	   Supported by National Science Foundation grants CCF-1317694 and CCF/FET-2008589, 
	   the Evans Foundation for Molecular Medicine, 
	   European Research Council grant 772766, Science Foundation Ireland grant 18/ERCS/5746,
	   and the Carver Mead New Adventures Fund.
JOB, AM were primarily supported by the University of Chicago
Materials Research Science and Engineering Center, which is funded by National
Science Foundation under award number DMR-2011854. AM acknowledges support from the Simons Foundation.
   \item[Author Contributions.]
	   CGE, EW, AM conceived the study.
	   CGE and EW designed the molecules.
	   CGE, JOB, EW, AM wrote simulation code, designed the experiments and performed the experiments, analyzed the data and wrote the manuscript.
   \item[Competing Interests.] 
	   The authors declare that they have no competing financial interests.
   \item[Correspondence.] 
	   Correspondence should be addressed to \texttt{cge@dna.caltech.edu},
	   \texttt{jdobrien07@gmail.com}, 
	   \texttt{winfree@caltech.edu}, or \texttt{amurugan@uchicago.edu}.
   \end{addendum}
   
\renewcommand\thefigure{E\arabic{figure}}    
\setcounter{figure}{0}

\begin{figure*}[ht]
\centering
\includegraphics[width=6.1in]{Figures/extfig0-hopfield-vs-sham.pdf}
\caption{\textbf{Parallels and differences between neural network models and self-assembly models as exemplars of collective behavior.}
In this rough metaphor, a neuron corresponds to a tile.  While Hopfield networks allow full connectivity, multifarious self-assembly (like place cell networks) restricts connectivity to a superposition of grids with different unit permutations.  The state of a Hopfield network consists of the set of active neurons, while the state of an assembly consists of the set of tiles present and their arrangement, which is restricted to be connected.
The energy of a state is a quadratic function governed by synaptic weights $w_{i,j}$ and biases $b_i$ for neural activities , or for assemblies, by directional binding energies $J^\delta_{i,j}$ for tiles $i$ and $j$ at positions $p$ and $p'$ that are neighbors in direction $\delta$, along with tile chemical potentials $\Theta_i$.
An environment presents a sequence of outside influences driving system state.
Learning in Hopfield networks occurs any time neurons are simultaneously active; for self-assembly, they must also be located next to each other.
Qualitative system behaviors depend on the number of memories being stored and the operating temperature, including phases where system state randomizes (paramagnetic / disoriented / dissolved), gets locked in a spurious local minimum (spin glass / random aggregation), or successfully retrieves learned memories.
Due in large part to the restrictions on connectivity, the capacity of place cell networks and multifarious self-assembly is less than for the Hopfield model.
See \sineural for details and discussion.}
\label{extfig:neural}
\end{figure*}


\begin{figure*}[ht]
\centering
\includegraphics{Figures/extfig1-tileassignment.pdf}
\caption{\textbf{Proofreading tile set design and tile assignment map.}
\textbf{a,} Our systems are designed to grow in a regime where a tile attaching by at least two bonds is favorable, but a tile attaching by one bond is not (`threshold 2').   Motivated by self-healing tile systems~\autocite{winfree_self-healing_2006}, we seek a tile set where no correct partial assembly should ever allow an undesired tile to attach by two or more bonds, though undesired attachments by one bond are allowed, such that any favorable attachment to a partial assembly will be correct. 
\textbf{b,} In addition to tiles attaching favorably by $2$ bonds to growing facets, new facets in the system will only be created by tiles attaching unfavorably by one bond, and then being stabilized by further, favorable growth.  
At a site where tile $T$ would correctly attach by one bond, a tile $U$ might be able to attach incorrectly by the same bond.  $T$ would correctly be stabilized by the subsequent attachment of $V$ by two bonds, but $U$ might be able to be stabilized as well if there is a tile $W$ that can attach to it and shares the same glue as $V$.  
Thus, if for every pair of tiles that can bind to each other (e.g., $T+V$), there is no other pair of binding tiles (e.g., $U+W$) that share two glues on the same edges of the tiles, then any tile that attaches by one bond to an assembly will either be the correct tile, or will not allow a subsequent attachment, and will likely detach.
This is equivalent to `second-order sensitivity' with all directions treated as inputs, functioning as a form of `proofreading'~\autocite{evans_optimizing_2018,winfree_proofreading_2004}.
\textbf{c,} We created a multifarious tile system by first starting with three shapes constructed entirely of unique tiles, then repeatedly attempting to `merge' tiles in different shapes by constraining the sequences of their domains to be identical, and checking whether each merge of two tiles results in a tile system that does not have any tile pairs violating criteria in \textbf{a} and \textbf{b}. \textbf{d,}
From multiple trials of the merging process, each initially favoring a checkerboard arrangement before attempting more general merges, we selected the smallest result containing 917 tiles.
DNA sequences for tiles in the system were designed with the single-stranded tile (SST) motif\autocite{yin_programming_2008}, with two alternating tiles motifs of 11~nt and 12~nt domains (tile sequences and full shape layouts are shown in \sitiles).}

\label{extfig:merging}
\end{figure*}



\begin{figure*}[ht]
\centering
\includegraphics{Figures/ExtFig2-proofreading-mod-alpha.pdf}
\caption{\textbf{Suppression of chimeric growth through tile set design.}
\textbf{a,} We use simulations to contrast assembly errors in three distinct tile sets: the proofreading tile set with an inert boundary used in experiments, described in \figref{fig:multifarious} \textbf{(a, top)}; %
a simple checkerboard tile set with a strictly alternating shared and unique tile pattern for each shape, where %
unique tiles can be seen as mediating different interactions between shared tiles \textbf{(a, middle)}; and an edge-guarded checkerboard in which we additionally enforce inert bonds around each shape's perimeter \textbf{(a, bottom)}.
For each tile set, we performed kinetic growth simulations, starting from a pre-formed $5\times 5$ seed taken from a location within H.
Simulations were performed using the kinetic Tile Assembly Model as implemented by XGrow (with chunk fission) \autocite{xgrow} with uniform tile concentrations corresponding to 62 nM and parameters estimated in \siktam.
\textbf{b,} Schematic illustrates various desired and undesired growth pathways for A, along with representative AFM images taken from the A flag 1 experiment
(\siAflag1).  Two distinct kinds of chimeric structures were seen in simulation as the result of promiscuous interactions: chimeric structures can grow either before full assembly of the target structure (e.g., part-A, part-M) or emerge spontaneously from the edge of a properly formed structure (e.g. full-A, part-H). Chimeras like those illustrated along the lower path are held together by just a few bonds and sometimes can quickly break apart (tiles with unintended bonds are shown in red); these result in sharp drops in simulated assembly size, as the simulation discards one subassembly when disconnected. 
Note that chimeric growth was not observed experimentally, possibly as a result of effective experimental system design; however, many observed structures failed to complete the upper right and/or lower left corners, or appeared to have suffered a spiral growth defect.
A possible explanation for the missing corners, which is also seen in H and M, is supported by coarse-grained molecular dynamics simulations of SST lattice curvature (\sioxDNA).  Spiral defects were not seen in H or M and are presumably due to the interior hole in A.
\textbf{c--e,} The size of the assembly (in units of the size of the fully formed H) is shown as a function of time. 
For higher temperature 48.9\,\ensuremath{^\circ\text{C}}\xspace (\textbf{c}), no chimeras are observed on the simulated timescales for any tile set. For intermediate temperature 47.2~\ensuremath{^\circ\text{C}}\xspace (\textbf{d}), all 6 checkerboard trajectories still result in chimeras, while no errors are observed on the timescale probed for the guarded checkerboard or experimentally-implemented proofreading tile set. 
For lower temperature 45.5\,\ensuremath{^\circ\text{C}}\xspace (\textbf{e}), chimeras are seen in all runs for checkerboard structures (red traces), 4 of the 6 runs for guarded checkerboard structures (green traces) and 1 of the 6 runs for proofreading structures.
}
  \label{extfig:errorsims}%
\end{figure*}


\begin{figure*}
    \centering
    \includegraphics{Figures/extfig4-nucleation.pdf}
    \caption{%
\textbf{Stochastic Greedy Nucleation Model, based on repeated stochastic simulations.}
\textbf{a,} The frequently-used kinetic Tile Assembly Model (kTAM)~\autocite{winfree_simulations_1998,evans_physical_2017} has rates for tile attachment and detachment events based on tile and assembly diffusion and total binding strength of correct attachments a tile can make at a lattice site.  Here $u_0 = 1$~M.
\textbf{b,} These rates can be used to derive a free energy for any tile assembly in a system, and, assuming fixed monomer concentrations, an equilibrium concentration for any assembly. Schulman \& Winfree \autocite{schulman_programmable_2009} showed that the equilibrium concentration of the highest-energy assembly along a nucleation trajectory under this assumption provides an upper bound for nucleation rate through that trajectory, with or without fixed monomer concentrations.
However, in a large system, considering all possible intermediate assemblies and all pathways, including many that are extremely unlikely, would be infeasible.  
Thus, we developed the Stochastic Greedy Nucleation Model to generate stochastically-chosen paths of tile attachments.  
\textbf{c,} Starting from a single tile (chosen with probability proportional to relative concentration), whenever the assembly is in a state $A_\mathrm{stable}$ where there is no tile attachment that would be favorable (have $\Delta G < 0$), one of the possible unfavorable (with $\Delta G \geq 0$) attachments is stochastically chosen, resulting in a higher-$G$ state $A_\mathrm{unstable}$. Then, all subsequent possible $\Delta G < 0$ attachments are made, resulting in the next $A'_\mathrm{stable}$ state; for our system of unique tiles for each site in the lattice, this sequence of favorable steps has a unique resulting assembly.  
\textbf{d,} The process repeats until all tiles in a shape are attached, which results in a trajectory with a maximum-$G$ assembly that can be used to bound the rate of nucleation, $\eta^+$, through that particular trajectory.  
\textbf{e,} By using this process to collect many trajectories, and then repeating the entire process for each of the three shapes in the system, we can estimate nucleation rates dependent upon temperature, with the assumption that tile monomer concentrations do not deplete, and that the trajectories found are a reasonable representation of likely trajectories.
For comparison between model predictions and experimental data in \efigref{extfig:flags}[d] and \ref{extfig:patterns}b, 
we determined the temperature at which the model predicted the nucleation rate exceeded a threshold (orange line), to compare with when fluorescence quenching exceeded a threshold. 
For details on the SGM model, see \sisgm.
\textbf{f,} To study the winner-take-all effect, we use a simplfied CRN model (shown here) and a more detailed model based on (but simpler than) the SGM; see \siwtacrn.
}
\label{extfig:nucleation}
\end{figure*}

\begin{figure*}
    \centering
    \includegraphics{Figures/extfig3-labels.pdf}
    \caption{\textbf{Fluorophore quenching as a measure of nucleation and growth.}  
    \textbf{a,} Fluorescent labels used a fluorophore-quencher pair placed on the $5'$ ends of two modified tiles unique to one shape, where they were co-located, but had no complementary binding domains, ensuring that dimers could not form, and trimers would not closely co-locate the fluorophore and quencher.  To constrain the pair to be close enough to quench in a well-formed lattice, one of the two tiles had its orientation and crossover position swapped compared to the unmodified tile for the location.
    \textbf{b,} Positions and types of all fluorophore/quencher pairs available for use.  For one sample, one position for each of four types of fluorophores could be chosen, and tile pairs for those locations replaced by their modified counterparts.  Thus different samples could probe different arrangements of up to four locations; four arrangements were used in experiments (e.g., in \textbf{e}). 
    \textbf{c,} Expected behavior of fluorophore labels on shapes as one shape nucleates and grows.  
    \textbf{d,} Fluorescence data for non-quenching (fluorophore tile only, orange) and quenching ($5\times 5$ lattice around fluorophore and quencher tiles, blue) controls for the ATTO647N fluorophore/quencher pair on A. Here, the temperature ramps linearly from $49\,\ensuremath{^\circ\text{C}}\xspace$ to $35\,\ensuremath{^\circ\text{C}}\xspace$  at a rate of $0.1\,\ensuremath{^\circ\text{C}}\xspace/\text{min}$, with all tiles at 50~nM, and each sample has its fluorescence normalized to its maximum value independently.
    \textbf{e,} An example of fluorescence growth time measurements (Mockingbird; see \simockingbird).
    Each fluorophore signal, in each sample, is independently normalized to its maximum value during the experiment, and the time between the point where the signal goes below 0.9 (``10\% quenching'') and the end of the experiment is measured (``growth time'').
    These times are then summed for all fluorophores, in all four samples, on each shape, resulting in a growth time for each shape, and, when normalized to the sum of all growth times, a relative growth time for each shape.
    See Methods and \sifluorophores\ for design and characterization of the fluorescence readout method, as well as an estimate of the melting temperature of H.
    }
    \label{extfig:fluorophores}
\end{figure*}







\begin{figure*}
    \centering
    \includegraphics{Figures/extfig5-flags.pdf}
    \caption{\textbf{Nucleation and growth with `flag' patterns of enhanced concentration.}
    \textbf{a--c,} 36 different concentration patterns with enhanced concentrations of shared tiles in $5\times 5$ regions were prepared, each with four different standard sets of fluorophores in four samples, and grown using two temperature protocols (\textbf{a}): a ramp focusing on $48\,\ensuremath{^\circ\text{C}}\xspace$ to $46\,\ensuremath{^\circ\text{C}}\xspace$ over 100 hours, and a hold at $47\,\ensuremath{^\circ\text{C}}\xspace$. 
    Using growth times as described in \efigref{extfig:fluorophores}, fluorescence data for many samples in both experiments showed preference for the desired shapes (\textbf{b, c}), but with considerable variation in selectivity and total amount of growth.  %
    \textbf{d,} No statistically significant correlation was found between the nucleation model prediction for temperature of on-target nucleation and the time of on-target shape quenching in the temperature ramp experiment.  
    \textbf{e--g,} Details of three patterns, with concentration patterns (1), weighted critical nucleus free energy starting from particular tiles (2), nucleation-model-estimated nucleation rates (3), temperature hold (4) and temperature ramp (5) experiment fluorescence results, and (6) AFM images from the temperature hold experiments. Information for all individual flag patterns is available in the \siflagdata.    }
    \label{extfig:flags}
\end{figure*}


\begin{figure*}[ht]
\begin{center}
\includegraphics{Figures/ExtFig6_expandWTAPanel-redone.pdf}
\caption{\textbf{Evidence of winner-take-all in flag experiments.} \textbf{a,} An example flag pattern (A flag 12), and uniform 50 nM concentration `no flag' pattern. \textbf{b,} Fluorescence normalized to maximum readings, from the temperature ramp experiment (\efigref{extfig:flags} and \siflagdata).  The fluorescence at the end of the experiment, $F_{p,s,f}$, of fluorophore $f$ in sample $s$ of pattern $p$ is used along with the value for the corresponding fluorescence value for the no flag pattern, $F_{\mathsf{no\, flag},s,f}$, to calculate the ratio $M_{p,s,f}$.  This ratio corresponds to the relative amount of quenching for that fluorophore in the flag pattern compared to the no flag pattern.  The ratios are averaged across the 5 on-target fluorophores (circled in \textbf{b}) in samples for the flag pattern to obtain an average on-target ratio, and across the 10 off-target fluorophores to obtain an average off-target ratio.  \textbf{c,} The on- and off-target ratios are plotted for each flag pattern.  For winner take all behavior, on-target quenching is expected to be higher with a flag pattern than with no flag, resulting in $F_p^{\mathsf{on\,target}} > 1$, while off-target quenching is expected to be reduced, resulting in $F_p^{\mathsf{off\,target}} < 1$. \label{extfig:wta}}

\end{center}
\end{figure*}



\begin{figure*}
    \centering
    \includegraphics{Figures/ExtFig9-capacity-mod.pdf}
    \caption{\textbf{Pattern recognition capacity.} To analyze the pattern-recognition capabilities of the designed tile set, the map-training algorithm (see \simaptraining) was run for increasingly larger sets of random images. 
    \textbf{a-c,} Example images mapped to concentration patterns for sets with 1, 12, and 18 trained images per shape, with the intended target shape for each image indicated.  Following the same procedure as used for the experimental system, with the same weighting of locations, $30\times 30$ images with 10 possible grayscale values and matching histograms were mapped exponentially to tile concentrations in the 917 tile system; however, all images were generated randomly.  Training was done using only the Window Nucleation Model with a window size $k$ of either 2, 4, or 6, with a limit of 400,000 steps (\siwindow).  For each number of images per shape considered, ten repetitions of training (starting from random assignments) were performed (to account for variability of the training algorithm) for each of three different sets of images (to account for variability in sets of images).
    \textbf{d,} As the number of images in the set increases, the performance of the training algorithm decreases. For larger $k$, the pixel-tile map can exploit higher-order correlations and can thus accommodate more images.  For each system, nucleation rates were calculated using the Stochastic Greedy Model, described in \sisgm, at $\ensuremath{G_{\mathrm{se}}}=5.4$, which roughly corresponds to a temperature of 48.6\,\ensuremath{^\circ\text{C}}\xspace, and with concentrations comparable to the experimental system.  Selectivity was calculated as the nucleation rate of the target shape for each image divided by the total nucleation rate of all three shapes for that image, averaged over all images in the system, and over all 30 systems (10 repetitions for each of 3 sets of images) for each point, with 90\% confidence intervals shown.  Star shows specificity calculated from nucleation model results for the experimentally-implemented system.
    \textbf{e,} As the number of images increases, pattern recognition must increasingly rely on patterns of concentrations of shared tiles, rather than choosing a pixel-to-tile map that places high-concentration pixels on tiles unique to the target shape.  Histograms show average concentrations of tiles in different shapes or combinations of shape
    (including the average across tile categories)
    for images in training cases \textbf{a--c}, and the experimental system.  The change can also be seen in the concentration maps of \textbf{a--c}, with the sharp checkerboard of high concentration tiles in target shapes in \textbf{a} becoming less apparent in \textbf{b} and \textbf{c}.
    }
    \label{extfig:capacity}
\end{figure*}

\begin{figure*}
    \centering
    \includegraphics{Figures/extfig8-patterns.pdf}
    \caption{\textbf{Classification of images viewed as concentration patterns.}  36 different concentration patterns, derived from a mapping of 36 grayscale images, were run using a ramp between 48\,\ensuremath{^\circ\text{C}}\xspace to 45\,\ensuremath{^\circ\text{C}}\xspace over approximately 150 hours.
    \textbf{a,} Three pattern examples, with source image, concentration pattern, nucleation model nucleation rate starting from particular tiles, nucleation model nucleation rates, fluorescence results, and AFM images. \textbf{b,} Across all patterns there was some correlation between the on-target nucleation temperature predicted by the nucleation model and on-target shape quenching time. \textbf{c,} Total AFM shape counts for each sample.  Information for all patterns is available in the \sipatterndata.} %
    \label{extfig:patterns}
\end{figure*}





\end{document}
