Question: How to extract bigWig signal for a given bed file?
import pyBigWig bw = pyBigWig.open("some_file.bw") for line in open("foo.bed"): cols = line.strip().split() vals = bw.values(cols, int(cols), int(cols)) # Do something with the values... bw.close()
bigWigToBedGraph from UCSC genome browser at http://hgdownload.soe.ucsc.edu/admin/exe/, just pick the compiled version that suites you. Usage:
bigWigToBedGraph - Convert from bigWig to bedGraph format. usage: bigWigToBedGraph in.bigWig out.bedGraph options: -chrom=chr1 - if set restrict output to given chromosome -start=N - if set, restrict output to only that over start -end=N - if set, restict output to only that under end -udcDir=/dir/to/cache - place to put cache for remote bigBed/bigWigs