Comments (10)
New version (1.6.1) should have fixed this.
from celltypist.
@malonzm1, can you show the result of adata.X.data.max()
?
from celltypist.
Thanks!
from celltypist.
It still says the following: WARNING:celltypist.logger:
from celltypist.
@malonzm1, can you show the shape of the data (adata.shape
), and the result of adata.X.expm1().sum(axis=1).min()
and adata.X.expm1().sum(axis=1).max()
from celltypist.
adata.shape
(3535249, 19494)
adata.X.expm1().sum(axis=1).min()
9999.994
adata.X.expm1().sum(axis=1).max()
10000.007
from celltypist.
@malonzm1, that's weird. Did you slice the data (genes) before prediction? Could you put all code here reproducing the warning message above?
from celltypist.
The warning message is: WARNING:celltypist.logger:
The code is:
import scanpy as sc
import pandas as pd
import scvi
from glob import glob
import os
import celltypist
from celltypist import models
infolder = '/scratch/cs/pan-autoimmune/data/scvi/10x'
os.chdir(infolder)
adata = sc.read_h5ad(filename='%s/10x.h5ad'%infolder)
adata.var['mt'] = adata.var_names.str.startswith('MT-')
sc.pp.calculate_qc_metrics(adata, qc_vars = ['mt'], percent_top=None, log1p=False, inplace=True)
adata = adata[adata.obs.pct_counts_mt < 15]
sc.pp.filter_genes(adata, min_counts=3)
sc.pp.filter_genes(adata, min_cells = 3)
sc.pp.filter_cells(adata, min_genes = 200)
sc.pp.filter_cells(adata, min_counts = 200)
sc.pp.normalize_total(adata, target_sum=1e4)
adata.layers["counts"] = adata.X.copy()
sc.pp.log1p(adata)
adata.raw = adata
sc.pp.highly_variable_genes(
adata,
n_top_genes=1200,
subset=True,
layer="counts",
flavor="seurat_v3",
batch_key="gse",
)
scvi.model.SCVI.setup_anndata(
adata,
layer="counts",
categorical_covariate_keys=["gse"],
continuous_covariate_keys=['pct_counts_mt', 'total_counts']
#continuous_covariate_keys=["percent_mito", "percent_ribo"],
)
models.download_models(force_update = True)
predictions = celltypist.annotate(adata, model = 'Immune_All_High.pkl', majority_voting = True)
adata = predictions.to_adata()
from celltypist.
@malonzm1, you specified subset=True
in sc.pp.highly_variable_genes
, which means only a subset of genes (here 1200) can be found in adata.X
. That's why a warning is raised because CellTypist expect all genes (for maximalising the overlap between the model and the query data) rather than only a few genes.
Btw, I think you need to put adata.layers["counts"] = adata.X.copy()
before sc.pp.normalize_total(adata, target_sum=1e4)
.
from celltypist.
Will close this issue. Please re-open it if you have further questions.
from celltypist.
Related Issues (20)
- codes for harmonizing the cell labels HOT 2
- the question about conf_score HOT 3
- CellTypist_Immune_Reference_v2 question HOT 2
- Immune_All_Low - model training question HOT 4
- Cluster-level label prediction HOT 1
- Running celltypist with concatenated dataset HOT 4
- Running the CellTypist training function celltypist.train on a subset of genes HOT 1
- ValueError in celltypist.annotate HOT 3
- is it available to generate model.pkl file from a marker gene list HOT 1
- Feature: Support Rapids-singlecell HOT 1
- Can not detect a neighborhood graph, will construct one before the over-clustering HOT 1
- multiple models HOT 7
- Question about over_clustering and conf_score? HOT 1
- Conflict with variable genes and model training HOT 1
- www.celltypist.org is down, cannot download models HOT 3
- Can not download the model HOT 2
- Very low confidence score even though labels are correct HOT 2
- celltypist before/after batch correction HOT 10
- Issue accessing www.celltypist.org - 502 Bad Gateway HOT 5
- Organ atlas Citing CellTypist. Automatic cell type harmonization and integr… HOT 1
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 celltypist.