Open jcasadogp opened 4 weeks ago
Hi,
I have similar question as the above question. I have 48 samples after merging them I wanna integrate them in a single object, but I want also to correct the possible batch effect over 1- the orig.ident (single sample) and 2- over the experiment batches in library preparation ( there are 6 libraries) so what I am doing is according integration vignette, So my object is splitted over orig.ident and i have 48 *2 layers, my code is: seurat_object[["RNA"]] <- split(seurat_object[["RNA"]], f=seurat_object$orig.ident) seurat_object <- FindVariableFeatures(seurat_object,nfeatures = number_features) if (TCRBCR_ex == TRUE) { TCR.genes <- grep("^TR[ABGD][VJ]",rownames(seurat_object),value = T) BCR.genes <- grep("^IG[HKL]",rownames(seurat_object),value = T) gene.blacklist <- c(TCR.genes, BCR.genes) var.genes <- VariableFeatures(seurat_object) var.genes <- setdiff(var.genes,gene.blacklist) VariableFeatures(seurat_object) <- var.genes } seurat_object <- ScaleData(seurat_object) seurat_object <- RunPCA(object = seurat_object, verbose = FALSE,features = VariableFeatures(seurat_object),npcs=50) seurat_object <- IntegrateLayers( object = seurat_object, method = HarmonyIntegration, orig.reduction = "pca", new.reduction = "harmony", verbose = FALSE) seurat_object <- FindNeighbors(seurat_object, dims=1:dims,reduction = "harmony",k.param = k) seurat_object <- FindClusters(seurat_object, resolution = seq(0,1,0.1), random.seed=42) seurat_object <- FindClusters(object = seurat_object,resolution=res,random.seed=42,graph.name = 'RNA_snn') seurat_object <- RunUMAP(seurat_object,reduction = "harmony",seed.use = 42,dims=1:dims, a=0.5,b=1, verbose=FALSE) seurat_object <- JoinLayers(seurat_object)
My questions are: 1-as the splitting and integration is over orgin.ident , this will remove the batch effect over samples/orig.ident? 2-now can I do similar step by now splitting the integrated object over libraries (6 libraries) and simply repeating the steps to correct batches over libraries? 3-the final integrated object is corrected for both samples and batches? Is this a correct solution you think or am I doing over correcting?
I appreciate any feedback and suggestions.
Thanks, Sogand
Hello,
I have a question of how to do both data integration and batch effect removal. I have previously posted this issue where they introduced me in Data Integration.
I have a Seurat Object with these metadata fields: LibraryPreparationChip and Treatment. I want to remove the effect of LibraryPreparationChip and do Data Integration for Treatment in order to compare them. If I understood correctly, batch effect removal with methods like harmony will eliminate the effect of that parameter while data integration just remodels the data, but do not eliminate the effect of that parameter, right?
I have a mixture of codes trying to find the appropriate combination:
Up to this point, if I am right, I eliminated the LibraryPreparationChip effect; how should I continue to do data integration of Treatment?
Thank you in advance!!
Julia