Skip to content

"Error: None of the features provided found in this assay" when running nichenet_seuratobj_aggregate #310

Description

@kangjiajinlong

Dear Nichetnetr team,

I am using Nichenet for my own Seurat data and I met an error in running the following code:

.libPaths("~/R/ubuntu/4.4.1/")

library(nichenetr)
library(Seurat)
library(SeuratObject)
library(tidyverse)
library(qs)

#Get Seurat object
obj.sub <- qread("Jack_analysis/filtered_gene_expression_without_doublet_29009_gsea_obj_new.qs")

obj.sub
An object of class Seurat
53711 features across 84827 samples within 13 assays
Active assay: SCT (16177 features, 3000 variable features)
3 layers present: counts, data, scale.data
12 other assays present: RNA, Antibody, escape.BP, escape.H, escape.C6, escape.Reactome, escape.WikiPathways, escape.BP_normalized, escape.H_normalized, escape.C6_normalized, escape.Reactome_normalized, escape.WikiPathways_normalized
2 dimensional reductions calculated: pca, umap

#Read in nichnet network
lr_network <- readRDS("Jack_analysis/nichnet/lr_network_human_21122021.rds")
ligand_target_matrix <- readRDS("Jack_analysis/nichnet/ligand_target_matrix_nsga2r_final.rds")
weighted_networks <- readRDS("Jack_analysis/nichnet/weighted_networks_nsga2r_final.rds")

#Perform the NicheNet analysis
#sender-focused approach
Idents(obj.sub) <- "major_celltype"

table(Idents(obj.sub))
CAR-NK Tumor PBMC
35161 23687 25979

table(obj.sub$condition)
Tumor + CAR Tumor + CAR + PBMC Tumor + PBMC
21441 35554 27832

nichenet_output <- nichenet_seuratobj_aggregate(
seurat_obj = obj.sub,
sender = "CAR-NK",
receiver = "Tumor",
condition_colname = "condition",
condition_oi = "Tumor + CAR + PBMC",
condition_reference = "Tumor + CAR",
expression_pct = 0.05,
ligand_target_matrix = ligand_target_matrix,
lr_network = lr_network,
weighted_networks = weighted_networks
)
[1] "The SCT assay will be used for the analysis."
[1] "Read in and process NicheNet's networks"
[1] "Define expressed ligands and receptors in receiver and sender cells"
[1] "Perform DE analysis in receiver cell"
[1] "Perform NicheNet ligand activity analysis"
[1] "Infer active target genes of the prioritized ligands"
[1] "Infer receptors of the prioritized ligands"
[1] "Perform DE analysis in sender cells"
Error: None of the features provided found in this assay

Session info is as follows:
R version 4.4.1 (2024-06-14)
Platform: x86_64-pc-linux-gnu
Running under: Ubuntu 22.04.5 LTS

Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so; LAPACK version 3.10.0

locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

time zone: Etc/UTC
tzcode source: system (glibc)

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] qs_0.27.2 lubridate_1.9.3 forcats_1.0.0 stringr_1.5.1 dplyr_1.1.4 purrr_1.0.2
[7] readr_2.1.5 tidyr_1.3.1 tibble_3.2.1 ggplot2_3.5.1 tidyverse_2.0.0 Seurat_5.1.0
[13] SeuratObject_5.0.2 sp_2.1-4 nichenetr_2.2.0

