Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

liana_wrap function hangs #145

Open
jjacob12 opened this issue Apr 7, 2024 · 16 comments
Open

liana_wrap function hangs #145

jjacob12 opened this issue Apr 7, 2024 · 16 comments

Comments

@jjacob12
Copy link

jjacob12 commented Apr 7, 2024

Hello,
I successfully installed Liana - thanks for your help with that! There's a new problem, which did not affect the above function when using the PBMC dataset in the Liana tutorial. Again I'm doing this on an HPC cluster with 1 core and I tried up to 25 GB RAM without success. One of my Seurat objects of interest is very heterogeneous with 3000+ cells and 15 annotated cell types.
Libraries I loaded:

library(Seurat)
library(tidyverse)
library(magrittr)
library(liana)

This is the dataset of interest, which has previously been though SCtransform normalisation, then clustered:

dyCbo.clust <- readRDS("outputs50K/DAOY-CBO/ClusterMapInput.DAOYcbo.NoMito.RiboPresent.SCT.clustered.CCdiffRegressed.rds")

Then I tried to run the liana_wrap function on the above dataset:

liana_dyCbo <- liana_wrap(dyCbo.clust)

It eventually got to 100% producing this message:

Expression from the `SCT` assay will be used
Running LIANA with `SCT_snn_res.0.8` as labels!
Warning: `invoke()` is deprecated as of rlang 0.4.0.LIANA: LR summary stats calculated!
Now Running: Natmi
Now Running: Connectome
Now Running: Logfc
Now Running: Sca
Now Running: Cellphonedb
|============================================================================= |100% ~0 s remaining 

but even then continued to hang and I could see the ssh connection to the HPC cluster broke in the Terminal sessions I opened - example couple of lines below:

channel 3: open failed: connect failed: Connection refused
channel 3: open failed: connect failed: Connection refused

I ran this liana function multiple times to no avail after quitting and restarting a new RStudio session. Why is this happening and how do I fix it? Thanks again.

@dbdimitrov
Copy link
Collaborator

Hi @jjacob12,

Hmmm, could it be that you are passing non-negative values? I see CST assay is used, perhaps make sure that the values are just log-normalized counts.

Also, best to pass the name of the column containing the clusters for your cells via idents_col.

@jjacob12
Copy link
Author

jjacob12 commented Apr 8, 2024

Ok, I'll try that out, just as soon I sort some compatibility issues between Seurat v4 and the latest tidyverse installation (required for OmnipathR, hence Liana to work) that mean Seurat plotting functions are failing. Will feedback soon.

@jjacob12
Copy link
Author

Hi @dbdimitrov,
I'm still having the same problem even after performing a standard log normalisation of the Seurat object. I don't think there is an issue with installation of LIANA as this was done by our expert HPC administrators and is fully compatible with the R version I'm using. Can you find the problem? Here is the pipeline:

{r eval=FALSE, echo=FALSE}
# load the above object, which has only been through mitochondrial gene and cell filtering to remove low-quality cells
dyCbo <- readRDS("../analysis50K/outputs50K/DAOY-CBO/filt.MitoCellsGenes.RiboGenesRetained.seurat.DAOYcbo.rds")
{r eval=FALSE, echo=FALSE}
s.genes <- cc.genes$s.genes
g2m.genes <- cc.genes$g2m.genes
{r eval=FALSE, echo=FALSE}
dyCbo <- NormalizeData(dyCbo)
dyCbo <- FindVariableFeatures(dyCbo, selection.method = "vst")
dyCbo <- CellCycleScoring(dyCbo, s.features = s.genes, g2m.features = g2m.genes, set.ident = TRUE)
dyCbo$CC.Difference <- dyCbo$S.Score - dyCbo$G2M.Score
dyCbo <- ScaleData(dyCbo, vars.to.regress = "CC.Difference", features = rownames(dyCbo))
dyCbo <- RunPCA(dyCbo, features = VariableFeatures(dyCbo))
dyCbo <- FindNeighbors(dyCbo, dims = 1:10)
dyCbo <- FindClusters(dyCbo, resolution = 0.8)
{r eval=FALSE, echo=FALSE}
# this Dimplot looks different from the UMAP plot for SCtransformed object, as expected. There are 13 clusters compared to 15 clusters when I used SCT pipeline.
dyCbo.logNorm <- RunUMAP(dyCbo.logNorm, dims = 1:10)

The above code ran with no error messages and produced the expected output. After cell annotation the UMAP plot was as expected:
Screenshot 2024-04-11 at 16 32 46

