text: user6827: I want to upload an excel file sheet that has certain barcodes that I would like to show on my umap. How do I go about adding the file and linking it to the metadata?
  Below is my following code.
  # set up the working directory
  wd = "/home/PTX_AAC656
  setwd(wd)
  
  # load counts
  # SD-52-JZ33 patient sample but aligned to both mouse and human
  SD_52_JZ33.data <- Read10X(data.dir = "../PTX_AAC656/metadata/patient_sample/SD-52-JZ33/outs/filtered_feature_bc_matrix/")
  BNM_human_only.data <- Read10X(data.dir = "../PTX_AAC656/metadata/human_only_alignment/SD-52-JZ33_BNM_5K/outs/filtered_feature_bc_matrix/")
  BNL_human_only.data <- Read10X(data.dir = "../PTX_AAC656/metadata/human_only_alignment/SD-52-JZ33_BNL_5K/outs/filtered_feature_bc_matrix/")
  BNL_mouse_only.data <- Read10X(data.dir = "../PTX_AAC656/metadata/mouse_only_alignment/SD-52-JZ33_BNL_5K/outs/filtered_feature_bc_matrix/")
  BNM_mouse_only.data <- Read10X(data.dir = "../PTX_AAC656/metadata/mouse_only_alignment/SD-52-JZ33_BNM_5K/outs/filtered_feature_bc_matrix/")
  
  
     BNL_both.data <- Read10X(data.dir = "../AAC656/SD-52-JZ33_BNL_5K/outs/filtered_feature_bc_matrix/")
      BNM_both.data <- Read10X(data.dir = "../AAC656/SD-52-JZ33_BNM_5K/outs/filtered_feature_bc_matrix/")
  
  setwd(wd)
  
  # create the Seurat objects
  SD_52_JZ33 <- CreateSeuratObject(counts = SD_52_JZ33.data, min.cells = 0, project = "human")
  BNL_human_only <- CreateSeuratObject(counts = BNL_human_only.data, min.cells = 0, project = "human_alignment_ptx")
  BNM_human_only <- CreateSeuratObject(counts = BNM_human_only.data, min.cells = 0, project = "human_alignment_ptx")
  BNM_both_ptx <- CreateSeuratObject(counts = BNM_both.data, min.cells = 0, project = "human_mouse_alignment_ptx")
  BNL_both_ptx <- CreateSeuratObject(counts = BNL_both.data, min.cells = 0, project = "human_mouse_alignment_ptx")
  BNL_both_ptx$model = "mouse_human_alignment_ptx"
  BNM_both_ptx$model = "mouse_human_alignment_ptx"
  SD_52_JZ33$model = "patient_aligned_mouse_human"
  BNM_human_only$model = "human_alignment_only_ptx"
  BNL_human_only$model = "human_alignment_only_ptx"
  BNL_both_ptx$model = "mouse_human_alignment_ptx"
  BNM_both_ptx$model = "mouse_human_alignment_ptx"
  BNM_mouse_only <- CreateSeuratObject(counts = BNM_mouse_only.data, min.cells = 0, project = "mouse_alignment_ptx")
  BNL_mouse_only <- CreateSeuratObject(counts = BNL_mouse_only.data, min.cells = 0, project = "mouse_alignment_ptx")
  BNL_mouse_only$model = "mouse_alignment_only_ptx"
  BNM_mouse_only$model = "mouse_alignment_only_ptx"
  
  # merge samples
  mouse_human_patient <- merge(BNL_mouse_only, y = c(BNM_mouse_only, SD_52_JZ33), add.cell.ids = c("A", "B", "C"), project = "HTB2876")
  human_ptx_human_patient <- merge(BNL_human_only, y = c(BNM_human_only, SD_52_JZ33), add.cell.ids = c("D", "E", "F"), project = "HTB2876")
  ptx_human_patient.1 <- merge(BNL_both_ptx, y = c(BNM_both_ptx, SD_52_JZ33), add.cell.ids = c("G", "H", "I"), project = "HTB2876")
  
  # mouse ptx model with patient
  # mark the mito genes
  mito.genes <- grep(pattern = "^MT-", x = rownames(x = mouse_human_patient), value = TRUE)
  mouse_human_patient[["percent.mt"]] <- PercentageFeatureSet(mouse_human_patient, pattern = "^MT-")
  mouse_human_patient[["log_nCount_RNA"]] <- log2(mouse_human_patient[["nCount_RNA"]]+1)
  
  # remove cells with <200 RNA molecules, or >6000 molecules, or >30% mito
  mouse_human_patient <- subset(mouse_human_patient, subset = nFeature_RNA > 200 & nFeature_RNA < 6000 & percent.mt < 30)
  mouse_human_patient <- NormalizeData(mouse_human_patient, normalization.method = "LogNormalize", scale.factor = 10000)
  mouse_human_patient <- FindVariableFeatures(mouse_human_patient, selection.method = "vst", nfeatures = 2000)
  all.genes.mouse <- rownames(mouse_human_patient)
  mouse_human_patient <- ScaleData(mouse_human_patient, features = VariableFeatures(object = mouse_human_patient), vars.to.regress = c("nCount_RNA"))
  mouse_human_patient <- RunPCA(mouse_human_patient, features = VariableFeatures(object = mouse_human_patient))
  mouse_human_patient <- FindNeighbors(mouse_human_patient, dims = 1:20)
  mouse_human_patient <- FindClusters(mouse_human_patient, resolution = 0.4)
  mouse_human_patient <- RunUMAP(mouse_human_patient, dims = 1:20)
  DimPlot(mouse_human_patient, reduction = "umap", group.by = "model")
  
  # human only alignment pix with patient 
  # mark the mito genes
  mito.genes <- grep(pattern = "^MT-", x = rownames(x = human_ptx_human_patient), value = TRUE)
  human_ptx_human_patient[["percent.mt"]] <- PercentageFeatureSet(human_ptx_human_patient, pattern = "^MT-")
  human_ptx_human_patient[["log_nCount_RNA"]] <- log2(human_ptx_human_patient[["nCount_RNA"]]+1)
  human_ptx_human_patient <- subset(human_ptx_human_patient, subset = nFeature_RNA > 200 & nFeature_RNA < 6000 & percent.mt < 30)
  
  # remove cells with <200 RNA molecules, or >6000 molecules, or >30% mito
  human_ptx_human_patient <- NormalizeData(human_ptx_human_patient, normalization.method = "LogNormalize", scale.factor = 10000)
  human_ptx_human_patient <- FindVariableFeatures(human_ptx_human_patient, selection.method = "vst", nfeatures = 2000)
  all.genes.human.ptx <- rownames(human_ptx_human_patient)
  human_ptx_human_patient <- ScaleData(human_ptx_human_patient, features = VariableFeatures(object = human_ptx_human_patient), vars.to.regress = c("nCount_RNA"))
  human_ptx_human_patient <- RunPCA(human_ptx_human_patient, features = VariableFeatures(object = human_ptx_human_patient))
  DimPlot(human_ptx_human_patient, reduction = "pca")
  human_ptx_human_patient <- FindNeighbors(human_ptx_human_patient, dims = 1:20)
  human_ptx_human_patient <- FindClusters(human_ptx_human_patient, resolution = 0.4)
  human_ptx_human_patient <- RunUMAP(human_ptx_human_patient, dims = 1:20)
  DimPlot(human_ptx_human_patient, reduction = "umap", group.by = "model")
  
  # ptx and human
  # mark the mito genes
  mito.genes.ptx_patient <- grep(pattern = "^MT-", x = rownames(x = ptx_human_patient.1), value = TRUE)
  ptx_human_patient.1[["percent.mt"]] <- PercentageFeatureSet(ptx_human_patient.1, pattern = "^MT-")
  ptx_human_patient.1[["log_nCount_RNA"]] <- log2(ptx_human_patient.1[["nCount_RNA"]]+1)
  
  # remove cells with <200 RNA molecules, or >6000 molecules, or >30% mito
  ptx_human_patient.1 <- subset(ptx_human_patient.1, subset = nFeature_RNA > 200 & nFeature_RNA < 6000 & percent.mt < 30)
  ptx_human_patient.1 <- NormalizeData(ptx_human_patient.1, normalization.method = "LogNormalize", scale.factor = 10000)
  ptx_human_patient.1 <- FindVariableFeatures(ptx_human_patient.1, selection.method = "vst", nfeatures = 2000)
  all.genes.both.patient.1 <- rownames(ptx_human_patient.1)
  ptx_human_patient.1 <- ScaleData(ptx_human_patient.1, features = VariableFeatures(object = ptx_human_patient.1), vars.to.regress = c("nCount_RNA"))
  ptx_human_patient.1 <- RunPCA(ptx_human_patient.1, features = VariableFeatures(object = ptx_human_patient.1))
  ptx_human_patient.1 <- FindNeighbors(ptx_human_patient.1, dims = 1:20)
  ptx_human_patient.1 <- FindClusters(ptx_human_patient.1, resolution = 0.4)
  ptx_human_patient.1 <- RunUMAP(ptx_human_patient.1, dims = 1:20)
  
  #run plots
  DimPlot(ptx_human_patient.1, reduction = "umap", group.by = "model")
  DimPlot(ptx_human_patient.1, reduction = "umap", label = "TRUE")
  saveRDS(ptx_human_patient.1, file = "derived_data/PTX_human_2876_res04_6000g.rds")
  DimPlot(ptx_human_patient.1, reduction = "umap", group.by = "model")
  DimPlot(ptx_human_patient.1, reduction = "umap", label = TRUE, pt.size = 0.5) + NoLegend()
  ptx_human_patient.1$clustering.idents <- Idents(object = ptx_human_patient.1)
  Idents(ptx_human_patient.1) <- "clustering.idents"
  new.cluster.ids <- c("Human PTX Tumor", "PTX Fibroblast", "Human Fibroblast", "PTX Macrophage", "Human PTX Tumor", "Human Mitochondrial", "Human Macrophage", "Human Endothelial", "Human T-cells", "Human PTX Tumor","Human Fibroblast", "PTX Fibroblast", "Human Tumor Ductal", "Human Acinar", "PTX Macrophage", "PTX Stellate", "PTX Endothelial")
  names(new.cluster.ids) <- levels(ptx_human_patient.1)
  ptx_human_patient.1 <- RenameIdents(ptx_human_patient.1, new.cluster.ids)
  saveRDS(ptx_human_patient.1, file = "derived_data/PTX_human_2876_res04_6000g.rds")
  p1 = DimPlot(ptx_human_patient.1, reduction = "umap", label = TRUE, pt.size = 0.5,  group.by = "clustering.idents") + NoLegend()
  p2 = DimPlot(ptx_human_patient.1, reduction = "umap", label = TRUE, pt.size = 0.5) + NoLegend()
  print(CombinePlots(plots = list(p1, p2)))
  markers2 <- FindAllMarkers(ptx_human_patient.1, min.pct = 0.25, logfc.threshold = 0.25)
  markers2 %>% group_by(cluster) %>% top_n(n = 2, wt = avg_logFC)
  saveRDS(markers, file="derived_data/markers_HTB2876_PC20_res04_6000g.rds")
  
  Part of my excel file 
  barcode muTaTionsTaTus
  GAGATGGCACTAGGCC-1  G12V
  CTGAGCGAGACTCAAA-1  G12V
  TACCGGGGTCCGAAGA-1  G12V
  TATACCTCATAGGCGA-1  G12V
  CTGCCATGTATTGGCT-1  G12V
  AGTGTTGTCAGGAGAC-1  G12V
  AATGCCAAGCAGTACG-1  G12V
  TTTGTTGAGGCTTCCG-1  G12V
  ACAGAAATCCATTCGC-1  G12V
  GTCATTTCAACTAGAA-1  G12V
  GAGTGTTGTGAGATTA-1  G12V
  TCTTGCGCATAACGGG-1  G12V
  ACATCGATCGGCATCG-1  G12V
  CATCCCACACACAGCC-1  G12V
  GACAGCCGTAGCTGTT-1  G12V
  CACAGATGTTAGGCCC-1  G12V
  AACGGGATCACAACCA-1  G12V
  
  
  user4885: If you want to add metadata to a Seurat object the new metadata needs to have the same length as the old metadata (== number of cells).  
  For an example, if you have a 8 cells c("a", "b", "c", "d", "e", "f", "g") and you want to be able to highlight the 4 cells with the "barcodes" c("a", "c", "f", "g") in a umap plot you have to add a new grouping column:
  # The Seurat object is called "ExampleData" and columns can be directly adressed using "$"
  # The barcodes of all cells are stored as the rownames of the meta.data slot 
  ExampleData$cells_of_interest <- ifelse(rownames(ExampleData@meta.data) %in% c("a", "c", "f", "g"), "interesting", "boring")
  
  From this you will get a new column in the meta data with the values:
  interesing, boring, interesting, boring, boring, interesting, interesting
  
  This way you can use this column in DimPlot:
  DimPlot(ExampleData, reduction = "umap", group.by = "cells_of_interest")
  
  With two colors in the plot one called "interesting" and one "boring"
  
