MarioniLab/miloR

How to extract cell barcode identified by MiloR?

obotman opened this issue · 2 comments

Hello,

First, thanks for developing MiloR. It's a super tool.
I would just like to known how to extract cell barcode identified from a milo object.
How can I convert the index into its corresponding barcode?

Thanks a lot,
Olivier

Hi @obotman - could you please clarify your question? Do you mean the single-cell IDs? The are the column names of the Milo object. Or do you mean the cell ID for the neighbourhood Index cells? If so, the entries of the nhoodIndex() list are the positions of the cells in the columns of the Milo object, therefore you can retrieve the cell IDs for the nhood indices as the following:

index.ids <- colnames(milo.obj)[unlist(nhoodIndex(milo.obj))]

Here milo.obj would be whatever variable name you have for your Milo object.

Thanks @MikeDMorgan, this is exactly what I simply asking for. I didn't realise that the index corresponds to the the positions of the cells.
Best regards,
Olivier