batch processing for samples