Skip to content

Commit

Permalink
Minor change in create_seurat to not allow underscores
Browse files Browse the repository at this point in the history
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
  • Loading branch information
malteborggrewe committed Oct 7, 2024
1 parent 098b076 commit 3314638
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions R/preprocessing.R
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ create_seurat <- function(fcs_fs,
matrix_unused <- matrix[, !(colnames(matrix) %in% panel$fcs_colname)]
# subset to only contain channels present in panel
matrix <- matrix[, colnames(matrix) %in% panel$fcs_colname]
# Seurat does not allow underscores in feature names; renaming antigen names
panel$antigen <- gsub("_", "-", panel$antigen)
# rename channels to antigen in panel
colnames(matrix) <- panel[match(colnames(matrix), panel$fcs_colname), ]$antigen
# transpose to have Seurat format
Expand Down

0 comments on commit 3314638

Please sign in to comment.