WayScience / coSMicQC

Single cell Morphology Quality Control (coSMicQC)
BSD 3-Clause "New" or "Revised" License
2 stars 2 forks source link

Add capabilities to receive and use sets of QC rules (default and customizable) #4

Closed d33bs closed 1 month ago

d33bs commented 2 months ago

Provide the ability for people to use sets of their own QC rules or use (without much configuration) a default QC set of rules. This could come in the form of a .yml or .toml file.

d33bs commented 2 months ago

@jenna-tomkinson - would you have any thoughts on what a default set of rules might include currently? I referenced your work from WayScience/Durbin_lab_data#26 for the feature_thresholds found within the tests, but I wasn't sure if these should be modified at all.

Maybe a default for this issue could look like (as qc_settings.yml) this?

versions:
  - cellprofiler: 4.2.4
thresholds:
  # Set a negative threshold to identify both outlier small nuclei
  # and low formfactor representing non-circular segmentations.
  - Nuclei_AreaShape_Area: -1
  - Nuclei_AreaShape_FormFactor: -1
  # find very elongated nuclei segmentations (above mean)
  - Nuclei_AreaShape_Eccentricity: 2
  # find large nuclei segmentations (above mean) and low formfactor
  - Nuclei_AreaShape_Area: 2
  - Nuclei_AreaShape_FormFactor: -2
d33bs commented 1 month ago

After discussing this more with @jenna-tomkinson, the file might look more like:

versions:
  - cellprofiler: ">=4.2.4"
thresholds:
  # Set a negative threshold to identify both outlier small nuclei
  # and low formfactor representing non-circular segmentations.
  small_and_low_formfactor_nuclei:
    - Nuclei_AreaShape_Area:
      - value: -1
        type: zscore
    - Nuclei_AreaShape_FormFactor:
      - value: -1
        type: zscore
  # find very elongated nuclei segmentations (above mean)
  elongated_nuclei:
    - Nuclei_AreaShape_Eccentricity:
      - value: 2
        type: zscore
  # find large nuclei segmentations (above mean) and low formfactor
  large_nuclei:
    - Nuclei_AreaShape_Area:
      - value: 2
        type: zscore
    - Nuclei_AreaShape_FormFactor:
      - value: -2
        type: zscore
jenna-tomkinson commented 1 month ago

I really like this change! It will make it easier to update and will make sure that the correct features and thresholds are used together.