A method and apparatus for preparation of a substrate containing a plurality of sequences. Photoremovable groups are attached to a surface of a substrate. Selected regions of the substrate are exposed to light so as to activate the selected areas. A monomer, also containing a photoremovable group, is provided to the substrate to bind at the selected areas. The process is repeated using a variety of monomers such as amino acids until sequences of a desired length are obtained. Detection methods and apparatus are also disclosed.