Script to process reads