Question: Converstion of BED with scores into bigWig
gravatar for Leszek
2.9 years ago by
IIMCB, Poland
Leszek3.9k wrote:

I have some profiles with scores in BED format and I would like to convert them into bigWig format to visualise these data in jBrowse.

9    35084375    35084376    ENSDART00000000004    160.9480969    -
9    35060460    35060461    ENSDART00000000005    752.3776435    +
4    14148184    14148185    ENSDART00000000019    5226.62898     -
2    50770137    50770138    ENSDART00000000042    3513.471655    -

Typically (genomeCoverageBed + bedGraphToBigWig), the intervals from BED file are summed up into bigWig, but this is not what I want. I would like the scores from BED to be visible directly in bigWig track. 

Can you recommend me some way of converting such BED in bigWig? 


scores conversion bigwig bed • 6.8k views
ADD COMMENTlink modified 2.9 years ago by michael.ante2.5k • written 2.9 years ago by Leszek3.9k
gravatar for michael.ante
2.9 years ago by
michael.ante2.5k wrote:

You can use awk to get a bedgraph:

awk '{printf "%s\t%d\t%d\t%2.3f\n" , $1,$2,$3,$5}'' myBed.bed > myFile.bedgraph

In case the BED file was not sorted properly:

sort -k1,1 -k2,2n myFile.bedgraph > myFile_sorted.bedgraph

Finally, use the UCSC bedGraphToBigWig tool:

bedGraphToBigWig myFile_sorted.bedgraph myChrom.sizes

Beware of the naming conventions (sometimes you need to add a chr to your chromosomes' name).



ADD COMMENTlink modified 2.9 years ago • written 2.9 years ago by michael.ante2.5k

thanks Michael, that was good hint!

I have overlapping intervals, therefore I sort it and merge the overlapping intervals first and then convert it to bedGraph and BigWig.

ADD REPLYlink written 2.9 years ago by Leszek3.9k

Nice reply, but how to get the "myChrom.sizes"? Thanks.

ADD REPLYlink written 16 months ago by moushengxu300

Please see: A: Easiest Way To Obtain Chromosome Length?

ADD REPLYlink written 15 months ago by michael.ante2.5k

samtools faidx genome.fasta

cut -f1,2 genome.fasta.fai > genome.size

ADD REPLYlink modified 8 months ago • written 8 months ago by kashifalikhan00740
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 914 users visited in the last hour