[BioC] countOverlaps, package:IRanges (Michael Lawrence)

Tatjana tatjana.milic86 at gmail.com
Wed Dec 7 16:22:22 CET 2011


I am working on RNA Seq analysis. I mapped the reads using bwa. As a reference,
I used genome from Ensembl. As I wanted to get a count table, where I will have
a list of genes, and the number of reads which were uniquely mapped to it, I
tried to use countOverlaps in R.

First question I have is regarding difference between 2 functions: readAligned
and readGappedAlignments.

I inputed both: bam files (using function readAligned) and indexed bam files
(using function readGappedAlignments).  When I tried do use countOverlaps, I
encountered some problems. Errors are: 

Error in countOverlaps(fcatusDb, tmp[countOverlaps(tmp, fcatusDb) == 1]) : 
  error in evaluating the argument 'subject' in selecting a method for function
'countOverlaps': Error in tmp[countOverlaps(tmp, fcatusDb) == 1] : 
  error in evaluating the argument 'i' in selecting a method for function '[':
Error in function (classes, fdef, mtable)  : 
  unable to find an inherited method for function "countOverlaps", for signature
"GRanges", "TranscriptDb"


The whole code I used is:

bwa_output=readGappedAlignments("out_trial.prefix.bam", format="BAM")
fcatusDb=makeTranscriptDbFromBiomart(biomart="ensembl", dataset =
"fcatus_gene_ensembl")

tmp=as(bwa_output, "Granges")
#also tried with "GrangesList", the same errors occur
rc=countOverlaps(fcatusDb, tmp[countOverlaps(tmp, fcatusDb)==1])


If someone has experience with this,or know how to solve this, please reply to
this post.

Thank you.
Tatjana



More information about the Bioconductor mailing list