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

RuntimeWarning: divide by zero encountered in log10 #86

Open
NicolasC0 opened this issue Nov 13, 2023 · 0 comments
Open

RuntimeWarning: divide by zero encountered in log10 #86

NicolasC0 opened this issue Nov 13, 2023 · 0 comments

Comments

@NicolasC0
Copy link

NicolasC0 commented Nov 13, 2023

Hello, thank you for developing mixer!

I've sucessfully run fit1, fit2 and the bivariate analysis. However, i've encuntered a RuntimeWarning such as this:

/home/nico/mixer/mixer/precimed/mixer/utils.py:894: RuntimeWarning: divide by zero encountered in log10
  data_x=-np.log10(np.flip(np.cumsum(np.flip(data_weights[si]))))     # step 2
/home/nico/.conda/envs/mixer/lib/python3.8/site-packages/scipy/interpolate/_interpolate.py:698: RuntimeWarning: invalid value encountered in subtract
  slope = (y_hi - y_lo) / (x_hi - x_lo)[:, None]
INFO:root:log_message(Done)

(example from one bivariate log file)

When I try to generate the figures I run into this warning:

~/mixer/mixer/results/bivariate/mgn_msp$ python3 ~/mixer/mixer/precimed/mixer_figures.py two \
--json-fit ~/mixer/mixer/results/fit2_results/mgn_msp/fit2_mgn_msp_combined.json \
--json-test bivariate_mgn_msp_combined.json \
--out mgn_msp.outfigs \
--statistic mean std \
--trait1 MGN
--trait2 MSP
generate mgn_msp.outfigs.csv from 2 json files...
Done.
/home/nico/mixer/mixer/precimed/mixer/figures.py:264: RuntimeWarning: All-NaN slice encountered
  plot_y[i, :] = plot_y[i, :] - np.nanmin(plot_y[i, :])
/home/nico/mixer/mixer/precimed/mixer/figures.py:266: RuntimeWarning: Mean of empty slice
  plot_y = np.nanmean(plot_y, 0)
Generated mgn_msp.outfigs.png
--trait2: command not found

The figure is generated despite the warning (though it's not recognizing the trait2) and I'm confused as to what the issue is. Greatly appreciate any help :)

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

1 participant