Hello,
I created a GRangesList of 3'UTRs and GappedAlignments of a BAM file using
the following code:
_____________________
library(GenomicRanges);
 library(Rsamtools);
 library(leeBamViews)
library ("GenomicFeatures")
txdb <- makeTranscriptDbFromUCSC(genome="mm9", tablename="knownGene")
#
# It remembers the transcript ids. so can be used later
p3UTRs <- threeUTRsByTranscript(txdb, use.names=TRUE)
# read the bam alignment
aligns <- readGappedAlignments ("Dend_accepted_hits_sorted.bam")

--------------------------------------
However, when I try to get the countOverlaps, I get the following error:
> c <- countOverlaps (p3UTRs, aligns)
Error in queryHits(findOverlaps(query, subject, maxgap = maxgap, type =
type)) :
  error in evaluating the argument 'x' in selecting a method for function
'queryHits'

I suspect that this happens as the sequence names, "chrUn_random chrX_random
chrY_random" etc which are present in the GRangeslist, p3UTRs are not
present in the GappedAlignement objects.

My questions is:
1. Can I make countOverlaps to choose only those intervals in which there
are entries in both the objects?
 2. How do I subjset GRangeList (p3UTRs) to include entries from specific
list of chromosomes of interest only?

-best
-Lax
> sessionInfo()
R version 2.12.0 (2010-10-15)
Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)

locale:
[1] en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] GenomicFeatures_1.2.1 leeBamViews_0.99.11   BSgenome_1.18.2
[4] Biobase_2.10.0        Rsamtools_1.2.0       Biostrings_2.18.0
[7] GenomicRanges_1.2.3   IRanges_1.8.2

loaded via a namespace (and not attached):
[1] biomaRt_2.6.0      DBI_0.2-5          RCurl_1.4-3
RSQLite_0.9-2
[5] rtracklayer_1.10.5 tools_2.12.0       XML_3.2-0

        [[alternative HTML version deleted]]

_______________________________________________
Bioc-sig-sequencing mailing list
Bioc-sig-sequencing@r-project.org
https://stat.ethz.ch/mailman/listinfo/bioc-sig-sequencing

Reply via email to