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

AttributeError: 'DataFrame' object has no attribute 'to_dense' #13

Open
eliscar opened this issue Jun 25, 2021 · 2 comments
Open

AttributeError: 'DataFrame' object has no attribute 'to_dense' #13

eliscar opened this issue Jun 25, 2021 · 2 comments

Comments

@eliscar
Copy link

eliscar commented Jun 25, 2021

Hi,

I'm trying to do correlation analysis with SCNIC but I'm stacked at this point.

qiime SCNIC calculate-correlations
--i-table fake_data-filtered.qza
--p-method sparcc
--o-correlation-table fake_correls.qza

I received this error: "Plugin error from SCNIC:

'DataFrame' object has no attribute 'to_dense'

Debug info has been saved to /tmp/qiime2-q2cli-err-8mn7co9c.log"

The debug info is this:
Correlating with sparcc
Traceback (most recent call last):
File "/home/qiime2/miniconda/envs/qiime2-2021.4/lib/python3.8/site-packages/q2cli/commands.py", line 329, in call
results = action(**arguments)
File "", line 2, in calculate_correlations
File "/home/qiime2/miniconda/envs/qiime2-2021.4/lib/python3.8/site-packages/qiime2/sdk/action.py", line 244, in bound_callable
outputs = self.callable_executor(scope, callable_args,
File "/home/qiime2/miniconda/envs/qiime2-2021.4/lib/python3.8/site-packages/qiime2/sdk/action.py", line 390, in callable_executor
output_views = self._callable(**view_args)
File "/home/qiime2/miniconda/envs/qiime2-2021.4/lib/python3.8/site-packages/q2_SCNIC/_SCNIC_methods.py", line 29, in calculate_correlations
correls = ca.fastspar_correlation(table, verbose=True, nprocs=n_procs)
File "/home/qiime2/miniconda/envs/qiime2-2021.4/lib/python3.8/site-packages/SCNIC/correlation_analysis.py", line 77, in fastspar_correlation
table.to_dataframe().to_dense().to_csv(path.join(temp, 'otu_table.tsv'), sep='\t', index_label='#OTU ID')
File "/home/qiime2/miniconda/envs/qiime2-2021.4/lib/python3.8/site-packages/pandas/core/generic.py", line 5465, in getattr
return object.getattribute(self, name)
AttributeError: 'DataFrame' object has no attribute 'to_dense'

I understood that 'to_dense' is something related to pandas, so I try to install pandas but still, the error remains.

Someone could help me fixing it?

Thank you

@weedcentipede
Copy link

Hi, I have the exact same issue, in the same Qiime2 version (2021.4) and other env versions (2020.8 and 2020.11).

Thanks in advance,
Luis Alfonso.

@timyerg
Copy link

timyerg commented Jul 21, 2021

For me worked chanding pandas version:
pip install pandas==0.25
After the analysis change it back to newer version to avoid further issues

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