Hi, I thought one can affect how ShortRead's readAligned function handles reverse strand BAM reads: to reverse complement them, or not, with the ScanBamParam reverseComplement. I'm not able to do that, can you set me straight? Thank you, see the code below.
library(ShortRead) b = readAligned('my.bam', type='BAM') sread(b)  151 CATTGCTTCCGTTTGTGCTCGATAAAAATAAGAAT...GTCTGGTTCATCATCTGTAAGAATGGCTTCCAGAG # reverseComplement: A logical(1) vectors. BAM files store reads mapping # to the minus strand as though they are on the plus strand. # Rsamtools obeys this convention by default # (‘reverseComplement=FALSE’), but when this value is set to # TRUE returns the sequence and quality scores of reads mapped # to the minus strand in the reverse complement (sequence) and # reverse (quality) of the read as stored in the BAM file. This # might be useful if wishing to recover read and quality scores # as represented in fastq files, but is NOT appropriate for # variant calling or other alignment-based operations. param.T = ScanBamParam(simpleCigar = TRUE, reverseComplement = TRUE, what = ShortRead:::.readAligned_bamWhat()) b.SBP.TRUE = readAligned('my.bam', type='BAM', param=param.T) sread(b.SBP.TRUE)  151 CATTGCTTCCGTTTGTGCTCGATAAAAATAAGAAT...GTCTGGTTCATCATCTGTAAGAATGGCTTCCAGAG param.F = ScanBamParam(simpleCigar = TRUE, reverseComplement = FALSE, what = ShortRead:::.readAligned_bamWhat()) b.SBP.FALSE = readAligned('my.bam', type='BAM', param=param.F) Warning message: UserArgumentMismatch using 'TRUE' for 'bamReverseComplement(param)' sread(b.SBP.FALSE)  151 CATTGCTTCCGTTTGTGCTCGATAAAAATAAGAAT...GTCTGGTTCATCATCTGTAAGAATGGCTTCCAGAG
> version _ platform x86_64-unknown-linux-gnu arch x86_64 os linux-gnu system x86_64, linux-gnu status Under development (unstable) major 3 minor 2.0 year 2015 month 01 day 11 svn rev 67421 language R version.string R Under development (unstable) (2015-01-11 r67421) nickname Unsuffered Consequences > sessionInfo() R Under development (unstable) (2015-01-11 r67421) Platform: x86_64-unknown-linux-gnu (64-bit) Running under: Ubuntu 14.04.1 LTS locale:  LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C  LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8  LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8  LC_PAPER=en_US.UTF-8 LC_NAME=C  LC_ADDRESS=C LC_TELEPHONE=C  LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C attached base packages:  stats4 parallel stats graphics grDevices utils datasets methods  base other attached packages:  ShortRead_1.25.8 GenomicAlignments_1.3.23 Rsamtools_1.19.26  GenomicRanges_1.19.33 GenomeInfoDb_1.3.12 Biostrings_2.35.7  XVector_0.7.3 IRanges_2.1.35 S4Vectors_0.5.16  BiocParallel_1.1.11 BiocGenerics_0.13.4 BiocInstaller_1.17.3 loaded via a namespace (and not attached):  base64enc_0.1-2 BatchJobs_1.5 BBmisc_1.8  Biobase_2.27.1 bitops_1.0-6 brew_1.0-6  checkmate_1.5.1 codetools_0.2-9 DBI_0.3.1  digest_0.6.8 fail_1.2 foreach_1.4.2  grid_3.2.0 hwriter_1.3.2 iterators_1.0.7  lattice_0.20-29 latticeExtra_0.6-26 RColorBrewer_1.1-2  RSQLite_1.0.0 sendmailR_1.2-1 stringr_0.6.2  tools_3.2.0 zlibbioc_1.13.0