Here is the structure of the Seurat object 'dyCbo.logNorm' used as input for liana_wrap

dyCbo.logNorm.annotate %>% dplyr::glimpse()
Formal class 'Seurat' [package "SeuratObject"] with 13 slots
  ..@ assays      :List of 1
  .. ..$ RNA:Formal class 'Assay' [package "SeuratObject"] with 8 slots
  ..@ meta.data   :'data.frame':	3037 obs. of  14 variables:
  .. ..$ orig.ident     : Factor w/ 1 level "dyCbo": 1 1 1 1 1 1 1 1 1 1 ...
  .. ..$ nCount_RNA     : num [1:3037] 6938 7605 7536 4737 13699 ...
  .. ..$ nFeature_RNA   : int [1:3037] 3589 2696 2587 2390 4114 468 3633 1620 2179 2839 ...
  .. ..$ percent.mito   : num [1:3037] 0.0693 0.0231 0.0481 0.0158 0.0104 ...
  .. ..$ S.Score        : num [1:3037] -0.0948 -0.0652 -0.1132 0.1823 0.0318 ...
  .. ..$ G2M.Score      : num [1:3037] -0.1573 -0.0676 -0.067 -0.0588 -0.1362 ...
  .. ..$ Phase          : chr [1:3037] "G1" "G1" "G1" "S" ...
  .. ..$ CC.difference  : num [1:3037] 0.06253 0.00244 -0.04624 0.24113 0.16794 ...
  .. ..$ old.ident      : Factor w/ 3 levels "G1","S","G2M": 1 1 1 2 2 2 2 1 1 1 ...
  .. ..$ CC.Difference  : num [1:3037] 0.06253 0.00244 -0.04624 0.24113 0.16794 ...
  .. ..$ RNA_snn_res.0.8: Factor w/ 13 levels "0","1","2","3",..: 10 2 11 8 6 4 13 9 5 1 ...
  .. ..$ seurat_clusters: Factor w/ 13 levels "0","1","2","3",..: 10 2 11 8 6 4 13 9 5 1 ...
  .. ..$ cells          : chr [1:3037] "AAACCCATCCCATAGA-1" "AAACCCATCGATTGGT-1" "AAACGAAAGAGCCTGA-1" "AAACGAAAGGGTGAGG-1" ...
  .. ..$ celltype       : chr [1:3037] "Oligodendrocytes" "Roof plate_1" "Ciliated cells" "Granule precursors" ...
  ..@ active.assay: chr "RNA"
  ..@ active.ident: Factor w/ 13 levels "IVth ventricle/CP",..: 10 2 11 8 6 4 13 9 5 1 ...
  .. ..- attr(*, "names")= chr [1:3037] "AAACCCATCCCATAGA-1" "AAACCCATCGATTGGT-1" "AAACGAAAGAGCCTGA-1" "AAACGAAAGGGTGAGG-1" ...
  ..@ graphs      :List of 2
  .. ..$ RNA_nn :Formal class 'Graph' [package "SeuratObject"] with 7 slots
  .. ..$ RNA_snn:Formal class 'Graph' [package "SeuratObject"] with 7 slots
  ..@ neighbors   : list()
  ..@ reductions  :List of 2
  .. ..$ pca :Formal class 'DimReduc' [package "SeuratObject"] with 9 slots
  .. ..$ umap:Formal class 'DimReduc' [package "SeuratObject"] with 9 slots
  ..@ images      : list()
  ..@ project.name: chr "dyCbo"
  ..@ misc        : list()
  ..@ version     :Classes 'package_version', 'numeric_version'  hidden list of 1
  .. ..$ : int [1:3] 4 1 3
  ..@ commands    :List of 7
  .. ..$ NormalizeData.RNA       :Formal class 'SeuratCommand' [package "SeuratObject"] with 5 slots
  .. ..$ FindVariableFeatures.RNA:Formal class 'SeuratCommand' [package "SeuratObject"] with 5 slots
  .. ..$ ScaleData.RNA           :Formal class 'SeuratCommand' [package "SeuratObject"] with 5 slots
  .. ..$ RunPCA.RNA              :Formal class 'SeuratCommand' [package "SeuratObject"] with 5 slots
  .. ..$ FindNeighbors.RNA.pca   :Formal class 'SeuratCommand' [package "SeuratObject"] with 5 slots
  .. ..$ FindClusters            :Formal class 'SeuratCommand' [package "SeuratObject"] with 5 slots
  .. ..$ RunUMAP.RNA.pca         :Formal class 'SeuratCommand' [package "SeuratObject"] with 5 slots
  ..@ tools       : list()

