-
Notifications
You must be signed in to change notification settings - Fork 26
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
API integration for user-submitted differential expression calculations (SCP-5767) #2212
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## development #2212 +/- ##
===============================================
+ Coverage 70.21% 70.33% +0.11%
===============================================
Files 333 332 -1
Lines 28437 28492 +55
Branches 2518 2518
===============================================
+ Hits 19967 20039 +72
+ Misses 8323 8306 -17
Partials 147 147
|
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.
Code looks good!
How do you foresee accounting for group order in pairwise DE requests? We know that pairwise DE for (A, B) is equal to pairwise DE for (B, A) via log2FC(A, B) = -1 * log2FC(B, A).
That'd halve compute and storage cost.
Perhaps the server here could naturally-order the groups in pairwise DE upon starting to process the post request. I don't think that's essential to do in this PR, but I'd advocate handling it before making the functionality GA.
Unless I'm mistaken, we had said that these parameters are order-dependent and we would not sort them. Group 1 is always first, and group 2 is always second. @jlchang can you confirm? |
Based off of our demo discussion, we will move forward with this plan. I've tracked it in SCP-5944 - it will need both client- and server-side updates, but they should be fairly minimal. |
@eweitz @jlchang I've added user quotas in a915c5a if you'd like to check that out. You can test the rate limiting by updating the |
@bistline If I submit either of the following DE jobs, I expected |
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.
Functional review: job submitted and ran as described. Errors, including exceeding weekly quota mostly return as expected.
Approving unless the 500
(see prior comment) should have been a 422
. If the particular incorrect de_job submissions are expected to return 500
, please just indicate in comments what type of job parameter validation should have been tested.
Paired with Jean, and the issue is that the request is malformed JSON (extra trailing comma) and our middleware couldn't parse the request:
In production, this will actually manifest as a |
BACKGROUND
Currently, there are only two ways a study can have differential expression results: automatic calculation of one-vs-rest on cell-type or raw annotations, or if a study owner supplies their own results. While SCP has support for calculating pairwise results, we don't compute these automatically due to the potential for cost overruns. Additionally, we do not calculate one-vs-rest results for all annotations due to known limitations.
CHANGES
Now, there is an API endpoint that will accept submissions for new differential expression calculations. These results can be one-vs-rest or pairwise for a given cluster/annotation in a study. This endpoint is currently not integrated anywhere in the application, and is only available from the Swagger documentation. It will validate all incoming requests and respond as follows:
204 No content
401 Unauthorized
403 forbidden
404 Not found
422 Unprocessable entity
MANUAL TESTING
Human milk - differential expression
study and submit a request for pairwise results:development.log
to see that a job was submitted to the Batch APIASCC3
409
and the messageRequested results already exist
403 Forbidden
with a messageUser requests are disabled for this study as it contains author-supplied differential expression results