ValueError: connot convert float NaN to integer

55 views
Skip to first unread message

ly Andy

unread,
May 13, 2023, 8:16:48 PM5/13/23
to DANPOS
Dear developers,

I encounter a issue when I run the program. The command:
python3 /home/yilei/biosoftware/DANPOS3/danpos.py dtriple 28825_WTmono1_S7_L999_R.final.bam:28827_R27mono1_S9_L999_R.final.bam
Capture.PNG
I found the line 289 in the wig.py is the height=int(m+0.5). The really problem of the above is the m maybe "NaN". Therefore, I changed the height=int(m+0.5) into height=int(0.5), and it can be run totally.
But I don't know if this modification would be introduce potential effect for the results. So, could you please give some suggestions?

Best,
Andy


simon holzinger

unread,
May 17, 2023, 8:12:57 AM5/17/23
to DANPOS
Hi Andy, 

I haven't encountered this problem yet and I can not reproduce it... 
m should be the mean coverage of the whole file (see a few lines up in the source 'm = self.mean()' ; self is a wig object --> the coverage). 
Just deleting the "m" probably has effects downstream which you don't want. 
My guess would be something with the input files as there is a "NaN" where a coverage should be...  

Best, 
Simon 

ly Andy

unread,
May 31, 2023, 5:32:06 PM5/31/23
to DANPOS
Dear Simon,

I figure out that the issue maybe result from  when you attempt to perform some mathematical operation that involves extremely small or extremely large numbers and Python simply outputs a NaN value as the result. Therefore, I think the "m", as the mean coverage of whole file, maybe involved the extremely value. I don't know how to fix it. Do you have some suggestions to handle it ?

Best,
Andy

ly Andy

unread,
Jun 16, 2023, 7:46:47 PM6/16/23
to DANPOS
Dear Simon,

Can you help me to fix this problem? I have been unable to solve this problem. 

Best,
Andy

ly Andy <andy12...@gmail.com> 于2023年5月31日周三 14:32写道:
--
You received this message because you are subscribed to a topic in the Google Groups "DANPOS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/danpos/IxD-wMQARTQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to danpos+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/danpos/fa122e6d-df09-40a8-8f75-9eabc72305b0n%40googlegroups.com.

ly Andy

unread,
Jun 16, 2023, 7:47:27 PM6/16/23
to DANPOS
Dear Simon,

Can you help me to fix this problem? I have been unable to solve this problem. 

Best,
Andy

Reply all
Reply to author
Forward
0 new messages