GithubHelp home page GithubHelp logo

fabilab / northstar Goto Github PK

View Code? Open in Web Editor NEW
25.0 25.0 6.0 311 KB

Single cell type annotation guided by cell atlases, with freedom to be queer

Home Page: https://northstar.readthedocs.io/

License: MIT License

Python 95.12% Shell 4.88%
cell-atlas clustering leidenalg scrna-seq scrna-seq-analysis singlecell

northstar's People

Contributors

bojkarth avatar fossabot avatar iosonofabio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

northstar's Issues

Tabula Sapiens Atlases

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

how to annotation the celltype using the extracted the result

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 optimise_partition no longer uses fixed_nodes param

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.

Error:

image

Lines to fix to optimise_partition in northstar:

https://github.com/northstaratlas/northstar/blob/7fe63704dc50680366460d20c8ff42b9cf94d718/northstar/cluster_with_annotations.py#L82-L113

Commit in Leidenalg updating the params:

vtraag/leidenalg@808bfdf#diff-e55f439ba556c8d66c1c73c19874c80a110699da462ea70f36cad3515e2565d9

MRE:

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.