As per your advice I provided the argument idents_col with the cell type labels

Here's a picture of the metadata table which I used with 'celltype' labels:

Screenshot 2024-04-11 at 16 39 39

This is the output from running liana_wrap. After half an hour it was still 'hanging' and crashed RStudio server again.

Screenshot 2024-04-11 at 16 44 15
sessionInfo()
R version 4.2.1 (2022-06-23)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)

Matrix products: default
BLAS/LAPACK: /gpfs3/apps/eb/2020b/skylake/software/FlexiBLAS/3.2.0-GCC-11.3.0/lib64/libflexiblas.so.3.2

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

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

other attached packages:
 [1] liana_0.1.11       magrittr_2.0.3     forcats_1.0.0      stringr_1.5.1      dplyr_1.1.4       
 [6] purrr_1.0.2        readr_2.1.5        tidyr_1.3.1        tibble_3.2.1       ggplot2_3.3.6     
[11] tidyverse_1.3.1    SeuratObject_4.1.3 Seurat_4.3.0      

loaded via a namespace (and not attached):
  [1] utf8_1.2.2                  spatstat.explore_3.0-6      reticulate_1.25            
  [4] tidyselect_1.2.1            htmlwidgets_1.5.4           BiocParallel_1.30.3        
  [7] grid_4.2.1                  Rtsne_0.16                  ScaledMatrix_1.4.0         
 [10] munsell_0.5.0               codetools_0.2-18            ica_1.0-2                  
 [13] statmod_1.4.36              scran_1.24.0                future_1.26.1              
 [16] miniUI_0.1.1.1              withr_2.5.0                 spatstat.random_3.1-3      
 [19] colorspace_2.0-3            progressr_0.10.1            Biobase_2.56.0             
 [22] filelock_1.0.2              logger_0.2.2                knitr_1.39                 
 [25] rstudioapi_0.16.0           stats4_4.2.1                SingleCellExperiment_1.18.1
 [28] ROCR_1.0-11                 tensor_1.5                  listenv_0.8.0              
 [31] labeling_0.4.2              MatrixGenerics_1.8.1        GenomeInfoDbData_1.2.8     
 [34] polyclip_1.10-0             farver_2.1.0                basilisk_1.8.1             
 [37] parallelly_1.32.0           vctrs_0.6.5                 generics_0.1.2             
 [40] xfun_0.31                   timechange_0.3.0            R6_2.5.1                   
 [43] doParallel_1.0.17           GenomeInfoDb_1.32.2         clue_0.3-61                
 [46] rsvd_1.0.5                  locfit_1.5-9.5              bitops_1.0-7               
 [49] spatstat.utils_3.0-1        DelayedArray_0.22.0         promises_1.2.0.1           
 [52] scales_1.3.0                gtable_0.3.0                beachmat_2.12.0            
 [55] globals_0.15.0              goftest_1.2-3               rlang_1.1.3                
 [58] GlobalOptions_0.1.2         splines_4.2.1               lazyeval_0.2.2             
 [61] spatstat.geom_3.0-6         broom_1.0.5                 checkmate_2.1.0            
 [64] yaml_2.3.5                  reshape2_1.4.4              abind_1.4-5                
 [67] modelr_0.1.11               backports_1.4.1             httpuv_1.6.5               
 [70] tools_4.2.1                 ellipsis_0.3.2              RColorBrewer_1.1-3         
 [73] BiocGenerics_0.42.0         ggridges_0.5.3              Rcpp_1.0.10                
 [76] plyr_1.8.7                  sparseMatrixStats_1.8.0     progress_1.2.2             
 [79] zlibbioc_1.42.0             RCurl_1.98-1.7              basilisk.utils_1.8.0       
 [82] prettyunits_1.1.1           deldir_1.0-6                pbapply_1.5-0              
 [85] GetoptLong_1.0.5            cowplot_1.1.1               S4Vectors_0.34.0           
 [88] zoo_1.8-10                  SummarizedExperiment_1.26.1 haven_2.5.4                
 [91] ggrepel_0.9.1               cluster_2.1.3               fs_1.5.2                   
 [94] data.table_1.14.2           scattermore_0.8             circlize_0.4.15            
 [97] lmtest_0.9-40               reprex_2.1.0                RANN_2.6.1                 
