Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chromosome order potential issue #152

Open
potulabe opened this issue Nov 13, 2024 · 2 comments
Open

Chromosome order potential issue #152

potulabe opened this issue Nov 13, 2024 · 2 comments

Comments

@potulabe
Copy link

potulabe commented Nov 13, 2024

I'm not sure if this kind of problem has been already reported, but I couldn't find any clues on how to solve it, so decided to write my question here.
I made a bunch of bigwig files using bedGraphToBigWig tool.
The chromosome order in my bedgraph files was right (Chr1...Chr9,Chr10,..). When converting the files, I also provided the chrom.sizes file with right chromosome order.

I can open the bigWig files in the IGV browser, and they look OK, I can browse to any position and the information is displayed correctly.
But when I open the files with pyBigWig, for some reason Chr10 can't be accessed. I'm not sure, but can it be related to the chromosome order problem? Because when I display the chromosome order with bw.chroms() command, I get the wrong alphabetical order (which was not originally in bedGraph files, and doesn't correspond to the genome file chromosome order):

{'Chr1': 217471166,
 'Chr10': 52432566,
 'Chr2': 181034961,
 'Chr3': 153873357,
 'Chr4': 153961319,
...
}

ucsc's bigWigInfo returns also the alphabetical order (despite the chrom.sizes file I provided for bedGraphToBigWig the chromosome order was correct):

 ~/projs/ucsc_tools/bigWigInfo -chroms PNS_female.bedgraph.bw
version: 4
isCompressed: yes
isSwapped: 0
primaryDataSize: 879,143
primaryIndexSize: 7,244
zoomLevels: 9
chromCount: 34
        Chr1 0 217471166
        Chr10 1 52432566
        Chr2 2 181034961
        Chr3 3 153873357
        Chr4 4 153961319
        Chr5 5 164033575
        Chr6 6 154486312
        Chr7 7 133565930
        Chr8 8 147241510
        Chr9 9 91218944
        Sca1 10 82299
        Sca109 11 2779
        Sca11 12 53911
        Sca110 13 2622
        Sca124 14 1584
        Sca148 15 991
        Sca151 16 803
        Sca19 17 32064
        Sca2 18 79987
        Sca20 19 31817
        Sca23 20 29586
        Sca29 21 27006
        Sca4 22 61141
        Sca41 23 13206
        Sca46 24 10342
        Sca47 25 10052
        Sca52 26 7253
        Sca59 27 6523
        Sca64 28 5339
        Sca72 29 4995
        Sca75 30 4956
        Sca80 31 4807
        Sca87 32 4214
        Sca94 33 3579
basesCovered: 4,010,903
mean: -nan
min: 0.000000
max: inf
std: -nan

I can send the examples of bedGraph and bigwig files if they are needed.

@dpryan79
Copy link
Collaborator

Sending an example bigwig could be useful. The dictionary order in python isn't always guaranteed, depending on the version of python you're using.

@potulabe
Copy link
Author

potulabe commented Nov 25, 2024

Thank you for answering!
I understand that dictionary order is not guaranteed, but that shouldn't impede accessing the data, isn't it?

Here in the google drive folder there are:

  • a small toy example of a bedGraph with 3 regions: on Chr1, on Chr2 and on Chr10:
track type=bedGraph name=test description=test visibility=fullcolor=200,100,0 altColor=0,100,200 priority=20
Chr1	55080	55111	0.16707633
Chr2	336493	336505	0.7326518
Chr10	338640	338652	0.7326518
  • the bigwig, made from this bedGraph with bedGraphToBigWig tool (./bedGraphToBigWig test.bedgraph test.fasta.sizes test.bedgraph.bw)

When I open this bigwig with pyBigWig I get None on the Chr10:
image

In IGVjs browser, embedded in my Dash application, I get smth on the Chr10:

  • Chr1:
    image
  • Chr2:
    image
  • Chr10:
    image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants