velocyto-team / velocyto.py

RNA velocity estimation in Python
http://velocyto.org/velocyto.py/
BSD 2-Clause "Simplified" License
160 stars 83 forks source link

Is it possible to analyze a part of cells in one loom.file according to CellID #77

Closed sunyan4BGI closed 6 years ago

sunyan4BGI commented 6 years ago

I have a loom.file of 3,000 cells (from SmartSeq2). But I only want to analyze one type of about 2,000 cells. Can I select these cells from the loom.file according to CellIDs? Or do I have to create another loom.file by velocyto run?

gioelelm commented 6 years ago

You can select the cells that you want to analyse by making a new filtered loom file. However the simplest way to pick a subset of cells is to do it as a filtering steps at the beginning of analysis you can do this using the velocyto's filter_cells method.

sunyan4BGI commented 6 years ago

I tried vlm.filter_cells(vlm.ca['CellID']==cellID_of_T_cells) cellID_of_T_cells is the list of cellIDs and I got ValueError: Lengths must match to compare

gioelelm commented 6 years ago

This is not a problem of velocyto.

You are comparing two numpy arrays and it is up to you to do this properly. Are you sure you are doing this in the right way? Maybe you should use the numpy.in1d function not the "==" statement.

sunyan4BGI commented 6 years ago

Thanks for your reply! I now get the correct result! velocyto is really a great algorithm,it can deal with datasets that other pseudotime algorithms can't do!