Comments (2)
@Tripfantasy, this model is available in CellTypist as "Mouse_Isocortex_Hippocampus.pkl".
For processing these files into a h5ad object, I am not sure of a standard way, but below is the code I usually used to do this:
import pandas as pd
import h5py
import scanpy as sc
from scipy.sparse import csr_matrix
f = h5py.File('expression_matrix.hdf5', 'r')
adata = sc.AnnData(csr_matrix(f['data']['counts'][()])).T
adata.var_names = [g.decode('utf-8') for g in f['data']['gene'][()]]
adata.obs_names = [c.decode('utf-8') for c in f['data']['samples'][()]]
coor = pd.read_csv('tsne.csv', index_col = 0)
assert coor.shape[0] == coor.index.intersection(adata.obs_names).size
assert coor.shape[0] == len(adata.obs_names)
adata.obsm['X_umap'] = coor.loc[adata.obs_names].values
meta = pd.read_csv('metadata.csv', index_col = 0)
assert meta.shape[0] == meta.index.intersection(adata.obs_names).size
assert meta.shape[0] < len(adata.obs_names)
adata = adata[meta.index].copy()
adata.obs = meta
adata.write('Yao_2021.h5ad')
from celltypist.
Oh neat! Thank you for the clarification, this helps a lot.
from celltypist.
Related Issues (20)
- " have completed preprocessing and cell clustering. " HOT 2
- 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 3
- 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 3
- Question about over_clustering and conf_score? HOT 1
- Using model trained by scRNA-seq datasets to predict Spatial transcriptmoic dataset HOT 2
- Unable to allocate xxx GiB for an array with shape and data type float64 HOT 2
- Running `celltypist.annotate` with `min_prop` can't create "Heterogeneous" category HOT 2
- Use of metacells? HOT 4
- unable to download models HOT 3
- Feature Request: Store freqs in annotation when majority_vote set to True HOT 2
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.