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

ZeroDivisionError: float division by zero #4

Open
liufeibio opened this issue Aug 29, 2019 · 5 comments
Open

ZeroDivisionError: float division by zero #4

liufeibio opened this issue Aug 29, 2019 · 5 comments

Comments

@liufeibio
Copy link

liufeibio commented Aug 29, 2019

Hi, @LKremer
I am trying to use CAFE_fig to visualize the results from CAFE, but I encountered some problems.
Here is my running: python3 ./CAFE_fig/CAFE_fig.py cafe_result.cafe -c asc=vL, da -pb 0.05 -pf 0.05 --dump test/ -g .pdf --count_all_expansions
And these are output:

Traceback (most recent call last):
File "./CAFE_fig/CAFE_fig.py", line 517, in
main(**vars(args))
File "./CAFE_fig/CAFE_fig.py", line 458, in main
c = CAFE_fig(report_cafe, families, clades, pb, pf, dump, gfx_output_format, count_all_expansions)
File "./CAFE_fig/CAFE_fig.py", line 86, in init
self.parse_tree()
File "./CAFE_fig/CAFE_fig.py", line 136, in parse_tree
self.parse_lambdas(line)
File "./CAFE_fig/CAFE_fig.py", line 209, in parse_lambdas
self.lambda_colors[i] = to_rgb(math.log(lambda_), min_l, max_l)
File "./CAFE_fig/CAFE_fig.py", line 62, in to_rgb
v = (v_abs - min_v) / (max_v - min_v) # scaled to a value between 0 and 1
ZeroDivisionError: float division by zero

Could you help with this? I appreciate your help. Thanks!
Fei

LKremer added a commit that referenced this issue Sep 5, 2019
@LKremer
Copy link
Owner

LKremer commented Sep 5, 2019

Hi @liufeibio ,
I added a quick fix to the issue, please let me know if it works for you.
Best,
Lukas

@liufeibio
Copy link
Author

Thanks for your help with this. It solved this problem. But I encountered another problem:
Writing test/summary.pdf
Traceback (most recent call last):
File "./CAFE_fig/CAFE_fig.py", line 520, in
main(**vars(args))
File "./CAFE_fig/CAFE_fig.py", line 480, in main
p_value = family.tree.search_nodes(id=node_id)[0].pvalue
AttributeError: 'TreeNode' object has no attribute 'pvalue'
Could you help with this? I appreciate your help. Thanks a lot!

@Hua-CM
Copy link

Hua-CM commented Oct 22, 2019

Thanks for your help with this. It solved this problem. But I encountered another problem:
Writing test/summary.pdf
Traceback (most recent call last):
File "./CAFE_fig/CAFE_fig.py", line 520, in
main(**vars(args))
File "./CAFE_fig/CAFE_fig.py", line 480, in main
p_value = family.tree.search_nodes(id=node_id)[0].pvalue
AttributeError: 'TreeNode' object has no attribute 'pvalue'
Could you help with this? I appreciate your help. Thanks a lot!

Did you resolve it? I come across the same problem now.

@liufeibio
Copy link
Author

Thanks for your help with this. It solved this problem. But I encountered another problem:
Writing test/summary.pdf
Traceback (most recent call last):
File "./CAFE_fig/CAFE_fig.py", line 520, in
main(**vars(args))
File "./CAFE_fig/CAFE_fig.py", line 480, in main
p_value = family.tree.search_nodes(id=node_id)[0].pvalue
AttributeError: 'TreeNode' object has no attribute 'pvalue'
Could you help with this? I appreciate your help. Thanks a lot!

Did you resolve it? I come across the same problem now.

No, I haven't, it is still there.

@LKremer
Copy link
Owner

LKremer commented Nov 26, 2019

Hi @liufeibio and @Hua-CM,
sorry for the late reply. I have two questions in order to narrow down the possible causes of the error.

  1. Can you reproduce the example plot from the readme file (using example data and the command in the readme)?
  2. if so, could you upload your input files here or send them to me via email (L.Kremer at dkfz.de)?
    Best, Lukas

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

3 participants