Skip to content

Commit

Permalink
1.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
mbaudis committed Feb 7, 2024
1 parent 6f46fae commit fda7bd9
Show file tree
Hide file tree
Showing 200 changed files with 6,951 additions and 7,588 deletions.
5 changes: 3 additions & 2 deletions bycon/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,12 @@
from parse_variant_request import *

byc: object = {
"args": {},
"form_data": {},
"pkg_path": pkg_path,
"bycon_lib_path": bycon_lib_path,
"parsed_config_paths": [],
"env": "server",
"mongohost": environ.get("BYCON_MONGO_HOST", "localhost")
"env": "server"
}
if not environ.get('HTTP_HOST'):
byc.update({"env": "local"})
Expand Down
19 changes: 5 additions & 14 deletions bycon/beaconServer/beacon.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ def beacon():
byc.update({"request_path_root": "beacon"})

rest_path_elements(byc)
get_bycon_args(byc)
args_update_form(byc)
prdbug(f'beacon.py - request_entity_path_id: {byc.get("request_entity_path_id")}', byc.get("debug_mode"))

Expand Down Expand Up @@ -99,19 +98,11 @@ def beacon():

exit()

# TODO: replace with proper error response object
byc.update({
"service_response": {},
"error_response": {
"error": {
"error_code": 422,
"error_message": "No correct service path provided. Please refer to the documentation at http://docs.progenetix.org"
}
}
})

cgi_print_response(byc, 422)

e_m = "No correct service path provided. Please refer to the documentation at http://docs.progenetix.org"
e_r = BeaconErrorResponse(byc).error(e_m, 422)
print_json_response(e_r, byc["env"])


################################################################################
################################################################################

Expand Down
9 changes: 2 additions & 7 deletions bycon/beaconServer/cohorts.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,11 @@ def main():
################################################################################

def cohorts():

initialize_bycon_service(byc, "cohorts")
run_beacon_init_stack(byc)
r = BeaconDataResponse(byc)
byc.update({
"service_response": r.collectionsResponse(),
"error_response": r.errorResponse()
})
r = BeaconDataResponse(byc).collectionsResponse()
print_json_response(r, byc["env"])

cgi_print_response( byc, 200 )

################################################################################
################################################################################
Expand Down
9 changes: 2 additions & 7 deletions bycon/beaconServer/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,9 @@ def configuration():
initialize_bycon_service(byc, "configuration")
r = BeaconInfoResponse(byc)
c_f = get_schema_file_path(byc, "beaconConfiguration")
c = load_yaml_empty_fallback( c_f )
c = load_yaml_empty_fallback(c_f)
print_json_response(r.populatedInfoResponse(c), byc["env"])

byc.update({
"service_response": r.populatedInfoResponse(c),
"error_response": r.errorResponse()
})

cgi_print_response( byc, 200 )

################################################################################
################################################################################
Expand Down
10 changes: 2 additions & 8 deletions bycon/beaconServer/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,10 @@ def main():
################################################################################

def datasets():

initialize_bycon_service(byc)
initialize_bycon_service(byc, "datasets")
run_beacon_init_stack(byc)
r = BeaconDataResponse(byc)
byc.update({
"service_response": r.collectionsResponse(),
"error_response": r.errorResponse()
})

cgi_print_response( byc, 200 )
print_json_response(r.collectionsResponse(), byc["env"])


################################################################################
Expand Down
8 changes: 1 addition & 7 deletions bycon/beaconServer/entry_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,7 @@ def entry_types():
r = BeaconInfoResponse(byc)
e_f = get_schema_file_path(byc, "beaconConfiguration")
e_t_s = load_yaml_empty_fallback( e_f )

byc.update({
"service_response": r.populatedInfoResponse({"entry_types": e_t_s["entryTypes"] }),
"error_response": r.errorResponse()
})

cgi_print_response( byc, 200 )
print_json_response(r.populatedInfoResponse({"entry_types": e_t_s["entryTypes"] }), byc["env"])


################################################################################
Expand Down
9 changes: 1 addition & 8 deletions bycon/beaconServer/filtering_terms.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,8 @@ def main():
def filtering_terms():
initialize_bycon_service(byc, "filtering_terms")
run_beacon_init_stack(byc)

r = BeaconDataResponse(byc)

byc.update({
"service_response": r.filteringTermsResponse(),
"error_response": r.errorResponse()
})

cgi_print_response( byc, 200 )
print_json_response(r.filteringTermsResponse(), byc["env"])


################################################################################
Expand Down
9 changes: 3 additions & 6 deletions bycon/beaconServer/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,7 @@ def info():
if k in pgx_info:
beacon_info.update({k:pgx_info[k]})

byc.update({
"service_response": r.populatedInfoResponse(beacon_info),
"error_response": r.errorResponse()
})
response = r.populatedInfoResponse(beacon_info)

# TODO: All the schemas really only here?
beacon_schemas = []
Expand All @@ -46,9 +43,9 @@ def info():
if e_d.get("is_entry_type", True) is True:
beacon_schemas.append(b_s)

byc["service_response"]["meta"].update( { "returned_schemas": beacon_schemas } )
response.update( { "returned_schemas": beacon_schemas } )
print_json_response(response, byc["env"])

cgi_print_response( byc, 200 )

################################################################################
################################################################################
Expand Down
7 changes: 1 addition & 6 deletions bycon/beaconServer/map.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,8 @@ def map():
r = BeaconInfoResponse(byc)
m_f = get_schema_file_path(byc, "beaconMap")
beaconMap = load_yaml_empty_fallback( m_f )
print_json_response(r.populatedInfoResponse(beaconMap), byc["env"])

byc.update({
"service_response": r.populatedInfoResponse(beaconMap),
"error_response": r.errorResponse()
})

cgi_print_response( byc, 200 )

################################################################################
################################################################################
Expand Down
8 changes: 4 additions & 4 deletions bycon/beaconServer/service_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ def service_info():
defs = byc.get("beacon_defaults", {})
b_e_d = defs.get("entity_defaults", {})
pgx_info = b_e_d.get("info", {})
c = pgx_info.get("content", {})
info = object_instance_from_schema_name(byc, "ga4gh-service-info-1-0-0-schema", "")

for k in info.keys():
if k in pgx_info:
info.update({k:pgx_info[k]})
print_json_response( info, byc["env"], 200 )
if k in c:
info.update({k:c[k]})
print_json_response(info, byc["env"])

################################################################################
################################################################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@
"datasetIds": ["progenetix"]
}
},
"filters": [
{ "id": "NCIT:C102872", "scope": "analyses", "includeDescendantTerms": false }
],
"filterLogic": "OR"
},
"pagination": {
"skip": 0,
"limit": 10
},
"filters": [
{ "id": "NCIT:C102872", "scope": "analyses", "includeDescendantTerms": false }
],
"includeResultsetResponses": "HIT",
"requestedGranularity": "count",
"debug": 0
"debugMode": 0
}
12 changes: 6 additions & 6 deletions bycon/beaconServer/tests/PUT-biosamples-from-NCIT-filters.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@
"datasetIds": ["progenetix"]
}
},
"filters": [
{ "id": "NCIT:C4536", "scope": "biosamples", "includeDescendantTerms": false },
{ "id": "NCIT:C95597", "scope": "biosamples", "includeDescendantTerms": false },
{ "id": "NCIT:C7712", "scope": "biosamples", "includeDescendantTerms": false }
],
"filterLogic": "OR"
},
"pagination": {
"skip": 0,
"limit": 10
},
"filters": [
{ "id": "NCIT:C4536", "scope": "biosamples", "includeDescendantTerms": false },
{ "id": "NCIT:C95597", "scope": "biosamples", "includeDescendantTerms": false },
{ "id": "NCIT:C7712", "scope": "biosamples", "includeDescendantTerms": false }
],
"includeResultsetResponses": "HIT",
"requestedGranularity": "record",
"debug": 0
"debugMode": 0
}
12 changes: 6 additions & 6 deletions bycon/beaconServer/tests/PUT-core-from-NCIT-filters.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
"datasetIds": ["progenetix"]
}
},
"filters": [
{ "id": "NCIT:C4536" },
{ "id": "NCIT:C95597" },
{ "id": "NCIT:C7712" }
],
"filterLogic": "OR"
},
"filters": [
{ "id": "NCIT:C4536" },
{ "id": "NCIT:C95597" },
{ "id": "NCIT:C7712" }
],
"debug": 1
"debugMode": 1
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,7 @@
"datasetIds": ["progenetix"]
}
},
"filterLogic": "OR"
"filters": [{ "id": "NCIT:C4536" }]
},
"filters": [
{ "id": "NCIT:C4536" },
{ "id": "NCIT:C95597" },
{ "id": "NCIT:C7712" }
],
"debug": 0
"debugMode": 0
}
11 changes: 4 additions & 7 deletions bycon/beaconServer/tests/PUT-phenopackets-from-NCIT-filters.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,13 @@
"datasetIds": ["progenetix"]
}
},
"filterLogic": "OR"
"filters": [
{ "id": "NCIT:C4536" },
]
},
"pagination": {
"skip": 0,
"limit": 10
},
"filters": [
{ "id": "NCIT:C4536" },
{ "id": "NCIT:C95597" },
{ "id": "NCIT:C7712" }
],
"debug": 1
"debugMode": 1
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
"end": [21967753, 22500000],
"variantType": "DEL"
}
}
},
"filters": [
{ "id": "NCIT:C3058" }
],
},
"pagination": {
"skip": 0,
"limit": 5
},
"filters": [
{ "id": "NCIT:C3058" }
],
"debug": 0
"debugMode": 0
}
6 changes: 3 additions & 3 deletions bycon/beaconServer/tests/PUT-variants-for-biosampleIds.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
"pgxbs-kftvhaqa",
"pgxbs-kftvj1nt"
]
}
},
"filters": [ ]
},
"filters": [ ],
"debug": 0
"debugMode": 0
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,19 @@
"datasets": {
"datasetIds": ["progenetix"]
},
"referenceName": "NC_000017.11",
"start": [7577120],
"referenceBases": "G",
"alternateBases": "A"
}
"g_variant": {
"referenceName": "refseq:NC_000017.11",
"start": [7577120],
"referenceBases": "G",
"alternateBases": "A"
}
},
"filters": []
},
"requestedGranularity": "record",
"pagination": {
"skip": 0,
"limit": 5
},
"filters": []
"debugMode": true
}
29 changes: 1 addition & 28 deletions bycon/beaconServer/tests/terminal-examples.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,5 @@
# Command line tests

```
./beaconServer/beacon.py --filters "pgx:icdom-81703" --requestedSchema biosample --referenceName 9 --start 10000000,12000000 --end 12500000,15000000 --variantType DEL
```

```
./beaconServer/beacon.py --requestedSchema genomicVariant --referenceName 9 --start 10000000,12000000 --end 12500000,15000000 --variantType DEL --output pgxseg > ~/Desktop/test.pgxseg
```

```
./beaconServer/beacon.py --filters "pgx:icdom-81703" --requestedSchema analysis --referenceName 9 --start 10000000,12000000 --end 12500000,15000000 --variantType DEL --output pgxmatrix > ~/Desktop/test.pgxmatrix
```

```
./beaconServer/beacon.py --filters "NCIT:C3058" --output pgxmatrix > ~/Desktop/NCIT_C3058.pgxmatrix
```

```
./services/cytomapper.py --cytoBands 8q24
./services/cytomapper.py --chroBases "9:0-50000000"
```

```
./services/genespans.py --geneId TP53
./services/genespans.py --geneId TP53 --filterPrecision start
```

```
./services/geolocations.py --city Heidel
./services/geolocations.py --geoDistance 20000 --geoLatitude 47.3 --geoLongitude 8.55
curl --json @PUT-individuals-from-NCIT-filters.json "http://progenetix.org/beacon/individuals/"
```
Loading

0 comments on commit fda7bd9

Please sign in to comment.