summarizeOverlaps on partial BAM file?
1
0
Entering edit mode
cidster12 • 0
@cidster12-7317
Last seen 9.8 years ago
United States

Hi,

summarizeOverlaps seems to take only BamFileList. Is there a way that it could work on a piece of a BamFile say something created via ScanBam?

input<-GRanges(seqnames = c("chr1"), ranges = IRanges(c(start),c(stop)))

 

range<-ScanBamParam(which=input)

binfo<-scanBam(bfile,param=range)

#coerce binfo into BamFileList?

 

summarizeOverlaps(features,binfolist)

 

if not summarizeOverlaps is there an alternative method?

GenomicFeatures GRange Rsamtools • 1.1k views
ADD COMMENT
0
Entering edit mode
@valerie-obenchain-4275
Last seen 2.9 years ago
United States

The ?summarizeOverlaps man page lists all data types for the 'reads' argument:

   reads: A GRanges, GRangesList GAlignments, GAlignmentsList,
          GAlignmentPairs, BamViews or BamFileList object that
          represents the data to be counted by ‘summarizeOverlaps’.

          ‘reads’ is missing when a BamViews object is the only
          argument supplied to ‘summarizeOverlaps’.  ‘reads’ are the
          files specified in ‘bamPaths’ of the BamViews object.

Instead of reading the data in first with scanBam() you can provide a ScanBamParam to summarizeOverlaps() as the 'pram' argument. If you want to read the data in for some other reason I would suggest using the readGAlignments() family of functions. See ?readGAlignments in the GenomicAlignments package. The GAlignments or GAlignmentsList class can then be passed to summarizeOverlaps().

Valerie

ADD COMMENT

Login before adding your answer.

Traffic: 573 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6