Question: UCSC BedGraph Issue
0
gravatar for mbio.kyle
3.6 years ago by
mbio.kyle300
United States
mbio.kyle300 wrote:

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 thebig wig 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?

methylation kent ucsc bedgraph • 1.8k views
ADD COMMENTlink modified 3.6 years ago by Maximilian Haeussler1.3k • written 3.6 years ago by mbio.kyle300
3

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

ADD REPLYlink written 3.6 years ago by Devon Ryan88k

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

ADD REPLYlink written 3.6 years ago by Maximilian Haeussler1.3k

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 REPLYlink written 3.6 years ago by mbio.kyle300

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

ADD REPLYlink written 3.6 years ago by Maximilian Haeussler1.3k

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 REPLYlink written 3.6 years ago by mbio.kyle300
1

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

ADD REPLYlink written 3.6 years ago by Maximilian Haeussler1.3k

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

ADD REPLYlink written 3.6 years ago by Maximilian Haeussler1.3k

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 REPLYlink written 3.6 years ago by mbio.kyle300
2
gravatar for Maximilian Haeussler
3.6 years ago by
UCSC
Maximilian Haeussler1.3k wrote:

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 COMMENTlink written 3.6 years ago by Maximilian Haeussler1.3k

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 REPLYlink modified 3.6 years ago • written 3.6 years ago by mbio.kyle300
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: 2449 users visited in the last hour