possible cross tab bugs | Ben Bimber | 2010-06-23 11:47 |
Status: Closed | ||
I have been experimenting with cross tabs and assay data. I made a cross tab here: https://xnight.primate.wisc.edu:8443/labkey/query/WNPRC/WNPRC_Units/Research_Services/MHC_SSP/Private/MHC_DB/executeQuery.view?schemaName=assay&query.queryName=SSP_Summary&query.Id~startswith=r950&query.PrimerPair~startswith=a There's a couple points worth noting: 1. creating the crosstab is simple enough. however, once you define your fields and hit 'submit', labkey loads that crosstab on your entire assay domain. the concept of giving a preview is good, but the assay has 105,000 records. it eventually completed, but it would be nice if labkey remembered whatever filters were applied when you went to the 'create crosstab' page so it didnt try to load the whole thing. 2. i created the crosstab. i went to my original grid, filtered it, then tried to load the crosstab (on ~20 records). the crosstab loaded, but it did not remember the grid filters, so i got 105,000 records again. I can appreciate why filters were not applied in point 1, but it seems like they should be remembered in this situation. example here: https://xnight.primate.wisc.edu:8443/labkey/query/WNPRC/WNPRC_Units/Research_Services/MHC_SSP/Private/MHC_DB/executeQuery.view?query.Id~startswith=r950&query.PrimerPair~startswith=a&query.queryName=SSP_Summary&schemaName=assay&query.reportId=db%3A19 3.crosstabs have an 'export to excel' button, which is a good thing. but it throws a java error when i try to export this cross tab. might have something to do with it being too large. the above URL will repro that. Looking to the future: Aggregating data and creating aggregate views is quite important across the board in the EHR. Crosstabs fulfill the majority of scenarios, but they are a little rough. It's a basic HTML output: no sorting, no filtering, etc. Instead of using crosstabs I'm considering writing the code to aggregate data in R, then trying to output the results into some sort of grid (either labkey or ext). While it requires that I write the code, it gives us a lot more control. That includes control over the type of aggregate function (ie. could be some oddball custom function instead of just sum, min, max), allows custom formatting (like coloring cells fitting criteria), etc. I have spoken with some of you about possible ways to approach this in the past, but perhaps some of you could comment a little here. Assuming I create a dataframe in R with my new aggregated data, what is the best approach to try to display that in a grid? The approach some of us discussed before was along the lines of converting R->json, then posting to a custom JS page that would interpret this and display the grid. a labkey grid is probably preferable, but I believe an ext grid would be needed since those accept array stores and labkey does not. I could also write R code that directly outputs HTML/javascript, but that seems like it would be kind of a pain unless there's a really good R package to handle that (which i have not yet found). Although I might be able to write a reusable function that accepts the dataframe and does all the work, so i at least only have to write that once. Is there anything already in labkey that would assist this? Any other comments or ideas on how to approach that? |
||