scripted munging of BAM files