saeyslab / nichenetr

NicheNet: predict active ligand-target links between interacting cells
469 stars 117 forks source link

Fix bugs in `assign_ligands_to_celltype` #275

Closed csangara closed 4 months ago

csangara commented 4 months ago

Example code:

seuratObj <- readRDS(url("https://zenodo.org/records/5840787/files/seurat_obj_subset_integrated_zonation.rds")) 
seuratObj <- UpdateSeuratObject(seuratObj)

seuratObj <- PrepSCTFindMarkers(seuratObj)
nichenet_output <- nichenet_seuratobj_cluster_de(
  seurat_obj = seuratObj, 
  sender = c("LSECs_portal", "Hepatocytes_portal", "Stellate cells_portal") , 
  receiver_affected = "KCs", 
  receiver_reference = c("MoMac1", "MoMac2"),
  ligand_target_matrix = ligand_target_matrix,
  lr_network = lr_network,
  weighted_networks = weighted_networks
)

assign_ligands_to_celltype(seuratObj, nichenet_output$top_ligands, celltype_col = "celltype", slot = "data")

This no longer produces an error.