[BioC] ShortRead error when reading BAM file
Martin Morgan
mtmorgan at fhcrc.org
Thu Sep 15 15:19:29 CEST 2011
On 09/15/2011 02:35 AM, Alex Gutteridge wrote:
> I'm trying to load a BAM file generated by Mosaik using ShortRead, but
> I'm getting the following error:
>
>> aln.bam = readAligned("data/ALIGNMENT/A430001.1.samtools.bam",type="BAM")
> Error: Input/Output
> 'readAligned' failed to parse files
> dirPath: 'data/ALIGNMENT/A430001.1.samtools.bam'
> pattern: ''
> type: 'BAM'
> error: INTEGER() can only be applied to a 'integer', not a 'symbol'
>> sessionInfo()
> R version 2.12.0 (2010-10-15)
> Platform: x86_64-unknown-linux-gnu (64-bit)
>
> locale:
> [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
> [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
> [5] LC_MONETARY=C LC_MESSAGES=en_US.UTF-8
> [7] LC_PAPER=en_US.UTF-8 LC_NAME=C
> [9] LC_ADDRESS=C LC_TELEPHONE=C
> [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
>
> attached base packages:
> [1] stats graphics grDevices utils datasets methods base
>
> other attached packages:
> [1] ShortRead_1.8.1 Rsamtools_1.2.3 lattice_0.19-13
> [4] Biostrings_2.18.0 GenomicRanges_1.2.1 IRanges_1.8.2
>
> loaded via a namespace (and not attached):
> [1] Biobase_2.10.0 grid_2.12.0 hwriter_1.2 tools_2.12.0
>
> I ran samtools from the command-line over the original Mosiak BAM file
> and it completed fine:
>
> samtools view -b A430001.1.bam > A430001.1.samtools.bam
>
> but I get the above error on both the Mosaik original and samtools
> processed BAM file.
>
> I also tried the debug suggested here:
> https://stat.ethz.ch/pipermail/bioconductor/2010-October/035745.html but
> it segfaulted:
>
>> param = ScanBamParam(simpleCigar = TRUE, reverseComplement = TRUE,
> + what = ShortRead:::.readAligned_bamWhat())
>>
>> res = scanBam('data/ALIGNMENT/A430001.1.samtools.bam', param=param)
>
> *** caught segfault ***
> address (nil), cause 'unknown'
>
> Traceback:
> 1: .Call(func, file, index, "rb", NULL, flag, simpleCigar, ...)
> 2: .io_bam(.scan_bam, file, index, reverseComplement, tmpl, param = param)
> 3: scanBam("data/ALIGNMENT/A430001.1.samtools.bam", param = param)
> 4: scanBam("data/ALIGNMENT/A430001.1.samtools.bam", param = param)
>
> Any suggestions to debug the file would be gratefully accepted.
Hi Alex --
I'd stick with
param = ScanBamParam(simpleCigar = TRUE, reverseComplement = TRUE,
what = ShortRead:::.readAligned_bamWhat())
res = scanBam('data/ALIGNMENT/A430001.1.samtools.bam', param=param)
as the starting point for debugging.
My first suggestion is to update R to R-2-13.1, install Rsamtools, and
try again.
The next is more complicated, but not to bad. Start R with the 'gdb'
debugger, provoke the error, and then find where the error occurred.
It'll look some thing like
R -d gdb
gdb> run
...
> ## now at the R prompt, do what you need to segfault
...
gdb> where
you'll have to type the 'run' and 'where' commands; 'where' will
generate a backtrace, and if you could forward that to me (e.g., copy /
paste) that would be great.
Martin
--
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