Entering edit mode
Hello,
I'm getting a strange warning message when I attempt to read in tag information from BAM files with scanBam. I haven't seen this warning in the past. I don't get the warning message if I ignore tags. The BAM file appears to be read in despite the warnings. Please see the following example, in which the file "test.bam" is the BAM-format version of this SAM file:
@HD VN:1.0 SO:unsorted @SQ SN:WT LN:180 @SQ SN:Y92del LN:180 @SQ SN:R94_P95insR LN:180 @SQ SN:P95_R102del LN:180 @SQ SN:P95_D97del LN:180 @SQ SN:P96_D97insP LN:180 @SQ SN:S101fs*21 LN:180 @SQ SN:G104fs*>118 LN:180 @PG ID:bowtie2 PN:bowtie2 VN:2.2.9 CL:"/home/rbradley/projects/gene_expression/software/Linux.x86_64/bin/bowtie2-align-s --wrapper basic-0 -x /fh/scratch/delete30/bradley_r/scratch_space_rbradley/tmp/Rtmp3T3QV3/file27dd3730600b --quiet --end-to-end --sensitive -k 1 --threads 3 --passthrough -U /tmp/18622.unp" SRR7236962.1491363 0 WT 58 255 100M * 0 0 GCTGCGGGTGCAAATGGCGCGCTACGGCCGCCCCCCGGACTCACACCACAGCCGCCGGGGACCGCCACCCCGCAGGTACGGGGGCGGTGGCTACGGACGC AAFFFKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKFKKK AS:i:0 XN:i:0 XM:i:0 XO:i:0 XG:i:0 NM:i:0 MD:Z:100 YT:Z:UU
The example follows:
> bam = scanBam ("~/test.bam", param = ScanBamParam (what = c ("qname", "rname"), tag = character (0))) > bam = scanBam ("~/test.bam", param = ScanBamParam (what = c ("qname", "rname"), tag = c ("XN", "XM"))) Warning messages: 1: In doTryCatch(return(expr), name, parentenv, handler) : length of NULL cannot be changed 2: In doTryCatch(return(expr), name, parentenv, handler) : length of NULL cannot be changed > bam [[1]] [[1]]$qname [1] "SRR7236962.1491363" [[1]]$rname [1] WT Levels: WT Y92del R94_P95insR P95_R102del P95_D97del P96_D97insP S101fs*21 G104fs*>118 [[1]]$tag [[1]]$tag$XN [1] 0 [[1]]$tag$XM [1] 0
> sessionInfo() R version 3.5.0 (2018-04-23) Platform: x86_64-apple-darwin15.6.0 (64-bit) Running under: macOS High Sierra 10.13.5 Matrix products: default BLAS: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRblas.0.dylib LAPACK: /Library/Frameworks/R.framework/Versions/3.5/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 grDevices utils datasets stats graphics methods base other attached packages: [1] Rsamtools_1.32.0 Biostrings_2.48.0 XVector_0.20.0 GenomicRanges_1.32.3 GenomeInfoDb_1.16.0 IRanges_2.14.10 S4Vectors_0.18.3 BiocGenerics_0.26.0 [9] dplyr_0.7.6 tidyr_0.8.1 readr_1.1.1 tibble_1.4.2 magrittr_1.5 loaded via a namespace (and not attached): [1] Rcpp_0.12.17 bindr_0.1.1 zlibbioc_1.26.0 hms_0.4.2 BiocParallel_1.14.1 tidyselect_0.2.4 R6_2.2.2 [8] rlang_0.2.1 tools_3.5.0 assertthat_0.2.0 bindrcpp_0.2.2 GenomeInfoDbData_1.1.0 purrr_0.2.5 bitops_1.0-6 [15] RCurl_1.95-4.10 glue_1.2.0 compiler_3.5.0 pillar_1.2.3 pkgconfig_2.0.1
Any help/advice would be greatly appreciated.
Thank you,
Robert Bradley
Martin, thank you for the quick response and fix. I updated Rsamtools per your instructions. I no longer gett the above warning message. However, I think that a new bug may have been introduced. I can read in the BAM version of the following SAM file without problems if I don't specify parameters:
However, if I attempt to read in tags, then the file isn't read correctly:
My sessionInfo is below (I couldn't include it in the above response due to the character limit):
Sorry please try again.
Thank you! It's working without problems for me now.