UCSC BedGraph Issue
1
0
Entering edit mode
9.4 years ago
mbio.kyle ▴ 380

I am working with some BS methylation data in BedGraph form. Here is what the data looks like:

genome   168326  168326  1
genome   168407  168407  1
genome   168408  168408  3
genome   168420  168420  1
genome   168421  168421  2
genome   168449  168449  5
genome   168450  168450  1

Obviously the genome is the actual name, but anyways. I am having trouble converting it into a UCSC binary data format for loading into a track hub. I have kent tools installed and have tried running bedGraphToBigWig on the the files, which completes without error. When I load the bigWig files the tracks are blank. I did some further investigation by running the bigWigs through bigWigToBedGraph, which again completed without error but returned an empty file. I tried converting the bigWigs to wigs using bigWigToWig and got the following output:

#bedGraph section genome:165-55617
#bedGraph section genome:55626-72139
#bedGraph section genome:72140-102836
#bedGraph section genome:102837-136403
#bedGraph section genome:136426-166013
#bedGraph section genome:166014-172052

If I upload the tracks as custom tracks in bedGraph format they display fine. I made sure they were sorted and ran them through bedGraphPack and nothing changed.

Has anyone encountered this before?

bedgraph kent ucsc methylation • 4.5k views
ADD COMMENT
3
Entering edit mode

BedGraph is 0-based half open, so you're specifying 0-width entries. I imagine that that could cause many problems.

ADD REPLY
0
Entering edit mode

Do you have a few example lines from your file? Or a link to your bigWig file?

ADD REPLY
0
Entering edit mode

The top red code block is an example of the bedGraph file I am working with, and the bottom block is what the wig file looks like when I convert bedGraph -> bigWig -> wig.

If I convert bedGraph -> bigWig -> bedGraph I get an empty file.

As for the bigWig I don't imagine you'd like to see a few lines of that :)

ADD REPLY
0
Entering edit mode

Can you specify a few real lines, not mock-up lines? Can you also tell us which genome you are using?

ADD REPLY
0
Entering edit mode

Here are some real lines:

AKATA_GFP    1878    1878    91
AKATA_GFP    1893    1893    10
AKATA_GFP    2215    2215    96
AKATA_GFP    2227    2227    90
AKATA_GFP    2228    2228    97
AKATA_GFP    2268    2268    50

The genome is one we 'created', which is an EBV virus genome with a GFP insert. We have a custom deployment of the UCSC browser. I have set up and viewed many things with this genome on custom track hubs so I am confident that the issue is with these files.

ADD REPLY
1
Entering edit mode

Your features have all 0-length. What is this supposed to show? Do you mean 1-bp long features?

ADD REPLY
0
Entering edit mode

What does your chrom.sizes file look like? I am not sure if underscores are legal in chromosome names in UCSC.

ADD REPLY
0
Entering edit mode

Here is the output of bigWigInfo on the bigWig file:

bigWigInfo BS.bw
version: 4
isCompressed: yes
isSwapped: 0
primaryDataSize: 27,587
primaryIndexSize: 6,244
zoomLevels: 7
chromCount: 1
basesCovered: 0
mean: -nan
min: 0.000000
max: 100.000000
std: -nan

Seems like the bigWig is clearly messed up!

ADD REPLY
2
Entering edit mode
9.4 years ago

As Devon Ryan pointed out, your input file features are all 0-length. A 1bp feature in UCSC coordinates starting from position 0 is written as (0,1). See the bedGraph help at http://genome.ucsc.edu/goldenPath/help/bedgraph.html

ADD COMMENT
0
Entering edit mode

This was the issue. Thanks very much to you and Devon for your help. Sorry for the delay I used up my 5 posts per day limit. For anyone else running into the same issue, the following awk command can be used to increment the end position column of the bedGraph file, the NR==1 bit skips the header, remove if not present

awk -v s=1 'NR==1 {print}{print $1, $2, $3+s, $4}' original_bed_graph.bg > fixed.bg
ADD REPLY

Login before adding your answer.

Traffic: 2305 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6