Changes between Initial Version and Version 1 of SOP/Demultiplex_HTO_ADT_data


Ignore:
Timestamp:
05/04/21 10:25:23 (4 years ago)
Author:
ibarrasa
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • SOP/Demultiplex_HTO_ADT_data

    v1 v1  
     1== Demultiplexing hashtag oligos (HTOs) ==
     2=== Demultiplexing with hashtag oligos (HTOs) and analysis with Seurat ===
     3Follow the the Seurat vignette on hashing, but on the demultiplex step use kfunc = “kmeans”.
     4These are the main steps:
     5
     6{{{
     7library(Seurat)
     8}}}
     9
     10Read the data
     11
     12{{{
     13L13_890.data <- Read10X(data.dir = "/PathTo/L13_890_HTO/outs/filtered_feature_bc_matrix")
     14L13_892.data <- Read10X(data.dir = "/PathTo/L13_892_HTO/outs/filtered_feature_bc_matrix")
     15}}}
     16
     17Explore the data
     18
     19{{{
     20head(L13_892.data$`Antibody Capture`@Dimnames[1])
     21rownames(x = L13_892.data[["Antibody Capture"]])
     22}}}
     23
     24Create Seurat object with the gene expression data
     25
     26
     27{{{
     28L13_892 <- CreateSeuratObject(counts = L13_892.data[["Gene Expression"]])
     29}}}
     30
     31Normalize RNA data with log normalization
     32
     33{{{
     34L13_892 <- NormalizeData(L13_892)
     35}}}
     36
     37Add the Percentage of mitochondrial reads
     38
     39{{{
     40L13_892[["percent.mt"]] <- PercentageFeatureSet(object = L13_892, pattern = "^mt-")
     41}}}
     42
     43Add HTO data as a new assay independent from RNA
     44
     45{{{
     46L13_892 <- NormalizeData(L13_892, assay = "HTO", normalization.method = "CLR")
     47}}}
     48
     49Demultiplex
     50
     51{{{
     52L13_892 <- HTODemux(L13_892, assay = "HTO",  positive.quantile = 0.99,  kfunc = "kmeans")
     53}}}
     54
     55Make ridge plots to see how well the tags are separating
     56
     57{{{
     58Indents_Demux_892 <- Idents(L13_892)
     59pdf("./RindgePlots_892.pdf", w=11, h=8.5)
     60RidgePlot(L13_892, assay = "HTO", features = rownames(L13_892[["HTO"]])[1:2],ncol = 2)
     61RidgePlot(L13_892, assay = "HTO", features = rownames(L13_892[["HTO"]])[3:4],ncol = 2)
     62
     63# Group cells based on the max HTO signal #This is just a quality control.
     64# This is not the way of separating cells by barcode
     65Idents(L13_892) <- "HTO_maxID"
     66RidgePlot(L13_892, assay = "HTO", features = rownames(L13_892[["HTO"]])[1:2],ncol = 2)
     67RidgePlot(L13_892, assay = "HTO", features = rownames(L13_892[["HTO"]])[3:4],ncol = 2)
     68dev.off()
     69Idents(L13_892) <- Indents_Demux_892
     70}}}
     71
     72See how many cells of each type do I have
     73
     74{{{
     75table(Idents(object = L13_892))
     76}}}
     77
     78 Now that we have separated the different cell populations we would continue with the standard Seurat Analysis.
     79
     80If we are combining several lanes and want to keep track of which negatives and doublets are coming from each lane, we may want to rename the cell IDs before merging several objects:
     81
     82{{{
     83table(Idents(object = L13_892))
     84new.cluster.ids <- c("Doublet892", "BFUEs-24h-PlusDex", "BFUEs-24h-PlusGalun", "BFUEs-24h-PlusTGFb", "BFUEs-24h-RegMed", "Negative892")
     85names(new.cluster.ids) <- levels(L13_892)
     86L13_892 <- RenameIdents(L13_892, new.cluster.ids)
     87table(Idents(object = L13_892))
     88head(Idents(L13_894))
     89table(Idents(object = L13_894))
     90new.cluster.ids <- c("Doublet894", "Condition1", "Condition2", "Condition3", "Condition4", "Negative894")
     91names(new.cluster.ids) <- levels(L13_894)
     92L13_894 <- RenameIdents(L13_894, new.cluster.ids)
     93table(Idents(object = L13_894))
     94}}}
     95
     96Merge all the sequencing lanes (the other samples 894, 896, 898 and 900 have been processed the same way than 892)
     97
     98{{{
     99all <- merge(x = L13_892, y = c(L13_894,L13_896,L13_898,L13_900))
     100}}}
     101