Hi,
I am using R version 4.4.2 and Seurat v5.2.1.
I have a dataset of 48 scRNAseq samples in sets of four samples per run; each rds file corresponds to one run. I have a csv of some metadata I want to add per sample (which also contains the barcode, batch, and run number per sample); however, I am unsure of the best way to demultiplex the samples since their barcodes (added on the bench one-by-one before pooling in sets of four for single-cell isolation) repeat in sets of 12 (we ran this in four batches). So, for instance, tag1 appears in all the runs i.e. rds files but is relevant for four samples within 1-4 files (depending on the tag order, some were mixed up as we had to re-run a lane), tag2 also is in all files' metadata barcode field but is needed for only four samples of the 48, and so on.
So, I have the batch and run number in the file name, and the non-unique barcode is in the metadata per file, but nowhere in the seurat object itself. How can I use HTODemux or another approach to split these up AND add the information from the file name to the seurat_object@meta.data layer?
I welcome any suggestions! Thank you!
(eta: typo in post tag)
Does my question and my answer in the following post help in any way: How to read a dataframe into Seurat for AddMetaData properly?