Skip to content

Instantly share code, notes, and snippets.

@jl32587
Forked from taoliu/bdg2bw
Created June 17, 2014 16:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jl32587/34370c995460f9d5ad65 to your computer and use it in GitHub Desktop.
Save jl32587/34370c995460f9d5ad65 to your computer and use it in GitHub Desktop.
#!/bin/bash
# check commands: slopBed, bedGraphToBigWig and bedClip
which slopBed &>/dev/null || which bedtools &>/dev/null || { echo "slopBed/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
slopBed -i ${F} -g ${G} -b 0 | bedClip stdin ${G} ${F}.clip
bedGraphToBigWig ${F}.clip ${G} ${F/bdg/bw}
rm -f ${F}.clip
@hwrichards
Copy link

Hi, I'm using bdg2bw and I'm getting this error:

* Input error: Chromosome chrX doesn't present in the .genome file. *
needLargeMem: trying to allocate 0 bytes (limit: 17179869184)

Previously the error was for chrY. I removed all of the chrY entries in the bdg file and go this. I presume if I remove chrX the error will be a different chromosome. If the notion is that there are no chrY or X or whichever chromosome is not present in my genome file is ridiculous. Of course they are (or I couldn't have removed them!) I've used bdg2bw countless times and never had an error. I get no unusual errors after alignment (either bowtie or bowtie2) or after peak calling (either MACS or MACS2). I'm at my wits end. Any suggestions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment