-
Notifications
You must be signed in to change notification settings - Fork 15
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
Validation and refactoring of differential expression analysis #388
base: development
Are you sure you want to change the base?
Conversation
This reverts commit 804f2ac.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Look quite good already!
… and check the correct one is raised.
for parameter in kwargs: | ||
if parameter not in self._allowed_parameters(): | ||
raise TypeError( | ||
f"Parameter {parameter} should not be provided for this analysis. Accepted keyword arguments to perform are {', '.join(self._allowed_parameters())}." | ||
) | ||
|
||
def _allowed_parameters(self) -> List[str]: | ||
"""Method returning a list of allowed parameters for the analysis to avoid calling tests with additional parameters.""" | ||
perform_signature = inspect.signature(self._perform) | ||
parameters = list(perform_signature.parameters.keys()) | ||
return [parameter for parameter in parameters if parameter != "kwargs"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can be removed, python does that for you :-)
(from for parameter in kwargs: ...
to return return [para..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not if I pass kwargs to _perform though, right? Which I need to do to match the signature of the abstract method? The idea was that by adding this here I enforce kwargs to be empty without relying on every implementation of _perform to contain that check.
**valid_parameter_input_two_groups, | ||
**{ | ||
DeaParameters.TEST_TYPE: DeaTestTypes.INDEPENDENT, | ||
DeaParameters.FDR_METHOD: "fdr_bh", | ||
DeaParameters.ISLOG2TRANSFORMED: False, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we pass those parameters explicitly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! this should be a solid basis for all the upcoming analysis!
This is a base branch for a major effort to refactor the differential expression analysis.
Currently this covers a skeleton for a new 3-tier class system for all differential expression analysis:
If you review at this stage, please check in particular if
Checklist to do before branching off:
Branches that can then be based on this: