[BioC] Rsamtools: scanBamFlag bug?

Martin Morgan mtmorgan at fhcrc.org
Tue May 22 08:44:32 CEST 2012


On 05/21/2012 03:19 AM, Nuno Fonseca wrote:
> Dear all,
>
> I got a unexpected behaviour when I set the isValidVendorRead flag as TRUE.
>
>  >library(Rsamtools)
>  >ScanBamParam(flag=scanBamFlag(isValidVendorRead=TRUE))
> class: ScanBamParam
> bamFlag (NA unless specified): isValidVendorRead=FALSE
> bamSimpleCigar: FALSE
> bamReverseComplement: FALSE
> bamTag:
> bamWhich: 0 elements
> bamWhat:
>
> The isValidVendorRead is shown as being FALSE but I would expect it to
> be TRUE. I started using Rsamtools recently so I am not sure if I am
> missing something or if this a bug.

Hi Nuno -- this is a bug; setting scanBamFlag(isValidVendorRead=TRUE) 
has the effect documented on ?ScanBamParam -- only valid vendor reads 
are returned.

The SAM / BAM specification (now) says the underlying flag is TRUE when 
reads do NOT pass quality checks, and in the development version of 
Bioconductor Rsamtools v.1.9.12 the flag 'isValidVendorRead' is 
deprecated in favor of 'isNotPassingQUalityControls', with TRUE and 
FALSE interchanged when the flag is created. The double negative (NOT 
... FALSE) is consistent with the SAM / BAM specification.

 > ScanBamParam(flag=scanBamFlag(isNotPassingQualityControls=FALSE))
class: ScanBamParam
bamFlag (NA unless specified): isNotPassingQualityControls=FALSE
bamSimpleCigar: FALSE
bamReverseComplement: FALSE
bamTag:
bamWhich: 0 elements
bamWhat:

Martin

>
> Thanks in advance for your time,
>
> Nuno Fonseca
>
> sessionInfo()
> R version 2.15.0 (2012-03-30)
> Platform: x86_64-redhat-linux-gnu (64-bit)
>
> locale:
> [1] LC_CTYPE=en_US.utf8 LC_NUMERIC=C
> [3] LC_TIME=en_US.utf8 LC_COLLATE=en_US.utf8
> [5] LC_MONETARY=en_US.utf8 LC_MESSAGES=en_US.utf8
> [7] LC_PAPER=C LC_NAME=C
> [9] LC_ADDRESS=C LC_TELEPHONE=C
> [11] LC_MEASUREMENT=en_US.utf8 LC_IDENTIFICATION=C
>
> attached base packages:
> [1] stats graphics grDevices utils datasets methods base
>
> other attached packages:
> [1] Rsamtools_1.8.4 Biostrings_2.24.1 GenomicRanges_1.8.5
> [4] IRanges_1.14.2 BiocGenerics_0.2.0
>
> loaded via a namespace (and not attached):
> [1] bitops_1.0-4.1 stats4_2.15.0 zlibbioc_1.2.0
>
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at r-project.org
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives:
> http://news.gmane.org/gmane.science.biology.informatics.conductor


-- 
Computational Biology
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N. PO Box 19024 Seattle, WA 98109

Location: M1-B861
Telephone: 206 667-2793



More information about the Bioconductor mailing list