Function library for clustering qMS dta