alexyermanos / Platypus

R package for the analysis of single-cell immune repertoires
GNU General Public License v3.0
36 stars 16 forks source link

VDJ_GEX_matrix removes the embeddings for cells without VDJ information #59

Open jianwu1 opened 1 year ago

jianwu1 commented 1 year ago

Hi,

I'm using packageVersion("Platypus") ‘3.4.1’. When doing DimPlot(vgm$GEX,reduction = "umap", group.by = "VDJ_available"), I found that cells without VDJs are not plotted due to NAs in their umap embeddings:

Screenshot 2023-07-15 at 12 08 46 pm

However, these cells do have embeddings in the seurat object I fed into VDJ_GEX_matrix():

vgm <- VDJ_GEX_matrix(
  VDJ.out.directory.list = list(vdj_dir),
  Seurat.in = lung_B16_CD4,
  group.id = 1L,
  GEX.integrate = TRUE,   
  VDJ.combine = TRUE, 
  integrate.VDJ.to.GEX = TRUE, 
  integrate.GEX.to.VDJ = TRUE, 

  trim.and.align = TRUE, 
  gap.opening.cost = 10,
  gap.extension.cost = 4, 
  parallel.processing = "mclapply"
  )
VDJ_unavailable_cells <- vgm$GEX@meta.data %>% 
  as_tibble(rownames = "barcode") %>% 
  filter(is.na(umap_1)) %>% 
  pull(barcode) %>% 
  str_remove("s\\d\\_") %>% 
  paste0("-1") %>% 
  subset(lung_B16_CD4, cells = .)

Embeddings(VDJ_unvailable_cells, reduction = "umap")
Screenshot 2023-07-15 at 12 15 21 pm

In addition, the embeddings for these cells are actually present in the reduction layer of vgm$GEX:

Screenshot 2023-07-15 at 3 08 16 pm