Describe the bug
During plotting, towards the end of the pipeline, I am running into KeyError: 'Chromosome not found: 17'. This is occurring at line 339 in plotting.py, when trying to fetch bigwig intervals.
I have double checked my input files, and they are all using "chr17" naming, not "17". Also, I do not run into any chromosome key errors before this point in the pipeline, suggesting there are no naming issues in my input files.
I suspect the 'chr' part of the chromosome name is somehow being lost during the creation of the genomeRange object (gr). However, I can't find where this happens to test it.
Could this possibly be related to a pyranges/pandas bug from last year, #281?
To Reproduce
I am running capcruncher for a single viewpoint:
- viewpoint:
chr17 3469 3916 17p-tel
- T2T reference files
Expected behavior
There should not be key errors affecting plotting
Screenshots
[text of error messages copied below]
Additional context
Removing temporary output capcruncher_output/interim/comparisons/summaries_and_subtractions/Late.mean-summary.17p-tel.bedgraph. /home/emmon/miniconda3/lib/python3.10/site-packages/iced/normalization/_ca_utils.py:8: UserWarning: The API of this module is likely to change. Use only for testing purposes warnings.warn( 2025-03-25 13:21:43.558 | INFO | __main__:<module>:21 - Checking if we can group tracks by condition 2025-03-25 13:21:43.559 | INFO | __main__:<module>:26 - Setting up tracks 2025-03-25 13:21:43.559 | INFO | __main__:<module>:35 - Adding bigwig tracks 2025-03-25 13:21:43.561 | INFO | __main__:<module>:62 - Added Early bigwig track 2025-03-25 13:21:43.561 | INFO | __main__:<module>:62 - Added Late bigwig track 2025-03-25 13:21:43.562 | INFO | __main__:<module>:78 - Adding subtraction tracks 2025-03-25 13:21:43.562 | INFO | __main__:<module>:81 - Adding Early-Late.mean-subtraction.17p-tel subtraction track 2025-03-25 13:21:43.562 | INFO | __main__:<module>:81 - Adding Late-Early.mean-subtraction.17p-tel subtraction track 2025-03-25 13:21:43.562 | INFO | __main__:<module>:139 - Adding genes track 2025-03-25 13:21:43.562 | INFO | __main__:<module>:149 - Making figure cat: PATH_TO_GENES_IN_BED12_FORMAT: No such file or directory 2025-03-25 13:21:43.615 | INFO | __main__:<module>:152 - Saving figure to: capcruncher_output/results/figures/17p-tel.pdf [ERROR:frame.py:224 - plot()] Error occured when plot track: track name: BigWigCollection.Early track type:<class 'capcruncher.api.plotting.CCBigWigCollection'> Error: <class 'KeyError'> 'Chromosome not found: 17' occurred in "/home/emmon/miniconda3/lib/python3.10/site-packages/coolbox/core/frame/frame.py", line 218 [ERROR:frame.py:231 - plot()] 'Chromosome not found: 17' Traceback (most recent call last): File "/home/emmon/miniconda3/lib/python3.10/site-packages/coolbox/core/frame/frame.py", line 218, in plot track.plot(ax, copy(gr), gr2=copy(gr2)) File "/home/emmon/miniconda3/lib/python3.10/site-packages/capcruncher/api/plotting.py", line 400, in plot data = self.fetch_data(gr, **kwargs) File "/home/emmon/miniconda3/lib/python3.10/site-packages/capcruncher/api/plotting.py", line 338, in fetch_data datasets = [ File "/home/emmon/miniconda3/lib/python3.10/site-packages/capcruncher/api/plotting.py", line 339, in <listcomp> bw.bw.fetch_intervals(gr.chrom, gr.start, gr.end) File "bbi/cbbi.pyx", line 677, in bbi.cbbi.BBIFile.fetch_intervals KeyError: 'Chromosome not found: 17' [ERROR:frame.py:224 - plot()] Error occured when plot track: track name: BigWigCollection.Late track type:<class 'capcruncher.api.plotting.CCBigWigCollection'> Error: <class 'KeyError'> 'Chromosome not found: 17' occurred in "/home/emmon/miniconda3/lib/python3.10/site-packages/coolbox/core/frame/frame.py", line 218 [ERROR:frame.py:231 - plot()] 'Chromosome not found: 17' Traceback (most recent call last): File "/home/emmon/miniconda3/lib/python3.10/site-packages/coolbox/core/frame/frame.py", line 218, in plot track.plot(ax, copy(gr), gr2=copy(gr2)) File "/home/emmon/miniconda3/lib/python3.10/site-packages/capcruncher/api/plotting.py", line 400, in plot data = self.fetch_data(gr, **kwargs) File "/home/emmon/miniconda3/lib/python3.10/site-packages/capcruncher/api/plotting.py", line 338, in fetch_data datasets = [ File "/home/emmon/miniconda3/lib/python3.10/site-packages/capcruncher/api/plotting.py", line 339, in <listcomp> bw.bw.fetch_intervals(gr.chrom, gr.start, gr.end) File "bbi/cbbi.pyx", line 677, in bbi.cbbi.BBIFile.fetch_intervals KeyError: 'Chromosome not found: 17'
Describe the bug
During plotting, towards the end of the pipeline, I am running into
KeyError: 'Chromosome not found: 17'. This is occurring at line 339 in plotting.py, when trying to fetch bigwig intervals.I have double checked my input files, and they are all using "chr17" naming, not "17". Also, I do not run into any chromosome key errors before this point in the pipeline, suggesting there are no naming issues in my input files.
I suspect the 'chr' part of the chromosome name is somehow being lost during the creation of the genomeRange object (gr). However, I can't find where this happens to test it.
Could this possibly be related to a pyranges/pandas bug from last year, #281?
To Reproduce
I am running capcruncher for a single viewpoint:
chr17 3469 3916 17p-telExpected behavior
There should not be key errors affecting plotting
Screenshots
[text of error messages copied below]
Additional context
Removing temporary output capcruncher_output/interim/comparisons/summaries_and_subtractions/Late.mean-summary.17p-tel.bedgraph. /home/emmon/miniconda3/lib/python3.10/site-packages/iced/normalization/_ca_utils.py:8: UserWarning: The API of this module is likely to change. Use only for testing purposes warnings.warn( 2025-03-25 13:21:43.558 | INFO | __main__:<module>:21 - Checking if we can group tracks by condition 2025-03-25 13:21:43.559 | INFO | __main__:<module>:26 - Setting up tracks 2025-03-25 13:21:43.559 | INFO | __main__:<module>:35 - Adding bigwig tracks 2025-03-25 13:21:43.561 | INFO | __main__:<module>:62 - Added Early bigwig track 2025-03-25 13:21:43.561 | INFO | __main__:<module>:62 - Added Late bigwig track 2025-03-25 13:21:43.562 | INFO | __main__:<module>:78 - Adding subtraction tracks 2025-03-25 13:21:43.562 | INFO | __main__:<module>:81 - Adding Early-Late.mean-subtraction.17p-tel subtraction track 2025-03-25 13:21:43.562 | INFO | __main__:<module>:81 - Adding Late-Early.mean-subtraction.17p-tel subtraction track 2025-03-25 13:21:43.562 | INFO | __main__:<module>:139 - Adding genes track 2025-03-25 13:21:43.562 | INFO | __main__:<module>:149 - Making figure cat: PATH_TO_GENES_IN_BED12_FORMAT: No such file or directory 2025-03-25 13:21:43.615 | INFO | __main__:<module>:152 - Saving figure to: capcruncher_output/results/figures/17p-tel.pdf [ERROR:frame.py:224 - plot()] Error occured when plot track: track name: BigWigCollection.Early track type:<class 'capcruncher.api.plotting.CCBigWigCollection'> Error: <class 'KeyError'> 'Chromosome not found: 17' occurred in "/home/emmon/miniconda3/lib/python3.10/site-packages/coolbox/core/frame/frame.py", line 218 [ERROR:frame.py:231 - plot()] 'Chromosome not found: 17' Traceback (most recent call last): File "/home/emmon/miniconda3/lib/python3.10/site-packages/coolbox/core/frame/frame.py", line 218, in plot track.plot(ax, copy(gr), gr2=copy(gr2)) File "/home/emmon/miniconda3/lib/python3.10/site-packages/capcruncher/api/plotting.py", line 400, in plot data = self.fetch_data(gr, **kwargs) File "/home/emmon/miniconda3/lib/python3.10/site-packages/capcruncher/api/plotting.py", line 338, in fetch_data datasets = [ File "/home/emmon/miniconda3/lib/python3.10/site-packages/capcruncher/api/plotting.py", line 339, in <listcomp> bw.bw.fetch_intervals(gr.chrom, gr.start, gr.end) File "bbi/cbbi.pyx", line 677, in bbi.cbbi.BBIFile.fetch_intervals KeyError: 'Chromosome not found: 17' [ERROR:frame.py:224 - plot()] Error occured when plot track: track name: BigWigCollection.Late track type:<class 'capcruncher.api.plotting.CCBigWigCollection'> Error: <class 'KeyError'> 'Chromosome not found: 17' occurred in "/home/emmon/miniconda3/lib/python3.10/site-packages/coolbox/core/frame/frame.py", line 218 [ERROR:frame.py:231 - plot()] 'Chromosome not found: 17' Traceback (most recent call last): File "/home/emmon/miniconda3/lib/python3.10/site-packages/coolbox/core/frame/frame.py", line 218, in plot track.plot(ax, copy(gr), gr2=copy(gr2)) File "/home/emmon/miniconda3/lib/python3.10/site-packages/capcruncher/api/plotting.py", line 400, in plot data = self.fetch_data(gr, **kwargs) File "/home/emmon/miniconda3/lib/python3.10/site-packages/capcruncher/api/plotting.py", line 338, in fetch_data datasets = [ File "/home/emmon/miniconda3/lib/python3.10/site-packages/capcruncher/api/plotting.py", line 339, in <listcomp> bw.bw.fetch_intervals(gr.chrom, gr.start, gr.end) File "bbi/cbbi.pyx", line 677, in bbi.cbbi.BBIFile.fetch_intervals KeyError: 'Chromosome not found: 17'