  We propose a method to generate `genetically-modified' (GM) initial
conditions for high-resolution simulations of galaxy formation in a
cosmological context. Building on the Hoffman-Ribak algorithm, we start from a
reference simulation with fully random initial conditions, then make controlled
changes to specific properties of a single halo (such as its mass and merger
history). The algorithm demonstrably makes minimal changes to other properties
of the halo and its environment, allowing us to isolate the impact of a given
modification. As a significant improvement over previous work, we are able to
calculate the abundance of the resulting objects relative to the reference
simulation. Our approach can be applied to a wide range of cosmic structures
and epochs; here we study two problems as a proof-of-concept. First, we
investigate the change in density profile and concentration as the collapse
time of three individual halos are varied at fixed final mass, showing good
agreement with previous statistical studies using large simulation suites.
Second, we modify the $z=0$ mass of halos to show that our theoretical
abundance calculations correctly recover the halo mass function. The results
demonstrate that the technique is robust, opening the way to controlled
experiments in galaxy formation using hydrodynamic zoom simulations.
