Question: Any Method Of Converting Bigwig File Format Into Bed Format?
4
gravatar for samwise.techno
7.0 years ago by
samwise.techno40 wrote:

I want to have a bigwig file converted into gff after having the genome coordinates and genome annotation files converted from Hg19 to Hg18. One way, would be to convert bigwig into BED, use the liftover tool and then have the BED file converted into gff. Could someone please suggest a method to convert bigwig to BED, nothing available on the net.

bed bigwig • 25k views
ADD COMMENTlink modified 11 months ago by Samir180 • written 7.0 years ago by samwise.techno40

Hi there,

Any help on how to solve this error

./bigWigToWig input.bw output.wig
udc couldn't read 4 bytes from input.bw, did read 0

Thanks in advance!

cheers
CN

ADD REPLYlink modified 6 months ago by RamRS27k • written 6.8 years ago by Chirag Nepal2.2k

Clear the cache and check if the file is empty

rm -rf /tmp/udcCache
bigWigInfo​ file.bw
ADD REPLYlink modified 6 months ago by RamRS27k • written 4.6 years ago by Sukhdeep Singh10k
12
gravatar for Alex Reynolds
7.0 years ago by
Alex Reynolds30k
Seattle, WA USA
Alex Reynolds30k wrote:

Instead of bigWigToBedGraph, you might use bigWigToWig, instead, as bedgraph is BED-like but isn't exactly BED, which may affect use of UCSC's liftover tool. In any case, both binaries are available from the UCSC executables download page.

Once you have the file in WIG format, you can convert it to a UCSC BED file with the BEDOPS wig2bed conversion utility.

Alternatively, you could take the bedgraph output and convert it to BED with an added GNU awk step:

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

You should be able to safely run it through liftover at that point.

ADD COMMENTlink modified 5.3 years ago • written 7.0 years ago by Alex Reynolds30k
2
gravatar for PoGibas
7.0 years ago by
PoGibas4.8k
Vilnius
PoGibas4.8k wrote:

bigWigToBedGraph might be what you're looking for.

bedgraph format

ADD COMMENTlink modified 7.0 years ago • written 7.0 years ago by PoGibas4.8k
1
gravatar for Samir
11 months ago by
Samir180
United States
Samir180 wrote:

Follow up to Alex's reply, here is an example:

wget http://genome.ucsc.edu/goldenPath/help/examples/bigWigExample.bw
## convert to intermediate wig format
bigWigToWig bigWigExample.bw out.wig
## convert wig to bed
wig2bed < out.wig > out.bed

bigWigToWig executable is from UCSC Kent utilities. Also, make sure to read manpage for wig2bed for details, particularly on 0- vs 1-based index and preserving header data.

ADD COMMENTlink modified 11 months ago • written 11 months ago by Samir180
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: 872 users visited in the last hour