This is a test version of Biostars. For the public version, visit https://www.biostars.org.
quantify signal in a chromosomal interval in different .bw files

hi there,

I have several bigwig files that have been normalized. is there a way to obtain the value for the signal present in a certain chromosomal interval?

I just want to get a value of the total signal between 2 chromosomal coordinates, and possibly do that for several intervals.

chip-seq bw bigwig

5 answers

One way:

Convert bigWig to Bedgraph:

$ bigWigToBedGraph signal.bw signal.bedgraph

Convert Bedgraph to BED:

$ awk '{ \
    if ($1 ~ /^chr/) { \
        print $1"\t"$2"\t"$3"\tid-"NR"\t"$4; \
    } \
}' signal.bedgraph > signal.bed

Get the total or summed signal over the region-of-interest via BEDOPS bedmap --sum:

$ echo -e "chrN\t1234\t2345" | bedmap --echo --sum - signal.bed > answer.bed

Other statistical operations are available; see bedmap --help.

If you have multiple regions of interest, you can put them into one BED file and do the map step on that file:

$ bedmap --echo --sum regions-of-interest.bed signal.bed > answer.bed

bigWigToBedGraph

Download bigWigToBedGraph from: http://hgdownload.cse.ucsc.edu/admin/exe/

You can pass genomic coordinates like this:

$ bigWigToBedGraph -chrom=chr1 -start=123 -end=456 input.bw output.bedGraph

bwtool

Ming Tang suggests trying bwtool. For example, have a look at the summary function. I haven't tried this tool, but it looks promising.

check bw-python https://github.com/brentp/bw-python

Deeptools bigwigCompare would probably do the trick.

can you tell me how you do it?

Log in to answer this question.