Seurat: subset barcodes based on match

Created on 11 Jun 2020  路  3Comments  路  Source: satijalab/seurat

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.

Most helpful comment

subset() have cells argument for that.

All 3 comments

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).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

GHAStVHenry picture GHAStVHenry  路  3Comments

htc502 picture htc502  路  3Comments

farhanma picture farhanma  路  3Comments

kysbbubbu picture kysbbubbu  路  3Comments

Biogitte picture Biogitte  路  3Comments