[BioC] Rsamtools Error: vector of negative length
mtmorgan at fhcrc.org
Tue Nov 9 16:28:16 CET 2010
On 11/09/2010 06:52 AM, Christoph Bartenhagen wrote:
> Hi again,
> thank you very much for your reply. It sounds very reasonable to me and
> it explains why it works with smaller BAM-files, i.e. files containing
> fewer reads.
> To track down the error, here's my sessionInfo() some more info about my
> error (I am not sure though how to generate a (small) reproducible
> example, since the problem seems to be related to quite large alignment
ok thanks for the additional info. In the mean time, a workaround is to
use the 'param' argument of scanBam to process smaller chunks (e.g.,
chromosomes) of your data at one time. Martin
>> bam = scanBam(file="alignment.bam")
> Error in .Call(func, file, index, "rb", NULL, flag, simpleCigar, ...) :
> negative length vectors are not allowed
> R version 2.12.0 (2010-10-15)
> Platform: x86_64-pc-linux-gnu (64-bit)
>  C
> attached base packages:
>  stats graphics grDevices utils datasets methods base
> other attached packages:
>  Rsamtools_1.2.0 Biostrings_2.18.0 GenomicRanges_1.2.0
>  IRanges_1.8.0
> loaded via a namespace (and not attached):
>  Biobase_2.10.0
> My BAM-file contains 69.654.881 reads of length 36bp each.
> If this problem has already been adressed, do I need to update my
> version of Rsamtools (1.2.0)? I just saw that the release version is
> 1.2.1 and the development version is 1.3.4.
> Thanks for any further advice,
> Am 09.11.2010 14:52, schrieb Martin Morgan:
>> On 11/09/2010 05:22 AM, Christoph Bartenhagen wrote:
>>> Hello everyone,
>>> I am experiencing a strange error, while reading (large) BAM-files (>
>>> 2GB) in R with the function scanBam() in the Rsamtools package.
>>> It stops saying "negative length vectors are not allowed".
>>> I think my BAM-file is ok, because I can read it in small chunks like
>>> reads on positive strand first, then reads on the negative strand (using
>>> ScanBamParam). This might be a more general Error in R because it seems
>>> to occur in very different R programs.
>>> Has anyone experienced this error?
>>> I would really appreciate any ideas how to fix this problem or
>>> concerning the reason for this error (I don't really understand what a
>>> "negative length vector" is).
>> Hi Christoph --
>> This is an integer overflow when the (accumulated) underlying DNA or
>> quality strings are too long. But I think this has been addressed and so
>> your sessionInfo() and a reproducible example (or at least the explicit
>> command that triggers the problem) would help.
>>> Thanks in advance
>>> Bioconductor mailing list
>>> Bioconductor at stat.math.ethz.ch
>>> Search the archives:
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N. PO Box 19024 Seattle, WA 98109
Telephone: 206 667-2793
More information about the Bioconductor