You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When displaying data in density plot tool and applying a filter (in my case to examine the objects from only one image in a database containing multiple images by applying a metadata filter) and creating a gate, the gate is applied to the entire population, disregarding the filter.
Unfortunately filters and gates behave independently, and we currently don't have an easy pathway to making them co-operate in this manner. It'd be nice to have in the future, but since that'd be an extensive rewrite I'm not sure if/when it'd happen.
As a workaround, you might want to try building a SQL filter which combines the two and adding that into the .properties file.
Yes, I commented in the example filters but arrived at same error message, pasted below.
Could this have something to do with user interface generated filters not being saved between sessions? Or is that expected behaviour?
An error occurred in the program:
DBException: ERROR: Database query failed for connection "MainThread" and failed to reconnect
Query was: "SELECT Per_Image.ImageNumber, Per_Image.ImageNumber
FROM Per_Image, (SELECT TableNumber, ImageNumber FROM CPA_per_image, Well_ID_Table WHERE CPA_per_image.well=Well_ID_Table.well AND Well_ID_Table.Gene REGEXP 'CDK.') AS subquery_0
WHERE Per_Image.ImageNumber = subquery_0.ImageNumber "
First exception was: no such table: CPA_per_image
Second exception was: ERROR: Database query failed for connection "MainThread"
Query was: "SELECT Per_Image.ImageNumber, Per_Image.ImageNumber
FROM Per_Image, (SELECT TableNumber, ImageNumber FROM CPA_per_image, Well_ID_Table WHERE CPA_per_image.well=Well_ID_Table.well AND Well_ID_Table.Gene REGEXP 'CDK.') AS subquery_0
WHERE Per_Image.ImageNumber = subquery_0.ImageNumber "
Exception was: no such table: CPA_per_image
Traceback (most recent call last):
File "cpa\density.pyc", line 215, in update_figpanel
File "cpa\density.pyc", line 234, in _load_points
File "cpa\dbconnect.pyc", line 64, in fn
File "cpa\dbconnect.pyc", line 525, in execute
It's the example filters from the default .properties file generated by Cellprofiler.
filter_SQL_EMPTY = SELECT TableNumber, ImageNumber FROM CPA_per_image, Well_ID_Table WHERE CPA_per_image.well=Well_ID_Table.well AND Well_ID_Table.Gene="EMPTY"
and
filter_SQL_CDKs = SELECT TableNumber, ImageNumber FROM CPA_per_image, Well_ID_Table WHERE CPA_per_image.well=Well_ID_Table.well AND Well_ID_Table.Gene REGEXP 'CDK.*'
Ah, I see. The example filters won't work straight off for any database, yours probably doesn't have a table called "CPA_per_image" and an extra table mapping wells to genes. I meant to point to those as an example of syntax rather than commands that'd work without editing.
If you could post the "create filter" window setup you used to make your filter, and the parameters for your gate, perhaps that'd be a better approach to figuring out how to combine the two.
Activity
DavidStirling commentedon Mar 31, 2021
Unfortunately filters and gates behave independently, and we currently don't have an easy pathway to making them co-operate in this manner. It'd be nice to have in the future, but since that'd be an extensive rewrite I'm not sure if/when it'd happen.
As a workaround, you might want to try building a SQL filter which combines the two and adding that into the .properties file.
AugustLundquist commentedon Apr 1, 2021
I see, thank you! I have tried this but was not able to successfully convert the gate to a SQL filter manually.
I arrive at same error message as in #243.
Could you or someone else provide a working example of such a .properties file?
DavidStirling commentedon Apr 3, 2021
The default .properties file should already have some SQL filters inside, but commented out. You could check those.
AugustLundquist commentedon Apr 9, 2021
Yes, I commented in the example filters but arrived at same error message, pasted below.
Could this have something to do with user interface generated filters not being saved between sessions? Or is that expected behaviour?
An error occurred in the program:
DBException: ERROR: Database query failed for connection "MainThread" and failed to reconnect
Query was: "SELECT Per_Image.ImageNumber, Per_Image.ImageNumber
FROM Per_Image, (SELECT TableNumber, ImageNumber FROM CPA_per_image, Well_ID_Table WHERE CPA_per_image.well=Well_ID_Table.well AND Well_ID_Table.Gene REGEXP 'CDK.') AS subquery_0
WHERE Per_Image.ImageNumber = subquery_0.ImageNumber "
First exception was: no such table: CPA_per_image
Second exception was: ERROR: Database query failed for connection "MainThread"
Query was: "SELECT Per_Image.ImageNumber, Per_Image.ImageNumber
FROM Per_Image, (SELECT TableNumber, ImageNumber FROM CPA_per_image, Well_ID_Table WHERE CPA_per_image.well=Well_ID_Table.well AND Well_ID_Table.Gene REGEXP 'CDK.') AS subquery_0
WHERE Per_Image.ImageNumber = subquery_0.ImageNumber "
Exception was: no such table: CPA_per_image
Traceback (most recent call last):
File "cpa\density.pyc", line 215, in update_figpanel
File "cpa\density.pyc", line 234, in _load_points
File "cpa\dbconnect.pyc", line 64, in fn
File "cpa\dbconnect.pyc", line 525, in execute
DavidStirling commentedon Apr 9, 2021
It looks like there's something very wrong with that filter, what exactly is it supposed to be doing?
AugustLundquist commentedon Apr 10, 2021
It's the example filters from the default .properties file generated by Cellprofiler.
filter_SQL_EMPTY = SELECT TableNumber, ImageNumber FROM CPA_per_image, Well_ID_Table WHERE CPA_per_image.well=Well_ID_Table.well AND Well_ID_Table.Gene="EMPTY"
and
filter_SQL_CDKs = SELECT TableNumber, ImageNumber FROM CPA_per_image, Well_ID_Table WHERE CPA_per_image.well=Well_ID_Table.well AND Well_ID_Table.Gene REGEXP 'CDK.*'
Selecting either one of them gives the error.
DavidStirling commentedon Apr 10, 2021
Ah, I see. The example filters won't work straight off for any database, yours probably doesn't have a table called "CPA_per_image" and an extra table mapping wells to genes. I meant to point to those as an example of syntax rather than commands that'd work without editing.
If you could post the "create filter" window setup you used to make your filter, and the parameters for your gate, perhaps that'd be a better approach to figuring out how to combine the two.
AugustLundquist commentedon Apr 15, 2021
Okay, I see. What I would like to combine is for instance the following gate and filter: