Entering edit mode
Noah Dowell
▴
410
@noah-dowell-3791
Last seen 10.4 years ago
To Whom It may Concern:
In using the findOverlappingPeaks function I encountered the following
error:
> tOverlap <- findOverlappingPeaks(rd1, rd1b, maxgap= 50, multiple =
TRUE, NameOfPeaks1= "tf1", NameOfPeaks2 = "tf2")
Error in dimnames(x) <- dn :
length of 'dimnames' [2] not equal to array extent
The rd1 and rd2 objects are RangedData created using IRanges but the
row names seem to be causing a problem.
> dimnames(rd1)
[[1]]
NULL
[[2]]
[1] "site" "score"
Compare this to the vignette example:
> dimnames(peaks1)
[[1]]
[1] "Site1" "Site2" "Site7" "Site3" "Site4" "Site5" "Site12"
"Site6" "Site8" "Site9" "Site10"
[12] "Site11"
[[2]]
[1] "strand"
The work around that seems to fix this problem for me is to use the
RangedData object that is the output of the annotatePeakInBatch
function. This object has many columns that are of no use to the
findOverlappingPeaks function so I did a little subset:
> smallAnno <- annoPeakTotal[,c(1,2)]
> head(smallAnno)
RangedData with 6 rows and 2 value columns across 16 spaces
space ranges | peak strand
<character> <iranges> | <character> <character>
0001 YAL069W I [ 16, 254] | 0001 1
0002 YAL067W-A I [ 2731, 2924] | 0002 1
0006 YAL062W I [29935, 29959] | 0006 1
0007 YAL062W I [30011, 30039] | 0007 1
0008 YAL062W I [31661, 31678] | 0008 1
0009 YAL062W I [31702, 31710] | 0009 1
Note that this fixed the row names problem:
> dimnames(smallAnno[1:10,])
[[1]]
[1] "0001 YAL069W" "0002 YAL067W-A" "0006 YAL062W" "0007 YAL062W"
"0008 YAL062W" "0009 YAL062W"
[7] "0010 YAL062W" "0011 YAL061W" "0017 YAL035W" "0018 YAL035W"
[[2]]
[1] "peak" "strand"
Hope this is helpful to anyone who is loading in BED files of ChIP
data and then looking for overlaps.
Best,
Noah