Onsite sample preparation