Comments (3)
Hey - it would be most helpful to post user questions in the scverse forum - there, other users encountering the same question will be able to find a response easier :)
Here, to take care of bugs in scanpy, it is most helpful for us if you are able to share public data/a small part of it/a synthetic data example so that we can check whats going on. Would it possible to you to supply something like that, such that I can reproduce your example myself?
From a first glance, with seurat_v3
requiring count data, it is important that your .X
(becoming the layer you refer to as counts
) indeed contains counts, otherwise loess
quickly runs into stability issues.
from scanpy.
From a first glance, with seurat_v3 requiring count data, it is important that your .X (becoming the layer you refer to as counts) indeed contains counts, otherwise loess quickly runs into stability issues.
I would expect there would be a warning here if this were the case, since check_values
defaults to True
.
But at least this person had the same error caused by passing in normalized values:
The author of scikit-misc says:
pass
surface="direct"
to the loess solver based only off the error message. So maybe we can enable that.
I don't know enough about loess to be able to say why that would fix this. It would be interesting to see the data that caused this error. I would definitely want to have a reproducible case before attempting a fix.
from scanpy.
My code also has the same bug problem, may I ask, how to solve it?
adata.raw = adata # keep full dimension safe sc.pp.highly_variable_genes( adata, flavor="seurat_v3",# n_top_genes=2000, layer="counts", batch_key="orig.ident", subset=True, span=1 )
Error output
`ValueError Traceback (most recent call last)
Cell In[13], line 3
1 #高变基因选取
2 adata.raw = adata # keep full dimension safe
----> 3 sc.pp.highly_variable_genes(
4 adata,
5 flavor="seurat_v3",#
6 n_top_genes=2000,
7 layer="counts",
8 batch_key="orig.ident",
9 subset=True,
10 span=1
11 )
13 filename = 'melanoma_sw_high_var.h5ad'
14 adata.write(filename)
File ~/miniconda3/envs/scanpy/lib/python3.12/site-packages/scanpy/preprocessing/_highly_variable_genes.py:441, in highly_variable_genes(adata, layer, n_top_genes, min_disp, max_disp, min_mean, max_mean, span, n_bins, flavor, subset, inplace, batch_key, check_values)
439 sig = signature(_highly_variable_genes_seurat_v3)
440 n_top_genes = cast(int, sig.parameters["n_top_genes"].default)
--> 441 return _highly_variable_genes_seurat_v3(
442 adata,
443 layer=layer,
444 n_top_genes=n_top_genes,
445 batch_key=batch_key,
446 check_values=check_values,
447 span=span,
448 subset=subset,
449 inplace=inplace,
450 )
452 if batch_key is None:
453 df = _highly_variable_genes_single_batch(
454 adata,
455 layer=layer,
(...)
462 flavor=flavor,
463 )
File ~/miniconda3/envs/scanpy/lib/python3.12/site-packages/scanpy/preprocessing/_highly_variable_genes.py:87, in _highly_variable_genes_seurat_v3(adata, layer, n_top_genes, batch_key, check_values, span, subset, inplace)
85 x = np.log10(mean[not_const])
86 model = loess(x, y, span=span, degree=2)
---> 87 model.fit()
88 estimat_var[not_const] = model.outputs.fitted_values
89 reg_std = np.sqrt(10**estimat_var)
File _loess.pyx:927, in _loess.loess.fit()
ValueError: b'Extrapolation not allowed with blending'`
from scanpy.
Related Issues (20)
- scale for sparse matrixes and mask
- missing scanpy components HOT 2
- `pl.rank_genes_groups_violin` should be able to pass `**kwds` to `pl.violin`
- plots in Rstudio messed up HOT 3
- tl.leiden suddenly produces different results HOT 5
- why scale is not in spatial HOT 12
- sc.get.aggregate looses values HOT 4
- Dependency on `legacy-api-wrap` prevents 1.10 conda release HOT 1
- Future warning in \preprocessing\_highly_variable_genes.py:226 HOT 3
- leiden alg with igraph flavor causes out of bounds freezing HOT 19
- Adding format checking for sparse matrix in the function "read_v3_10x_h5"
- add support for Visium HD Spatial Gene Expression data HOT 9
- `sc.tl.ingest`: `pkg_version` does not work with `anndata==0.10.6` HOT 12
- AssertionError: Don’t call _normalize_index with non-categorical/string names HOT 1
- sc.tl.leiden TypeError: unexpected keyword 'flavor' HOT 1
- Suggestion to support VisiumHD tissue_position_list files (using parquet files) HOT 2
- Performance: Investigate `pp.scale` with sparse matrices HOT 1
- Tests fail with pytest 8.1 when a `data` dir exists HOT 13
- AxisError when calculating QC metrics on backed data HOT 1
- Failed violins HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scanpy.