satijalab / seurat

R toolkit for single cell genomics
http://www.satijalab.org/seurat
Other
2.26k stars 908 forks source link

HVFInfo() Error: argument "selection.method" is missing, with no default #8098

Closed AnnaAMonaco closed 10 months ago

AnnaAMonaco commented 10 months ago

Hi,

I am running Seurat on a series of samples and have been using the same script without issue for quite some time now, however today I ran into an issue with HVFInfo(). I want to extract the info to subset the HVGs to use for downstream analysis, and this step has never given me problems. Now it complains a lack of "selection.method".

> fl.se = FindVariableFeatures(fl.se, assay = "integrated")
Warning: Not all features provided are in this Assay object, removing the following feature(s): HBBP1, HBZ2, PF4V1, SHH, TRDN, HBZ, PRSS56, PTH2, APOA1, SOST, TUBB3, NR0B1, SRRM3, FGF3, ANKRD55, RXFP2, DPPA3, MYBPC3, CXCL10, CCER1, CHADL, GSX2, IQCJ, GIMAP5, FLJ30838, GRAP, MYPN, SLC22A2, SMYD1, LMOD3, PAH, GAD2, GJD4, CDH4, PAX1, GIMAP8, GP6, HSPB3, LINC00672, AKAP5, DCDC1, TRIB3, ASGR2, TM6SF2, KCNH8, HNF4A, C2CD2, NMS, NOVA2, GALR3, PCNX2B, MOS, EXOC3L1, OLFR149, PNLIPRP2, APOD, QSOX2, TRDV1, CLCN7, MMP17, FAM229A, DNAJB7, TMEM191C, NET1, CATIP, SLC34A3, ABCA4, NR1I3, TUNAR, RAD9B, ASZ1, DGKG, MT4, SRD5A1, CD5, FBP2, C8orf82, MYO1H, IFIT3, FOXL3-OT1, MAPK15, TEKT4, AQP4, CER1, COX8C, OC90, GNAS, WDR87, PDE1C, SPNS3, HYOU1, GATM, EARS2, FLJ42875, LY6G6C, PAQR3, ZNF750, H2AC16, PRKCG, SPDYA, DDB2, POPDC2, FBXO4, TERB1, KLHL10, PRSS57, PKP3, RIPK1, LHPP, NMRK2, LZTS1, FUT9, SEC62, HOXB3, ZER1, GPRIN2, EMILIN3, BCL6B, SPAG4, COX7B, TCAF2, AFAP1L2, P2RY1, SUSD4, TMEM61, GSTM5, GCLC, SCAND2P, DNAJ [... truncated]
> my.HVF = HVFInfo(fl.se)
Warning: The following arguments are not used: method
Error in tolower(x = selection.method) : 
  argument "selection.method" is missing, with no default

