question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] support float64 .X for cell selection from gene expression histogram.

See original GitHub issue

Copying the comment I made here as a fresh issue.

Using the demo data at https://cellxgene-example-data.czi.technology/pbmc3k.h5ad if I run

import scanpy as sc
import numpy as np
import scipy
adata = sc.read('pbmc3k.h5ad')
adata.X = scipy.sparse.csr_matrix(adata.X, dtype=np.float32)
adata.write('pbmc3k_32.h5ad')

adata = sc.read('pbmc3k.h5ad')
adata.X = scipy.sparse.csr_matrix(adata.X, dtype=np.float64)
adata.write('pbmc3k_64.h5ad')

Then the highlighting and selection as a group of cells by selecting a region of the gene expression histogram only works for pbmc3k_32.h5ad in cellxgene v0.17.0

This is a problem because h5ad files produced by SeuratDisk seem to use float.64

Which is probably also the cause of https://github.com/chanzuckerberg/cellxgene/issues/2291 since the Azimuth data h5ad file was likely produced with SeuratDisk and this file looks like:

adata = sc.read('local.h5ad')
adata.X
<982538x77521 sparse matrix of type '<class 'numpy.float64'>'
	with 1748651019 stored elements in Compressed Sparse Row format>

Screenshots Screen Shot 2021-07-20 at 23 06 49

Expected behavior cellxgene supports this function for float64 .X matrix

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Jon-bioinfocommented, Jul 20, 2021

I see the same error.

crossfilter.js:279 Warning - unknown metadata schema (float64) for field X 1480.
crossfilter.js:247 Uncaught (in promise) TypeError: o is not iterable (cannot read property undefined)
    at AM._addObsCrossfilterDimension (crossfilter.js:247)
    at crossfilter.js:166
    at Generator.next (<anonymous>)
    at Cr (asyncToGenerator.js:3)
    at i (asyncToGenerator.js:25)
1reaction
bkmartinjrcommented, Jul 20, 2021

@Jon-bioinfo - thanks for the issue.

Could you take a look at the Browser console and report any error messages you see there?

FYI, I am able to reproduce, and the console shows:

Warning - unknown metadata schema (float64) for field X 1278.
_getObsDimensionParams @ crossfilter.js:279
crossfilter.js:247 Uncaught (in promise) TypeError: o is not iterable (cannot read property undefined)
    at AM._addObsCrossfilterDimension (crossfilter.js:247)
    at crossfilter.js:166
    at Generator.next (<anonymous>)
    at Cr (asyncToGenerator.js:3)
    at i (asyncToGenerator.js:25)

Likely scenario: the back-end is failing to down-cast to float32 correctly (the front-end only accepts float32).

Read more comments on GitHub >

github_iconTop Results From Across the Web

gene highlights #2303 - chanzuckerberg/cellxgene - GitHub
One feature of cellxgene is that you can highlight the cells based on the expression of a gene by just clicking on the...
Read more >
Scanpy – Single-Cell Analysis in Python — Scanpy 1.9.1 ...
Scanpy is a scalable toolkit for analyzing single-cell gene expression data built jointly with anndata. It includes preprocessing, visualization, clustering, ...
Read more >
Release notes for Cell Ranger 7.1.0 (December 7, 2022)
The new upper range is 45,000 for single cell gene expression analyses. ... Fixed a 3' Cell Multiplexing t-SNE plot bug where the...
Read more >
Chapter 2 How to use Cellxgene VIP
To plot expression of gene among categories of an annotation, e.g., cell type, sex, or batch etc. Step 1. User needs to select...
Read more >
Exploratory Cellxgene Workshop - YouTube
This is the workshop held for using Exploratory Cellxgene (ExCellxgene) to interactively analyze and annotate single- cell datasets.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found