R views in Protein Prophet query in CPAS 8.1

CPAS Forum (Inactive)
R views in Protein Prophet query in CPAS 8.1 greener  2008-05-07 11:36
Status: Closed
 
Howdy Folks,

The implementation of R in 8.1 is amazing. Special thanks to Brian "Cpas" Connolly for the detailed Linux notes on your website (and for your help with the upgrade).
The R views created through spectral counting query work great, however when we try to run them through the Protein Prophet query we receive the following error:

An error occurred rendering this view, you may not have permission to view it

I tried :
open permissions on the folder/project
executing the scripts under an admin account

Double checked the R View Configuration and found

Script execution:    Batch mode.
Permissions: Admin
R is using the system temporary folder

The tomcat/labkey log showed something I think could be a part of it.
Its as if the R script runner is trying to run its method on an object (the R Report?) but instead is throwing a null pointer.
Maybe some object is not being instantiated?

I pasted the log info below.
If anyone has already encountered this let me know, what would be a good solution for this. Thanks everybody -Rich

[root@localhost logs]# tail -n 50 labkey.log

ERROR RScriptRunner 2008-05-07 10:58:48,537 http-8443-Processor17 : Error while rendering RReport
java.lang.NullPointerException
at org.labkey.api.data.CrosstabTableInfo.addCrosstabQuery(CrosstabTableInfo.java:223)
        at org.labkey.api.data.CrosstabTableInfo.getFromSQL(CrosstabTableInfo.java:477)
        at org.labkey.api.data.AbstractTableInfo.getFromSQL(AbstractTableInfo.java:86)
        at org.labkey.api.data.Table.getSelectSQL(Table.java:1213)
        at org.labkey.api.data.Table.getDisplaySelectSQL(Table.java:1250)
        at org.labkey.api.data.Table.selectForDisplay(Table.java:1476)
        at org.labkey.api.data.Table.selectForDisplay(Table.java:1457)
        at org.labkey.api.data.RenderContext.selectForDisplay(RenderContext.java:348)
        at org.labkey.api.data.RenderContext.getResultSet(RenderContext.java:230)
        at org.labkey.api.data.DataRegion.getResultSet(DataRegion.java:560)
        at org.labkey.api.data.DataRegion.getResultSet(DataRegion.java:555)
        at org.labkey.api.reports.report.RReport.generateResultSet(RReport.java:440)
        at org.labkey.api.reports.report.DefaultScriptRunner.createInputDataFile(DefaultScriptRunner.java:196)
        at org.labkey.api.reports.report.DefaultScriptRunner.runScript(DefaultScriptRunner.java:48)
        at org.labkey.api.reports.report.RReport.renderReport(RReport.java:185)
        at org.labkey.api.reports.report.view.RunRReportView.getTabView(RunRReportView.java:256)
        at org.labkey.api.view.TabStripView.renderInternal(TabStripView.java:28)
        at org.labkey.api.reports.report.view.RunReportView.renderInternal(RunReportView.java:38)
        at org.labkey.api.view.HttpView.renderInternal(HttpView.java:222)
        at org.labkey.api.view.HttpView.render(HttpView.java:131)
        at org.labkey.api.view.HttpView.render(HttpView.java:113)
        at org.labkey.api.view.HttpView.include(HttpView.java:525)
        at org.labkey.jsp.compiled.org.labkey.api.view.template.CommonTemplate_jsp._jspService(CommonTemplate_jsp.java:173)
        at org.labkey.api.view.JspView.renderView(JspView.java:103)
        at org.labkey.api.view.WebPartView.renderInternal(WebPartView.java:171)
        at org.labkey.api.view.HttpView.render(HttpView.java:131)
        at org.labkey.api.view.HttpView.render(HttpView.java:113)
        at org.labkey.api.action.SpringActionController.renderInTemplate(SpringActionController.java:365)
        at org.labkey.api.action.SpringActionController.handleRequest(SpringActionController.java:293)
        at org.labkey.api.view.ViewServlet.dispatchActionController(ViewServlet.java:315)
        at org.labkey.api.view.ViewServlet._dispatchActionURL(ViewServlet.java:152)
        at org.labkey.api.view.ViewServlet.service(ViewServlet.java:128)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
        at org.labkey.api.data.TransactionFilter.doFilter(TransactionFilter.java:36)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
        at org.labkey.core.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:124)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
        at org.labkey.api.module.ModuleLoader.doFilter(ModuleLoader.java:899)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
        at org.labkey.api.security.AuthFilter.doFilter(AuthFilter.java:94)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
        at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
        at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
        at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
        at java.lang.Thread.run(Unknown Source)
 
 
Peter responded:  2008-05-07 15:04
Rich,

You've definitely found a bug, but I'm not sure whether the crosstab view (the one labeled "ProteinProphet (Query)" in the Compare button dropdown on the MS2 runs grid) can support R integration. In other words, the fix might be to take away the "Create R View" option on this grid. The reason is that CPAS sends the grid data set to the R script as a single rectangular dataset, accessible as $labkey.data from R. The CrossTab view doesn't have a single unique column name defined for every column.

The good news is you should be able to accomplish the same result by using the Spectra Counts compare view. These views are designed to be passed to R or to Excel easily. In our docs on the spectra count data sets (https://www.labkey.org/wiki/home/Documentation/page.view?name=labelFree) check out the section titled "Using Excel Pivot Tables for Spectra Counts". That example uses the spectra count version (rectangular, denormalized) of the same data as the ProteinProphet (Query) data set. Excel pivot tables or R scripts can be used to put the breakdown by runs across the columns of the data set, if that is the way you want to view that data.

Peter