Skip to content

Commit

Permalink
1.8.5
Browse files Browse the repository at this point in the history
  • Loading branch information
mbaudis committed Jul 1, 2024
1 parent c7065aa commit 9681a5b
Show file tree
Hide file tree
Showing 20 changed files with 44 additions and 17 deletions.
Empty file modified bycon/beaconServer/__init__.py
100755 → 100644
Empty file.
Empty file modified bycon/beaconServer/beacon.py
100755 → 100644
Empty file.
Empty file modified bycon/beaconServer/cohorts.py
100755 → 100644
Empty file.
Empty file modified bycon/beaconServer/configuration.py
100755 → 100644
Empty file.
Empty file modified bycon/beaconServer/datasets.py
100755 → 100644
Empty file.
Empty file modified bycon/beaconServer/entry_types.py
100755 → 100644
Empty file.
Empty file modified bycon/beaconServer/filtering_terms.py
100755 → 100644
Empty file.
Empty file modified bycon/beaconServer/info.py
100755 → 100644
Empty file.
Empty file modified bycon/beaconServer/map.py
100755 → 100644
Empty file.
Empty file modified bycon/beaconServer/service_info.py
100755 → 100644
Empty file.
1 change: 0 additions & 1 deletion bycon/definitions/variant_request_definitions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ request_types:
* `mateName` can be the same or different to `referenceName`
* `mateName` is the higher numbered/named chromosome
all_of:
# - assembly_id
- reference_name
- mate_name
- start
Expand Down
7 changes: 3 additions & 4 deletions bycon/lib/args_parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def args_update_form():
parameter collection (in "local" context).
"""
a_defs = BYC.get("argument_definitions", {})
cmd_args = create_args_parser(a_defs)
cmd_args = __create_args_parser(a_defs)
arg_vars = vars(cmd_args)
for p in arg_vars.keys():
if not (v := arg_vars.get(p)):
Expand All @@ -29,16 +29,15 @@ def args_update_form():

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

def create_args_parser(a_defs):
def __create_args_parser(a_defs):
parser = argparse.ArgumentParser()
for a_n, a_d in a_defs.items():
if "cmdFlags" in a_d:
argDef = {
"flags": a_d.get("cmdFlags"),
"help": a_d.get("description", "TBD"),
}
default = a_d.get("default")
if default:
if (default := a_d.get("default")):
argDef.update({"default": default})
parser.add_argument(*argDef.pop("flags"), **argDef)
cmd_args = parser.parse_args()
Expand Down
2 changes: 1 addition & 1 deletion bycon/lib/beacon_response_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ def __get_handover_access_key(self):

def __result_sets_save_handovers(self):
ho_client = MongoClient(host=DB_MONGOHOST)
ho_coll = ho_client[HOUSEKEEPING_DB].ho_db[HOUSEKEEPING_HO_COLL]
ho_coll = ho_client[HOUSEKEEPING_DB][HOUSEKEEPING_HO_COLL]
for ds_id, d_s in self.datasets_results.items():
if not d_s:
continue
Expand Down
2 changes: 1 addition & 1 deletion bycon/lib/dataset_parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def ds_id_from_accessid():
return False
if ds_id not in BYC["DATABASE_NAMES"]:
return False
BYC.update({"BYC_DATASET_IDS": ds_ids})
BYC.update({"BYC_DATASET_IDS": [ds_id]})
return True


Expand Down
32 changes: 25 additions & 7 deletions bycon/lib/query_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -543,12 +543,8 @@ def __create_variantRangeRequest_query(self, v_pars):
v_p_defs["end"]["db_key"]: { "$gt": int(vp[ "start" ][0]) }
}

p_n = "variant_min_length"
if p_n in vp:
v_q.update( { v_p_defs[p_n]["db_key"]: { "$gte" : vp[p_n] } } )
p_n = "variant_max_length"
if "variant_max_length" in vp:
v_q.update( { v_p_defs[p_n]["db_key"]: { "$lte" : vp[p_n] } } )
if (l_q := self.__request_variant_size_limits(v_pars)):
v_q.update(l_q)

p_n = "variant_type"
if p_n in vp:
Expand All @@ -565,6 +561,28 @@ def __create_variantRangeRequest_query(self, v_pars):

#--------------------------------------------------------------------------#

def __request_variant_size_limits(self, v_pars):
vp = v_pars
v_p_defs = self.argument_definitions
l_k = v_p_defs["variant_max_length"]["db_key"]
s_q = {l_k: {}}

p_n = "variant_min_length"
if (minl := vp.get(p_n)):
{ v_p_defs["variant_max_length"]["db_key"]: {}}
s_q[l_k].update( { "$gte" : minl } )
p_n = "variant_max_length"
if (maxl := vp.get(p_n)):
s_q[l_k].update( { "$lte" : maxl } )

if s_q[l_k].keys():
return s_q

return None

#--------------------------------------------------------------------------#


def __create_variantBracketRequest_query(self, v_pars):
vp = v_pars
prdbug(f'...__create_variantBracketRequest_query parameters: {vp}')
Expand Down Expand Up @@ -788,7 +806,7 @@ def __query_from_hoid(self):
return

ho_client = MongoClient(host=DB_MONGOHOST)
ho_coll = ho_client[HOUSEKEEPING_DB].ho_db[HOUSEKEEPING_HO_COLL]
ho_coll = ho_client[HOUSEKEEPING_DB][HOUSEKEEPING_HO_COLL]
h_o = ho_coll.find_one({"id": accessid})

# accessid overrides ... ?
Expand Down
1 change: 1 addition & 0 deletions bycon/lib/service_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def initialize_bycon_service():
update_requested_schema_from_request()
set_special_modes()
select_dataset_ids()
prdbug(f'initialize_bycon_service - ds_id: {BYC["BYC_DATASET_IDS"]}')
set_user_name()
set_returned_granularities()
parse_filters()
Expand Down
10 changes: 10 additions & 0 deletions docs/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@ While changes are documented for individual point versions we actually do not
push releases out for all of them; they serve more as internal development
milestones.

### 2023-06-24 (v.1.8.5)

* bug fix: `variantMinSize` wasn't evaluated if also `variantMaxSize` was given
* `byconaut`: change in datastructure of status maps and frequencies
- we have abandoned the "max value ..." concepts which weren't used anyway
and switched to bin coverage and frequency values for high level changes
additionally to the all CNV values
- this allows now a simple overplotting of high level gains and losses over
the low level/combined CNV histograms

### 2023-06-19 (v.1.8.4)

* changed the values for individual.sex from PATO to EFO (see the [Progenetix data notes](https://docs.progenetix.org/changelog/#2024-06-18-switching-ontology-use-for-individualsex))
Expand Down
2 changes: 1 addition & 1 deletion docs/generated/argument_definitions.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ requested schema, e.g. biosample
* include resultset responses, e.g. HIT, MISS
* kind of a holdover from Beacon pre-v1 but HIT & ALL might have
some use in networks
**default:** `ALL`
**default:** `HIT`

### `dataset_ids`
**type:** array
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

setup(
name="bycon",
version="1.8.4",
version="1.8.5",
description="A Python-based environment for the Beacon v2 genomics API",
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down
2 changes: 1 addition & 1 deletion updev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ BY=(./dist/*tar.gz)
pip3 install $BY --break-system-packages
# pipreqs --force .
# python3 -m build --wheel && twine upload dist/*
# git tag v1.8.0 & git push --tags
# git tag v1.8.4 & git push --tags
./install.py
# TODO: the caller for this should be external
../byconaut/install.py
Expand Down

0 comments on commit 9681a5b

Please sign in to comment.