You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I'm confused how the cell type classification using a reference dataset with multiple batches works in Seurat version 5. In reference mapping tutorial (https://satijalab.org/seurat/articles/integration_mapping) you integrate the batches together with cca, but then you use the non integrated PCA to classify the cell types of the query. Doesn't the batch effect impact the classification in here? In the old Seurat versions the PCA was calculated for the integrated assay and the batch corrected PCA reduction was used for cell type prediction. Why has the workflow changed despite the prediction functions are the same? Or is the tutorial not up to date?
This is my code made based on tutorial. I read unintegrated data, run PCA and predict. I skip the batch correction because according to the tutorial the batch corrected PCA reduction is not used in the prediction. Is this the correct way to do it??
`
#Read and process reference data
sobj = readRDS('hypo.rds')
sobj[["RNA"]] <- split(sobj[["RNA"]], f = sobj$batch_key)
sobj <- NormalizeData(sobj)
sobj <- FindVariableFeatures(sobj,nfeatures=3000)
sobj <- ScaleData(sobj)
sobj <- RunPCA(sobj)
#Read query and predict its cell types using the reference
sobj_in_vitro = readRDS('in_vitro.rds')
features = intersect(rownames(sobj_in_vitro[['RNA']]), VariableFeatures(sobj))
Hi,
I'm confused how the cell type classification using a reference dataset with multiple batches works in Seurat version 5. In reference mapping tutorial (https://satijalab.org/seurat/articles/integration_mapping) you integrate the batches together with cca, but then you use the non integrated PCA to classify the cell types of the query. Doesn't the batch effect impact the classification in here? In the old Seurat versions the PCA was calculated for the integrated assay and the batch corrected PCA reduction was used for cell type prediction. Why has the workflow changed despite the prediction functions are the same? Or is the tutorial not up to date?
This is my code made based on tutorial. I read unintegrated data, run PCA and predict. I skip the batch correction because according to the tutorial the batch corrected PCA reduction is not used in the prediction. Is this the correct way to do it??
`
#Read and process reference data
sobj = readRDS('hypo.rds')
sobj[["RNA"]] <- split(sobj[["RNA"]], f = sobj$batch_key)
sobj <- NormalizeData(sobj)
sobj <- FindVariableFeatures(sobj,nfeatures=3000)
sobj <- ScaleData(sobj)
sobj <- RunPCA(sobj)
#Read query and predict its cell types using the reference
sobj_in_vitro = readRDS('in_vitro.rds')
features = intersect(rownames(sobj_in_vitro[['RNA']]), VariableFeatures(sobj))
transfer_anchors <- FindTransferAnchors(reference = sobj, query = sobj_in_vitro, dims = 1:15,
reference.reduction = "pca", features=features)
predictions <- TransferData(anchorset = transfer_anchors, refdata = sobj$Cell_types, dims = 1:15)
sobj_in_vitro <- AddMetaData(sobj_in_vitro, metadata = predictions)
table(sobj_in_vitro$predicted.id)
`
The text was updated successfully, but these errors were encountered: