I would like to use Emperor to create an interactive PCoA plot outside the context of QIIME. To do this I need to generate an ordination file from my data matrix, like the results provided by skbio.stats.ordination.CA.
My data is a pandas DataFrame of bacterial strains (rows) and the COGs found in their genome (columns). Each column is a different COG, and each strain has between 0 and 4 copies of each COG. There are a lot of zeros in the matrix but no rows or columns that are populated entirely by zeros.
When I try to run stats.ordination.CA
as follows:
res_ord = stats.ordination.CA(matrix_dm, row_ids=matrix_dm.index, column_ids=cogs)
where cogs
is a pandas Series consisting of the matrix_dm
column headers.
I get a very long error, ending with: 'LinAlgError: SVD did not converge'
I've verified that my matrix does not contain any NaNs or Infs. According to a couple other threads, this might be a bug in scikit-bio. Any other thoughts on what might be happening?