Sample analysis code