@@ -7,19 +7,25 @@ for (datasetId in names(seuratObjects)) {
77 next
88 }
99
10- P1 <- Seurat :: FeaturePlot(seuratObj , features = c(field ), reduction = ' tsne' , min.cutoff = ' q05' , max.cutoff = ' q95' )
11- P2 <- Seurat :: FeaturePlot(seuratObj , features = c(field ), reduction = ' umap' , min.cutoff = ' q05' , max.cutoff = ' q95' )
10+ tryCatch({
11+ P1 <- Seurat :: FeaturePlot(seuratObj , features = c(field ), reduction = ' tsne' , min.cutoff = ' q05' , max.cutoff = ' q95' )
12+ P2 <- Seurat :: FeaturePlot(seuratObj , features = c(field ), reduction = ' umap' , min.cutoff = ' q05' , max.cutoff = ' q95' )
1213
13- if (' wnn.umap' %in% names(seuratObj @ reductions )) {
14- P3 <- Seurat :: FeaturePlot(seuratObj , features = c(field ), reduction = ' wnn.umap' , min.cutoff = ' q05' , max.cutoff = ' q95' )
15- P1 <- P1 | P2 | P3
16- } else {
17- P1 <- P1 | P2
18- }
14+ if (' wnn.umap' %in% names(seuratObj @ reductions )) {
15+ P3 <- Seurat :: FeaturePlot(seuratObj , features = c(field ), reduction = ' wnn.umap' , min.cutoff = ' q05' , max.cutoff = ' q95' )
16+ P1 <- P1 | P2 | P3
17+ } else {
18+ P1 <- P1 | P2
19+ }
1920
20- P1 <- P1 + patchwork :: plot_annotation(title = field ) + patchwork :: plot_layout(guides = " collect" )
21+ P1 <- P1 + patchwork :: plot_annotation(title = field ) + patchwork :: plot_layout(guides = " collect" )
2122
22- print(P1 )
23+ print(P1 )
24+ }, error = function (e ){
25+ print(paste0(' Error running FeaturePlots for: ' , datasetId ))
26+ print(conditionMessage(e ))
27+ traceback()
28+ })
2329 }
2430
2531 # Cleanup
0 commit comments