Question: Reporting Tools error
0
gravatar for Mayte
4.5 years ago by
Mayte0
United States
Mayte0 wrote:

Hi

I am having problems with reporting tools.To be simple I am including the same example as in Category package and then try to do html with Reporting Tools but I get an error.  (R studio sometimes crashes with this) any help is appreciated.

Mayte

library("hgu95av2.db")
library("annotate")

probids <- ls(hgu95av2GENENAME)[1:300]
## Select for probeids that have PFAM ids
hasPFAM <- sapply(mget(probids, hgu95av2PFAM), function(ids)
                  if(!is.na(ids) && length(ids) > 1) TRUE else FALSE)
probids <- probids[hasPFAM]
## get unique Entrez Gene IDs
probids <- unique(getEG(probids, "hgu95av2"))
## Now do the same for the universe
univ <- ls(hgu95av2GENENAME)
univHasPFAM <- sapply(mget(univ, hgu95av2PFAM), function(ids)
                      if(!is.na(ids) && length(ids) > 1) TRUE else
                         FALSE)
univ <- univ[univHasPFAM]
univ <- unique(getEG(univ, "hgu95av2"))

p <- new("PFAMHyperGParams", geneIds=probids, universeGeneIds=univ,
         annotation="hgu95av2")
## this takes a while...
if(interactive()){
hypt <- hyperGTest(p)
summary(hypt)
htmlReport(hypt, file="temp.html", summary.args=list("htmlLinks"=TRUE))
}

library(ReportingTools)
Report <-HTMLReport(shortName ="PFAM analysis", title='PFAM analysis',reportDirectory='./myoutput',baseUrl = "")
ReportingTools::publish(hypt, Report, selectedIDs=probids, annotation.db="org.Hs.eg", categorySize=20,makePlot=FALSE)

Error in if (dim(df)[1] < 1) { : argument is of length zero

sessionInfo()
R version 3.1.1 (2014-07-10)
Platform: x86_64-apple-darwin13.1.0 (64-bit)

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

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

other attached packages:
 [1] ReportingTools_2.4.0 knitr_1.6            xtable_1.7-4         annotate_1.42.1      hgu95av2.db_2.14.0   org.Hs.eg.db_2.14.0 
 [7] Category_2.30.0      GO.db_2.14.0         RSQLite_0.11.4       DBI_0.3.0            Matrix_1.1-4         AnnotationDbi_1.26.0
[13] GenomeInfoDb_1.0.2   Biobase_2.24.0       BiocGenerics_0.10.0 

loaded via a namespace (and not attached):
 [1] acepack_1.3-3.3          AnnotationForge_1.6.1    BatchJobs_1.3            BBmisc_1.7               BiocParallel_0.6.1     
 [6] biomaRt_2.20.0           Biostrings_2.32.1        biovizBase_1.12.3        bitops_1.0-6             brew_1.0-6             
[11] BSgenome_1.32.0          checkmate_1.4            cluster_1.15.3           codetools_0.2-9          colorspace_1.2-4       
[16] DESeq2_1.4.5             dichromat_2.0-0          digest_0.6.4             edgeR_3.6.8              evaluate_0.5.5         
[21] fail_1.2                 foreach_1.4.2            foreign_0.8-61           formatR_1.0              Formula_1.1-2           
[26] genefilter_1.46.1        geneplotter_1.42.0       GenomicAlignments_1.0.6  GenomicFeatures_1.16.2   GenomicRanges_1.16.4   
[31] ggbio_1.12.10            ggplot2_1.0.0            GOstats_2.30.0           graph_1.42.0             grid_3.1.1             
[36] gridExtra_0.9.1          GSEABase_1.26.0          gtable_0.1.2             Hmisc_3.14-5             hwriter_1.3.2           
[41] IRanges_1.22.10          iterators_1.0.7          lattice_0.20-29          latticeExtra_0.6-26      limma_3.20.9           
[46] locfit_1.5-9.1           MASS_7.3-34              munsell_0.4.2            nnet_7.3-8               PFAM.db_2.14.0         
[51] plyr_1.8.1               proto_0.3-10             R.methodsS3_1.6.1        R.oo_1.18.0              R.utils_1.33.0         
[56] RBGL_1.40.1              RColorBrewer_1.0-5       Rcpp_0.11.2              RcppArmadillo_0.4.400.0  RCurl_1.95-4.3         
[61] reshape2_1.4             rpart_4.1-8              Rsamtools_1.16.1         rtracklayer_1.24.2       scales_0.2.4           
[66] sendmailR_1.1-2          splines_3.1.1            stats4_3.1.1             stringr_0.6.2            survival_2.37-7         
[71] tools_3.1.1              VariantAnnotation_1.10.5 XML_3.98-1.1             XVector_0.4.0            zlibbioc_1.10.0        
reporting tools • 1.1k views
ADD COMMENTlink modified 3.9 years ago by Mayte Suarez-Farinas510 • written 4.5 years ago by Mayte0
Answer: Reporting Tools error
1
gravatar for Laurent Gatto
4.5 years ago by
Laurent Gatto1.1k
United Kingdom
Laurent Gatto1.1k wrote:

Hi Mayte,

I managed to run your code without any problem. Only difference was that I loaded GOstats before creating the PFAMHyperGParams.

I couldn't see any obvious difference between your session information and mine (see below). To make sure you are up-to-date, you might try to update all your packages (that's what I did before running you example) and try again:

library("BiocInstaller")
biocLite()

Hope this helps.

Laurent

> sessionInfo()
R version 3.1.1 Patched (2014-09-02 r66514)
Platform: x86_64-unknown-linux-gnu (64-bit)

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

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

other attached packages:
 [1] PFAM.db_2.14.0       ReportingTools_2.4.0 knitr_1.6           
 [4] xtable_1.7-4         GOstats_2.30.0       graph_1.42.0        
 [7] Category_2.30.0      GO.db_2.14.0         Matrix_1.1-4        
[10] annotate_1.42.1      hgu95av2.db_2.14.0   org.Hs.eg.db_2.14.0 
[13] RSQLite_0.11.4       DBI_0.3.0            AnnotationDbi_1.26.0
[16] GenomeInfoDb_1.0.2   Biobase_2.24.0       BiocGenerics_0.10.0 

loaded via a namespace (and not attached):
 [1] acepack_1.3-3.3          AnnotationForge_1.6.1    BatchJobs_1.3           
 [4] BBmisc_1.7               BiocParallel_0.6.1       biomaRt_2.20.0          
 [7] Biostrings_2.32.1        biovizBase_1.12.3        bitops_1.0-6            
[10] brew_1.0-6               BSgenome_1.32.0          checkmate_1.4           
[13] cluster_1.15.2           codetools_0.2-9          colorspace_1.2-4        
[16] DESeq2_1.4.5             dichromat_2.0-0          digest_0.6.4            
[19] edgeR_3.6.8              evaluate_0.5.5           fail_1.2                
[22] foreach_1.4.2            foreign_0.8-61           formatR_1.0             
[25] Formula_1.1-2            genefilter_1.46.1        geneplotter_1.42.0      
[28] GenomicAlignments_1.0.6  GenomicFeatures_1.16.2   GenomicRanges_1.16.4    
[31] ggbio_1.12.10            ggplot2_1.0.0            grid_3.1.1              
[34] gridExtra_0.9.1          GSEABase_1.26.0          gtable_0.1.2            
[37] Hmisc_3.14-5             hwriter_1.3.2            IRanges_1.22.10         
[40] iterators_1.0.7          lattice_0.20-29          latticeExtra_0.6-26     
[43] limma_3.20.9             locfit_1.5-9.1           MASS_7.3-34             
[46] munsell_0.4.2            nnet_7.3-8               plyr_1.8.1              
[49] proto_0.3-10             RBGL_1.40.1              RColorBrewer_1.0-5      
[52] Rcpp_0.11.2              RcppArmadillo_0.4.400.0  RCurl_1.95-4.3          
[55] reshape2_1.4             R.methodsS3_1.6.1        R.oo_1.18.0             
[58] rpart_4.1-8              Rsamtools_1.16.1         rtracklayer_1.24.2      
[61] R.utils_1.33.0           scales_0.2.4             sendmailR_1.1-2         
[64] splines_3.1.1            stats4_3.1.1             stringr_0.6.2           
[67] survival_2.37-7          tools_3.1.1              VariantAnnotation_1.10.5
[70] XML_3.98-1.1             XVector_0.4.0            zlibbioc_1.10.0         
ADD COMMENTlink modified 4.5 years ago • written 4.5 years ago by Laurent Gatto1.1k
Answer: Reporting Tools error
0
gravatar for Mayte
4.5 years ago by
Mayte0
United States
Mayte0 wrote:

