#!/usr/bin/perl -w 
@list = qw(
1A_50
1B_51
1C_52
1D_53
);

foreach $a (@list){
system("samtools view -Sb hs$a.sam > tmp.bam");
system("samtools sort tmp.bam > hs$a\_sorted.bam");
system("samtools index hs$a\_sorted.bam");
system("bedtools bamtobed -bed12 -i hs$a\_sorted.bam > hs$a\_sorted.bed ");

}

