Flex - display of molecular models
Michael Pique, Andy Arvai, and Tom Macke
The Scripps Research Institute, formerly Scripps Clinic, MB-5
La Jolla CA 92037
(619) 554-9775 mp@scripps.edu
You may reproduce, use, and modify the files in these directories
provided you retain the credits and acknowledgements.
Flex displays stick-figure molecular models on a Sun Workstation, Stardent,
or (when high speed isn't needed) any X.11 workstation.
A control panel allows adjustment of viewing style. Pressing and holding
the left or middle mouse buttons while dragging in the window rotates.
Pressing and dragging in the "Recenter" window changes your viewpoint.
If rocking or rolling are turned on, pressing and dragging in the "Rock and
Roll" window adjusts the amount and direction of rocking and rolling (spinning).
On some machines, the view style can be changed to include spheres, ribbons,
ball-and-stick, atom labels, and stereo.
Input files are of four types:
1. "pdb": Protein Data Bank. Also called "Brookhaven Format", these
are fixed-column ASCII files that define the static structure
of a protein, nucleic acid, or non-polymer molecule.
Flex makes bonds from atoms by distance: atoms in different
"chains" (column 22) or atoms separated by "TER" lines
are never bonded together. Flex looks only at PDB record
types "atom", "hetatm", "ter", and "end" (lower or upper case),
and the residue, chain, and atom fields for labels,
and only uses the atom type (columns 13-16) and position fields.
Some versions of Flex use atom types to set
color and sphere radii, and to find mainchain atoms for ribbons.
Here is some sample input.
ATOM 19 HN THR 2 15.386 10.901 4.600
ATOM 20 HOG THR 2 14.161 9.481 4.420
ATOM 21 N CYS 3 13.507 11.238 8.398
ATOM 22 CA CYS 3 13.659 10.715 9.763
ATOM 23 C CYS 3 12.265 10.443 10.307
HETATM 99 FE XXX 4 33.265 10.443 10.307
^col 1 ^col 13 ^ col 30 ^col 39 ^col 47
See "demo" directory "dna.pdb" for an example.
2. "stacked pdb": two or more PDB files concatenated with "END"
lines in between them. Flex animates this file as a series
of molecular positions. For an example, see
demo/data_peptide_folding/peptide_folding.pdb
3. "binpos": binary file of positions copied from a stacked pdp file.
using the "pdbtobinpos" utility. You still need to give
one ASCII pdp file for flex to get atom types from.
Example: flex -binpos simulation.binpos first_frame.pdb
4. "bnd": bond file (given as -bnd FILE): a list of integer atom
numbers, two per line, that specify what atoms are bonded
to each other. This overrides flex's normal distance-bonding.
5. "vib": vibration file (given as -vib FILES..): a two-number
header giving the mode number and frequency for a vibration
mode, then three floating point values (x,y,z) per atom.
These "vib" files go with a specific PDB file to tell how
the atoms vibrate. See the demo directory files
demo/demo_vibrating_protein for examples.
Other Flex options include:
-c X Y Z : center viewing region on point specified.
-rot MATRIX: use matrix (3x3 floats) as initial viewing matrix.
-n or -netg: read no PDB files but wait listening to a network socket
(see Tom Macke's FFE program). You can use -port INT to change.
-xgl: on Sun workstation versions, use the XGL library calls.
This is currently the default, but does not work on monochromes.
-xlib or -noxgl: use X.11 Xlib calls instead of XGL calls. Slower, but
for now (Sept. 1991) required for monochrome Suns I'm afraid.
-stereo or -s: Stardent Titans and Stellar only: stereo (requires the
Tektronix plate, or StereoGraphics or Atari or Sega glasses).
-bs: bond sequential: generates bonds to connect all atoms in sequence.
-count INT: override default of 1 for "show counter" initialization.
-update INT: set upper limit on number of updates, for running demos.
These demo scripts in the demo directory exercise Flex:
demo_vibrating_protein - shows a vibrating protein molecule
demo_dna - shows a static DNA structure
demo_peptide_folding - shows a Cray-calculated folding simulation
Flex runs under the X Window System including under Sun's OpenWindows and
on color Suns (especially GX and GS) uses Sun's XGL for acceleration.
The XGL version has color but the raw Xlib one (run with -xlib flag) doesn't,
and doesn't have display ribbons although the menu comes up anyway. Sorry.
The Xlib version uses the freely-available XView toolkit and runs on
DECstations and Stardents. See README file for more info.
IMPORTANT NOTE: to run "xview_sun4/flex" on monochrome systems, right now you
* MUST * specify the "-xlib" flag. I'm still working on getting this recognized
automatically. You can use the script "flex.sh" in the demo directory
to control this as well as to select between SunView and X versions on Suns.
Under OpenWindows, if Flex seems to hesitate and stall, try closing or
quitting any "perfmeters" you're running, or change their update cycle
to 10-15 seconds. Each time they update they seem to freeze the screen.
Flex runs under SunView in memory-buffered monochrome on monochrome displays,
in software-double-buffered monochrome on 8-bit single-buffered color displays,
and in hardware-double-buffered monochrome on double-buffered color displays.
The old SunView versions are frozen and will be retired eventually.
Good luck and have fun. This is only a start at a real molecular graphics
system. Flex also runs on the Sun TAAC-1 application accelerator, so get in
touch if that's useful to you. We have networkable front-ends to
drive Flex from other applications, including Amber, Discover, and Sybyl.
Let me know of bug fixes and improvements. I am out of my league in X.11
so any hints and corrections will be genuinely welcome.
-- Michael Pique