Skip to content

Conversation

@chriswzou
Copy link
Contributor

As a wrapper around runPhenoScore, calculateDrugScreen can lead to unexpected behavior when:

  • A doubling column is specified, but there are no condition or replicate columns.
  • The user expects to do count filtering and normalization using the top-level PooledScreen module functions countNormalization or filterLowCounts, but does not explicitly pass a lack of count filter as a keyword argument. This leads to an unintended second count filter when runPhenoScore applies its count filters.

This PR implements a check in _calculateGrowthFactor to catch the former and improves the docstring and signature of the calculateDrugScreen function to catch the latter.

Does pushing update the documentation/run tests automatically? How do we typically do these two?

@abearab abearab self-requested a review September 17, 2024 21:22
"""
adat = self.adata.copy()
if 'condition' not in adat.obs.columns or 'replicate' not in adat.obs.columns:
raise ValueError("The 'condition' and 'replicate' columns self.adata.")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there is a missing word here, right?

For a given phenotype score, runPhenoScore implements a count filter threshold. By default this threshold changes
any guide or target whose mean count across replicates being compared is <40 to NAs. Because this can lead to
unexpected behavior when the user relies on filterLowCounts, we specify both the count_filter_threshold and
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can also remove filterLowCounts if it's confusing. I had it in previous versions and it's not necessary to keep it. What do you think?

"""
adat = adata.copy()

if 'condition' not in adat.obs.columns:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works for now, thanks for adding this as a more clear error message. We may change it in future so runPhenoScore can take "condition" as an input.

@abearab abearab merged commit 3ffdcd8 into ArcInstitute:master Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants