akdess / CaSpER

78 stars 28 forks source link

workflow for merging multiple scRNA samples #42

Open hartlama opened 3 years ago

hartlama commented 3 years ago

Hello, I have multiple scRNA samples that I've merged into once Seurat object. I realize I shouldn't combine samples when merging BAM files. At what point in the workflow should I combine the BAF profiles for all samples? How do I make sure they match up to the sample IDs in my Seurat object? Thanks.

akdess commented 3 years ago

Hi @hartlama, I am very sorry for the late reply.

You can merge the cells of one sample and extract BAF file from merged bam. You can do this for all the samples. And you can give the BAF information generated from the merged bam for all the cells within one sample. Another option is to ignore BAF information and run Casper using only expression signal.

you can ignore BAF shift: after saying CreateCasperObject with parameters: loh.name.mapping=NULL and loh=NULL Instead of runCasper you can run the following:

final.objects <- list() loh.list <- list() cnv.list <- list()

message("Performing HMM segmentation...")

for (i in 1:object@cnv.scale) { cnv.list[[i]] <- PerformSegmentationWithHMM(object, cnv.scale = i, removeCentromere = F, cytoband = cytoband) }

for (i in 1:3) {

object <- cnv.list[[i]] object@segments$states2 <- rep("neut", length(object@segments$state))

object@segments$states2[as.numeric(as.character(object@segments$state)) == 1] <- "del" object@segments$states2[as.numeric(as.character(object@segments$state)) == 5] <- "amp" final.objects[[i]] <- generateLargeScaleEvents(object) }