I have a Seurat object of 8 patients. I want to add metadata to that so that I have origin of each cell. At the moment UMAP just shows a bunch of cells while I want to color clusters by sample
This is my metadata
> str(head(metadata))
'data.frame': 6 obs. of 3 variables:
$ barcodes: chr "AAACAGCCAAACTGCC-5" "AAACAGCCAACAGGAT-1" "AAACAGCCAAGATTCT-1" "AAACAGCCAAGGTATA-1" ...
$ libcodes: Factor w/ 8 levels "1","2","3","4",..: 5 1 1 1 5 7
$ samples : chr "PN0252_0005" "PN0252_0001" "PN0252_0001" "PN0252_0001" ...
>
> pbmc
An object of class Seurat
36601 features across 26473 samples within 1 assay
Active assay: RNA (36601 features, 0 variable features)
>
> dim(metadata)
[1] 26473 3
>