fabilab / northstar Goto Github PK
View Code? Open in Web Editor NEWSingle cell type annotation guided by cell atlases, with freedom to be queer
Home Page: https://northstar.readthedocs.io/
License: MIT License
Single cell type annotation guided by cell atlases, with freedom to be queer
Home Page: https://northstar.readthedocs.io/
License: MIT License
Hi Fabio,
I hope you and doing well (and still monitoring this repository).
I'm trying to generate Atlases from the Tabula Sapiens h5ad files that you can download from figshare.
I want to use them to classify tissue-matched samples.
I've gotten northstar to run through (the "subsample" version) but maybe classify 10% of new cells.
I was wondering what type of processing I should do before reading these files with annData and calling the northstar.average_atlas()/northstar.subsample_atlas() and northstar.Averages()/northstar.Subsample functions.
Also, what kind of preprocessing should I do on in let's say Seurat on a standard 10x run?
Would really appreciate the help! All other cell assignment pipelines I have tried are basically unusable.
Thanks,
Chris
Hi, all
I try to use the northstar to annotate my single cell dataset following the Tutorial:
...
af = northstar.AtlasFetcher()
af.list_atlases()
myatlas = af.fetch_atlas('Darmanis_2015_nofetal', kind='subsample')
cell_types_ns = model.membership
pd.DataFrame(cell_types_ns).to_csv("/Users/.../..celltype.csv")
but when i open the ..csv, i just see the numbers:
ย | 0 |
---|---|
0 | 18 |
1 | 17 |
2 | 17 |
3 | 17 |
4 | 17 |
5 | 17 |
6 | 17 |
7 | 17 |
8 | 17 |
9 | 17 |
10 | 17 |
11 | 17 |
12 | 17 |
13 | 17 |
....
is this right? how could i get the right celltype annotation into my adata in the scanpy?
many thanks!
CC
Leidenalg no longer supports the param fixed_nodes in optimise_partition as of 26Aug. This results in the below error. fixed_nodes should be changed to is_membership_fixed.
vtraag/leidenalg@808bfdf#diff-e55f439ba556c8d66c1c73c19874c80a110699da462ea70f36cad3515e2565d9
import northstar
from anndata import AnnData
import pandas as pd
import numpy as np
import string
# Choose an atlas
atlas_name = 'Darmanis_2015'
# Get a gene expression matrix of the new dataset (here a
# random matrix for simplicity)
N = 200
L = 50
af = northstar.AtlasFetcher()
dar_atlas = af.fetch_atlas( "Darmanis_2015")
dar_genes = dar_atlas.var_names
new_dataset = pd.DataFrame(
data=np.random.rand(L, N).astype(np.float32),
index=list(np.random.choice(list(dar_genes), L)),
columns=['cell_'+str(i+1) for i in range(N)],
)
# Initialize northstar classes
model = northstar.Averages(
atlas='Darmanis_2015',
n_neighbors=5,
n_pcs=10,
)
# Run the classifier
model.fit(new_dataset)
# Get the cluster memberships for the new cells
membership = model.membership
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.