Yuchun,

Could you please send us the sample input so that we can replicate the error? Thanks!

BTW, I suggest set select = “all” since you are interested in selecting all overlapping TSSs within 5kb of the ChIP peaks. In addition, if you are interested in both nearest and overlapping TSS,  please set output = "both" without calling the function twice.

For future correspondences, could you please cc bioconductor list so that others could benefit and contribute? Thanks!

Best regards,

Julie


On 8/3/14 4:48 PM, "Yuchun Guo" <yguo@MIT.EDU> wrote:

Hi Julie,

I am a postdoc in David Gifford’s computational genomics group at MIT. I am using your ChIPpeakAnno package for finding genes around TF binding sites. I would like to get your help on finding genes that have TSSs within 5000bp of the ChIP peaks.

I can run successfully on getting the nearest genes.
peaks1 = annotatePeakInBatch(peakList[,], AnnotationData=TSS.hg19, FeatureLocForDistance="TSS", PeakLocForDistance="middle")

But, I ran the following and got an error.
peaks2 = annotatePeakInBatch(peakList[,], AnnotationData=TSS.hg19, FeatureLocForDistance="TSS", PeakLocForDistance="middle", maxgap=5000, select="first", output="overlapping")
Error in matrix(as.numeric(r.o[, 7:8]), ncol = 2) :
  (list) object cannot be coerced to type 'double'

Did I make some mistakes on calling the annotatePeakInBatch method? Please let me know.

Thanks,

Yuchun



> sessionInfo()
R version 3.1.1 (2014-07-10)
Platform: x86_64-pc-linux-gnu (64-bit)

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C
 [9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

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

other attached packages:
 [1] reactome.db_1.48.0   org.Hs.eg.db_2.14.0  ChIPpeakAnno_2.12.1
 [4] AnnotationDbi_1.26.0 GenomeInfoDb_1.0.2   Biobase_2.24.0
 [7] RSQLite_0.11.4       DBI_0.2-7            Biostrings_2.32.1
[10] XVector_0.4.0        IRanges_1.22.9       BiocGenerics_0.10.0
[13] biomaRt_2.20.0       VennDiagram_1.6.7

loaded via a namespace (and not attached):
 [1] BatchJobs_1.3           BBmisc_1.7              BiocParallel_0.6.1
 [4] bitops_1.0-6            brew_1.0-6              BSgenome_1.32.0
 [7] checkmate_1.2           codetools_0.2-8         digest_0.6.4
[10] fail_1.2                foreach_1.4.2           GenomicAlignments_1.0.3
[13] GenomicFeatures_1.16.2  GenomicRanges_1.16.3    GO.db_2.14.0
[16] iterators_1.0.7         limma_3.20.8            MASS_7.3-33
[19] multtest_2.20.0         Rcpp_0.11.0             RCurl_1.95-4.1
[22] Rsamtools_1.16.1        rtracklayer_1.24.2      sendmailR_1.1-2
[25] splines_3.1.1           stats4_3.1.1            stringr_0.6.2
[28] survival_2.37-7         tools_3.1.1             XML_3.98-1.1
[31] zlibbioc_1.10.0


	[[alternative HTML version deleted]]

