#!/bin/tcsh

set arch=`uname -m`
set progPath=/nfs/team71/psg/ygu/pub/solexaHybrid_v1.2/alignTool/bin.$arch

set assembly=SpA.dbs

foreach i (bwa-sam-ref.out smalt-sam-ref.out)
	set sam = `echo $i | sed 's/\.out//'`
	$progPath/samtools-0.1.3/samtools faidx $assembly
	$progPath/samtools-0.1.3/samtools import $assembly.fai $sam.out $sam.bam
	$progPath/samtools-0.1.3/samtools sort $sam.bam $sam.srt
	/software/badger/bin/tg_index -b $sam.srt.bam -o $sam.gap5
end

