Hi Michael,

I tried the code but got the exact same errors as before.

Thanks,
Margaret Linan


On Tue, May 28, 2013 at 1:52 PM, Michael Love
<michaelisaiahlove@gmail.com>wrote:

> hi Margaret,
>
> On Tue, May 28, 2013 at 10:26 PM, Margaret Linan <mlinan@asu.edu> wrote:
> >
> > However I ran into a problem with my file.bam see below:
> >
> >> library("DEXSeq")
> >> exonicParts <- prepareAnnotationForDEXSeq(hse, aggregateGenes=TRUE)
> >> bamDir<-file.path("C:/Users/mlinan/Desktop")
> >> fls <- list.files(bamDir, pattern="bam$", full=TRUE)
> >> library("Rsamtools")
> > Loading required package: Biostrings
> >
> >> bamlst <- BamFileList(fls)
> >> library("DEXSeq")
> >
> >> SE <- countReadsForDEXSeq(exonicParts, bamlst)
> > Error in value[[3L]](cond) :
> >   failed to open BamFile: SAM/BAM header missing or empty
> >   file: 'C:/Users/mlinan/Desktop/file.bam'
> > In addition: Warning messages:
> > 1: In doTryCatch(return(expr), name, parentenv, handler) :
> >   [bam_header_read] EOF marker is absent. The input is probably
> truncated.
> > 2: In doTryCatch(return(expr), name, parentenv, handler) :
> >   [bam_header_read] invalid BAM binary header (this is not a BAM file).
> >> SE
> > Error: object 'SE' not found
> >
> >
>
> Maybe we can troubleshoot with a simpler use of the Rsamtools package,
> which is used by countReadsForDEXSeq().
>
> Could you try this code:
>
> file <- "C:/Users/mlinan/Desktop/file.bam"
> library(Rsamtools)
> which <- GRanges("chr1",IRanges(10e6,width=1000))  # assuming you are
> using 'chr' style coordinates
> what <- c("rname", "strand", "pos", "qwidth", "seq")
> param <- ScanBamParam(which=which, what=what)
> bam <- scanBam(file, param=param)
> str(bam)
>
> best,
>
> Mike
>

	[[alternative HTML version deleted]]

