#!/usr/bin/perl
use warnings;

$PATH="/lustre/scratch103/sanger/team145/NA1850x_trio/MAPPING/NA1850x_trio/";

for ($i=1;$i<13;$i++){
system("bsub -o logs/NA18506".$i."_split.o -q long \"samtools index NA18506/$i.release.bam;\"");
}

#system("bsub -o logs/NA18506_X_split.o -q longl \" samtools flagstat NA18506/X.release.bam > NA18506/X.release.bam.flagstat; samtools index NA18506/X.release.bam\"");


for ($i=3;$i<17;$i++){
system("bsub -o logs/NA18507".$i."_split.o -q long \"samtools index NA18507/$i.release.bam;\"");
}

#system("bsub -o logs/NA18507_X_split.o -q long \" samtools flagstat NA18507/X.release.bam > NA18507/X.release.bam.flagstat; samtools index NA18507/X.release.bam\"");

#for ($i=1;$i<23;$i++){
#    system("mv NA18508/NA18508.$i.release.bam NA18508/$i.release.bam");
#system("bsub -o logs/NA18508_".$i."_split.o -q long \"samtools index NA18508/$i.release.bam;\"");
#}
#    system("mv NA18508/NA18508.X.release.bam NA18508/X.release.bam");
#system("bsub -o logs/NA18508_X_split.o -q long \" samtools index NA18508/X.release.bam\"");
