BigWig from ensembl assembly to UCSC session
2
0
Entering edit mode
6.4 years ago
Dataminer ★ 2.8k

Dear Community,

I am having trouble in viewing my data in UCSC and I am not sure what is going wrong.

Situation#: I have my bam files aligned using ensembl assembly and then preprocessed and generated bigwigs (deep tools) and then uploaded at UCSC (no errors). But as soon as I visualise the tracks, I get blanks in the section of tracks and says no data. I find this strange because as my data file is not empty.

Could anyone suggest a reason/solution.

Thank you in advance

Bigwig UCSC ENSEMBL • 4.3k views
ADD COMMENT
0
Entering edit mode

chromosome name differences is what first comes to mind.

ADD REPLY
1
Entering edit mode

I know how to fix this in wiggle files but I have no clue how to fix this in bigwigs.

ADD REPLY
0
Entering edit mode

There is a command in ucsc tool kit called bigWigToWig . You can convert bigwig to wig and then use wigToBigWig tool to reconvert ?

ADD REPLY
5
Entering edit mode
6.4 years ago

The issue is just the chromosome names. You can convert the chromosome names in a bigWig file with this:

The input is the bigWig file and a chromosome name map, such as from here. If you have deepTools installed already then the pyBigWig python package is already installed as well.

ADD COMMENT
0
Entering edit mode

Hey Devon, Thank you for your message. I have taken this file from GRCh37_ensembl2UCSC.txt the link.

I am doing this in terminal python convertBigWigChroms.py GRCh37_ensembl2UCSC.txt Sort.Ref.ER.DSG.bam.bw ER.DSG.bw and I get this error:

Traceback (most recent call last):
  File "convertBigWigChroms.py", line 16, in <module>
    if cols[1] == "":
IndexError: list index out of range

Could you please let me know how to make it run.

Thank you

ADD REPLY
0
Entering edit mode

That's what I get for not actually testing the script on a use case with blanks like that. Change line 34 to the following:

if len(cols) < 2 or cols[1] == "":

Edit: I've updated the gist to include this now.

ADD REPLY
0
Entering edit mode

Hi, Thanks for this code, works for me even to convert bigwig aligned on dm6 version using the chromosome name map of dm3, if you are not interested in the 1860 1.5kbp pieces of genome added on dm6.

I just add between lines 26-27 to consider only chromosome names already known in dm3:

 
if chrom not in d.keys():
        continue

ADD REPLY
0
Entering edit mode

Hi @ Devon_Ryan,

I am trying to change the chromosomes name in a bigwig file, but the script fails at ints = bw.intervals(chrom, 0, length) with the following error:

Process finished with exit code 137 (interrupted by signal 9: SIGKILL)

I believe the error is due to excessive memory usage. DO you have any suggestions on how to solve this issue?

ADD REPLY
0
Entering edit mode

Weird, you can always use Kent's tools from UCSC to convert to bedGraph, modify that, and then convert it back to a bigWig file.

ADD REPLY
0
Entering edit mode

thank you for your response.

I am trying to change the chromosome names in the bw file. After adding the header with the new mapping, I start with adding the entries, but in the original bw file, there are some positions that do not have any value. when i use bw.intervals(chr, start, end), I see [nan].

How can I add entries with nan values to an output bw file? I currently get the following error if there are nan values:

The entries you tried to add are out of order, precede already added entries, or otherwise use illegal values. Please correct this and try again.

ADD REPLY
0
Entering edit mode

You can remove those. You'll presumably need to sort the bedGraph file, since Kent's tools are very picky about that sort of thing.

ADD REPLY
0
Entering edit mode
6.4 years ago
GenoMax 147k

If you used Ensembl assembly for analysis then why not use custom tracks feature at Ensembl to view the data?

Note: Chromosomal identifier styles are different between UCSC and Ensembl so this is not going to work on UCSC without additional work.

ADD COMMENT
0
Entering edit mode

Reviewer wants UCSC session and I don't want to realign the data.

ADD REPLY
0
Entering edit mode

Perhaps they are unaware of the option to view these at Ensembl. Any chance of suggesting this option?

ADD REPLY
0
Entering edit mode

I can try but not sure if these guys will accept it.

ADD REPLY
0
Entering edit mode

Could you suggest something. I don't want to realign as it will cost a lot of time and the other option is to generate wiggle track (add chr)and convert them into bigwigs. But is it possible to add "chr" to the existing bigwigs and make them work?

ADD REPLY

Login before adding your answer.

Traffic: 1989 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