Created
February 20, 2013 15:38
-
-
Save klmr/4996432 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env bash | |
source ~/.config/extpaths # For samtools | |
set -e | |
set -u | |
n=0 | |
for bam in $*; do | |
out="${bam%.bam}.bgr.gz" | |
let n=n+1 | |
echo "$bam $out" | |
bsub -J test-$n " | |
echo 'track type=bedGraph' > \"$out\" | |
samtools view \"$bam\" | while read qname flag chr pos mapq cigar rnext pnext tlen seq; do | |
let start=\$pos-1 | |
end=\$pos+\${#seq} | |
echo \"\$chr \$start \$end\" | |
done | gzip -c >> \"$out\"" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment