Skip to content

Commit e81073c

Browse files
committed
Switch barcode prefix logic from CellMembrane to LK
1 parent 8c681fd commit e81073c

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

singlecell/resources/chunks/AppendSaturation.R

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,16 @@ for (datasetId in names(seuratObjects)) {
66
stop(paste0('Unable to find molInfo file for: ', datasetId))
77
}
88

9-
seuratObj <- CellMembrane::AppendPerCellSaturation(seuratObj, molInfoFile = molInfoFile)
9+
if (!'DatasetId' %in% names(seuratObj@meta.data)) {
10+
stop('Seurat object lacks a DatasetId field!')
11+
}
12+
13+
datasetId <- unique(seuratObj$DatasetId)
14+
if (length(datasetId) != 1) {
15+
stop('Saturation can only be computed from single-dataset seurat objects!')
16+
}
17+
18+
seuratObj <- CellMembrane::AppendPerCellSaturation(seuratObj, molInfoFile = molInfoFile, cellbarcodePrefix = paste0(datasetId, '_'))
1019

1120
newSeuratObjects[[datasetId]] <- seuratObj
1221

0 commit comments

Comments
 (0)