Last active
November 18, 2015 00:38
-
-
Save crazyhottommy/b38bed2fa9d7060806e4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
for bam in *bam | |
do | |
echo $bam | |
genomeCoverageBed -ibam $bam -bg -g hg19.genome.info > $(basename $bam .bam).bdg | |
done | |
for bdg in *bdg | |
do | |
echo $bdg | |
bdg2bw $bdg hg19.genome.info | |
done |
This file contains hidden or 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 | |
# this script is from Tao Liu https://gist.github.com/taoliu/2469050 | |
# check commands: slopBed, bedGraphToBigWig and bedClip | |
which bedtools &>/dev/null || { echo "bedtools not found! Download bedTools: <http://code.google.com/p/bedtools/>"; exit 1; } | |
which bedGraphToBigWig &>/dev/null || { echo "bedGraphToBigWig not found! Download: <http://hgdownload.cse.ucsc.edu/admin/exe/>"; exit 1; } | |
which bedClip &>/dev/null || { echo "bedClip not found! Download: <http://hgdownload.cse.ucsc.edu/admin/exe/>"; exit 1; } | |
# end of checking | |
if [ $# -lt 2 ];then | |
echo "Need 2 parameters! <bedgraph> <chrom info>" | |
exit | |
fi | |
F=$1 | |
G=$2 | |
bedtools slop -i ${F} -g ${G} -b 0 | bedClip stdin ${G} ${F}.clip | |
bedGraphToBigWig ${F}.clip ${G} ${F/bdg/bw} | |
rm -f ${F}.clip | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment