Although this is not what you asked, I thought I'd mention that you
can do this with molecules too. (...using moltemplate. Never one to
let an opportunity pass without pushing moltemplate!)
For reference, the following moltemplate example creates a lipid
bilayer containing only one kind of lipid:
lipids = new DPPC
[32].move(7.5, 0, 0)
[37].move(3.75, 6.49519, 0)
[2].rot(180, 1, 0, 0)
(This creates a 3-dimensional array containing 32x37x2=2368 "DPPC"
molecules. The move() and rot() commands move them into a 2-D
hexagonal lattice with two layers. Of course, you must define the
"DPPC" molecule.)
Now to mix two different types of molecules together (for example
"DPPC" and "DLPC") you could do it this way:
lipids = new random([DPPC,DLPC], [0.5,0.5])
[32].move(7.5, 0, 0)
[37].move(3.75, 6.49519, 0)
[2].rot(180, 1, 0, 0)
The results (after periodic boundary conditions are applied) are shown here:
http://lammps.sandia.gov/images/moltemplate/DPPC+DLPC_bilayer32x37_t=0ps.jpg
(These are simplified coarse-grained lipids with yellow and green head groups)
Note: the list of numbers [0.5,0.5] specify the probabilities. You
can also specify an random-seed, for example: "random([DPPC,DLPC],
[0.5,0.5], 12345)"
You can do this with more than two types of molecules, and you can do
this with 1-dimensional or 2-dimensional arrays as well. For example,
the next example makes a polymer (a 1-dimensional array) out of a
random mixture of 50 "2bead" and "3bead" monomers.
monomers = new
random([2bead,3bead],[0.6,0.4])
[50].rot(180,1,0,0).move(2.95, 0, 0)
(See attached pictures.)
For more complex packing geometries, you can use a combination of
PACKMOL and moltemplate:
http://www.moltemplate.org/examples/vesicle_Brannigan2005+Bellesia2010.html
(Forgive me if you have seen all these examples before. I show these
pictures a lot.)
I think you can do similar things with other molecule builder tools too.
Cheers!
Andrew