Skip to content

Commit

Permalink
Improve default nimble append
Browse files Browse the repository at this point in the history
  • Loading branch information
bbimber committed Jan 31, 2025
1 parent 75e956d commit b61a726
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions R/NimbleAPI.R
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,8 @@ PerformDefaultNimbleAppend <- function(seuratObj, isotypeFilterThreshold = 0.1,
}

.GroupMhcData <- function(seuratObj, targetAssay, sourceAssay = 'MHC', prefix = 'Mamu-', assayForLibrarySize = 'RNA') {
seuratObj <- .AssignLocusToMhcFeatures(seuratObj, sourceAssayName = sourceAssay)

ad <- Seurat::GetAssay(seuratObj, assay = sourceAssay)
groupedMHC <- .RegroupCountMatrix(Seurat::GetAssayData(seuratObj, assay = sourceAssay, layer = 'counts'), featureTransform = function(x){
return(ad@meta.features$locus[rownames(ad) == x])
Expand Down
2 changes: 1 addition & 1 deletion R/NimbleAppend.R
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ AppendNimbleCounts <- function(seuratObject, nimbleFile, targetAssayName, maxAmb

x <- sort(table(x), decreasing = T)
x <- data.frame(Feature = names(x), Total = as.numeric(unname(x)))
x$Fraction <- x$Total / totalUMI
x$Total <- paste0(x$Total, ' (', scales::percent(x$Total / totalUMI, accuracy = 0.001), ')')
print(x)
df <- df[!ambigFeatRows, , drop = F]

Expand Down

0 comments on commit b61a726

Please sign in to comment.