MolSys molecular model file format ------------------------------------------- This is the format of .MLS molecule fragment files produced by MolSys. It will be primarily of interest to those who wish to convert molecule files to and from MLS format. The format describes type #6 MLS files only. This is the format used by the current version of MolSys. The file format : (13 bytes) "MolSys XXXXX" terminated with a zero byte. Only the first 6 bytes are checked by MolSys to determine if the file is correct. "XXXXX" depends on the source of the file. Files saved from MolSys will have "vX.YZ" where X.YZ if the version of MolSys which produced the file. e.g. "MolSys v0.74\0" (At least 2 bytes) String containing the name of the fragment terminated by a line feed ($0A) and a zero byte. e.g. "Cyclohexane\n\0" (1 word) Number of atoms in the fragment, in Motorola format. (1 byte) $06, denoting a type 6 molecule file. Then, for each atom, repeated for the number of atoms: (1 byte) The atom type, see table below. (3 * 8 bytes) The X, Y and Z co-ordinates of the atom, in nanometers, in a fixed point format (see below). (1 word) The number of the 1st atom to which this atom is bonded. (1 word) The number of the 2nd atom to which this atom is bonded. (1 word) The number of the 3rd atom to which this atom is bonded. (1 word) The number of the 4th atom to which this atom is bonded. A maximum of 4 atoms may be bonded to each atom. If less than 4 bonds are needed, the unused words are set to -1. Atom numbering starts at 0 and is given by the position of the atom in the file. (4 bytes) 4 bytes reflecting the types of the bonds above. 1=single, 2=double, 3=triple, 0=unbonded. (1 byte) $4D, indicating end of atom. MolSys checks this byte after reading each atom to ensure that the file has not become corrupt. ------------------------------------------------------------------------------ The atom types: Type no. Symbol No. of bonds Atom 0 0 1 Site type 0 1 1 1 Site type 1 2 2 1 Site type 2 3 3 1 Site type 3 4 C 4 Carbon >C< 5 C 3 Carbon >C= 6 C 2 Carbon ðC- 7 C 2 Carbon =C= 8 O 2 Oxygen -O- 9 O 1 Oxygen =O 10 O 1 Oxygen -Oÿ 11 N 3 Nitrogen -N< 12 N 2 Nitrogen -N= 13 N 1 Nitrogen ðN 14 N 4 Nitrogen >N+< 15 P 4 Phosphorus =Pó 16 S 2 Sulphur -S- 17 S 4 Sulphur >S® 18 H 1 Hydrogen -H 19 F 1 Fluorine -F 20 Cl 1 Chlorine -Cl 21 Br 1 Bromine -Br 22 I 1 Iodine -I Fixed point format: This format represents a fixed point number in 8 bytes and is used for the atom co-ordinates. The bit layout is: Bit 63: Sign bit, 0 +ve, 1 -ve Bits 62-0: Absolute value of the co-ordinate, with an implicit binary point between bits 47 and 48. Thus co-ordinates are stored such that the maximum possible size of the molecule is 65536 nm (about the size of a human chromosome) and to a resolution of about 4e-15 nm. Example file: The example given is that of a molecule of water, consisting of 3 atoms in a file of 143 bytes. Hex: Description: 4D6F 6C53 7973 2076 302E 3734 00 "MolSys v0.74\0" 5761 7465 7220 2848 324F 290A 00 "Water (H2O)\n\0" 0003 3 atoms in fragment 06 Type #6 file ----------------------------------------Start of atom 0: 08 Type 8 atom (Oxygen -O-, 2 bonds) XXXX XXXX XXXX XXXX X-coord YYYY YYYY YYYY YYYY Y-coord ZZZZ ZZZZ ZZZZ ZZZZ Z-coord 0002 0001 FFFF FFFF Bonded to atoms 2 and 1 01 01 00 00 2 single bonds, 2 unused bonds 4D End of atom marker ----------------------------------------Start of atom 1: 12 Type 18 ($12) atom (Hydrogen -H, 1 bond) XXXX XXXX XXXX XXXX X-coord YYYY YYYY YYYY YYYY Y-coord ZZZZ ZZZZ ZZZZ ZZZZ Z-coord 0000 FFFF FFFF FFFF Bonded to atom 0 01 00 00 00 One single bond 4D End of atom marker ----------------------------------------Start of atom 2: 12 Type 18 ($12) atom (Hydrogen -H, 1 bond) XXXX XXXX XXXX XXXX X-coord YYYY YYYY YYYY YYYY Y-coord ZZZZ ZZZZ ZZZZ ZZZZ Z-coord 0000 FFFF FFFF FFFF Bonded to atom 0 01 00 00 00 One single bond 4D End of atom marker This is the format of type #6 MLS files, as used by v0.74 of MolSys. Previous versions of MolSys used a slightly different format with the atom co-ordinates stored as floating point numbers. These new files are designed to be more portable to the PC version of MolSys, PMS. R.M. 16/09/92