[BioC] RWebServices createMap(): Error in dots[[1L]][[1L]] : subscript out of bounds
Martin Morgan
mtmorgan at fhcrc.org
Thu Jan 14 06:03:53 CET 2010
Michael Shipway wrote:
> I believe I have identified the bug, it is in
> RWebServices version 1.10.0,
> Function: getFunctionDoc()
> File: mkMapUtil.R
> Lines: 218-283
>
> I do not have a copy of the version 1.8.0 code so I cannot confirm that this
> has changed in 1.10.0, only that it exists.
>
> This function now crashes if the <package>/man directory of the package does
> NOT contain "R documentation" file in (Rd) format.
> NOTE: it does not need to be the correct Rd file for the package, a random
> documentation file from another package seems to work as well.
> It does check for the existence of several key elements of the Rd format, so
> it must be a valid Rd file at least.
This must have been a difficult issue to track down. RWebServices is
expecting that the package have appropriate documentation, which is why
I suggested R CMD check. R's Rd parser changed a lot leading up to 2.10,
so RWebServices also changed; there are no easy alternatives to using
the non-exported functions you mention below.
Martin
>
> It appears that getFunctionDoc() uses the Rd_db() function to "build a
> database of all Rd sources in the package".
> This wrapped in a try() function to trap any errors.
> However, it appears that finding zero files in not an error, just a null
> result, so the function tries to evaluate the database... and fails.
>
> As long as at least one valid Rd files is in the /man directory, the ant
> "map-package" target will succeed.
>
> It should also be noted that the R-manual says this about Rd_db():
> Warning
> These functions are still experimental. Names, interfaces and values might
> change in future versions.
>
> Michael Shipway
>
> P.S. The document "Parsing Rd Files" Jan 1, 2010 details the Rd file format.
> http://developer.r-project.org/parseRd.pdf
> "Prior to this document, the R documentation (Rd) file format did not have a
> formal description."
>
>
> -----Original Message-----
> From: bioconductor-bounces at stat.math.ethz.ch
> [mailto:bioconductor-bounces at stat.math.ethz.ch] On Behalf Of Martin Morgan
> Sent: Thursday, January 07, 2010 1:34 PM
> To: Michael Shipway
> Cc: bioconductor at stat.math.ethz.ch
> Subject: Re: [BioC] RWebServices createMap(): Error in dots[[1L]][[1L]] :
> subscript out of bounds
>
> Michael Shipway wrote:
>> Can anyone help me with this, I cannot recreate a web service on a 2nd
>> machine?
>>
>> I've developed and tested an RWebservices based web service on CentOS
>> release 5.3 (Final) running in a VM on my windows XP box.
>>
>> However, when I transferred the code to my production machine, CentOS
>> release 5.4 (Final), I cannot map the package (e.g. generate Java code).
>>
>> Other differences between the two setups:
>>
>> Feature Dev Production
>>
>> RWebServices Version 1.8.0 1.10.0
>>
>> R version 2.8.1 2.10.0
>>
>>
>>
>> I've confirmed that my R package is installed and functioning correctly on
>> both machines.
>>
>> When I run "ant -Dpkg=natreeV3 map-package" on the production machine, I
> get
>> the error message:
>>
>> "Error in dots[[1L]][[1L]] : subscript out of bounds"
>
> I think the issue is in your package documentation, though am not sure.
> Does R CMD build <your_pkg> && R CMD check <your_package>_<vers> suggest
> anything? Some more below...
>
>>
>>
>> Below is the full verbose output of the map-package
>>
>> --------------------------------------------------------------------
>>
>> Buildfile: build.xml
>>
>>
>>
>> -user-tuning-properties-exist:
>>
>>
>>
>> -unpack-tuning-properties:
>>
>>
>>
>> map-package:
>>
>> [exec] >
>>
>> [exec] > library(RWebServices)
>>
>> [exec] Loading required package: SJava
>>
>> [exec] Loading required package: TypeInfo
>>
>> [exec] Loading required package: tools
>>
>> [exec] > createMap(pkgs="natreeV3",
>>
>> [exec] + generateTests=TRUE,
>>
>> [exec] + outputDirectory="/home/mshipwa1/natreeV3",
>>
>> [exec] + typeMode="javalib",
>>
>> [exec] + deployMode="jms",
>>
>> [exec] + wsdlStyle="WRAPPED",
>>
>> [exec] + wsdlUse="LITERAL",
>>
>> [exec] + extraClasses="",
>>
>> [exec] + pkgRoot="org.bioconductor",
>>
>> [exec] + verbose=TRUE)
>>
>
> the command above ('createMap(...)') can be executed in an R session,
> after library(RWebServices). You can then debug the error message using,
> e.g., traceback() or debug(). A little more below...
>
>> [exec] Loading required package: tree
>>
>> [exec] ********************************************
>>
>> [exec] *** resolve all data type mapping *****
>>
>> [exec] ********************************************
>>
>> [exec] >>>>>> Generate data map for extraClasses:
>>
>> [exec] >>>>>> Generate data map for R function:
>>
>> [exec] character test1(numeric depth) data map for: character
>>
>> [exec] data map for: numeric
>>
>> [exec] >>>>>> Generate data map for R function:
>>
>> [exec] list test2(numeric depth) data map for: list
>>
>> [exec] data map for: numeric
>>
>> [exec] >>>>>> Generate data map for R function:
>>
>> [exec] character naTree5(character dataFileName, numeric ndays,
> numeric
>> features, numeric treeDepth) data map for: character
>>
>> [exec] data map for: character
>>
>> [exec] data map for: numeric
>>
>> [exec] data map for: numeric
>>
>> [exec] data map for: numeric
>>
>> [exec] >>>>>> Generate data map for R function:
>>
>> [exec] list naTree(character dataFileName, numeric ndays, numeric
>> features, numeric treeDepth) data map for: list
>>
>> [exec] data map for: character
>>
>> [exec] data map for: numeric
>>
>> [exec] data map for: numeric
>>
>> [exec] data map for: numeric
>>
>> [exec]
> ---------------------------------------------------------------
>> [exec] [R Type] => [Java Type] [Java Package] [R Package]
>> [TypeGroup] [R->Java] [Java->R]
>>
>> [exec]
> ---------------------------------------------------------------
>> [exec]
> ---------------------------------------------------------------
>> [exec] ********************************************
>>
>> [exec] **** resolve function mapping *****
>>
>> [exec] ********************************************
>>
>> [exec] >>>>>> Generate function map for R package: natreeV3
>>
>> [exec] >> (1) java function signature:
>>
>> [exec] [[1]]
>>
>> [exec] String[] test1(double[] depth)
>>
>> [exec] [[2]]
>>
>> [exec] Object[] test2(double[] depth)
>>
>> [exec] [[3]]
>>
>> [exec] String[] naTree5(String[] dataFileName, double[] ndays,
> double[]
>> features, double[] treeDepth)
>>
>> [exec] [[4]]
>>
>> [exec] Object[] naTree(String[] dataFileName, double[] ndays,
> double[]
>> features, double[] treeDepth)
>>
>> [exec] Error in dots[[1L]][[1L]] : subscript out of bounds
>>
>> [exec] Calls: createMap ... .local -> getFunctionDoc -> mapply ->
> .Call
>> -> <Anonymous>
>
> getFunctionDoc is the clue here that is a documentation problem. Likely
> it is one of these (ugly) lines
>
> db_alias_texts <- mapply(tools:::.Rd_get_section, db,
> which = "alias")
> db_description_texts <- mapply(tools:::.Rd_get_section,
> db, which = "description")
> db_value_texts <- mapply(tools:::.Rd_get_section, db,
> which = "value")
> db_arg_texts <- mapply(tools:::.Rd_get_section, db,
> which = "arguments")
>
> Martin
>
>> [exec] Execution halted
>>
>> [exec] Result: 1
>>
>> [delete] Deleting: /home/mshipwa1/natreeV3/null1969125778
>>
>>
>>
>> BUILD SUCCESSFUL
>>
>> Total time: 2 seconds
>>
>>
>> [[alternative HTML version deleted]]
>>
>> _______________________________________________
>> Bioconductor mailing list
>> Bioconductor at stat.math.ethz.ch
>> https://stat.ethz.ch/mailman/listinfo/bioconductor
>> Search the archives:
> http://news.gmane.org/gmane.science.biology.informatics.conductor
>
>
--
Martin Morgan
Computational Biology / Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N.
PO Box 19024 Seattle, WA 98109
Location: Arnold Building M1 B861
Phone: (206) 667-2793
More information about the Bioconductor
mailing list