-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compartment names should be parameterizable #110
Comments
the default is ["cells", "cytoplasm", and "nuclei"], but compartments are indeed parameterizable: pycytominer/pycytominer/aggregate.py Line 30 in ac3ef68
It is possible they are not parameterized somewhere, but if so, we should rectify. |
ah, I just realized that pycytominer will throw an error for non-canonical compartments:
We should probably update this to throw a warning instead. |
My bad. I was taking a very quick look and did not realize that |
To give a bit of context, I was trying to feed an sqlite db with the following tables: 'Per_Image', 'Per_Cells', 'Per_Cytoplasm', 'Per_Nuclei'. passing At that moment, I did not know about cytominer-database. But I guess that it was created to fix these issues. We tested it and it worked :) |
@pamzgt But the fix is simple! sqlite3 backend.sqlite 'alter table Per_cells rename to Cells' |
update: I needed to solve this in #111 - working on it now |
turns out that the "good first issue" tag here was wrong 😂 Long story short, this is now fully modular (and fully tested) in #111 One key block preventing an easy fix is here This is now implemented: from pycytominer.cyto_utils.cells import SingleCells
# Only SQLite supported currently
sc = SingleCells(file_or_conn="sqlite:///EXAMPLE_PATH.sqlite")
# Merge single cell data using the appropriate linking columns
# Linking columns can also be specified for modular compartments
# Different normalization methods also available (see normalize.py)
sc_df = sc.merge_single_cells(single_cell_normalize=False)
# For the default linking cols and for specific modular formatting, run the following
from pycytominer.cyto_utils import get_default_linking_cols
get_default_linking_cols()
# Aggregate single cells
level_3_df = sc.aggregate_profiles()
# Note that above is a faster implementation of the following operation:
from pycytominer import aggregate
level_3_df = aggregate(sc_df) |
It's possible this is already the case, but @pamzgt wasn't able to find it
The text was updated successfully, but these errors were encountered: