Rsamtools / rtracklayer creating csi index for BAM files
0
0
Entering edit mode
ATpoint ★ 4.2k
@atpoint-13662
Last seen 2 hours ago
Germany

I am asking this out of personal interest based on this Biostars post where OP aimed to export a BAM file with long chromosomes that do not fit into the default bai index, resulting in the error message one can see in that post.

export(anyBamfile.bam, BamFile(file = "exported.bam"))

After digging in the source code a bit the best I came up with was deactivating the indexing via index = FALSE and do it manually via samtools, but there must be a way to do it. Maybe an auto-detect option to build csi index automatically instead of bai if contig length exceeds the maximum of bai would be a good addition.

R version 3.6.1 (2019-07-05)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Sierra 10.12.5

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.6/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] parallel  stats4    stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] rtracklayer_1.44.2          GenomicAlignments_1.20.1    Rsamtools_2.0.0             Biostrings_2.52.0           XVector_0.24.0              DESeq2_1.24.0               statmod_1.4.32             
 [8] csaw_1.18.0                 tximport_1.12.3             data.table_1.12.2           edgeR_3.26.5                limma_3.40.6                zinbwave_1.6.0              SingleCellExperiment_1.6.0 
[15] SummarizedExperiment_1.14.0 DelayedArray_0.10.0         BiocParallel_1.18.0         matrixStats_0.54.0          Biobase_2.44.0              GenomicRanges_1.36.0        GenomeInfoDb_1.20.0        
[22] IRanges_2.18.1              S4Vectors_0.22.0            BiocGenerics_0.30.0        

loaded via a namespace (and not attached):
 [1] bitops_1.0-6           bit64_0.9-7            RColorBrewer_1.1-2     progress_1.2.2         httr_1.4.0             numDeriv_2016.8-1.1    tools_3.6.1            backports_1.1.4       
 [9] R6_2.4.0               KernSmooth_2.23-15     rpart_4.1-15           Hmisc_4.2-0            DBI_1.0.0              lazyeval_0.2.2         colorspace_1.4-1       nnet_7.3-12           
[17] gridExtra_2.3          tidyselect_0.2.5       prettyunits_1.0.2      bit_1.1-14             compiler_3.6.1         glmnet_3.0-1           pspline_1.0-18         htmlTable_1.13.1      
[25] labeling_0.3           checkmate_1.9.4        scales_1.0.0           mvtnorm_1.0-11         readr_1.3.1            genefilter_1.66.0      stringr_1.4.0          digest_0.6.20         
[33] foreign_0.8-71         htmltools_0.3.6        base64enc_0.1-3        pkgconfig_2.0.2        stabledist_0.7-1       ADGofTest_0.3          htmlwidgets_1.3        rlang_0.4.0           
[41] rstudioapi_0.10        RSQLite_2.1.2          shape_1.4.4            jsonlite_1.6           acepack_1.4.1          dplyr_0.8.3            RCurl_1.95-4.12        magrittr_1.5          
[49] GenomeInfoDbData_1.2.1 Formula_1.2-3          Matrix_1.2-17          Rcpp_1.0.2             munsell_0.5.0          stringi_1.4.3          zlibbioc_1.30.0        grid_3.6.1            
[57] blob_1.2.0             crayon_1.3.4           lattice_0.20-38        splines_3.6.1          GenomicFeatures_1.36.4 annotate_1.62.0        hms_0.5.0              locfit_1.5-9.1        
[65] knitr_1.23             zeallot_0.1.0          pillar_1.4.2           softImpute_1.4         geneplotter_1.62.0     codetools_0.2-16       biomaRt_2.40.3         XML_3.98-1.20         
[73] glue_1.3.1             latticeExtra_0.6-28    BiocManager_1.30.4     vctrs_0.2.0            foreach_1.4.7          gtable_0.3.0           purrr_0.3.2            assertthat_0.2.1      
[81] ggplot2_3.2.0          xfun_0.8               xtable_1.8-4           survival_2.44-1.1      pcaPP_1.9-73           gsl_2.1-6              tibble_2.1.3           copula_0.999-19.1     
[89] iterators_1.0.12       AnnotationDbi_1.46.0   memoise_1.1.0          cluster_2.1.0
rsamtools rtracklayer • 1.1k views
ADD COMMENT

Login before adding your answer.

Traffic: 734 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6