indir=$1

batchID=`basename $indir`
sample=$indir/sample

fusion_stat_file=$indir/${batchID}_fusion_count_stat.txt
for i in `cat $sample`;do cat $indir/${i}/${i}_fusion_stat.txt;done | head -n1 > $fusion_stat_file;
for i in `cat $sample`;do cat $indir/${i}/${i}_fusion_stat.txt;done | grep -v Sample >> $fusion_stat_file;

QC_stat_file=$indir/${batchID}_QC_stat.txt
for i in `cat $sample`;do cat $indir/${i}/${i}_QC_stat.txt;done | head -n1 > $QC_stat_file;
for i in `cat $sample`;do cat $indir/${i}/${i}_QC_stat.txt;done | grep -v Sample >> $QC_stat_file
