Gneiss -- Cannot Convert Float NaN to integer


(Courtneystairs) #1

Hi there,

I have encountered an error that I have been unable to troubleshoot using the gneiss workflow.

    qiime gneiss correlation-clustering \
      --i-table $input_table \
      --o-clustering hierarchy.qza
    qiime gneiss ilr-hierarchical \
      --i-table $input_table \
      --i-tree hierarchy.qza \
      --o-balances balances.qza

Both of these work and generate balances and heirarchy files.

    qiime gneiss ols-regression \
      --p-formula "Sample_type" \
      --i-table balances.qza \
      --i-tree hierarchy.qza \
      --m-metadata-file $metadatapath \
      --verbose \
      --o-visualization regression_summary_Sample_type.qzv

However, this command fails with the error below.

I thought maybe this was because there were some 0 balances, however when I run:

qiime tools export --input-path balances.qza --output exportbalances
biom summarize-table -i exportbalances/feature-table.biom -o exportbalances/summarized.txt

/local/one/CSTAIRS/CONDA/env/qiime2-2018.8/lib/python3.5/site-packages/gneiss-0.4.4-py3.5.egg/gneiss/regression/_ols.py:192: RuntimeWarning: invalid value encountered in sqrt
/local/one/CSTAIRS/CONDA/env/qiime2-2018.8/lib/python3.5/site-packages/gneiss-0.4.4-py3.5.egg/gneiss/regression/_ols.py:193: RuntimeWarning: invalid value encountered in true_divide
/local/one/CSTAIRS/CONDA/env/qiime2-2018.8/lib/python3.5/site-packages/scipy/stats/_distn_infrastructure.py:879: RuntimeWarning: invalid value encountered in greater
return (self.a < x) & (x < self.b)
/local/one/CSTAIRS/CONDA/env/qiime2-2018.8/lib/python3.5/site-packages/scipy/stats/_distn_infrastructure.py:879: RuntimeWarning: invalid value encountered in less
return (self.a < x) & (x < self.b)
/local/one/CSTAIRS/CONDA/env/qiime2-2018.8/lib/python3.5/site-packages/scipy/stats/_distn_infrastructure.py:1818: RuntimeWarning: invalid value encountered in less_equal
cond2 = cond0 & (x <= self.a)
/local/one/CSTAIRS/CONDA/env/qiime2-2018.8/lib/python3.5/site-packages/gneiss-0.4.4-py3.5.egg/gneiss/regression/_ols.py:206: RuntimeWarning: invalid value encountered in double_scalars
/local/one/CSTAIRS/CONDA/env/qiime2-2018.8/lib/python3.5/site-packages/statsmodels/stats/multitest.py:320: RuntimeWarning: invalid value encountered in less_equal
reject = pvals_sorted <= ecdffactor*alpha
Traceback (most recent call last):
File “/local/one/CSTAIRS/CONDA/env/qiime2-2018.8/lib/python3.5/site-packages/q2cli/commands.py”, line 274, in call
results = action(**arguments)
File “”, line 2, in ols_regression
File “/local/one/CSTAIRS/CONDA/env/qiime2-2018.8/lib/python3.5/site-packages/qiime2/sdk/action.py”, line 231, in bound_callable
output_types, provenance)
File “/local/one/CSTAIRS/CONDA/env/qiime2-2018.8/lib/python3.5/site-packages/qiime2/sdk/action.py”, line 424, in callable_executor
ret_val = self._callable(output_dir=temp_dir, **view_args)
File “/local/one/CSTAIRS/CONDA/env/qiime2-2018.8/lib/python3.5/site-packages/q2_gneiss/regression/_regression.py”, line 34, in ols_regression
ols_summary(output_dir, res, tree)
File “/local/one/CSTAIRS/CONDA/env/qiime2-2018.8/lib/python3.5/site-packages/gneiss-0.4.4-py3.5.egg/gneiss/plot/_regression_plot.py”, line 302, in ols_summary
hm_p = _heatmap_summary(model.pvalues.T, model.coefficients().T)
File “/local/one/CSTAIRS/CONDA/env/qiime2-2018.8/lib/python3.5/site-packages/gneiss-0.4.4-py3.5.egg/gneiss/plot/_regression_plot.py”, line 186, in _heatmap_summary
ind = int(np.floor((x - _min) / (_max - _min) * (N - 1)))
ValueError: cannot convert float NaN to integer

Plugin error from gneiss:

cannot convert float NaN to integer

See above for debug info.


(Matthew Ryan Dillon) #2

Hi @courtneystairs - I saw you flagged this post for removal because you solved it — I have rejected the flag - how about instead you share what you did to solve the problem, that way other future users can benefit from this. Thanks! :qiime2:


(Courtneystairs) #3

Oh of course… Its a really silly issue. Turns out both of the Gneiss problems I had (this one and the one posted earlier: QIIME2 view of regression summary empty CSV) were related to the same issue.

I have posted a reply on this post – its still pending, but hopefully gets approved soon.

In summary, I was trying to generate the regression summary using a metadata file that contained more samples than those i was trying to compare.

I had generated the balances and hierarchy files using a filtered features table. When I went to generated the regression summary, I would get the above error. However, when I used a metadata file containing only my samples of interest, it worked. As with the FDR table in the other post.

I’m pretty new to QIIME2 and do not routinely do these sorts of analyses, I’m simply running these analyses for colleagues who do not know how to use linux, so perhaps this was a newbie error. I’ve learned quite a bit over the last few weeks - the documentation is very well done and this forum is an amazing resource. So thank you for that!!