Skip to content

Commit

Permalink
Merge pull request #23 from msraredon/dev_master
Browse files Browse the repository at this point in the history
NeighborhoodToCell metadata fix: add prefix
  • Loading branch information
jcyang34 authored Nov 9, 2023
2 parents 155ba29 + 633ed0b commit 96ad10f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
6 changes: 5 additions & 1 deletion R/RunCellToNeighborhood.R
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,11 @@ RunCellToNeighborhood <- function(sys.small,

# Add metadata based on ident slot
demo <- Seurat::AddMetaData(demo,metadata = barcodes,col.name = 'SendingCell')
demo <- Seurat::AddMetaData(demo,metadata = Seurat::Idents(sys.small)[barcodes],col.name = 'SendingType')
# bug fix: add the Neighborhood - prefix
sending_type.meta <- data.frame(Seurat::Idents(sys.small)[barcodes])
rownames(sending_type.meta) <- paste(rownames(sending_type.meta),"Neighborhood",sep = '')

demo <- Seurat::AddMetaData(demo,metadata = sending_type.meta,col.name = 'SendingType')

# Gather and assemble additional metadata
if (!is.null(meta.data.to.map)){
Expand Down
6 changes: 5 additions & 1 deletion R/RunNeighborhoodToCell.R
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,11 @@ RunNeighborhoodToCell <- function(sys.small,

# Add metadata based on ident slot
demo <- Seurat::AddMetaData(demo,metadata = barcodes,col.name = 'ReceivingCell')
demo <- Seurat::AddMetaData(demo,metadata = Seurat::Idents(sys.small)[barcodes],col.name = 'ReceivingType')
# bug fix: add the Neighborhood - prefix
receiving_type.meta <- data.frame(Seurat::Idents(sys.small)[barcodes])
rownames(receiving_type.meta) <- paste("Neighborhood",rownames(receiving_type.meta),sep = '')

demo <- Seurat::AddMetaData(demo,metadata = receiving_type.meta,col.name = 'ReceivingType')

# Gather and assemble additional metadata
if (!is.null(meta.data.to.map)){
Expand Down
2 changes: 2 additions & 0 deletions omnipathr-log/omnipathr-20231109-1646.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[2023-11-09 16:46:30] [INFO] [OmnipathR] Initialized cache: `/home/rstudio/.cache/OmnipathR`.
[2023-11-09 16:46:30] [INFO] [OmnipathR] Welcome to OmnipathR!

0 comments on commit 96ad10f

Please sign in to comment.