4dn-dcic/pairsqc

autocalculate max_distance from chromsize

Opened this issue · 5 comments

To avoid this kind of error

Traceback (most recent call last):
  File "/usr/local/bin/pairsqc//pairsqc.py", line 372, in <module>
    distance_histogram (args.pairs, args.chrsize, outfilename=PLOT_TABLE_OUT_FILE_PATH, cols = cols, orientation_list = orientation_list, max_logdistance = max_logdist)
  File "/usr/local/bin/pairsqc//pairsqc.py", line 310, in distance_histogram
    ss[bin_number].calculate_contact_probability(bin_mid, bin_size)
  File "/usr/local/bin/pairsqc//pairsqc.py", line 146, in calculate_contact_probability
    self.prob = self.sumcount / self.allpossible_sumcount / bin_size
ZeroDivisionError: division by zero

Hi, how can i solve the problem as follows?

Traceback (most recent call last):
  File "/store/jsxu/biosoft/pairsqc/pairsqc.py", line 372, in <module>
    distance_histogram (args.pairs, args.chrsize, outfilename=PLOT_TABLE_OUT_FILE_PATH, cols = cols, orientation_list = orientation_list, max_logdistance = max_logdist)
  File "/store/jsxu/biosoft/pairsqc/pairsqc.py", line 310, in distance_histogram
    ss[bin_number].calculate_contact_probability(bin_mid, bin_size)
  File "/store/jsxu/biosoft/pairsqc/pairsqc.py", line 146, in calculate_contact_probability
    self.prob = self.sumcount / self.allpossible_sumcount / bin_size
ZeroDivisionError: division by zero

Hi, are you using it on human data or some other species?

I'm using X.tropicalis data,and I tried to set the the parameter -M (from 8.4 to 8.3) to be smaller, It works fine.

The largest chromosome for X.tropicalis (X_v10) is 217,471,166bp, log10(217471166) = 8.337402. Can I use 8.3 ?

Yes!

OK! Thanks.