I tried running HVFInfo() with also method="sct" and selection.method="sct" (even though it's deprecated), but neither helped. fl.se is a Seurat object subset of another, my.se that I have successfully run HVFInfo() on. So I loaded that object but now I run into the same error message.

> my.se <- readRDS("data/Ra_no81-integrated.rds")
> my.se = FindVariableFeatures(my.se, assay = "integrated")
Warning: Not all features provided are in this Assay object, removing the following feature(s): MATN1, CCL4, SPINK5, CCL3, CHGB, IBSP, SST, CXCL10, KRT4, TNMD, COX6A2, PI3, ACAN, SYT4, CD52, TREM2, ART3, RIT2, TREM1, C3AR1, SPRR1A, MEFV, RP1L1, CD14, FBP2, CCL19, SMPD3, GSG1, APOD, LY6D, XKR4, FAM180A, OC90, ITGBL1, PENK, COL28A1, SEZ6L, STMN4, UPK1B, DIO2, GBP5, AGR3, PADI1, SLC6A18, CLVS1, SLC17A6, MYOZ2, MYOM1, AREG, DHH, MUC16, MB, SCG2, SAA2, KRT16, CCL21, CLEC2D, LMOD3, HSD17B2, SLA2, PAX7, PCSK1, SNHG9, CDH4, TXLNB, CP, UBD, SIGLEC6B, GALNT6, IL7R, TAC1, AQP4, KIF2B, MIAT, SLC10A4, DGKB, CHRNA1, APCDD1L, FUT2, GJA4, CFI, ALDH1A1, BBOX1, SULT1E1, PRLR, COMP, SAMSN1, PAPPA2, SLC15A2, OVOL1, TMEM273, LCN6, GRM5, AVPR1A, RGS6, NRG3, IL11, SYNPR, GRAP2, KCNC3, ERICH3, LHX8, BANF2, MYH2, TEKT4, TLR13, PCNX2B, APOC1, C1QTNF8, TAFA1, LYPD1, SLC5A7, HSD11B1, MEGF11, PHF24, DCST1, ZNF157, HNF4A, MSR1, B3GNT9, LCN2, LHCGR, ADAM28, ESRRB, BARX1, SLC6A20, C19orf31, KCNAB1, TMEM229A, DMRT1, IL17RB, CF [... truncated]
> my.HVF = HVFInfo(my.se)
Warning: The following arguments are not used: method
Error in tolower(x = selection.method) : 
  argument "selection.method" is missing, with no default

Could this be a compatibility issue between SeuratObject (v5.0.1) and Seurat (4.3.0.1)? I don't recall updating either since the last time I used HVFInfo(), but could've been updated as a dependency from something else and I didn't notice. I tried closing and starting a new R session a few times, but get the same outcome.

Thanks in advance, Anna

> sessionInfo()
R version 4.2.2 (2022-10-31)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: MarIuX64 2.0 GNU/Linux

Matrix products: default
BLAS:   /pkg/R-4.2.2-0/lib/R/lib/libRblas.so
LAPACK: /pkg/R-4.2.2-0/lib/R/lib/libRlapack.so

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

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

other attached packages:
 [1] stringr_1.5.0      Polychrome_1.5.1   ggrepel_0.9.2      gridExtra_2.3     
 [5] tidyr_1.3.0        ggplot2_3.4.0      RColorBrewer_1.1-3 Rtsne_0.16        
 [9] dplyr_1.1.4        SeuratObject_5.0.1 Seurat_4.3.0.1    

loaded via a namespace (and not attached):
 [1] nlme_3.1-161           spatstat.sparse_3.0-0  matrixStats_0.63.0    
 [4] RcppAnnoy_0.0.20       httr_1.4.4             sctransform_0.4.1     
 [7] tools_4.2.2            utf8_1.2.2             R6_2.5.1              
[10] irlba_2.3.5.1          KernSmooth_2.23-20     DBI_1.1.3             
[13] uwot_0.1.14            lazyeval_0.2.2         colorspace_2.1-0
[16] withr_2.5.0            sp_1.6-0               tidyselect_1.2.0
[19] compiler_4.2.2         progressr_0.13.0       cli_3.6.1
[22] spatstat.explore_3.0-6 plotly_4.10.3          labeling_0.4.2
[25] scales_1.2.1           lmtest_0.9-40          spatstat.data_3.0-0
[28] ggridges_0.5.4         pbapply_1.7-0          goftest_1.2-3
[31] digest_0.6.31          spatstat.utils_3.0-1   pkgconfig_2.0.3
[34] htmltools_0.5.4        parallelly_1.34.0      fastmap_1.1.0
[37] htmlwidgets_1.6.2      rlang_1.1.2            shiny_1.7.4
[40] farver_2.1.1           generics_0.1.3         zoo_1.8-11
[43] jsonlite_1.8.4         spatstat.random_3.1-3  ica_1.0-3
[46] magrittr_2.0.3         dotCall64_1.0-2        patchwork_1.1.2
[49] Matrix_1.6-3           Rcpp_1.0.10            munsell_0.5.0
[52] fansi_1.0.4            abind_1.4-5            reticulate_1.28
[55] lifecycle_1.0.3        scatterplot3d_0.3-42   stringi_1.7.12
[58] MASS_7.3-58.2          plyr_1.8.8             grid_4.2.2
[61] parallel_4.2.2         listenv_0.9.0          promises_1.2.0.1
[64] deldir_1.0-6           miniUI_0.1.1.1         lattice_0.20-45
[67] cowplot_1.1.1          splines_4.2.2          tensor_1.5
[70] pillar_1.9.0           igraph_1.3.5           spatstat.geom_3.0-5
[73] future.apply_1.10.0    reshape2_1.4.4         codetools_0.2-18
[76] leiden_0.4.3           glue_1.6.2             data.table_1.14.6
[79] png_0.1-8              vctrs_0.6.4            spam_2.9-1
[82] httpuv_1.6.8           polyclip_1.10-4        gtable_0.3.1
[85] RANN_2.6.1             purrr_1.0.1            scattermore_1.2
[88] future_1.30.0          mime_0.12              xtable_1.8-4
[91] later_1.3.0            survival_3.5-0         viridisLite_0.4.1
[94] tibble_3.2.1           cluster_2.1.4          globals_0.16.2
[97] fitdistrplus_1.1-8     ellipsis_0.3.2         ROCR_1.0-11
AnnaAMonaco commented 10 months ago

Update for anyone who runs into the same error: it is indeed a compatibility issue between Seurat v4 and SeuratObject v5, I changed to SeuratObject v4.1.4 and all works perfectly fine again.