[BioC] reading BAM files

Martin Morgan mtmorgan at fhcrc.org
Mon Nov 26 18:30:07 CET 2012


Hi Hermann --

On 11/26/2012 09:26 AM, Hermann Norpois wrote:
> Hello,
>
> I try to read BAM files - so far without success. And I dont know why.
>
> My Bamfile is wgEncodeOpenChromDnase8988tAlnRep1.bam
> (downloaded from the Encode site)
>
> For example:
>
> library (ShortRead)

library(Rsamtools)

>> which <- RangesList(seq1=IRanges(1000,2000),
> + seq2=IRanges(c(100,1000), c(1000,2000)))
>> what <- c("rname", "strand", "pos", "qwidth","seq")
>> param <- ScanBamParam(which=which, what=what)
>> bam <- scanBam ("~/Bam/wgEncodeOpenChromDnase8988tAlnRep1.bam",
> param=param)
> [bam_index_load] fail to load BAM index.
> Fehler in open.BamFile(BamFile(file, index), "rb") :
>    failed to load BAM index

index the bam file first

indexBam("~/Bam/wgEncodeOpenChromDnase8988tAlnRep1.bam")

Martin

>    file: /home/hnorpois/Bam/wgEncodeOpenChromDnase8988tAlnRep1.bam
>
>
> The mentioned syntax I copied from an introduction to Rsamtools.
> Actually I would like to know a simple syntax that enables me to read
> BAM-files. Can anybody give me a hint.
>
> Thanks Hermann
>
> 	[[alternative HTML version deleted]]
>
> _______________________________________________
> 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: Arnold Building M1 B861
Phone: (206) 667-2793



More information about the Bioconductor mailing list