Closed ChenchenWangiSummer closed 4 years ago
Hi CC,
Please include the whole code you wanna run. You're clearly skipping some chunks in the code above since you never call the model constructor and fit
function...
Hi iosonofabio, this is my whole code:
import northstar
import scanpy as sc
# Choose atlas
af = northstar.AtlasFetcher()
af.list_atlases()
myatlas = af.fetch_atlas('Darmanis_2015_nofetal', kind='subsample')
# atlas = 'Darmanis_2015_nofetal'
# Prepare classifier
model = northstar.Subsample(
atlas=myatlas,
)
adata = sc.read('/Users/wangchenchen/data/single_cell2/downstream/LZ003_final.loom', validate=False)
#dataset = anndata.read_loom('/Users/wangchenchen/data/single_cell2/downstream/LZ003_aucell.loom', sparse=False)
# Run classifier
model.fit(adata)
# Extract result
cell_types_ns = model.membership
embedding = model.embed(method='umap')
pd.DataFrame(cell_types_ns).to_csv("/Users/wangchenchen/data/single_cell2/downstream/LZ003_celltype.csv")
Hi CC,
Please include the whole code you wanna run. You're clearly skipping some chunks in the code above since you never call the model constructor and
fit
function...
model.membership
is a pandas Series:
You could use "model.embed()" to get a sense of what's going on.
OK, so the northstar can not give the cell names if I am not setting cell names?
model.membership
is a pandas Series:
- The index is our cell names. You are not setting your cell names so they end up being strings that look like numbers - you probably wanna fix that in your loom reading step.
- The values is the clusters. If you get numbers, it means they are new clusters compared to the atlas. In other words, your cells "as are" look very different from the transcriptome profiles in that atlas.
You could use "model.embed()" to get a sense of what's going on.
I'm not sure what you mean. How could northstar know your cell names? It only knows about cell types, from the atlas
@iosonofabio sorry, I mean can I using the northstar to get the results of my cell type annotation information as the index in the output file?
@ChenchenWangiSummer I recommend you seek advice from a more experienced data analyst, your questions appear to be a little uninformed. Closing.
Hi, all I try to use the northstar to annotate my single cell dataset following the Tutorial:
but when i open the ..csv, i just see the numbers:
....
is this right? how could i get the right celltype annotation into my adata in the scanpy?
many thanks! CC