loaded via a namespace (and not attached):
[1] RcppAnnoy_0.0.22 splines_4.4.1 later_1.3.2 bitops_1.0-9 polyclip_1.10-7
[6] hardhat_1.4.0 pROC_1.18.5 rpart_4.1.23 fastDummies_1.7.4 lifecycle_1.0.4
[11] rstatix_0.7.2 doParallel_1.0.17 globals_0.16.3 lattice_0.22-6 MASS_7.3-60.2
[16] backports_1.5.0 magrittr_2.0.3 rmarkdown_2.29 Hmisc_5.2-0 plotly_4.10.4
[21] httpuv_1.6.15 sctransform_0.4.1 spam_2.11-0 spatstat.sparse_3.1-0 reticulate_1.40.0
[26] cowplot_1.1.3 pbapply_1.7-2 RColorBrewer_1.1-3 pkgload_1.4.0 abind_1.4-8
[31] Rtsne_0.17 presto_1.0.0 BiocGenerics_0.52.0 nnet_7.3-19 tweenr_2.0.3
[36] ipred_0.9-15 circlize_0.4.16 lava_1.8.0 IRanges_2.40.0 S4Vectors_0.44.0
[41] ggrepel_0.9.6 irlba_2.3.5.1 listenv_0.9.1 spatstat.utils_3.1-1 goftest_1.2-3
[46] RSpectra_0.16-2 spatstat.random_3.3-2 fitdistrplus_1.2-1 parallelly_1.39.0 leiden_0.4.3.1
[51] codetools_0.2-20 RApiSerialize_0.1.4 ggforce_0.4.2 tidyselect_1.2.1 shape_1.4.6.1
[56] farver_2.1.2 matrixStats_1.4.1 stats4_4.4.1 base64enc_0.1-3 spatstat.explore_3.3-3
[61] jsonlite_1.8.9 caret_6.0-94 GetoptLong_1.0.5 e1071_1.7-16 progressr_0.15.1
[66] Formula_1.2-5 ggridges_0.5.6 survival_3.6-4 iterators_1.0.14 foreach_1.5.2
[71] tools_4.4.1 ggnewscale_0.5.0 ica_1.0-3 Rcpp_1.0.13-1 glue_1.8.0
[76] prodlim_2024.06.25 gridExtra_2.3 xfun_0.49 withr_3.0.2 fastmap_1.2.0
[81] fansi_1.0.6 caTools_1.18.3 digest_0.6.37 timechange_0.3.0 R6_2.5.1
[86] mime_0.12 colorspace_2.1-1 scattermore_1.2 tensor_1.5 spatstat.data_3.1-4
[91] DiagrammeR_1.0.11 utf8_1.2.4 generics_0.1.3 data.table_1.16.2 recipes_1.1.0
[96] class_7.3-22 httr_1.4.7 htmlwidgets_1.6.4 uwot_0.2.2 ModelMetrics_1.2.2.2
[101] pkgconfig_2.0.3 gtable_0.3.6 timeDate_4041.110 ComplexHeatmap_2.22.0 lmtest_0.9-40
[106] shadowtext_0.1.4 htmltools_0.5.8.1 carData_3.0-5 dotCall64_1.2 clue_0.3-66
[111] scales_1.3.0 png_0.1-8 gower_1.0.1 spatstat.univar_3.1-1 knitr_1.49
[116] rstudioapi_0.17.1 tzdb_0.4.0 reshape2_1.4.4 rjson_0.2.23 checkmate_2.3.2
[121] visNetwork_2.1.2 nlme_3.1-164 proxy_0.4-27 zoo_1.8-12 GlobalOptions_0.1.2
[126] KernSmooth_2.23-24 parallel_4.4.1 miniUI_0.1.1.1 foreign_0.8-86 pillar_1.9.0
[131] grid_4.4.1 vctrs_0.6.5 RANN_2.6.2 ggpubr_0.6.0 randomForest_4.7-1.2
[136] promises_1.3.0 car_3.1-3 stringfish_0.16.0 xtable_1.8-4 cluster_2.1.6
[141] htmlTable_2.4.3 evaluate_1.0.1 cli_3.6.3 compiler_4.4.1 rlang_1.1.4
[146] crayon_1.5.3 ggsignif_0.6.4 future.apply_1.11.3 labeling_0.4.3 fdrtool_1.2.18
[151] plyr_1.8.9 stringi_1.8.4 viridisLite_0.4.2 deldir_2.0-4 munsell_0.5.1
[156] lazyeval_0.2.2 spatstat.geom_3.3-4 Matrix_1.7-0 RcppHNSW_0.6.0 hms_1.1.3
[161] patchwork_1.3.0 future_1.34.0 shiny_1.9.1 ROCR_1.0-11 broom_1.0.7
[166] igraph_2.1.1 RcppParallel_5.1.9

The error is the same whether I use RNA or SCT assay. Could you kindly advise what is the cause of this issue and what I should do? Thanks for the help.

Jack

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions