Skip to content

Commit

Permalink
2.1.0 updated
Browse files Browse the repository at this point in the history
  • Loading branch information
mbaudis committed Dec 10, 2024
1 parent dbf094e commit 84d4420
Show file tree
Hide file tree
Showing 14 changed files with 889 additions and 442 deletions.
320 changes: 314 additions & 6 deletions beaconplusWeb/node_modules/.package-lock.json

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions beaconplusWeb/node_modules/@next/swc-darwin-x64/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
18 changes: 18 additions & 0 deletions beaconplusWeb/node_modules/@next/swc-darwin-x64/package.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

833 changes: 483 additions & 350 deletions beaconplusWeb/package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions beaconplusWeb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"@tippyjs/react": "^4.2.0",
"animate": "^1.0.0",
"animate.css": "^4.1.1",
"build": "^0.1.4",
"classnames": "^2.2.6",
"env-cmd": "^10.1.0",
"file-saver": "^2.0.5",
Expand Down
5 changes: 0 additions & 5 deletions bycon/config/variant_request_definitions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ request_pars:
- mate_end
- variant_min_length
- variant_max_length
# - gene_id
# - aminoacid_change
# - genomic_allele_short_form
# - cyto_bands
# - variant_query_digests

# BeaconPlus
multi_request_pars:
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 @@ -537,7 +537,7 @@ def __filtering_terms_query(self):
if BYC["TEST_MODE"] is True:
query = mongo_test_mode_query(self.ds_id, f_coll)

prdbug(f'filtering_terms_query: {query}')
# prdbug(f'filtering_terms_query: {query}')

self.filtering_terms_query = query

Expand Down
32 changes: 22 additions & 10 deletions bycon/lib/query_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from os import environ
from pymongo import MongoClient

from bycon_helpers import days_from_iso8601duration, prdbug, return_paginated_list
from bycon_helpers import days_from_iso8601duration, prdbug, prjsonnice, return_paginated_list
from config import *
from cytoband_parsing import Cytobands
from genome_utils import ChroNames, GeneInfo, VariantTypes
Expand Down Expand Up @@ -189,23 +189,31 @@ def __preprocess_variant_pars(self):
v_p_s = self.variant_request_definitions.get("request_pars", [])
v_mp_s = self.variant_request_definitions.get("multi_request_pars", [])

vips = []

# standard pars
s_q_p_0 = {}
if (v_s_s := v_p_s & BYC_PARS.keys()):
s_q_p_0 = {}
for v_p in v_s_s:
v_v = BYC_PARS.get(v_p)
s_q_p_0.update({ v_p: v_v })
BYC_VARGS.update({ v_p: v_v })
prdbug(f'...__preprocess_variant_pars: {v_p} {v_v}')
self.variant_multi_pars.append(s_q_p_0)

for v_mp in v_mp_s:
if len(v_mp_vs := BYC_PARS.get(v_mp, [])) > 0:
for v in v_mp_vs:
self.variant_multi_pars.append({v_mp: v})
if len(s_q_p_0.keys()) > 0:
t_p = s_q_p_0.copy()
t_p.update({v_mp: v})
vips.append(self.__parse_variant_parameters(t_p))
else:
vips.append({v_mp: v})
if (len(vips)) < 1:
if len(s_q_p_0.keys()) > 0:
vips.append(self.__parse_variant_parameters(s_q_p_0))

for v_p_i, v_p_s in enumerate(self.variant_multi_pars):
self.variant_multi_pars[v_p_i] = self.__parse_variant_parameters(v_p_s)
self.variant_multi_pars = vips


# -------------------------------------------------------------------------#
Expand Down Expand Up @@ -713,7 +721,7 @@ def __query_from_filters(self):

# TODO: needs a general solution; so far for the iso age w/
# pre-calculated days field...
if "alphanumeric" in f_info.get("type", "ontology"):
if "alphanumeric" in f_info.get("ft_type", "ontology"):
f_class, comp, val = re.match(r'^(\w+):([<>=]+?)(\w[\w.]+?)$', f_info["id"]).group(1, 2, 3)
if "iso8601duration" in f_info.get("format", "___none___"):
val = days_from_iso8601duration(val)
Expand All @@ -737,7 +745,7 @@ def __query_from_filters(self):
if len(f_query_vals) == 1:
f_s_l.append({f_field: f_query_vals[0]})
else:
if "alphanumeric" in f_infos[f_entity][f_field].get("type", "ontology"):
if "alphanumeric" in f_infos[f_entity][f_field].get("ft_type", "ontology"):
q_l = []
for a_q_v in f_query_vals:
q_l.append({f_field: a_q_v})
Expand Down Expand Up @@ -775,20 +783,24 @@ def __query_from_filter_definitions(self, f_val):
f_info = {
"id": f_val,
"scope": "biosamples",
"type": "___undefined___",
"ft_type": "___undefined___",
"db_key": "___undefined___",
"child_terms": [f_val]
}

prdbug(f'...__query_from_filter_definitions: {f_val}')

