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

percent_strong outputs nan when no replicates are present #15

Open
gwaybio opened this issue Sep 16, 2020 · 0 comments
Open

percent_strong outputs nan when no replicates are present #15

gwaybio opened this issue Sep 16, 2020 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@gwaybio
Copy link
Member

gwaybio commented Sep 16, 2020

When no replicates are present, denom = 0 and we receive the following error:

/home/ubuntu/efs/Periscope_Calico/workspace/software/Periscope_Calico/miniconda3/envs/pooled-cell-painting/lib/python3.7/site-packages/cytominer_eval/operations/percent_strong.py:50: RuntimeWarning: invalid value encountered in long_scalars
  ).sum() / denom

We should add an AssertionError when denom = 0 and provide an error message that "no replicate groups identified".

The line is

replicate_df = similarity_melted_df.query("group_replicate")
denom = replicate_df.shape[0]
percent_strong = (
replicate_df.similarity_metric > non_replicate_quantile
).sum() / denom

@gwaybio gwaybio added enhancement New feature or request good first issue Good for newcomers labels Sep 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant