Sample preparation for analytical methods