Created
October 22, 2013 11:39
-
-
Save mtw/7099129 to your computer and use it in GitHub Desktop.
Convert BAM to BigWig coverage (useful for visualization in UCSC Browser)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# generate coverage profiles | |
vis="./vis" | |
chromsizes="foo.chrom.sizes" | |
genomeCoverageBed=`which genomeCoverageBed` | |
bedGraphToBigWig=`which bedGraphToBigWig` | |
if ! [ -d "$vis" ]; | |
then | |
mkdir -p $vis | |
echo "created $vis" | |
fi | |
set -x | |
for BAM in $(ls *.bam) | |
do | |
$genomeCoverageBed -ibam $BAM -bg -g $chromsizes > $vis/$BAM.bg | |
$bedGraphToBigWig $vis/$BAM.bg $chromsizes $vis/$BAM.bw | |
done | |
set +x |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment