Analyzing a sample