R/SimpleClustering.R

Defines functions SimpleClustering

SimpleClustering = function(SeuratObject,numberPrincipalComponents,varsToRegress){
  
  #SCTransform
  SeuratObject = SCTransform(SeuratObject, vars.to.regress = c("varsToRegress"), verbose = F)
  
  # PCA and UMAP dimensional reduction
  SeuratObject <- RunPCA(object = SeuratObject, 
                        npcs = numberPrincipalComponents)
  SeuratObject <- RunUMAP(object = SeuratObject, 
                         dims = 1:numberPrincipalComponents, 
                         check_duplicates = F)
  
  # Find Neighbors and Clusters
  SeuratObject <- FindNeighbors(SeuratObject, 
                               dims = 1:numberPrincipalComponents, 
                               verbose = T)
  SeuratObject <- FindClusters(SeuratObject, 
                              verbose = T)
}
AndersonButler/ABCC.Seurat documentation built on Oct. 30, 2019, 4:49 a.m.