Question: Converstion of BED with scores into bigWig
0
gravatar for Leszek
2.3 years ago by
Leszek3.8k
IIMCB, Poland
Leszek3.8k 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 • 5.0k views
ADD COMMENTlink modified 2.3 years ago by michael.ante1.6k • written 2.3 years ago by Leszek3.8k
6
gravatar for michael.ante
2.3 years ago by
michael.ante1.6k
Austria/Vienna
michael.ante1.6k 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 myBigWig.bw

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

Cheers,

Michael

ADD COMMENTlink modified 2.3 years ago • written 2.3 years ago by michael.ante1.6k

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.3 years ago by Leszek3.8k

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

ADD REPLYlink written 8 months ago by moushengxu260

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

ADD REPLYlink written 8 months ago by michael.ante1.6k

samtools faidx genome.fasta

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

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

Help
Access

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