I did as you suggested. still it does not run. I think it is the summary function called by ReportingTools. I am pasting the whole session to see if someone can see what the problem is. otherwise I guess I have to reinstall everything and see what happens.

 

library(GOstats)
Loading required package: Biobase
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: ‘BiocGenerics’

The following objects are masked from ‘package:parallel’:

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ, clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following object is masked from ‘package:stats’:

    xtabs

The following objects are masked from ‘package:base’:

    anyDuplicated, append, as.data.frame, as.vector, cbind, colnames, do.call, duplicated, eval, evalq, Filter, Find, get,
    intersect, is.unsorted, lapply, Map, mapply, match, mget, order, paste, pmax, pmax.int, pmin, pmin.int, Position,
    rank, rbind, Reduce, rep.int, rownames, sapply, setdiff, sort, table, tapply, union, unique, unlist

Welcome to Bioconductor

    Vignettes contain introductory material; view with 'browseVignettes()'. To cite Bioconductor, see
    'citation("Biobase")', and for packages 'citation("pkgname")'.

Loading required package: Category
Loading required package: AnnotationDbi
Loading required package: GenomeInfoDb
Loading required package: Matrix
Loading required package: GO.db
Loading required package: DBI

Loading required package: graph

Attaching package: ‘GOstats’

The following object is masked from ‘package:AnnotationDbi’:

    makeGOGraph

> library("hgu95av2.db")
Loading required package: org.Hs.eg.db

> 
> library("annotate")
> 
>  
> 
> probids <- ls(hgu95av2GENENAME)[1:300]
> 
> ## Select for probeids that have PFAM ids
> 
> hasPFAM <- sapply(mget(probids, hgu95av2PFAM), function(ids)
+ 
+                   if(!is.na(ids) && length(ids) > 1) TRUE else FALSE)
hgu95av2PFAM is deprecated because up to date IPI IDs are no longer available.
Please use select() if you need access to PFAM or PROSITE accessions. 

> 
> probids <- probids[hasPFAM]
> 
> ## get unique Entrez Gene IDs
> 
> probids <- unique(getEG(probids, "hgu95av2"))
> 
> ## Now do the same for the universe
> 
> univ <- ls(hgu95av2GENENAME)
> 
> univHasPFAM <- sapply(mget(univ, hgu95av2PFAM), function(ids)
+ 
+                       if(!is.na(ids) && length(ids) > 1) TRUE else
+ 
+                          FALSE)
hgu95av2PFAM is deprecated because up to date IPI IDs are no longer available.
Please use select() if you need access to PFAM or PROSITE accessions. 

