Skip to content

Commit 3314638

Browse files
Minor change in create_seurat to not allow underscores
Seurat changes underscores to dashes in feature names, which could interfere with panel antigen names in seu@misc and thus produces errors in transformation. Now feature names are automatically adjusted in create_seurat function
1 parent 098b076 commit 3314638

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

R/preprocessing.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ create_seurat <- function(fcs_fs,
7575
matrix_unused <- matrix[, !(colnames(matrix) %in% panel$fcs_colname)]
7676
# subset to only contain channels present in panel
7777
matrix <- matrix[, colnames(matrix) %in% panel$fcs_colname]
78+
# Seurat does not allow underscores in feature names; renaming antigen names
79+
panel$antigen <- gsub("_", "-", panel$antigen)
7880
# rename channels to antigen in panel
7981
colnames(matrix) <- panel[match(colnames(matrix), panel$fcs_colname), ]$antigen
8082
# transpose to have Seurat format

0 commit comments

Comments
 (0)