maximilianh / cellBrowser

main repo: https://github.com/ucscGenomeBrowser/cellBrowser/ - Python pipeline and Javascript scatter plot library for single-cell datasets, http://cellbrowser.rtfd.org
https://github.com/ucscGenomeBrowser/cellBrowser/
GNU General Public License v3.0
105 stars 42 forks source link

Error on importing h5ad file with cbImportScanpy #125

Closed matthewspeir closed 5 years ago

matthewspeir commented 5 years ago

When I try importing one of the new Tabula Muris Senis h5ad files, I get the following error:

INFO:root:Writing UMAP coords to tms-brain-myeloid-facs/umap_coords.tsv
Traceback (most recent call last):
  File "/cluster/home/mspeir/miniconda3/bin/cbImportScanpy", line 10, in <module>
    sys.exit(cbImportScanpyCli())
  File "/cluster/home/mspeir/miniconda3/lib/python3.6/site-packages/cellbrowser/convert.py", line 522, in cbImportScanpyCli
    markerField=markerField)
  File "/cluster/home/mspeir/miniconda3/lib/python3.6/site-packages/cellbrowser/cellbrowser.py", line 3278, in scanpyToCellbrowser
    writeAnndataCoords(adata, layoutCode, path, layoutCode, layoutName, coordDescs)
  File "/cluster/home/mspeir/miniconda3/lib/python3.6/site-packages/cellbrowser/cellbrowser.py", line 3098, in writeAnndataCoords
    fa2_coord.columns=['x','y']
  File "/cluster/home/mspeir/miniconda3/lib/python3.6/site-packages/pandas/core/generic.py", line 4385, in __setattr__
    return object.__setattr__(self, name, value)
  File "pandas/_libs/properties.pyx", line 69, in pandas._libs.properties.AxisProperty.__set__
  File "/cluster/home/mspeir/miniconda3/lib/python3.6/site-packages/pandas/core/generic.py", line 645, in _set_axis
    self._data.set_axis(axis, labels)
  File "/cluster/home/mspeir/miniconda3/lib/python3.6/site-packages/pandas/core/internals.py", line 3323, in set_axis
    'values have {new} elements'.format(old=old_len, new=new_len))
ValueError: Length mismatch: Expected axis has 12 elements, new values have 2 elements

Some files (e.g. Bladder_droplet.h5ad and Bladder_facs.h5ad) work fine, but running it for this dataset (Brain_Myeloid_facs.h5ad) results in an error.

Command:

cbImportScanpy -i orig/Brain_Myeloid_facs.h5ad -o tms-brain-myeloid-facs -n tms-brain-myeloid-facs

Data location:

/hive/data/inside/cells/datasets/tabula-muris-senis
maximilianh commented 5 years ago

Ah. This happens when the object contains more than two dimensions. In this case, they calculated umap with many dimensions. Apparently only for a few tissues. Fixed now in 0.5.45. Thanks!

On Wed, Jul 31, 2019 at 11:07 PM Matt Speir notifications@github.com wrote:

When I try importing one of the new Tabula Muris Senis h5ad files, I get the following error:

INFO:root:Writing UMAP coords to tms-brain-myeloid-facs/umap_coords.tsv Traceback (most recent call last): File "/cluster/home/mspeir/miniconda3/bin/cbImportScanpy", line 10, in sys.exit(cbImportScanpyCli()) File "/cluster/home/mspeir/miniconda3/lib/python3.6/site-packages/cellbrowser/convert.py", line 522, in cbImportScanpyCli markerField=markerField) File "/cluster/home/mspeir/miniconda3/lib/python3.6/site-packages/cellbrowser/cellbrowser.py", line 3278, in scanpyToCellbrowser writeAnndataCoords(adata, layoutCode, path, layoutCode, layoutName, coordDescs) File "/cluster/home/mspeir/miniconda3/lib/python3.6/site-packages/cellbrowser/cellbrowser.py", line 3098, in writeAnndataCoords fa2_coord.columns=['x','y'] File "/cluster/home/mspeir/miniconda3/lib/python3.6/site-packages/pandas/core/generic.py", line 4385, in setattr return object.setattr(self, name, value) File "pandas/_libs/properties.pyx", line 69, in pandas._libs.properties.AxisProperty.set File "/cluster/home/mspeir/miniconda3/lib/python3.6/site-packages/pandas/core/generic.py", line 645, in _set_axis self._data.set_axis(axis, labels) File "/cluster/home/mspeir/miniconda3/lib/python3.6/site-packages/pandas/core/internals.py", line 3323, in set_axis 'values have {new} elements'.format(old=old_len, new=new_len)) ValueError: Length mismatch: Expected axis has 12 elements, new values have 2 elements

Some files (e.g. Bladder_droplet.h5ad and Bladder_facs.h5ad) work fine, but running it for this dataset (Brain_Myeloid_facs.h5ad) results in an error.

Command:

cbImportScanpy -i orig/Brain_Myeloid_facs.h5ad -o tms-brain-myeloid-facs -n tms-brain-myeloid-facs

Data location:

/hive/data/inside/cells/datasets/tabula-muris-senis

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/maximilianh/cellBrowser/issues/125?email_source=notifications&email_token=AACL4TN56VERFL4TUM3CS2DQCH5KVA5CNFSM4IIKSNMKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HCVMOEA, or mute the thread https://github.com/notifications/unsubscribe-auth/AACL4TJHA6YK3T7FIAQO67LQCH5KVANCNFSM4IIKSNMA .