stuart-lab / signac

R toolkit for the analysis of single-cell chromatin data
https://stuartlab.org/signac/
Other
331 stars 88 forks source link

could not find function "CollapseToLongestTranscript" #1313

Closed TerezaClarence closed 1 year ago

TerezaClarence commented 1 year ago

Dear Signac developers,

I was wondering if you could help me with the following:

pbmc

An object of class Seurat 
413020 features across 500 samples within 3 assays 
Active assay: ATAC (349688 features, 87520 variable features)
 2 other assays present: RNA, SCT
 3 dimensional reductions calculated: pca, lsi, wnn.umap

links <- pbmc[['ATAC']]@links
head(links)
GRanges object with 6 ranges and 6 metadata columns:
      seqnames        ranges strand |      score        gene               peak
         <Rle>     <IRanges>  <Rle> |  <numeric> <character>        <character>
  [1]     chr1 778780-817371      * | -0.0461836      FAM87B chr1-777599-779961
  [2]     chr1 778780-825138      * |  0.0627401   LINC01128 chr1-777599-779961
  [3]     chr1 778780-827522      * | -0.0310350   LINC00115 chr1-777599-779961
  [4]     chr1 778780-876903      * |  0.1217460      FAM41C chr1-777599-779961
  [5]     chr1 778780-923928      * |  0.1264468      SAMD11 chr1-777599-779961
  [6]     chr1 778780-959309      * | -0.1094097       NOC2L chr1-777599-779961
         zscore     pvalue pvalue.fdr
      <numeric>  <numeric>  <numeric>
  [1] -1.108142 0.13390034   0.431234
  [2]  0.196815 0.42198607   0.491931
  [3] -0.513947 0.30364438   0.476515
  [4]  2.390801 0.00840582   0.180765
  [5]  0.428067 0.33430120   0.480874
  [6] -1.901514 0.02861733   0.294288
  -------
  seqinfo: 24 sequences from an unspecified genome; no seqlengths

links <- links[intersect(which(links$pvalue.fdr < 0.1), which(abs(links$score) > 0.3)),]

gene.ranges <- CollapseToLongestTranscript(ranges = Annotation(pbmc))
**Error in CollapseToLongestTranscript(ranges = Annotation(pbmc)): could not find function "CollapseToLongestTranscript"**

and when I check :

Annotation(pbmc)

GRanges object with 3021151 ranges and 5 metadata columns:
                  seqnames        ranges strand |           tx_id   gene_name
                     <Rle>     <IRanges>  <Rle> |     <character> <character>
  ENSE00001489430     chrX 276322-276394      + | ENST00000399012      PLCXD1
  ENSE00001536003     chrX 276324-276394      + | ENST00000484611      PLCXD1
  ENSE00002160563     chrX 276353-276394      + | ENST00000430923      PLCXD1
  ENSE00001750899     chrX 281055-281121      + | ENST00000445062      PLCXD1
  ENSE00001489388     chrX 281192-281684      + | ENST00000381657      PLCXD1
              ...      ...           ...    ... .             ...         ...
  ENST00000361739     chrM     7586-8269      + | ENST00000361739      MT-CO2
  ENST00000361789     chrM   14747-15887      + | ENST00000361789      MT-CYB
  ENST00000361851     chrM     8366-8572      + | ENST00000361851     MT-ATP8
  ENST00000361899     chrM     8527-9207      + | ENST00000361899     MT-ATP6
  ENST00000362079     chrM     9207-9990      + | ENST00000362079      MT-CO3
                          gene_id   gene_biotype     type
                      <character>    <character> <factor>
  ENSE00001489430 ENSG00000182378 protein_coding     exon
  ENSE00001536003 ENSG00000182378 protein_coding     exon
  ENSE00002160563 ENSG00000182378 protein_coding     exon
  ENSE00001750899 ENSG00000182378 protein_coding     exon
  ENSE00001489388 ENSG00000182378 protein_coding     exon
              ...             ...            ...      ...
  ENST00000361739 ENSG00000198712 protein_coding      cds
  ENST00000361789 ENSG00000198727 protein_coding      cds
  ENST00000361851 ENSG00000228253 protein_coding      cds
  ENST00000361899 ENSG00000198899 protein_coding      cds
  ENST00000362079 ENSG00000198938 protein_coding      cds
  -------
  seqinfo: 25 sequences from hg38 genome

