CellProfiler-Analyst
CellProfiler-Analyst copied to clipboard
SQL query tool inappropriately returns/saves truncated values
From this forum post: http://cellprofiler.org/forum/posting.php?mode=quote&f=13&p=9579. The files mentioned are attached.
An example query is
SELECT o.ImageNumber, o.ObjectNumber, i.Image_Metadata_Strain as "Strain", i.Image_Metadata_Replicate as "Replicate", o.CorrectWorms_Math_Intensity_Area as 'Intensity/Area', o.CorrectWorms_Intensity_UpperQuartileIntensity_Flurscnc_llmcrrctd as 'UQ Intensity' FROM Per_Image as i, Per_Object as o WHERE i.ImageNumber = o.ImageNumber"
Two issues (which I think are variations of the same thing):
- In the SQL query tool (squerymaker.py), data returned from a query is cast to strings in a numpy array, with the effect of truncating numeric data in the resultant data table in TableViewer. I can "solve" this in the code by casting as dtype=object @ ln 49, but I'm not sure if this is the right answer.
- Very small numbers retrieved from a query (e.g. 8.035E-06) are returned from an SQL query and expressed in this notation in the data table, but are truncated upon saving them to a CSV.
Attachments: http://cellprofiler.org/issues/uploaded/R36J8U/20130723_SQLqueryproblem.db http://cellprofiler.org/issues/uploaded/SgOzMQ/20130723_SQLqueryproblem.properties