> 
> univ <- univ[univHasPFAM]
> 
> univ <- unique(getEG(univ, "hgu95av2"))
> 
>  
> 
> p <- new("PFAMHyperGParams", geneIds=probids, universeGeneIds=univ,
+ 
+          annotation="hgu95av2")
> 
> ## this takes a while...
> 
> if(interactive()){
+ 
+ hypt <- hyperGTest(p)
+ 
+ summary(hypt)
+ 
+ htmlReport(hypt, file="temp.html", summary.args=list("htmlLinks"=TRUE))
+ 
+ }
hgu95av2PFAM is deprecated because up to date IPI IDs are no longer available.
Please use select() if you need access to PFAM or PROSITE accessions. 

hgu95av2PFAM is deprecated because up to date IPI IDs are no longer available.
Please use select() if you need access to PFAM or PROSITE accessions. 

> 
>  
> 
>  
> 
> library(ReportingTools)
Loading required package: knitr
Warning messages:
1: In namespaceImportMethods(ns, loadNamespace(j <- imp[[1L]], c(lib.loc,  :
  No generic function found corresponding to requested imported methods for "summary" from package "AnnotationDbi" (malformed exports?)
2: In namespaceImportMethods(ns, loadNamespace(j <- imp[[1L]], c(lib.loc,  :
  No generic function found corresponding to requested imported methods for "summary" from package "Category" (malformed exports?)
3: In namespaceImportMethods(ns, loadNamespace(j <- imp[[1L]], c(lib.loc,  :
  No generic function found corresponding to requested imported methods for "summary" from package "GOstats" (malformed exports?)
> 
> Report <-HTMLReport(shortName ="PFAM analysis", title='PFAM analysis',reportDirectory='./myoutput',baseUrl = "")
> 
> ReportingTools::publish(hypt, Report, selectedIDs=probids, annotation.db="org.Hs.eg", categorySize=20,makePlot=FALSE)
Error in if (dim(df)[1] < 1) { : argument is of length zero
> 
ADD COMMENTlink modified 4.5 years ago by Martin Morgan ♦♦ 23k • written 4.5 years ago by Mayte0
Answer: Reporting Tools error
0
gravatar for Laurent Gatto
4.5 years ago by
Laurent Gatto1.1k
United Kingdom
Laurent Gatto1.1k wrote:

Maybe you need to re-install ReportingTools and AnnotationDbi - see [1] for details. Let me know if this fixes your issue.

Laurent

[1] https://stat.ethz.ch/pipermail/bioc-devel/2014-September/006266.html

ADD COMMENTlink written 4.5 years ago by Laurent Gatto1.1k
Answer: Reporting Tools error
0
gravatar for Mayte Suarez-Farinas
3.9 years ago by
United States
Mayte Suarez-Farinas510 wrote:

 

Hi Laurent.

I gave up on this for a while, but will try again.

I got a new computer , all new installation from scratch and still I get an error when i try to publish a KEGG result.

 keggParams<-new("KEGGHyperGParams", geneIds = DEGi_entrez, universeGeneIds=UnivEntrez,
                          annotation=evalas.name(AnnPkg))$packageName, pvalueCutoff = pPath, testDirection = "over")
          keggResults<-hyperGTest(keggParams)

This works:
          htmlReport(keggResults, file=paste("./reports","KEGG Analysis",cni_original,'.html',sep=''), summary.args=list("htmlLinks"=TRUE,  pvalue=pPath,categorySize=20))

But any of the two following lines give me an error 
          publish(keggResults, .toDF = getMethod(toReportDF, "PFAMHyperGResult"))

publish(keggResults, htmlReport=keggtab, .toDF = getMethod(toReportDF, "PFAMHyperGResult"), selectedIDs=DEGi_entrez, annotation.db="org.Hs.eg",categorySize=20, makePlot=FALSE)

Error in (function (classes, fdef, mtable)  : 
  unable to find an inherited method for function ‘publish’ for signature ‘"KEGGHyperGResult", "missing"’

Again, it works for GO analysis and PFAM but not for KEGG.

 

ADD COMMENTlink written 3.9 years ago by Mayte Suarez-Farinas510
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 236 users visited in the last hour