Skip to content

Commit 68af414

Browse files
committed
Bugfix when trying to drop the default assay
1 parent 669e5a6 commit 68af414

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

singlecell/resources/chunks/DropAssays.R

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@ for (datasetId in names(seuratObjects)) {
44

55
for (assayName in assayNames) {
66
if (assayName %in% names(seuratObj@assays)) {
7+
print(paste0('Dropping assay: ', assayName))
8+
updateAssay <- assayName == Seurat::DefaultAssay(seuratObj)
79
seuratObj@assays[[assayName]] <- NULL
10+
if (updateAssay) {
11+
print(paste0('Changing default assay to: ', names(seuratObj@assays)[1]))
12+
Seurat::DefaultAssay(seuratObj) <- names(seuratObj@assays)[1]
13+
}
814
} else {
915
print(paste0('Assay not found, skipping: ', assayName))
1016
}

0 commit comments

Comments
 (0)