I am not sure why CollapseToLongestTranscript is not found, but it is not found in general, in any function selection at all, as if it did not exist.

sessionInfo()

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

other attached packages:
 [1] EnsDb.Hsapiens.v86_2.99.0         ensembldb_2.18.4                 
 [3] AnnotationFilter_1.18.0           GenomicFeatures_1.46.5           
 [5] AnnotationDbi_1.56.2              BSgenome.Hsapiens.UCSC.hg38_1.4.4
 [7] BSgenome_1.62.0                   rtracklayer_1.54.0               
 [9] Biostrings_2.62.0                 XVector_0.34.0                   
[11] future_1.30.0                     scales_1.2.1                     
[13] ggsci_2.9                         data.table_1.14.6                
[15] zellkonverter_1.7.3               SingleCellExperiment_1.16.0      
[17] basilisk_1.6.0                    pbmcsca.SeuratData_3.0.0         
[19] SeuratData_0.2.2                  SeuratDisk_0.0.0.9020            
[21] SingleR_1.8.1                     SummarizedExperiment_1.24.0      
[23] Biobase_2.54.0                    GenomicRanges_1.46.1             
[25] GenomeInfoDb_1.30.1               IRanges_2.28.0                   
[27] S4Vectors_0.32.4                  BiocGenerics_0.40.0              
[29] MatrixGenerics_1.6.0              matrixStats_0.63.0               
[31] dplyr_1.0.10                      Signac_1.9.0                     
[33] SeuratObject_4.1.3                Seurat_4.3.0                                             
[37] BiocParallel_1.28.3               limma_3.50.3                     
[39] ggplot2_3.4.0                    

loaded via a namespace (and not attached):
  [1] rappdirs_0.3.3            pbdZMQ_0.3-8             
  [3] scattermore_0.8           mashr_0.2.69             
  [5] tidyr_1.2.1               bit64_4.0.5              
  [7] irlba_2.3.5.1             DelayedArray_0.20.0      
  [9] KEGGREST_1.34.0           RCurl_1.98-1.9           
 [11] doParallel_1.0.17         generics_0.1.3           
 [13] ScaledMatrix_1.2.0        RhpcBLASctl_0.21-247.1   
 [15] cowplot_1.1.1             RSQLite_2.2.20           
 [17] RANN_2.6.1                bit_4.0.5                
 [19] xml2_1.3.3                spatstat.data_3.0-0      
 [21] httpuv_1.6.7              assertthat_0.2.1         
 [23] hms_1.1.2                 babelgene_22.9           
 [25] evaluate_0.19             promises_1.2.0.1         
 [27] restfulr_0.0.15           fansi_1.0.3              
 [29] progress_1.2.2            dbplyr_2.2.1             
 [31] caTools_1.18.2            Rgraphviz_2.38.0         
 [33] igraph_1.3.5              DBI_1.1.3                
 [35] htmlwidgets_1.6.0         spatstat.geom_3.0-3      
 [37] purrr_1.0.0               ellipsis_0.3.2           
 [39] backports_1.4.1           annotate_1.72.0          
 [41] aod_1.3.2                 biomaRt_2.50.3           
 [43] deldir_1.0-6              sparseMatrixStats_1.6.0  
 [45] vctrs_0.5.1               ROCR_1.0-11              
 [47] abind_1.4-5               cachem_1.0.6             
 [49] withr_2.5.0               progressr_0.12.0         
 [51] sctransform_0.3.5         GenomicAlignments_1.30.0 
 [53] prettyunits_1.1.1         goftest_1.2-3            
 [55] cluster_2.1.4             dir.expiry_1.2.0         
 [57] IRdisplay_1.1             lazyeval_0.2.2           
 [59] crayon_1.5.2              basilisk.utils_1.6.0     
 [61] hdf5r_1.3.7               spatstat.explore_3.0-5   
 [63] edgeR_3.36.0              pkgconfig_2.0.3          
 [65] ProtGenerics_1.26.0       nlme_3.1-161             
 [67] rlang_1.0.6               globals_0.16.2           
 [69] lifecycle_1.0.3           miniUI_0.1.1.1           
 [71] filelock_1.0.2            BiocFileCache_2.2.1      
 [73] rsvd_1.0.5                invgamma_1.1             
 [75] polyclip_1.10-4           lmtest_0.9-40            
 [77] graph_1.72.0              Matrix_1.5-3             
 [79] IRkernel_1.3.1            ashr_2.2-54              
 [81] Rhdf5lib_1.16.0           boot_1.3-28.1            
 [83] zoo_1.8-11                base64enc_0.1-3          
 [85] ggridges_0.5.4            GlobalOptions_0.1.2      
 [87] png_0.1-8                 viridisLite_0.4.1        
 [89] rjson_0.2.21              bitops_1.0-7             
 [91] KernSmooth_2.23-20        rhdf5filters_1.6.0       
 [93] EnrichmentBrowser_2.25.3  blob_1.2.3               
 [95] DelayedMatrixStats_1.16.0 shape_1.4.6              
 [97] mixsqp_0.3-48             stringr_1.5.0            
 [99] SQUAREM_2021.1            parallelly_1.33.0        
[101] spatstat.random_3.0-1     rmeta_3.0                
[103] beachmat_2.10.0           memoise_2.0.1            
[105] GSEABase_1.56.0           magrittr_2.0.3           
[107] plyr_1.8.8                ica_1.0-3                
[109] gplots_3.1.3              zlibbioc_1.40.0          
[111] compiler_4.1.1            BiocIO_1.4.0             
[113] RColorBrewer_1.1-3        clue_0.3-63              
[115] KEGGgraph_1.54.0          lme4_1.1-31              
[117] fitdistrplus_1.1-8        Rsamtools_2.10.0         
[119] cli_3.5.0                 listenv_0.9.0            
[121] patchwork_1.1.2           pbapply_1.6-0            
[123] MASS_7.3-58.1             tidyselect_1.2.0         
[125] stringi_1.7.8             yaml_2.3.6               
[127] zenith_0.99.1             BiocSingular_1.10.0      
[129] locfit_1.5-9.7            ggrepel_0.9.2            
[131] grid_4.1.1                fastmatch_1.1-3          
[133] tools_4.1.1               future.apply_1.10.0      
[135] parallel_4.1.1            circlize_0.4.15          
[137] uuid_1.1-0                foreach_1.5.2            
[139] gridExtra_2.3             Rtsne_0.16               
[141] RcppZiggurat_0.1.6        digest_0.6.31            
[143] shiny_1.7.4               Rcpp_1.0.9               
[145] broom_1.0.2               later_1.3.0              
[147] RcppAnnoy_0.0.20          httr_1.4.4               
[149] ComplexHeatmap_2.10.0     Rdpack_2.4               
[151] colorspace_2.0-3          XML_3.99-0.13            
[153] tensor_1.5                reticulate_1.26          
[155] truncnorm_1.0-8           splines_4.1.1            
[157] uwot_0.1.14               RcppRoll_0.3.0           
[159] spatstat.utils_3.0-1      sp_1.5-1                 
[161] plotly_4.10.1             xtable_1.8-4             
[163] jsonlite_1.8.4            nloptr_2.0.3             
[165] Rfast_2.0.6               R6_2.5.1                 
[167] pillar_1.8.1              htmltools_0.5.4          
[169] mime_0.12                 glue_1.6.2               
[171] fastmap_1.1.0             minqa_1.2.5              
[173] BiocNeighbors_1.12.0      codetools_0.2-18         
[175] mvtnorm_1.1-3             utf8_1.2.2               
[177] lattice_0.20-45           spatstat.sparse_3.0-0    
[179] tibble_3.1.8              pbkrtest_0.5.1           
[181] curl_4.3.3                leiden_0.4.3             
[183] gtools_3.9.4              survival_3.4-0           
[185] repr_1.1.4                munsell_0.5.0            
[187] GetoptLong_1.0.5          rhdf5_2.38.1             
[189] GenomeInfoDbData_1.2.7    iterators_1.0.14         
[191] HDF5Array_1.22.1          reshape2_1.4.4           
[193] gtable_0.3.1              msigdbr_7.5.1            
[195] rbibutils_2.2.11  

Thank you in advance!

Best regards, Tereza

timoast commented 1 year ago

The function CollapseToLongestTranscript() is not exported by the Signac package, it's only present for internal use in other functions. You can still use non-exported functions using the ::: operator, i.e: Signac:::CollapseToLongestTranscript()