@@ -2248,69 +2248,6 @@ def get_organ_types():
22482248 return _organ_types
22492249
22502250
2251- """
2252- Retrive the assay types from ontology-api
2253-
2254- Returns
2255- -------
2256- dict
2257- The available assay types by name in the following format:
2258-
2259- {
2260- "10x-multiome": {
2261- "contains_pii": true,
2262- "description": "10x Multiome",
2263- "name": "10x-multiome",
2264- "primary": true,
2265- "vis_only": false,
2266- "vitessce_hints": []
2267- },
2268- "AF": {
2269- "contains_pii": false,
2270- "description": "Autofluorescence Microscopy",
2271- "name": "AF",
2272- "primary": true,
2273- "vis_only": false,
2274- "vitessce_hints": []
2275- },
2276- ...
2277- }
2278- """
2279- def get_assay_types ():
2280- global _ontology_api_url
2281-
2282- target_url = _ontology_api_url + SchemaConstants .ONTOLOGY_API_ASSAY_TYPES_ENDPOINT
2283-
2284- # Use Memcached to improve performance
2285- response = make_request_get (target_url , internal_token_used = True )
2286-
2287- # Invoke .raise_for_status(), an HTTPError will be raised with certain status codes
2288- response .raise_for_status ()
2289-
2290- if response .status_code == 200 :
2291- assay_types_by_name = {}
2292- result_dict = response .json ()
2293-
2294- # Due to the json envelop being used int the json result
2295- assay_types_list = result_dict ['result' ]
2296- for assay_type_dict in assay_types_list :
2297- assay_types_by_name [assay_type_dict ['name' ]] = assay_type_dict
2298-
2299- return assay_types_by_name
2300- else :
2301- # Log the full stack trace, prepend a line with our message
2302- logger .exception ("Unable to make a request to query the assay types via ontology-api" )
2303-
2304- logger .debug ("======get_assay_types() status code from ontology-api======" )
2305- logger .debug (response .status_code )
2306-
2307- logger .debug ("======get_assay_types() response text from ontology-api======" )
2308- logger .debug (response .text )
2309-
2310- # Also bubble up the error message from ontology-api
2311- raise requests .exceptions .RequestException (response .text )
2312-
2313-
23142251####################################################################################################
23152252## Internal functions
23162253####################################################################################################
0 commit comments