[100] fitdistrplus_1.1-8          matrixStats_0.62.0          hms_1.1.3                  
[103] patchwork_1.1.1             mime_0.12                   evaluate_0.15              
[106] xtable_1.8-4                readxl_1.4.3                IRanges_2.30.0             
[109] gridExtra_2.3               shape_1.4.6                 compiler_4.2.1             
[112] KernSmooth_2.23-20          crayon_1.5.1                htmltools_0.5.2            
[115] later_1.3.0                 tzdb_0.3.0                  lubridate_1.9.3            
[118] DBI_1.1.3                   dbplyr_2.5.0                ComplexHeatmap_2.12.0      
[121] MASS_7.3-57                 rappdirs_0.3.3              Matrix_1.5-4               
[124] cli_3.6.1                   metapod_1.4.0               parallel_4.2.1             
[127] igraph_1.3.2                GenomicRanges_1.48.0        pkgconfig_2.0.3            
[130] dir.expiry_1.4.0            OmnipathR_3.8.0             sp_1.5-0                   
[133] scuttle_1.6.2               plotly_4.10.0               spatstat.sparse_3.0-0      
[136] xml2_1.3.3                  foreach_1.5.2               dqrng_0.3.0                
[139] XVector_0.36.0              rvest_1.0.4                 digest_0.6.29              
[142] sctransform_0.3.5           RcppAnnoy_0.0.19            spatstat.data_3.0-0        
[145] rmarkdown_2.14              cellranger_1.1.0            leiden_0.4.2               
[148] edgeR_3.38.1                uwot_0.1.14                 DelayedMatrixStats_1.18.2  
[151] curl_5.2.1                  shiny_1.7.1                 rjson_0.2.21               
[154] lifecycle_1.0.3             nlme_3.1-158                jsonlite_1.8.8             
[157] BiocNeighbors_1.14.0        limma_3.52.4                viridisLite_0.4.0          
[160] fansi_1.0.3                 pillar_1.9.0                lattice_0.20-45            
[163] fastmap_1.1.0               httr_1.4.7                  survival_3.3-1             
[166] glue_1.6.2                  png_0.1-7                   iterators_1.0.14           
[169] bluster_1.6.0               stringi_1.7.6               BiocSingular_1.12.0        
[172] irlba_2.3.5                 future.apply_1.9.0         

@dbdimitrov
Copy link
Collaborator

Hi @jjacob12, yeah. I'm really not sure why this is the case. I assume it has to do with calculating the final p-values for CellPhoneDB, but I cannot reproduce this error... Can you try passing assay='RNA'?

If it then hangs again, perhaps you could share a subset of your data, and I can then attempt to debug on my end.

@jjacob12
Copy link
Author

Hi @dbdimitrov, I have just tried:

liana.dyCbo <- liana_wrap(dyCbo.logNorm.annotate,
                          idents_col = "celltype",
                          assay = "RNA")

This function threw an error quite quickly on trying to run it:

Expression from the `RNA` assay will be used
Running LIANA with `celltype` as labels!
`Idents` were converted to factor
Error in `select()`:
! <text>:1:7: unexpected symbol
1: Using an
          ^
Backtrace:
  1. liana::liana_wrap(...)
 20. dplyr:::select.data.frame(., columns)  # comment - why 3 colons??

I attach the traceback which might help to troubleshoot:

Liana_issues_Traceback.docx

Please let me know if I need to share the relevant data - very happy to do so.
Many thanks for your help.

@jjacob12
Copy link
Author

Also, @dbdimitrov please send an email address to send the data to, if it's needed.

@dbdimitrov
Copy link
Collaborator

Hi @jjacob12, daniel.dimitrov {a} uni-heidelberg.de

@jjacob12
Copy link
Author

Many thanks @dbdimitrov - I have shared a one-drive folder with the Seurat object which corresponds to the same object as 'dyCbo.logNorm.annotate' above.

@jjacob12
Copy link
Author

Hi @dbdimitrov I hope you were able to access the file. Please let me know if there was a problem with access.

@dbdimitrov
Copy link
Collaborator

Hi @jjacob12, I was able to, thanks for sharing. I'm mid revisions of 2 papers but I will come back to you as soon as I find some time. Sorry for the delay.

@jjacob12
Copy link
Author

Sure @dbdimitrov. Good to know you accessed the file.

@dbdimitrov
Copy link
Collaborator

Hi @jjacob12,

Sorry it took me a while to come back to you.

Using your subset data, even with 1000 permutations it worked on my laptop. Also, there is nothing obviously wrong with the data nor with your R session.

