Hi,
I hope that a similar issue was not yet open here.
I'm analyzing a data set and I would like to filter my seurat object based on barcode matching. So I have a folder that contain the cells barcodes that I want to retrieve from my object, example:
barcode
1: AAACCTGAGAAACCTA
2: AAACCTGAGAAAGTGG
3: AAACGGGAGGTTCCTA
4: AAACGGGCACTGTGTA
5: AAACGGGGTGAACCTT
The problem is, in my list the number of barcode are much more smaller than in my seurat object, so if I add this info to metadata this doesn't work.
You have a way to match barcodes from the object with an external file (in order to allow you to continue the analysis just with this subset of cells)?
I saw the subset() function but I think this cannot be applied to this case, please correct me if I'm wrong.
Thanks for your time.
subset() have cells argument for that.
Yes definitely the subset function with cells argument as listed above. Just make sure to remove numbers preceding barcodes and make sure to append appropriate suffix if the barcodes in your Seurat object have sample suffixes attached.
Thanks @crazyhottommy and @samuel-marsh I tested now and works perfectly (I completely forgot to see this argument).
Most helpful comment
subset()havecellsargument for that.