anacal find chemical composition from elemental analysis results
doc generated from the script with gendoc
bash script, version=1.05


anacal [options] file[.ea] [max_dev]


clean up after swallowing edited internals and exit
show this help and exit
show full help and exit
show version and exit


This script, with the --install option, compiles and installs a binary anacal in $PREFIX/bin, with documentation in $PREFIX/{man,pdf,html}. To this end, it creates anacal.c, Makefile, and a directory tests with input files for testing. These can be removed by calling the script with the --clean option. Any changes in the files will be stored back in the script. So if you have applied any changes, run me with the -c option, and then with the -I option to install the changes.

About the installed binary anacal: Given, for a chemical composition:

anacal calculates compositions for all combinations of the candidate molecular formulas and reports the combinations for which the average deviation between calculated and measured element percentages is better than the value given by the second argument, 1% by befault.

Input is taken from file.ea, output is written to stdout. The extension .ea is automatically appended to the input file.

Run without parameters for help.


The input file should have the following structure (numbers are line numbers):
a title line
elementsymbol followed by percentage for each element determined
bruto formula's of the possible components, one per line;
comments may be added with the #-character; remaining characters up to end-of-line are skipped.

Sample input file (case sensitive):

   6718 DEBO 145
   C54.53 H6.31 N8.10 S14.48
   C15 H20 N2 O3 S
   C11 H16 N2 O S
   C4 H12 N2 S2
   C2 H4 O S
   H Cl#hydrochloric acid
   H2 O#water


Wybo Dekker


Released under the GNU General Public License