Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strategy for reclustering an Integrated object #2340

Closed
saeedfc opened this issue Nov 20, 2019 · 1 comment
Closed

Strategy for reclustering an Integrated object #2340

saeedfc opened this issue Nov 20, 2019 · 1 comment

Comments

@saeedfc
Copy link

saeedfc commented Nov 20, 2019

Dear Seurat Team,

After integration, I can either subset and run the UMAP/tSNE and Findneighbours and Findclusters functions with integrated assay.(So Seurat will use the subset of the integrated matrix it created with all the cells).

SO <- subset(Int.SO, idents = c(1,2,3,5,6,8,13,14,15))
DefaultAssay(SO) <- "integrated"
SO <- RunPCA(SO, npcs = 100, verbose = FALSE, assay = "integrated")
SO <- RunUMAP(SO, dims = 1:20, assay = "integrated", umap.method = 'umap-learn', metric = 'correlation', n.neighbors = 10L, min.dist = 0.5)
SO <- FindNeighbors(SO, dims = 1:40, prune.SNN = 1/15,k.param = 20, force.recalc = T)
SO <- FindClusters(SO, resolution = 0.65)
UMAPPlot(SO)

DefaultAssay(SO) <- "RNA"
SO <- NormalizeData(SO)

Alternatively, I can select the cell names that I need for reclustering from the original integrated object and then start fresh by creating new seurat objects with only these selected cell names and integrate freshly.(To create a new integrated matrix based on the cells present).And then do UMAP/tsne and clustering.

cell_list <- WhichCells(Int.SO, idents = c(1,2,3,5,6,8,13,14,15))
SO1 <- CreateSeuratObject(counts = X1, project = "WT", min.cells = 3, min.features = 200)
SO1 <- subset(SO1, cells = intersect(Cells(SO1), cell_list))
SO2 <- CreateSeuratObject(counts = X1, project = "KO", min.cells = 3, min.features = 200)
SO2 <- subset(SO2, cells = intersect(Cells(SO2), cell_list))
POI.sub <- list(SO1,SO2)

for (i in 1:length(POI.sub)) {
    POI.sub[[i]] <- SCTransform(POI.sub[[i]], vars.to.regress = "percent.mt",verbose = FALSE)
}

POI.features <- SelectIntegrationFeatures(object.list = POI.sub, nfeatures = 2000)

POI.sub <- PrepSCTIntegration(object.list = POI.sub, anchor.features = POI.features, 
    verbose = FALSE)
POI.anchors <- FindIntegrationAnchors(object.list = POI.sub, normalization.method = "SCT", 
    anchor.features = POI.features, verbose = FALSE)
SO <- IntegrateData(anchorset = POI.anchors, normalization.method = "SCT", 
    verbose = FALSE)

DefaultAssay(SO) <- "integrated"
SO <- RunPCA(SO, npcs = 100, verbose = FALSE, assay = "integrated")
SO <- FindNeighbors(SO, dims = 1:30)
SO <- FindClusters(SO, resolution = 0.3,graph.name = 'integrated_snn')

SO <-  RunUMAP(SO, min.dist = 0.5, assay = "integrated", umap.method = 'umap-learn', metric = 'correlation', n.neighbors = 20L,spread = 0.7, graph = 'integrated_snn')

DefaultAssay(SO) <- "RNA"
SO <- NormalizeData(SO)

Is either of these strategies 'wrong'?

@timoast
Copy link
Collaborator

timoast commented Nov 22, 2019

Neither of these are "wrong", but I don't think there is any advantage to the second approach

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants