GreenleafLab / ArchR

ArchR : Analysis of Regulatory Chromatin in R (www.ArchRProject.com)
MIT License
384 stars 137 forks source link

Error with LSI-projection! #653

Closed IC-hub closed 3 years ago

IC-hub commented 3 years ago

Attach your log file

2021-03-25 09:08:07 : ERROR Found in .computeLSI for  
LogFile = ArchRLogs/ArchR-addIterativeLSI-b2038219887-Date-2021-03-25_Time-09-07-57.log

<simpleError in doTryCatch(return(expr), name, parentenv, handler): Error with LSI-projection! Cor less than 0.95 of re-projection. Please report bu
g to github!>

Describe the bug When running addIterativeLSI function with TileMatrix, the LSI projection fails.

To Reproduce The bug couldn't be reproduced on Tutorial dataset.

Session Info

R version 4.0.4 (2021-02-15)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Debian GNU/Linux bullseye/sid

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.13.so

locale:
[1] C

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

other attached packages:
 [1] gridExtra_2.3                     Rsamtools_2.6.0                  
 [3] BSgenome.Hsapiens.UCSC.hg38_1.4.3 BSgenome_1.58.0                  
 [5] rtracklayer_1.50.0                Biostrings_2.58.0                
 [7] XVector_0.30.0                    ArchR_1.0.1                      
 [9] magrittr_2.0.1                    rhdf5_2.34.0                     
[11] Matrix_1.3-2                      data.table_1.14.0                
[13] SummarizedExperiment_1.20.0       Biobase_2.50.0                   
[15] GenomicRanges_1.42.0              GenomeInfoDb_1.26.4              
[17] IRanges_2.24.1                    S4Vectors_0.28.1                 
[19] BiocGenerics_0.36.0               MatrixGenerics_1.2.1             
[21] matrixStats_0.58.0                ggplot2_3.3.3                    

loaded via a namespace (and not attached):
 [1] tidyselect_1.1.0         purrr_0.3.4              lattice_0.20-41         
 [4] colorspace_2.0-0         vctrs_0.3.6              generics_0.1.0          
 [7] utf8_1.2.1               XML_3.99-0.6             rlang_0.4.10            
[10] pillar_1.5.1             glue_1.4.2               withr_2.4.1             
[13] BiocParallel_1.24.1      GenomeInfoDbData_1.2.4   lifecycle_1.0.0         
[16] stringr_1.4.0            zlibbioc_1.36.0          munsell_0.5.0           
[19] gtable_0.3.0             labeling_0.4.2           Cairo_1.5-12.2          
[22] fansi_0.4.2              Rcpp_1.0.6               scales_1.1.1            
[25] DelayedArray_0.16.2      farver_2.1.0             digest_0.6.27           
[28] stringi_1.5.3            dplyr_1.0.5              tools_4.0.4             
[31] bitops_1.0-6             rhdf5filters_1.2.0       RCurl_1.98-1.3          
[34] tibble_3.1.0             crayon_1.4.1             pkgconfig_2.0.3         
[37] MASS_7.3-53.1            ellipsis_0.3.1           rstudioapi_0.13         
[40] Rhdf5lib_1.12.1          R6_2.5.0                 GenomicAlignments_1.26.0
rcorces commented 3 years ago

Sorry you are having trouble. I have never seen this before and this is not supposed to happen. I dont think I have enough information to help and your log file was not attached to the issue. Perhaps you can provide the code that was used to call addIterativeLSI() and the log file as a start.

IC-hub commented 3 years ago

ArchR-addIterativeLSI-13a65581ef2e-Date-2021-03-19_Time-09-12-14.log My log is shown in the attached file and here are my codes around addIterativeLSI:

proj <- ArchRProject(
  ArrowFiles = ArrowFiles, 
  outputDirectory = "HemeTutorial",
  copyArrows = TRUE #This is recommened so that you maintain an unaltered copy for later usage.
)

cell_id = read.csv('bin_1000_cellID.csv', stringsAsFactors=FALSE)
names(cell_id) = c('1', 'barcode')

# keep selected cells
barcode_in = intersect(paste('multi-pbmc10k#',cell_id$barcode,sep=''),proj$cellNames)
proj2 = proj[barcode_in,]

# LSI and clustering
proj2 <- addIterativeLSI(ArchRProj = proj2, useMatrix = "TileMatrix", name = "IterativeLSI",sampleCellsPre = 500,clusterParams=list(sampleCells =500,n.start=10))
rcorces commented 3 years ago

Try using subsetArchRProject() to subset your project via the cells parameter. https://www.archrproject.com/reference/subsetArchRProject.html

jgranja24 commented 3 years ago

Hi @IC-hub, I think there is a chance maybe something weird was with the cells used. I added a check to use 50 cells vs 10 cells for LSI projection. I made this now a warning vs an error as well. This is really just a sanity check that should be essentially identical, but I am not sure why in your case this is not true. This will be reflected in the newest release upcoming.