library(liana)
sce <- readRDS("Annotated.DAOYcbo.logNorm.clustered.umap.CCdiff.regressed.rds")
liana_res <- liana_wrap(sce,
                        idents_col='celltype',
                        permutation.params = list(nperms = 100),
                        assay='RNA')

On my end, it also takes a bit of time once it reaches 100% but after a minute or so it returns the results as expected.
What follows the permutation step (i.e. the progress bar) is just a bunch of left_joins using dplyr, which I really doubt would be the reason why the R session hands.

I recommend using LIANA+ (extended liana in Python), and if you're interested I can share a couple of lines of code to convert a Seurat object into SingleCellExperiment and export it as an AnnData.

Sorry, I couldn't be of more help.

─ Session info ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 setting  value
 version  R version 4.2.0 (2022-04-22)
 os       Ubuntu 20.04.6 LTS
 system   x86_64, linux-gnu
 ui       RStudio
 language en_US
 collate  en_US.UTF-8
 ctype    en_US.UTF-8
 tz       Europe/Berlin
 date     2024-05-14
 rstudio  1.1.456 (desktop)
 pandoc   3.1.1 @ /home/dbdimitrov/anaconda3/envs/R4.2/bin/ (via rmarkdown)

─ Packages ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 package              * version   date (UTC) lib source
 abind                  1.4-5     2016-07-21 [1] CRAN (R 4.2.1)
 backports              1.4.1     2021-12-13 [1] CRAN (R 4.2.1)
 basilisk               1.11.3    2023-03-24 [1] Github (LTLA/basilisk@6b6ba9f)
 basilisk.utils         1.11.2    2023-03-24 [1] Github (LTLA/basilisk.utils@7ee5213)
 beachmat               2.14.0    2022-11-01 [1] Bioconductor
 Biobase                2.58.0    2022-11-01 [1] Bioconductor
 BiocGenerics           0.44.0    2022-11-01 [1] Bioconductor
 BiocNeighbors          1.16.0    2022-11-01 [1] Bioconductor
 BiocParallel           1.32.6    2023-03-17 [1] Bioconductor
 BiocSingular           1.14.0    2022-11-01 [1] Bioconductor
 bitops                 1.0-7     2021-04-24 [1] CRAN (R 4.2.1)
 bluster                1.8.0     2022-11-01 [1] Bioconductor
 cellranger             1.1.0     2016-07-27 [1] CRAN (R 4.2.1)
 checkmate              2.1.0     2022-04-21 [1] CRAN (R 4.2.3)
 circlize               0.4.15    2022-05-10 [1] CRAN (R 4.2.3)
 cli                    3.6.1     2023-03-23 [1] CRAN (R 4.2.3)
 clue                   0.3-64    2023-01-31 [1] CRAN (R 4.2.3)
 cluster                2.1.4     2022-08-22 [1] CRAN (R 4.2.1)
 codetools              0.2-19    2023-02-01 [1] CRAN (R 4.2.2)
 colorspace             2.1-0     2023-01-23 [1] CRAN (R 4.2.2)
 ComplexHeatmap         2.14.0    2022-11-01 [1] Bioconductor
 cowplot                1.1.1     2020-12-30 [1] CRAN (R 4.2.1)
 crayon                 1.5.2     2022-09-29 [1] CRAN (R 4.2.1)
 curl                   4.3.3     2022-10-06 [1] CRAN (R 4.2.1)
 data.table             1.14.8    2023-02-17 [1] CRAN (R 4.2.2)
 DelayedArray           0.24.0    2022-11-01 [1] Bioconductor
 DelayedMatrixStats     1.20.0    2022-11-01 [1] Bioconductor
 deldir                 1.0-6     2021-10-23 [1] CRAN (R 4.2.1)
 digest                 0.6.31    2022-12-11 [1] CRAN (R 4.2.2)
 dir.expiry             1.6.0     2022-11-01 [1] Bioconductor
 doParallel             1.0.17    2022-02-07 [1] CRAN (R 4.2.3)
 dplyr                  1.1.1     2023-03-22 [1] CRAN (R 4.2.3)
 dqrng                  0.3.0     2021-05-01 [1] CRAN (R 4.2.1)
 edgeR                  3.40.2    2023-01-19 [1] Bioconductor
 ellipsis               0.3.2     2021-04-29 [1] CRAN (R 4.2.1)
 evaluate               0.20      2023-01-17 [1] CRAN (R 4.2.2)
 fansi                  1.0.4     2023-01-22 [1] CRAN (R 4.2.2)
 fastmap                1.1.1     2023-02-24 [1] CRAN (R 4.2.2)
 filelock               1.0.2     2018-10-05 [1] CRAN (R 4.2.3)
 fitdistrplus           1.1-8     2022-03-10 [1] CRAN (R 4.2.1)
 foreach                1.5.2     2022-02-02 [1] CRAN (R 4.2.0)
 future                 1.32.0    2023-03-07 [1] CRAN (R 4.2.2)
 future.apply           1.10.0    2022-11-05 [1] CRAN (R 4.2.2)
 generics               0.1.3     2022-07-05 [1] CRAN (R 4.2.1)
 GenomeInfoDb           1.34.9    2023-02-02 [1] Bioconductor
 GenomeInfoDbData       1.2.9     2023-03-24 [1] Bioconductor
 GenomicRanges          1.50.2    2022-12-16 [1] Bioconductor
 GetoptLong             1.0.5     2020-12-15 [1] CRAN (R 4.2.3)
 ggplot2                3.4.1     2023-02-10 [1] CRAN (R 4.2.2)
 ggrepel                0.9.3     2023-02-03 [1] CRAN (R 4.2.2)
 ggridges               0.5.4     2022-09-26 [1] CRAN (R 4.2.1)
 GlobalOptions          0.1.2     2020-06-10 [1] CRAN (R 4.2.3)
 globals                0.16.2    2022-11-21 [1] CRAN (R 4.2.2)
 glue                   1.6.2     2022-02-24 [1] CRAN (R 4.2.1)
 goftest                1.2-3     2021-10-07 [1] CRAN (R 4.2.1)
 gridExtra              2.3       2017-09-09 [1] CRAN (R 4.2.1)
 gtable                 0.3.3     2023-03-21 [1] CRAN (R 4.2.3)
 hms                    1.1.3     2023-03-21 [1] CRAN (R 4.2.3)
 htmltools              0.5.5     2023-03-23 [1] CRAN (R 4.2.3)
 htmlwidgets            1.6.2     2023-03-17 [1] CRAN (R 4.2.3)
 httpuv                 1.6.9     2023-02-14 [1] CRAN (R 4.2.2)
 httr                   1.4.5     2023-02-24 [1] CRAN (R 4.2.2)
 ica                    1.0-3     2022-07-08 [1] CRAN (R 4.2.1)
 igraph                 1.3.1     2022-04-20 [1] CRAN (R 4.2.0)
 IRanges                2.32.0    2022-11-01 [1] Bioconductor
 irlba                  2.3.5.1   2022-10-03 [1] CRAN (R 4.2.1)
 iterators              1.0.14    2022-02-05 [1] CRAN (R 4.2.0)
 jsonlite               1.8.4     2022-12-06 [1] CRAN (R 4.2.2)
 KernSmooth             2.23-20   2021-05-03 [1] CRAN (R 4.2.1)
 knitr                  1.42      2023-01-25 [1] CRAN (R 4.2.2)
 later                  1.3.0     2021-08-18 [1] CRAN (R 4.2.2)
 lattice                0.20-45   2021-09-22 [1] CRAN (R 4.2.1)
 lazyeval               0.2.2     2019-03-15 [1] CRAN (R 4.2.1)
 leiden                 0.4.3     2022-09-10 [1] CRAN (R 4.2.1)
 liana                * 0.1.14    2024-02-28 [1] Bioconductor
 lifecycle              1.0.3     2022-10-07 [1] CRAN (R 4.2.1)
 limma                  3.54.2    2023-02-28 [1] Bioconductor
 listenv                0.9.0     2022-12-16 [1] CRAN (R 4.2.2)
 lmtest                 0.9-40    2022-03-21 [1] CRAN (R 4.2.1)
 locfit                 1.5-9.7   2023-01-02 [1] CRAN (R 4.2.3)
 logger                 0.2.2     2021-10-19 [1] CRAN (R 4.2.3)
 lubridate              1.9.3     2023-09-27 [1] CRAN (R 4.2.0)
 magrittr               2.0.3     2022-03-30 [1] CRAN (R 4.2.1)
 MASS                   7.3-58.3  2023-03-07 [1] CRAN (R 4.2.2)
 Matrix                 1.5-3     2022-11-11 [1] CRAN (R 4.2.2)
 MatrixGenerics         1.10.0    2022-11-01 [1] Bioconductor
 matrixStats            0.63.0    2022-11-18 [1] CRAN (R 4.2.2)
 metapod                1.6.0     2022-11-01 [1] Bioconductor
 mime                   0.12      2021-09-28 [1] CRAN (R 4.2.1)
 miniUI                 0.1.1.1   2018-05-18 [1] CRAN (R 4.2.1)
 munsell                0.5.0     2018-06-12 [1] CRAN (R 4.2.1)
 nlme                   3.1-162   2023-01-31 [1] CRAN (R 4.2.2)
 OmnipathR              3.11.3    2024-02-28 [1] Github (saezlab/OmnipathR@4183d8d)
 parallelly             1.35.0    2023-03-23 [1] CRAN (R 4.2.3)
 patchwork              1.1.2     2022-08-19 [1] CRAN (R 4.2.1)
 pbapply                1.7-0     2023-01-13 [1] CRAN (R 4.2.2)
 pillar                 1.9.0     2023-03-22 [1] CRAN (R 4.2.3)
 pkgconfig              2.0.3     2019-09-22 [1] CRAN (R 4.2.1)
 plotly                 4.10.1    2022-11-07 [1] CRAN (R 4.2.2)
 plyr                   1.8.8     2022-11-11 [1] CRAN (R 4.2.2)
 png                    0.1-8     2022-11-29 [1] CRAN (R 4.2.2)
 polyclip               1.10-4    2022-10-20 [1] CRAN (R 4.2.1)
 prettyunits            1.1.1     2020-01-24 [1] CRAN (R 4.2.1)
 progress               1.2.2     2019-05-16 [1] CRAN (R 4.2.1)
 progressr              0.13.0    2023-01-10 [1] CRAN (R 4.2.2)
 promises               1.2.0.1   2021-02-11 [1] CRAN (R 4.2.1)
 purrr                  1.0.1     2023-01-10 [1] CRAN (R 4.2.2)
 R6                     2.5.1     2021-08-19 [1] CRAN (R 4.2.1)
 RANN                   2.6.1     2019-01-08 [1] CRAN (R 4.2.1)
 rappdirs               0.3.3     2021-01-31 [1] CRAN (R 4.2.1)
 RColorBrewer           1.1-3     2022-04-03 [1] CRAN (R 4.2.1)
 Rcpp                   1.0.10    2023-01-22 [1] CRAN (R 4.2.2)
 RcppAnnoy              0.0.20    2022-10-27 [1] CRAN (R 4.2.1)
 RCurl                  1.98-1.10 2023-01-27 [1] CRAN (R 4.2.2)
 readr                  2.1.4     2023-02-10 [1] CRAN (R 4.2.2)
 readxl                 1.4.2     2023-02-09 [1] CRAN (R 4.2.2)
 reshape2               1.4.4     2020-04-09 [1] CRAN (R 4.2.1)
 reticulate             1.25      2022-05-11 [1] CRAN (R 4.2.0)
 rjson                  0.2.21    2022-01-09 [1] CRAN (R 4.2.1)
 rlang                  1.1.0     2023-03-14 [1] CRAN (R 4.2.2)
 rmarkdown              2.14      2022-04-25 [1] CRAN (R 4.2.0)
 ROCR                   1.0-11    2020-05-02 [1] CRAN (R 4.2.1)
 rstudioapi             0.14      2022-08-22 [1] CRAN (R 4.2.1)
 rsvd                   1.0.5     2021-04-16 [1] CRAN (R 4.2.1)
 Rtsne                  0.16      2022-04-17 [1] CRAN (R 4.2.1)
 rvest                  1.0.3     2022-08-19 [1] CRAN (R 4.2.1)
 S4Vectors              0.36.2    2023-02-26 [1] Bioconductor
 ScaledMatrix           1.6.0     2022-11-01 [1] Bioconductor
 scales                 1.2.1     2022-08-20 [1] CRAN (R 4.2.1)
 scattermore            0.8       2022-02-14 [1] CRAN (R 4.2.1)
 scran                  1.26.2    2023-01-19 [1] Bioconductor
 sctransform            0.3.5     2022-09-21 [1] CRAN (R 4.2.1)
 scuttle                1.8.4     2023-01-19 [1] Bioconductor
 sessioninfo            1.2.2     2021-12-06 [1] CRAN (R 4.2.0)
 Seurat                 4.3.0     2022-11-18 [1] CRAN (R 4.2.2)
 SeuratObject           4.1.3     2022-11-07 [1] CRAN (R 4.2.2)
 shape                  1.4.6     2021-05-19 [1] CRAN (R 4.2.0)
 shiny                  1.7.4     2022-12-15 [1] CRAN (R 4.2.2)
 SingleCellExperiment   1.20.1    2023-03-17 [1] Bioconductor
 sp                     1.6-0     2023-01-19 [1] CRAN (R 4.2.2)
 sparseMatrixStats      1.10.0    2022-11-01 [1] Bioconductor
 spatstat.data          3.0-1     2023-03-12 [1] CRAN (R 4.2.2)
 spatstat.explore       3.1-0     2023-03-14 [1] CRAN (R 4.2.2)
 spatstat.geom          3.1-0     2023-03-12 [1] CRAN (R 4.2.2)
 spatstat.random        3.1-4     2023-03-13 [1] CRAN (R 4.2.2)
 spatstat.sparse        3.0-1     2023-03-12 [1] CRAN (R 4.2.2)
 spatstat.utils         3.0-2     2023-03-11 [1] CRAN (R 4.2.2)
 statmod                1.5.0     2023-01-06 [1] CRAN (R 4.2.3)
 stringi                1.7.6     2021-11-29 [1] CRAN (R 4.2.0)
 stringr                1.5.0     2022-12-02 [1] CRAN (R 4.2.2)
 SummarizedExperiment   1.28.0    2022-11-01 [1] Bioconductor
 survival               3.5-5     2023-03-12 [1] CRAN (R 4.2.2)
 tensor                 1.5       2012-05-05 [1] CRAN (R 4.2.1)
 tibble                 3.2.1     2023-03-20 [1] CRAN (R 4.2.3)
 tidyr                  1.3.0     2023-01-24 [1] CRAN (R 4.2.2)
 tidyselect             1.2.0     2022-10-10 [1] CRAN (R 4.2.1)
 timechange             0.2.0     2023-01-11 [1] CRAN (R 4.2.0)
 tzdb                   0.3.0     2022-03-28 [1] CRAN (R 4.2.1)
 utf8                   1.2.3     2023-01-31 [1] CRAN (R 4.2.2)
 uwot                   0.1.14    2022-08-22 [1] CRAN (R 4.2.1)
 vctrs                  0.6.1     2023-03-22 [1] CRAN (R 4.2.3)
 viridisLite            0.4.1     2022-08-22 [1] CRAN (R 4.2.1)
 withr                  2.5.0     2022-03-03 [1] CRAN (R 4.2.1)
 xfun                   0.42      2024-02-08 [1] CRAN (R 4.2.0)
 xml2                   1.3.3     2021-11-30 [1] CRAN (R 4.2.1)
 xtable                 1.8-4     2019-04-21 [1] CRAN (R 4.2.1)
 XVector                0.38.0    2022-11-01 [1] Bioconductor
 yaml                   2.3.7     2023-01-23 [1] CRAN (R 4.2.2)
 zlibbioc               1.44.0    2022-11-01 [1] Bioconductor
 zoo                    1.8-11    2022-09-17 [1] CRAN (R 4.2.1)

 [1] /home/dbdimitrov/anaconda3/envs/R4.2/lib/R/library

