Various scripts and functions for chemical analysis