Skip to content

Commit

Permalink
add check to avoid error for len(cut_intervals) <= 1
Browse files Browse the repository at this point in the history
  • Loading branch information
fidelram committed Mar 31, 2017
1 parent 4cba879 commit d423f0a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions hicexplorer/HiCMatrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,9 @@ def fit_cut_intervals(cut_intervals):
# check that the matrix has bins of same size
# otherwise try to adjust the bins to
# to match a regular binning
if len(cut_intervals) <= 1:
# do nothing if there is only one interval
return cut_intervals
chrom, start, end, extra = zip(*cut_intervals)

median = int(np.median(np.diff(start)))
Expand Down

0 comments on commit d423f0a

Please sign in to comment.