chris-mcginnis-ucsf / MULTI-seq

R implementation of MULTI-seq sample classification workflow
59 stars 10 forks source link

MULTI-seq and Seurat Integration #9

Closed alexfernandes8a closed 4 years ago

alexfernandes8a commented 4 years ago

Hello @chris-mcginnis-ucsf, can you please provide more details about how to export the sample barcode UMI count matrix to be used as the input for Seurat or CellRanger?

RM-SCB commented 4 years ago

Hi, What I do it the following:


# This contains the  output of cell ranger count
cr <- Read10X(data.dir = "~/pathtoCellRangerOutput/filtered_feature_bc_matrix/")
sc <- CreateSeuratObject(counts = cr, project = "nameofproject", assay = "RNA")

# Load multiseq count table
bar.table <- readRDS(file = "~/pathtofile/bar.table.rds")

# Transform table
tbar <- t(bar.table)
tbar <- tbar[1:4, ] #take only barcodes/columns of interest
htos <- as.data.frame(tbar)

# Add HTO data as a new assay independent from RNA
sc[["HTO"]] <- CreateAssayObject(counts = htos)

# Normalise HTO
DefaultAssay(object = sc) <- "HTO"
sc <- NormalizeData(sc, assay = "HTO", normalization.method = "CLR")

# MULTIseqDemux / autothreshold
sc <- MULTIseqDemux(sc,
                     assay = "HTO",
                     autoThresh = TRUE,
                     maxiter = 10,
                     qrange = seq(from = 0.1, to = 0.9, by = 0.05),
                     verbose = TRUE)
chris-mcginnis-ucsf commented 4 years ago

This is a good workflow (thanks again @r-mvl ) although it is worth noting that the MULTIseqDemux command uses an older and slightly different implementation of the demultiplexing code provided in the deMULTIplex R package. If you wanted the MULTI-seq counts stored in your Seurat object, use the code from @r-mvl . Although I would suggest using the deMULTIplex classification workflow and storing the results in metadata over using the MULTIseqDemux command.

hrstuart commented 3 months ago

Hi, Do you still recommend using the deMULTIplex workflow in this repository over the seurat MULTIseqDemux command? Thanks!