original_text: 6827: <p>I want to upload an excel file sheet that has certain barcodes that I would like to show on my umap. How do I go about adding the file and linking it to the metadata?</p>
  
  <p>Below is my following code.</p>
  
  <pre><code># set up the working directory
  wd = "/home/PTX_AAC656
  setwd(wd)
  
  # load counts
  # SD-52-JZ33 patient sample but aligned to both mouse and human
  SD_52_JZ33.data &lt;- Read10X(data.dir = "../PTX_AAC656/metadata/patient_sample/SD-52-JZ33/outs/filtered_feature_bc_matrix/")
  BNM_human_only.data &lt;- Read10X(data.dir = "../PTX_AAC656/metadata/human_only_alignment/SD-52-JZ33_BNM_5K/outs/filtered_feature_bc_matrix/")
  BNL_human_only.data &lt;- Read10X(data.dir = "../PTX_AAC656/metadata/human_only_alignment/SD-52-JZ33_BNL_5K/outs/filtered_feature_bc_matrix/")
  BNL_mouse_only.data &lt;- Read10X(data.dir = "../PTX_AAC656/metadata/mouse_only_alignment/SD-52-JZ33_BNL_5K/outs/filtered_feature_bc_matrix/")
  BNM_mouse_only.data &lt;- Read10X(data.dir = "../PTX_AAC656/metadata/mouse_only_alignment/SD-52-JZ33_BNM_5K/outs/filtered_feature_bc_matrix/")
  
  
     BNL_both.data &lt;- Read10X(data.dir = "../AAC656/SD-52-JZ33_BNL_5K/outs/filtered_feature_bc_matrix/")
      BNM_both.data &lt;- Read10X(data.dir = "../AAC656/SD-52-JZ33_BNM_5K/outs/filtered_feature_bc_matrix/")
  
  setwd(wd)
  
  # create the Seurat objects
  SD_52_JZ33 &lt;- CreateSeuratObject(counts = SD_52_JZ33.data, min.cells = 0, project = "human")
  BNL_human_only &lt;- CreateSeuratObject(counts = BNL_human_only.data, min.cells = 0, project = "human_alignment_ptx")
  BNM_human_only &lt;- CreateSeuratObject(counts = BNM_human_only.data, min.cells = 0, project = "human_alignment_ptx")
  BNM_both_ptx &lt;- CreateSeuratObject(counts = BNM_both.data, min.cells = 0, project = "human_mouse_alignment_ptx")
  BNL_both_ptx &lt;- CreateSeuratObject(counts = BNL_both.data, min.cells = 0, project = "human_mouse_alignment_ptx")
  BNL_both_ptx<span class="math-container">$model = "mouse_human_alignment_ptx"
  BNM_both_ptx$</span>model = "mouse_human_alignment_ptx"
  SD_52_JZ33<span class="math-container">$model = "patient_aligned_mouse_human"
  BNM_human_only$</span>model = "human_alignment_only_ptx"
  BNL_human_only<span class="math-container">$model = "human_alignment_only_ptx"
  BNL_both_ptx$</span>model = "mouse_human_alignment_ptx"
  BNM_both_ptx<span class="math-container">$model = "mouse_human_alignment_ptx"
  BNM_mouse_only &lt;- CreateSeuratObject(counts = BNM_mouse_only.data, min.cells = 0, project = "mouse_alignment_ptx")
  BNL_mouse_only &lt;- CreateSeuratObject(counts = BNL_mouse_only.data, min.cells = 0, project = "mouse_alignment_ptx")
  BNL_mouse_only$</span>model = "mouse_alignment_only_ptx"
  BNM_mouse_only$model = "mouse_alignment_only_ptx"
  
  # merge samples
  mouse_human_patient &lt;- merge(BNL_mouse_only, y = c(BNM_mouse_only, SD_52_JZ33), add.cell.ids = c("A", "B", "C"), project = "HTB2876")
  human_ptx_human_patient &lt;- merge(BNL_human_only, y = c(BNM_human_only, SD_52_JZ33), add.cell.ids = c("D", "E", "F"), project = "HTB2876")
  ptx_human_patient.1 &lt;- merge(BNL_both_ptx, y = c(BNM_both_ptx, SD_52_JZ33), add.cell.ids = c("G", "H", "I"), project = "HTB2876")
  
  # mouse ptx model with patient
  # mark the mito genes
  mito.genes &lt;- grep(pattern = "^MT-", x = rownames(x = mouse_human_patient), value = TRUE)
  mouse_human_patient[["percent.mt"]] &lt;- PercentageFeatureSet(mouse_human_patient, pattern = "^MT-")
  mouse_human_patient[["log_nCount_RNA"]] &lt;- log2(mouse_human_patient[["nCount_RNA"]]+1)
  
  # remove cells with &lt;200 RNA molecules, or &gt;6000 molecules, or &gt;30% mito
  mouse_human_patient &lt;- subset(mouse_human_patient, subset = nFeature_RNA &gt; 200 &amp; nFeature_RNA &lt; 6000 &amp; percent.mt &lt; 30)
  mouse_human_patient &lt;- NormalizeData(mouse_human_patient, normalization.method = "LogNormalize", scale.factor = 10000)
  mouse_human_patient &lt;- FindVariableFeatures(mouse_human_patient, selection.method = "vst", nfeatures = 2000)
  all.genes.mouse &lt;- rownames(mouse_human_patient)
  mouse_human_patient &lt;- ScaleData(mouse_human_patient, features = VariableFeatures(object = mouse_human_patient), vars.to.regress = c("nCount_RNA"))
  mouse_human_patient &lt;- RunPCA(mouse_human_patient, features = VariableFeatures(object = mouse_human_patient))
  mouse_human_patient &lt;- FindNeighbors(mouse_human_patient, dims = 1:20)
  mouse_human_patient &lt;- FindClusters(mouse_human_patient, resolution = 0.4)
  mouse_human_patient &lt;- RunUMAP(mouse_human_patient, dims = 1:20)
  DimPlot(mouse_human_patient, reduction = "umap", group.by = "model")
  
  # human only alignment pix with patient 
  # mark the mito genes
  mito.genes &lt;- grep(pattern = "^MT-", x = rownames(x = human_ptx_human_patient), value = TRUE)
  human_ptx_human_patient[["percent.mt"]] &lt;- PercentageFeatureSet(human_ptx_human_patient, pattern = "^MT-")
  human_ptx_human_patient[["log_nCount_RNA"]] &lt;- log2(human_ptx_human_patient[["nCount_RNA"]]+1)
  human_ptx_human_patient &lt;- subset(human_ptx_human_patient, subset = nFeature_RNA &gt; 200 &amp; nFeature_RNA &lt; 6000 &amp; percent.mt &lt; 30)
  
  # remove cells with &lt;200 RNA molecules, or &gt;6000 molecules, or &gt;30% mito
  human_ptx_human_patient &lt;- NormalizeData(human_ptx_human_patient, normalization.method = "LogNormalize", scale.factor = 10000)
  human_ptx_human_patient &lt;- FindVariableFeatures(human_ptx_human_patient, selection.method = "vst", nfeatures = 2000)
  all.genes.human.ptx &lt;- rownames(human_ptx_human_patient)
  human_ptx_human_patient &lt;- ScaleData(human_ptx_human_patient, features = VariableFeatures(object = human_ptx_human_patient), vars.to.regress = c("nCount_RNA"))
  human_ptx_human_patient &lt;- RunPCA(human_ptx_human_patient, features = VariableFeatures(object = human_ptx_human_patient))
  DimPlot(human_ptx_human_patient, reduction = "pca")
  human_ptx_human_patient &lt;- FindNeighbors(human_ptx_human_patient, dims = 1:20)
  human_ptx_human_patient &lt;- FindClusters(human_ptx_human_patient, resolution = 0.4)
  human_ptx_human_patient &lt;- RunUMAP(human_ptx_human_patient, dims = 1:20)
  DimPlot(human_ptx_human_patient, reduction = "umap", group.by = "model")
  
  # ptx and human
  # mark the mito genes
  mito.genes.ptx_patient &lt;- grep(pattern = "^MT-", x = rownames(x = ptx_human_patient.1), value = TRUE)
  ptx_human_patient.1[["percent.mt"]] &lt;- PercentageFeatureSet(ptx_human_patient.1, pattern = "^MT-")
  ptx_human_patient.1[["log_nCount_RNA"]] &lt;- log2(ptx_human_patient.1[["nCount_RNA"]]+1)
  
  # remove cells with &lt;200 RNA molecules, or &gt;6000 molecules, or &gt;30% mito
  ptx_human_patient.1 &lt;- subset(ptx_human_patient.1, subset = nFeature_RNA &gt; 200 &amp; nFeature_RNA &lt; 6000 &amp; percent.mt &lt; 30)
  ptx_human_patient.1 &lt;- NormalizeData(ptx_human_patient.1, normalization.method = "LogNormalize", scale.factor = 10000)
  ptx_human_patient.1 &lt;- FindVariableFeatures(ptx_human_patient.1, selection.method = "vst", nfeatures = 2000)
  all.genes.both.patient.1 &lt;- rownames(ptx_human_patient.1)
  ptx_human_patient.1 &lt;- ScaleData(ptx_human_patient.1, features = VariableFeatures(object = ptx_human_patient.1), vars.to.regress = c("nCount_RNA"))
  ptx_human_patient.1 &lt;- RunPCA(ptx_human_patient.1, features = VariableFeatures(object = ptx_human_patient.1))
  ptx_human_patient.1 &lt;- FindNeighbors(ptx_human_patient.1, dims = 1:20)
  ptx_human_patient.1 &lt;- FindClusters(ptx_human_patient.1, resolution = 0.4)
  ptx_human_patient.1 &lt;- RunUMAP(ptx_human_patient.1, dims = 1:20)
  
  #run plots
  DimPlot(ptx_human_patient.1, reduction = "umap", group.by = "model")
  DimPlot(ptx_human_patient.1, reduction = "umap", label = "TRUE")
  saveRDS(ptx_human_patient.1, file = "derived_data/PTX_human_2876_res04_6000g.rds")
  DimPlot(ptx_human_patient.1, reduction = "umap", group.by = "model")
  DimPlot(ptx_human_patient.1, reduction = "umap", label = TRUE, pt.size = 0.5) + NoLegend()
  ptx_human_patient.1$clustering.idents &lt;- Idents(object = ptx_human_patient.1)
  Idents(ptx_human_patient.1) &lt;- "clustering.idents"
  new.cluster.ids &lt;- c("Human PTX Tumor", "PTX Fibroblast", "Human Fibroblast", "PTX Macrophage", "Human PTX Tumor", "Human Mitochondrial", "Human Macrophage", "Human Endothelial", "Human T-cells", "Human PTX Tumor","Human Fibroblast", "PTX Fibroblast", "Human Tumor Ductal", "Human Acinar", "PTX Macrophage", "PTX Stellate", "PTX Endothelial")
  names(new.cluster.ids) &lt;- levels(ptx_human_patient.1)
  ptx_human_patient.1 &lt;- RenameIdents(ptx_human_patient.1, new.cluster.ids)
  saveRDS(ptx_human_patient.1, file = "derived_data/PTX_human_2876_res04_6000g.rds")
  p1 = DimPlot(ptx_human_patient.1, reduction = "umap", label = TRUE, pt.size = 0.5,  group.by = "clustering.idents") + NoLegend()
  p2 = DimPlot(ptx_human_patient.1, reduction = "umap", label = TRUE, pt.size = 0.5) + NoLegend()
  print(CombinePlots(plots = list(p1, p2)))
  markers2 &lt;- FindAllMarkers(ptx_human_patient.1, min.pct = 0.25, logfc.threshold = 0.25)
  markers2 %&gt;% group_by(cluster) %&gt;% top_n(n = 2, wt = avg_logFC)
  saveRDS(markers, file="derived_data/markers_HTB2876_PC20_res04_6000g.rds")
  </code></pre>
  
  <p>Part of my excel file </p>
  
  <pre><code>barcode muTaTionsTaTus
  GAGATGGCACTAGGCC-1  G12V
  CTGAGCGAGACTCAAA-1  G12V
  TACCGGGGTCCGAAGA-1  G12V
  TATACCTCATAGGCGA-1  G12V
  CTGCCATGTATTGGCT-1  G12V
  AGTGTTGTCAGGAGAC-1  G12V
  AATGCCAAGCAGTACG-1  G12V
  TTTGTTGAGGCTTCCG-1  G12V
  ACAGAAATCCATTCGC-1  G12V
  GTCATTTCAACTAGAA-1  G12V
  GAGTGTTGTGAGATTA-1  G12V
  TCTTGCGCATAACGGG-1  G12V
  ACATCGATCGGCATCG-1  G12V
  CATCCCACACACAGCC-1  G12V
  GACAGCCGTAGCTGTT-1  G12V
  CACAGATGTTAGGCCC-1  G12V
  AACGGGATCACAACCA-1  G12V
  </code></pre>
   4885: <p>If you want to add metadata to a Seurat object the new metadata needs to have the same length as the old metadata (== number of cells).  </p>
  
  <p>For an example, if you have a 8 cells <code>c("a", "b", "c", "d", "e", "f", "g")</code> and you want to be able to highlight the 4 cells with the "barcodes" <code>c("a", "c", "f", "g")</code> in a umap plot you have to add a new grouping column:</p>
  
  <pre><code># The Seurat object is called "ExampleData" and columns can be directly adressed using "$"
  # The barcodes of all cells are stored as the rownames of the meta.data slot 
  ExampleData$cells_of_interest &lt;- ifelse(rownames(ExampleData@meta.data) %in% c("a", "c", "f", "g"), "interesting", "boring")
  </code></pre>
  
  <p>From this you will get a new column in the meta data with the values:</p>
  
  <pre><code>interesing, boring, interesting, boring, boring, interesting, interesting
  </code></pre>
  
  <p>This way you can use this column in <code>DimPlot</code>:</p>
  
  <pre><code>DimPlot(ExampleData, reduction = "umap", group.by = "cells_of_interest")
  </code></pre>
  
  <p>With two colors in the plot one called "interesting" and one "boring"</p>
  