Bug / Usage issue on "diversity alpha-correlation"?

Hi all,
The following might be a minor issue to solve.
“qiime diversity alpha-correlation” may throw an error if the metric to correlate is present as column in the passed metadata (e.g. #SampleID\tBarcodeSequence\t…faith_pd)

1 Like

Thanks @Franck_Lejzerowicz!

Could you you please share the command and full error traceback you are receiving? I can toss that info into a bug report.

Thanks!

Hi @Nicholas_Bokulich,

it’s qiime2-2018.2

Command:
qiime diversity alpha-correlation
–i-alpha-diversity /path/tosom_file_faith_pd.qza
–p-method spearman
–m-metadata-file /path/to/metadata_containing_collated_faith_pd_column.tsv
–o-visualization /path/to/output/dir

Output:
Plugin error from diversity:
only length-1 arrays can be converted to Python scalars

If I then:

import pandas as pd
t = pd.read_csv(’/path/to/metadata_containing_collated_faith_pd_column.tsv’, header=0, sep=’\t’, index_col=0, dtype=object)
t2 = t.loc[:,[x for x in list(t.columns) if ‘faith_pd’ not in x]]
t2.to_csv(’/path/to/metadata_containing_collated_faith_pd_column____TMP.tsv’, sep=’\t’)

and then re-Command:

qiime diversity alpha-correlation
–i-alpha-diversity /path/tosom_file_faith_pd.qza
–p-method spearman
–m-metadata-file /path/to/metadata_containing_collated_faith_pd_column____TMP.tsv
–o-visualization /path/to/output/dir

Output OK:

Saved Visualization to: /path/to/output/dir.qzv

Could the same column entry in both the metadata and the alpha diversity (here “faith_pd”) create the problem? I guess some users might be collating alphas in their metadata so it could be an issue.

Thanks to you.
F

1 Like

Thanks @Franck_Lejzerowicz!

I have raised this bug report. We will post back here when this is resolved. Stay tuned! :radio:

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.