cytomining / pycytominer

Python package for processing image-based profiling data
https://pycytominer.readthedocs.io
BSD 3-Clause "New" or "Revised" License
79 stars 35 forks source link

Detect compartments in the single cell input file and throw a warning if they are not used #114

Open gwaybio opened 3 years ago

gwaybio commented 3 years ago

In #111 - I add a method in the cells.py class to merge tables using predefined "linking" columns.

If there are more than the default compartments in the provided input file (e.g. single cell SQLite), then the merge_single_cells() method will silently ignore the additional compartments if the method is not used properly.

We should throw a warning if there is a missing table not used.

jenna-tomkinson commented 1 year ago

@gwaybio

Can you clarify what you mean by if the method is not used properly? This will help make clear how a user should use this class and we can add documentation.

gwaybio commented 1 year ago

Can you clarify what you mean by if the method is not used properly?

The user must specify which compartments are present in the SingleCells(compartments=?) class attribute

https://github.com/cytomining/pycytominer/blob/182745ad24593b60d6cacd10c06ae237ad62a6da/pycytominer/cyto_utils/cells.py#L42

If the user is using non-canonical compartments and they fail to specify them, pycytominer will not know to include them.