LDServer
LDServer copied to clipboard
[Raremetal-server] Issues with missing masks and encoding
Summary
We have found two issues with Raremetal-server covariance endpoint:
- If any of the masks in a region are empty, the server rejects the entire request.
- It seems that the success of the request is partially sensitive to the
content-type
encoding header sent to the server. (see example below using requests; introspect differences usingtest.request.headers
)
Expected behavior
This is a topic for discussion.
Reproducible test case
In the below example, mask 3 is empty for this region, but all other masks are valid.
#!/usr/bin/env python3
import requests
payload = {
"chrom":"19",
"start":45400845,
"stop":45420845,
"genotypeDataset":1,
"phenotypeDataset":1,
"phenotype":"hdl",
"samples":"ALL",
"genomeBuild":"GRCh37",
"masks":[1,2,3,4,5,6]
}
test = requests.post("https://portaldev.sph.umich.edu/raremetal/v1/aggregation/covariance", json=payload)
print(f"{test.status_code} {test.reason}")
print(test.json())
Interestingly, if the POST request is sent using data=
instead of json=
, the request will succeed. (due to a different content-type
header being sent with the request)