sam=$1
bedgraph=$(echo $sam | sed 's/.bam/.split.bedgraph/g')
bw=$(echo $sam | sed 's/.bam/.split.bw/g')


#echo "make index file"
#samtools index $1
echo "Create BedGraph coverage file"
#/data/hannon/gordon/usr/bin/genomeCoverageBed -split -bg -ibam $1 -g /data/zhang/makerman/SMA/EXPR/out.merge/clean/mm9/mm9_chromInfo.txt > $bedgraph
echo "Convert the BedGraph file to BigWig"
/data/hannon/gordon/usr/bin/bedGraphToBigWig $bedgraph /data/zhang/makerman/SMA/EXPR/out.merge/clean/mm9/mm9_chromInfo.txt $bw
