Dear All,
I have a small problem with Find overlaps function of IRange. I am trying to make the overlap between my peaks and the intron dataset that I have downloaded from UCSC.
So here is what I am doing....
peak.file =read.table ("/data/.chip=20.txt", header=T, sep='\t')
pr <- RangedData(IRanges(start=peak.file$start, end=peak.file$end), space=peak.file$chromosome, idx=peak.file$target.gene.name), idx=1:nrow(peak.file)
pr
RangedData with 52445 rows and 1 value column across 21 spaces
space ranges | idx
< factor > < IRanges > | < factor >
1 chr1 [ 9933699, 9934385] | Snord87
2 chr1 [ 88255056, 88257357] | Ncl
then I am doing the same for my introns
intron.file =read.table ("/data//mm9.intron.txt", header=T, sep='\t')
intron <- RangedData(IRanges(start=intron.file$start, end=intron.file$end), space=intron.file$chr, idx=intron.file$name)
intron
intron
RangedData with 254240 rows and 1 value column across 32 spaces
space ranges | idx
< factor> < IRanges> | <factor>
1 chr1 [134221650, 134222782] | NM_001195025_intron_1_0_chr1_134221651_ F
2 chr1 [134222806, 134224273] | NM_001195025_intron_2_0_chr1_134222807_f
And then I am doing that
> ol=findOverlaps(pr, intron, maxgap=0, minoverlap=250, type = "equal", select = "first")
> ol
CompressedIntegerList of length 21
[["chr1"]] NA NA N 11538 NA NA ... NA NA NA NA NA<NA>
[["chr10"]] NA NA NA NA NA NA... 4431 NA 4960 NA NA<NA>
[["chr11"]] 1096 NA NA NA NA 9556 ... 6717 6719 NA NA NA 6722
[["chr12"]] 5425 NA 1884 NA NA NA 551 ... NA NA 647 NA NA NA
[["chr13"]] NA NA N A NA NA NA... NA NA NA NA NA NA
[["chr14"]] NA NA NA NA NA NA... NA NA NA NA 5550 NA
[["chr15"]] NA NA 396 NA NA NA NA... NA NA NA NA NA 2318
[["chr16"]] NA 882 278 NA NA NA NA... NA 3985 1360 NA NA<NA>
[["chr17"]] 4365 NA NA NA NA NA... NA NA NA NA NA <NA>
[["chr18"]] 742 NA NA NA NA NA NA... NA NA NA 2836 NA<NA>
Where you see [HTML] is NA
> as.matrix(ol)
Error in as.vector(data) :
no method for coercing this S4 class to a vector
What am I doing wrong??? Is this what I should I expect????
Thank you in advance
I will wait for your answer
Best regards Lena
you'll have to reformat the post as most of these elements are just [HTML].
that's a bug in the biostar renderer I believe.
This seems to be more of an R and package problem. It would be helpful to know what version of IRanges, bioconductor and R you are using.
sorry for the late answer but I was sick....here it is