OverflowError: cannot convert float infinity to integer

41 views
Skip to first unread message

Maciej Kotliński

unread,
Oct 18, 2023, 10:51:17 AM10/18/23
to DANPOS
Hi,
I'm getting such error while running dpeak, dregion and dtriple on some sample sets.
Could somebody help with that?
Best Regards,
Maciek

merging peaks from all groups...
define reference peaks by pooling peaks defined in all samples...

retriving peak values for each group...
Flag_pH5-W1-chr
whole genome aveage value is 924.724698453909, use cutoff 1125
total_width_above_cutoff: 451430
whole genome aveage value is 924.724698453909, use cutoff 1125
total_width_above_cutoff: 463560
8081_pH5-W1-chr
whole genome aveage value is 924.7246984539094, use cutoff 1125
total_width_above_cutoff: 526010
whole genome aveage value is 924.7246984539094, use cutoff 1125
total_width_above_cutoff: 534790
Flag_pH5-W1-chr:8081_pH5-W1-chr
Traceback (most recent call last):
 File "/home/mk/yersinia-chip-seq/DANPOS3-SimHolz-Dev/danpos.py", line 1368, in <module>
   elif sys.argv[1]=='dtriple':runDANPOS(command='dtriple')
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 File "/home/mk/yersinia-chip-seq/DANPOS3-SimHolz-Dev/danpos.py", line 306, in runDANPOS
   danpos(\
 File "/home/mk/yersinia-chip-seq/DANPOS3-SimHolz-Dev/functions.py", line 406, in danpos
   dfgroups[dfname].fillRegions(regions=peaks,file=re.sub(':','-',os.path.join(opath,'diff',dfname+testname[test]+"local_gain.refpeaks.xls")),pheight=pheight,height=logp,width=peak_width,calculate_P_value=0,po
s_only=True)
 File "/home/mk/yersinia-chip-seq/DANPOS3-SimHolz-Dev/wig.py", line 289, in fillRegions
   height=int(m+0.5)
          ^^^^^^^^^^
OverflowError: cannot convert float infinity to integer


simon holzinger

unread,
Oct 19, 2023, 6:42:28 AM10/19/23
to DANPOS
Hi Maciek, 

I'm not really familiar with the "dpeak" and the "dregion" options. But I try to help. 
I think the error occurs because one of your inputs has infinity values. Maybe you try to run some sample-over-input Chip-Seq data where infinity values were created in the process? 
To circumvent this issue add a pseudocount to prevent x/0 in the process of dividing sample/input.

I hope this helps

bw
Simon 

Maciej Kotliński

unread,
Oct 19, 2023, 8:19:56 AM10/19/23
to dan...@googlegroups.com
Hi,
Danpos generates pooled/*.wig files for both compared sample sets. The values there are in the range of ~1.3 to ~8700. There are also few 0.0 values on the begging and end of chromosomes.
There is also diff/*.wig file generated with values from -84 to 308, some 0.0 vales and some 'inf'.
I made an spreadsheet with values from all three .wig files (2 polled samples and diff) to check where the 'inf' values come from.
In all rows with 'inf' values in diff file, the values from both files from puled directory are in the middle of the range (800 - 3300). The values of first sample are 2-3 times higher than the second.
I divided the values from first file in pooled by values from the second file in pooled. Te result is different than the number in diff file (also when I try value A^n/B^n or A^2/B^2).
I noticed that quotients (A/B) of 14 rows with 'inf' values are highest in the range (with some exceptions).

Regards,
Maciek

--
You received this message because you are subscribed to the Google Groups "DANPOS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to danpos+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/danpos/f12f49fe-ed5a-4b72-b24e-635a208d5080n%40googlegroups.com.


simon holzinger

unread,
Oct 19, 2023, 9:59:31 AM10/19/23
to DANPOS
Hi,
 
the unexpected behaviour from diff is, because it is actually not the difference but the log10(pvalue) from a poisson test between each position. Don't ask me why that is... I did not write the program. 
Other difference measurements are implemented as well in the code (chi squared, L2FC, subtraction) but there is no flag to change it. You would have to do it in the source code.

Coming back to you original post - was that your problem? Did you use the diff.wig in a separate "dpeak"/"dregion" run? 

bw
Simon 
Reply all
Reply to author
Forward
0 new messages