Help with subset seurat object by a column in metadata
Hi all,
I try to subset seurat object by sample:
subset(x = combined_seurat_large, subset = sample == "1") Error in .subscript.2ary(x, i, j, drop = drop) : subscript out of bounds
I found other people asked this error on the internet but don't have a clear answer yet. Would you please have a suggestion? The error persists with seurat version 4.3 and 5.1. Thank you so much!
• 2,100 views
•
link
0 answers
No answers yet.
Log in to answer this question.
If
sampleis one of the column inmeta.data, you can subset sample "1" using following commands:Thank you for your reply! Unfortunately, I got the same error message.
Seems that the bug still exists and they are working on it.
...and maybe you should try switch to Scanpy as @stefanonard85 said here: github issue
Thank you for the suggestion. Another way is to recreate the seurat object and use only the sample you want.