@jjacob12
Copy link
Author

Hi @dbdimitrov, that is really odd, but reassuring it works fine at your end with the data I sent you.

"I recommend using LIANA+ (extended liana in Python), and if you're interested I can share a couple of lines of code to convert a Seurat object into SingleCellExperiment and export it as an AnnData." Yes please could you share this. Many thanks.

@dbdimitrov
Copy link
Collaborator

Hi @jjacob12,

I believe the easiest way is to use zellkonverter. BiocManager::install("zellkonverter")

sce <- readRDS("Annotated.DAOYcbo.logNorm.clustered.umap.CCdiff.regressed.rds")
sce <- Seurat::as.SingleCellExperiment(sce)
zellkonverter::writeH5AD(sce, 'adata.h5ad')

From there, it should be as easy as following the tutorials on the liana-py webpage, e.g.:
https://liana-py.readthedocs.io/en/latest/notebooks/basic_usage.html

Hope this helps.

@dbdimitrov
Copy link
Collaborator

Tested your converted AnnData object in Python:

import scanpy as sc
import liana as li

adata = sc.read_h5ad("adata.h5ad")
li.mt.rank_aggregate(adata, groupby='celltype', layer='logcounts', use_raw=False, verbose=True)
adata.uns['liana_res'].head()

runs in ~ 30 sec :)

@jjacob12
Copy link
Author

Many thanks for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants