Skip to content

Density plot gate does not respect filter #290

Open

Description

@AugustLundquist

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.

Is there some workaround to this?

Thank you!

Activity

  1. DavidStirling commented on Mar 31, 2021

    @DavidStirling
    Member

    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.

  2. AugustLundquist commented on Apr 1, 2021

    @AugustLundquist
    Author

    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?

  3. DavidStirling commented on Apr 3, 2021

    @DavidStirling
    Member

    The default .properties file should already have some SQL filters inside, but commented out. You could check those.

  4. AugustLundquist commented on Apr 9, 2021

    @AugustLundquist
    Author

    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

  5. DavidStirling commented on Apr 9, 2021

    @DavidStirling
    Member

    It looks like there's something very wrong with that filter, what exactly is it supposed to be doing?

  6. AugustLundquist commented on Apr 10, 2021

    @AugustLundquist
    Author

    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.

  7. DavidStirling commented on Apr 10, 2021

    @DavidStirling
    Member

    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.

  8. AugustLundquist commented on Apr 15, 2021

    @AugustLundquist
    Author

    Okay, I see. What I would like to combine is for instance the following gate and filter:

    Screenshot 2021-04-15 155853

    Screenshot 2021-04-15 154849

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions