User Interface Features
- Rotate and zoom into molecules
- Save and open molecule data files
- Basic numerical data display (e.g. Molar mass)
- Different viewing options: Ball-and-stick/Space-filling/skeletal, color filters that visualize data, etc.
- Display parts of molecules as color-coded "packages" (convex hulls) for conceptual organization (e.g. highlight nucleic acids in DNA or sugar units in starch)
- Crystals: Diamond, Salt, etc.
- Nucleic Acids: Adenine, Uracil, DNA fragments like the TATA Box, etc.
- Organic Chemicals: Hydrocarbons, Benzene, EDTA, etc.
- Proteins: Every amino acid and an alpha-chain
- Sugars: Glucose, Starch, Cellulose
- ... and many more
- Glade 3.6.7 with GTK+
- Glasgow Haskell Compiler, GHC 6.10.3 (yes, I know this is quite old)
- gtk2hs 0.10.1
Atoms and Bonds
Data in Color
Densities are calculated by dividing by the cube of the atomic radius.
A little bit of chemistry here: four of EDTA's oxygen atoms carry a negative charge: they show as black under the charge filter because they have a "low charge". Together with the nitrogen atoms (blue when no filter), these six atoms "capture" metal ions ("M" in the diagram on the right) and prevent them from reacting with other compounds.
This property makes EDTA useful for dissolving metal oxides and reducing water hardness in laundry (metal ions make water hard), among other applications.
hmol can handle single, double and triple bonds between atoms, as well as "intermolecular forces" (represented as "dotted bonds" in the snapshots of DNA).
Convenient subroutines build macromolecules out of atoms and smaller molecules:
- alkane (from Molecule.hs) constructs an alkane of any desired length.
- polymerize (from MoleculeBuilder.hs) chains some copies of a specified molecule together by connecting specified bonds end-to-end.
- crystallize2D and crystallize3D (from MoleculeBuilder.hs) lays out an 2D or 3D array of a chosen molecule and connects the specified bonds to form a sheet or crystal.
- transcribeToSingleHelix and transcribeToDoubleHelix (from NucleicAcids.hs) synthesizes a DNA fragment from a given nucleic acid sequence (the "Human Telomeric Repeat" pictured at the very top comes from the sequence "TTAGGG".)
- proteinAlphaHelix (from Proteins.hs) chains a given sequence of amino acids into an alpha helix.
Several strands link side-by-side to confer additional strength.
2 Special Algorithms
The positions of the orbitals were usually based on usual geometries—four orbitals would be displayed with a tetrahedral geometry. But sometimes strange bond angles are necessary, such as for proline, an amino acid with an unusual pentagonal carbon ring. This forces the bond angle within the pentagon to be 108° instead of the approximately 109.5° bond angle of tetrahedral carbon atoms.
I used some Haskell tricks to make programming easier, but they take long to explain so I'll save them for another post.
Hmol is licensed under the GNU General Public License Version 3. Redistribution of this work, with or without modification, is permitted if Cheng Herng Yi is attributed as the original author of this work, but not in any way that suggests that Cheng Herng Yi endorses you or your use of the work.