stuart-lab / signac

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

Error in CreateChromatinAssay() #249

Closed sherbrich closed 4 years ago

sherbrich commented 4 years ago

In working through the 'Analyzing PBMC scATAC-seq' vignette with my own data generated using cellranger-atac count, I run into the following error when calling the CreateChromatinAssay() function:

 chrom_assay <- CreateChromatinAssay(
      counts = counts,
      sep = c(":", "-"),
      genome = 'mm10',
      fragments = 'fragments.tsv.gz',
      min.cells = 10, 
      min.features = 200
)
Computing hash
Checking for 9062 cell barcodes
Error in scan(file = file, what = what, sep = sep, quote = quote, dec = dec,  : 
line 1 did not have 3 elements

the traceback is as follows:

18. scan(file = file, what = what, sep = sep, quote = quote, dec = dec, 
    nmax = nrows, skip = 0, na.strings = na.strings, quiet = TRUE, 
    fill = fill, strip.white = strip.white, blank.lines.skip = blank.lines.skip, 
    multi.line = FALSE, comment.char = comment.char, allowEscapes = allowEscapes,  ... 
17. (function (file, header = FALSE, sep = "", quote = "\"'", dec = ".", 
    numerals = c("allow.loss", "warn.loss", "no.loss"), row.names, 
    col.names, as.is = !stringsAsFactors, na.strings = "NA", 
    colClasses = NA, nrows = -1, skip = 0, check.names = TRUE,  ... 
16. do.call(read.table, args) 
15. do.call(read.table, args) 
14. .simple_read_table(destfile, ...) 
13. fetch_table_from_url(url, colnames = names(col2class), col2class = col2class) 
12. fetch_table_from_UCSC(genome, "chromInfo", col2class = col2class, 
    goldenPath.url = goldenPath.url) 
11. GenomeInfoDb:::fetch_chrom_sizes_from_UCSC(GENOME, goldenPath.url = goldenPath.url) at mm10.R#40
10. GET_CHROM_SIZES(goldenPath.url = goldenPath.url) 
9. .get_chrom_info_for_registered_UCSC_genome(script_path, assembled.molecules.only = assembled.molecules.only, 
    map.NCBI = map.NCBI, add.ensembl.col = add.ensembl.col, goldenPath.url = goldenPath.url, 
    recache = recache) 
8. getChromInfoFromUCSC(genome, as.Seqinfo = TRUE) 
7. .make_Seqinfo_from_genome(genome) 
6. Seqinfo(genome = new.data) 
5. SetAssayData.ChromatinAssay(object = new.assay, slot = "seqinfo", 
    new.data = seqinfo) 
4. SetAssayData(object = new.assay, slot = "seqinfo", new.data = seqinfo) 
3. as.ChromatinAssay.Assay(x = seurat.assay, ranges = ranges, seqinfo = genome, 
    motifs = motifs, fragments = frags, annotation = annotation, 
    bias = bias, positionEnrichment = positionEnrichment) 
2. as.ChromatinAssay(x = seurat.assay, ranges = ranges, seqinfo = genome, 
    motifs = motifs, fragments = frags, annotation = annotation, 
    bias = bias, positionEnrichment = positionEnrichment) 
1. CreateChromatinAssay(counts = counts, sep = c(":", "-"), genome = "mm10", 
    fragments = "fragments.tsv.gz", min.cells = 10, min.features = 200) `

and sessionInfo():

R version 4.0.2 (2020-06-22)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Catalina 10.15.6

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

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

other attached packages:
[1] GenomeInfoDb_1.24.2 IRanges_2.22.2      S4Vectors_0.26.1    BiocGenerics_0.34.0 Seurat_3.2.1       
[6] Signac_1.0.0.9000   Matrix_1.2-18      

loaded via a namespace (and not attached):
  [1] backports_1.1.10            fastmatch_1.1-0             Hmisc_4.4-1                
  [4] BiocFileCache_1.12.1        plyr_1.8.6                  igraph_1.2.5               
  [7] lazyeval_0.2.2              splines_4.0.2               BiocParallel_1.22.0        
 [10] listenv_0.8.0               SnowballC_0.7.0             ggplot2_3.3.2              
 [13] digest_0.6.25               ensembldb_2.12.1            htmltools_0.5.0            
 [16] magrittr_1.5                checkmate_2.0.0             memoise_1.1.0              
 [19] BSgenome_1.56.0             tensor_1.5                  cluster_2.1.0              
 [22] ROCR_1.0-11                 globals_0.13.0              Biostrings_2.56.0          
 [25] matrixStats_0.56.0          ggbio_1.36.0                askpass_1.1                
 [28] prettyunits_1.1.1           jpeg_0.1-8.1                colorspace_1.4-1           
 [31] rappdirs_0.3.1              blob_1.2.1                  ggrepel_0.8.2              
 [34] xfun_0.17                   dplyr_1.0.2                 crayon_1.3.4               
 [37] RCurl_1.98-1.2              jsonlite_1.7.1              graph_1.66.0               
 [40] spatstat_1.64-1             spatstat.data_1.4-3         VariantAnnotation_1.34.0   
 [43] survival_3.2-3              zoo_1.8-8                   glue_1.4.2                 
 [46] polyclip_1.10-0             gtable_0.3.0                zlibbioc_1.34.0            
 [49] XVector_0.28.0              leiden_0.3.3                DelayedArray_0.14.1        
 [52] future.apply_1.6.0          abind_1.4-5                 scales_1.1.1               
 [55] GGally_2.0.0                DBI_1.1.0                   miniUI_0.1.1.1             
 [58] Rcpp_1.0.5                  progress_1.2.2              viridisLite_0.3.0          
 [61] xtable_1.8-4                htmlTable_2.1.0             reticulate_1.16            
 [64] foreign_0.8-80              bit_4.0.4                   rsvd_1.0.3                 
 [67] OrganismDbi_1.30.0          Formula_1.2-3               htmlwidgets_1.5.1          
 [70] httr_1.4.2                  RColorBrewer_1.1-2          ellipsis_0.3.1             
 [73] ica_1.0-2                   reshape_0.8.8               XML_3.99-0.5               
 [76] pkgconfig_2.0.3             ggseqlogo_0.1               dbplyr_1.4.4               
 [79] nnet_7.3-14                 uwot_0.1.8                  deldir_0.1-29              
 [82] tidyselect_1.1.0            rlang_0.4.7                 reshape2_1.4.4             
 [85] later_1.1.0.1               AnnotationDbi_1.50.3        munsell_0.5.0              
 [88] tools_4.0.2                 generics_0.0.2              RSQLite_2.2.0              
 [91] ggridges_0.5.2              stringr_1.4.0               fastmap_1.0.1              
 [94] goftest_1.2-2               knitr_1.29                  bit64_4.0.5                
 [97] fitdistrplus_1.1-1          purrr_0.3.4                 RANN_2.6.1                 
[100] AnnotationFilter_1.12.0     RBGL_1.64.0                 pbapply_1.4-3              
[103] future_1.18.0               nlme_3.1-149                mime_0.9                   
[106] RcppRoll_0.3.0              biomaRt_2.44.1              hdf5r_1.3.3                
[109] compiler_4.0.2              rstudioapi_0.11             curl_4.3                   
[112] plotly_4.9.2.1              png_0.1-7                   spatstat.utils_1.17-0      
[115] tibble_3.0.3                stringi_1.5.3               GenomicFeatures_1.40.1     
[118] lattice_0.20-41             ProtGenerics_1.20.0         vctrs_0.3.4                
[121] pillar_1.4.6                lifecycle_0.2.0             BiocManager_1.30.10        
[124] lmtest_0.9-38               RcppAnnoy_0.0.16            data.table_1.13.0          
[127] cowplot_1.1.0               bitops_1.0-6                irlba_2.3.3                
[130] rtracklayer_1.48.0          httpuv_1.5.4                patchwork_1.0.1            
[133] GenomicRanges_1.40.0        R6_2.4.1                    latticeExtra_0.6-29        
[136] promises_1.1.1              lsa_0.73.2                  KernSmooth_2.23-17         
[139] gridExtra_2.3               codetools_0.2-16            dichromat_2.0-0            
[142] assertthat_0.2.1            MASS_7.3-53                 SummarizedExperiment_1.18.2
[145] openssl_1.4.2               GenomicAlignments_1.24.0    sctransform_0.2.1          
[148] Rsamtools_2.4.0             GenomeInfoDbData_1.2.3      hms_0.5.3                  
[151] mgcv_1.8-33                 grid_4.0.2                  rpart_4.1-15               
[154] tidyr_1.1.2                 Rtsne_0.15                  biovizBase_1.36.0          
[157] Biobase_2.48.0              shiny_1.5.0                 base64enc_0.1-3      

thanks!

timoast commented 4 years ago

It looks like GenomeInfoDb is having issues creating the seqinfo object. You can either remove the genome parameter or set it to a pre-existing Seqinfo object for your genome.