for f_d in f_d_s.values():
if f_d.get("collationed", False) is True:
continue
f_re = re.compile(f_d.get("pattern", "___none___"))
if f_re.match(f_val):
f_info = {
"id": f_val,
"scope": f_d.get("scope", "biosamples"),
"entity": f_d.get("entity", "biosample"),
"db_key": f_d["db_key"],
"type": f_d.get("type", "ontology"),
"ft_type": f_d.get("ft_type", "ontology"),
"format": f_d.get("format", "___none___"),
"child_terms": [f_val]
}
Expand Down
4 changes: 2 additions & 2 deletions housekeepers/recordsSampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def main():
exit()
set_entities()

example_queries = BYC["dataset_definitions"]["progenetix"].get("test_queries", {})
example_queries = BYC.get("test_queries", {})

BYC_PARS.update({"response_entity_path_id":"analyses"})
BYC_PARS.update({"inputfile":"___dummy___"})
Expand Down Expand Up @@ -87,7 +87,7 @@ def main():
continue

f_i_ids = ds["analyses.id"].get("target_values", [])
ana_ids.update(random_samples(f_i_ids, min(50, len(f_i_ids))))
ana_ids.update(random_samples(f_i_ids, min(BYC_PARS.get("limit", 200), len(f_i_ids))))
print(f'==> now {len(ana_ids)}')

BYC_PARS.update({"analysis_ids": list(ana_ids)})
Expand Down
50 changes: 0 additions & 50 deletions local/dataset_definitions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,56 +15,6 @@ progenetix:
- id: DUO:0000004
label: no restriction
version: 2021-11-11
# TODO: probably temporary ...
test_queries:
CDKN2AcnvQuery:
filters:
- NCIT:C3058
reference_name: refseq:NC_000009.12
start:
- 21000001
- 21975098
end:
- 21967753
- 23000000
variant_type: EFO:0030067
EIF4A1snvQuery:
reference_name: refseq:NC_000017.11
start:
- 7577120
alternate_bases: A
reference_bases: G
EIF4A1rangeQuery:
reference_name: refseq:NC_000017.11
start:
- 7572825
end:
- 7579005
variant_type: SO:0001059
# geneMatchQuery:
# gene_id: CDK2
# variant_min_length: 100000
# variant_max_length: 200000
# variant_type: EFO:0030070
HeLaIdentifierQuery:
filters:
- cellosaurus:CVCL_0030
CDKN2AshortFormExample:
filters:
- NCIT:C3058
variant_query_digests: 9:21000001-21975098--21967753-24000000:DEL
fusionExample:
variant_type: SO:0000806
reference_name: refseq:NC_000008.11
mate_name: refseq:NC_000012.12
start:
- 45100000
end:
- 47300000
mate_start:
- 26200000
mate_end:
- 35600000

cellz:
id: cellz
Expand Down
63 changes: 45 additions & 18 deletions local/test_queries.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,45 @@
default:
CDKN2AcnvQuery:
filters: [NCIT:C3058]
reference_name: refseq:NC_000009.12
start: [21000001 21975098]
end: [21967753 23000000]
variant_type: EFO:0030067
EIF4A1snvQuery:
reference_name: refseq:NC_000017.11
start: [7577120]
variant_type: SO:0001059
alternate_bases: A
reference_bases: G
CDKN2ArangeQuery:
filters: [NCIT:C3058]
reference_name: refseq:NC_000009.12
start: [21967753]
end: [21975098]
CDKN2AcnvQuery:
filters:
- NCIT:C3058
reference_name: refseq:NC_000009.12
start: [21000001,21975098]
end: [21967753,23000000]
variant_type: EFO:0030067
EIF4A1snvQuery:
reference_name: refseq:NC_000017.11
start: [7577120]
variant_type: SO:0001059
alternate_bases: A
reference_bases: G
EIF4A1rangeQuery:
reference_name: refseq:NC_000017.11
start: [7572825]
end: [7579005]
variant_type: SO:0001059
geneMatchQuery:
gene_id: CDK2
variant_min_length: 100000
variant_max_length: 2000000
variant_type: EFO:0030070
HeLaIdentifierQuery:
filters:
- cellosaurus:CVCL_0030
CDKN2AshortFormExample:
filters:
- NCIT:C3058
variant_query_digests: 9:21000001-21975098--21967753-24000000:DEL
fusionExample:
variant_type: SO:0000806
reference_name: refseq:NC_000008.11
mate_name: refseq:NC_000012.12
start: [45100000]
end: [47300000]
mate_start: [26200000]
mate_end: [35600000]
ClinicalFiltersQuery:
filters:
- NCIT:C48786
- NCIT:C20197
AgeAtDXquery:
filters:
- ageAtDiagnosis:<=P18Y
Binary file modified rsrc/mongodump/_byconServicesDB.tar.gz
Binary file not shown.
Binary file modified rsrc/mongodump/examplez.tar.gz
Binary file not shown.

0 comments on commit 84d4420

Please sign in to comment.