Skip to content
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

Bug: infer_cp_features() Function Fails to Capture Features If the Compartment Name Contains Multi-Case Letters #412

Open
axiomcura opened this issue May 3, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@axiomcura
Copy link
Collaborator

axiomcura commented May 3, 2024

Example code with output

I'm currently working with a dataset that doesn't utilize CellProfiler features. As a result, it has different compartments:

compartments = ['Primary', 'Cells', 'F Actin', 'Mitochondria', 'MyoD']

What's neat about pycytominer's infer_cp_features() function is that you can specify the compartments from which you want to select morphological features using the compartments parameter:

from pycytominer.cyto_utils import infer_cp_features

compartments = ['Primary', 'Cells', 'F Actin', 'Mitochondria', 'MyoD']
incarta_features = infer_cp_features(incarta_df, compartments)

In the generated feature list, all the features within the MyoD compartment are missing. This indicates that the infer_cp_features() function is not capturing to capture the MyoD compartment.

Issue description

Feature names within the MyoD compartment are not captured.

Expected behavior

The expected behavior is to receive all features from all compartments.

Additional information

pycytominer version: 1.0.1

After some digging within the source code, I noticed that infer_cp_features() utilizes the convert_compartment_format_to_list() function. This function converts all compartment names to lowercase, except for the first letter, which causes MyoD to turn into Myod.

While I recognize that this functionality is tailored specifically for CellProfiler features, it presents an exciting opportunity to consider generalizing it for other features that have been extracted from other technologies!

@axiomcura axiomcura added the bug Something isn't working label May 3, 2024
@axiomcura axiomcura changed the title Bug: `infer_cp_features() Function Fails to Capture Features If the Compartment Name Contains Multi-Case Letters Bug: infer_cp_features() Function Fails to Capture Features If the Compartment Name Contains Multi-Case Letters May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant