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

summary_method: Invalid interval bounds #277

Closed
BenoitM-I2BC opened this issue Aug 31, 2020 · 2 comments
Closed

summary_method: Invalid interval bounds #277

BenoitM-I2BC opened this issue Aug 31, 2020 · 2 comments

Comments

@BenoitM-I2BC
Copy link

(python 3.8)
(pyGenomeTracks 3.5)

Hi,
I report here what seems to be a bug in BedGraph Summary_Method. The error occurs when --region right border argument is not included in the bedgraph intervals.
The left border of the --region argument does not have to be included in the bedgraph intervals.

Below is a minimal test file to (hopefully) reproduce to the bug.
All the instructions work without summary_method.

Best,
Benoit

===== Bedgraph.bg ===== (the interval [400-404] is not included)
chr7	100	200	1
chr7	200	300	2
chr7	300	350	3
chr7	350	399	4
chr7	405	450	5
===== Track1.ini =====
[bedgraph]
file = Bedgraph.bg
height = 5
summary_method = max
file_type = bedgraph
### WORKS
pyGenomeTracks -o test1.png --tracks track1.ini --region chr7:100-399
pyGenomeTracks -o test1.png --tracks track1.ini --region chr7:100-406
pyGenomeTracks -o test1.png --tracks track1.ini --region chr7:50-399

### FAILS
pyGenomeTracks -o test1.png --tracks track1.ini --region chr7:100-400
pyGenomeTracks -o test1.png --tracks track1.ini --region chr7:100-401

### it returns:
Traceback (most recent call last):
  File "/usr/local/bin/pyGenomeTracks", line 11, in <module>
    main(args)
  File "/usr/local/lib/python3.8/site-packages/pygenometracks/plotTracks.py", line 331, in main
    trp.plot(args.outFileName, *regions[0], title=args.title,
  File "/usr/local/lib/python3.8/site-packages/pygenometracks/tracksClass.py", line 265, in plot
    track.plot(plot_axis, chrom, start, end)
  File "/usr/local/lib/python3.8/site-packages/pygenometracks/tracks/BedGraphTrack.py", line 320, in plot
    score_list, x_values = self.get_values_as_bigwig(score_list,
  File "/usr/local/lib/python3.8/site-packages/pygenometracks/tracks/BedGraphTrack.py", line 422, in get_values_as_bigwig
    scores_per_bin = np.array(bw.stats(chrom_region,
RuntimeError: Invalid interval bounds!

@lldelisle
Copy link
Collaborator

Hi,
Good catch. I had not thought about this case. I made a pull request to solve this issue. It will be solved in the next release.

@lldelisle
Copy link
Collaborator

Hi,
The bug fix is now available in the new version. Thanks again for the bug report.

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