Skip to content

Commit

Permalink
t3sting
Browse files Browse the repository at this point in the history
  • Loading branch information
costero-e committed Jul 3, 2024
1 parent 36d41de commit 34f6dad
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion beacon/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,6 @@
#
ontologies_folder = "ontologies"

alphanumeric_terms = ['libraryStrategy', 'molecularAttributes.geneIds', 'diseases.ageOfOnset.iso8601duration']
alphanumeric_terms = ['libraryStrategy', 'molecularAttributes.geneIds', 'diseases.ageOfOnset.iso8601duration', 'molecularAttributes.aminoacidChanges']

ontology_files={"NCIT": "http://purl.obolibrary.org/obo/NCIT.obo"}
11 changes: 3 additions & 8 deletions beacon/request/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

LOG = logging.getLogger(__name__)


def collection_handler(db_fn, request=None):
async def wrapper(request: Request):
try:
Expand Down Expand Up @@ -58,8 +59,6 @@ async def wrapper(request: Request):
[r for r in records] if records else []
)
LOG.debug(entity_schema)
LOG.debug(response_converted)
LOG.debug(type(response_converted))
response = build_beacon_collection_response(
response_converted, count, qparams, lambda x, y: x, entity_schema
)
Expand Down Expand Up @@ -220,20 +219,16 @@ async def wrapper(request: Request):
#LOG.debug(response_datasets)
new_count=0
loop = asyncio.get_running_loop()
tasks=[]
for dataset in response_datasets:
with ThreadPoolExecutor() as pool:
tasks.append(await loop.run_in_executor(pool, db_fn, entry_id, qparams, dataset))
#LOG.debug(dataset)
asyncio.wait(tasks)
for task in tasks:
entity_schema, count, dataset_count, records = task
entity_schema, count, dataset_count, records = await loop.run_in_executor(pool, db_fn, entry_id, qparams, dataset)
#LOG.debug(dataset)

if dataset_count != -1:
new_count+=dataset_count
datasets_docs[dataset]=records
datasets_count[dataset]=dataset_count

if include != 'NONE':
count=new_count
else:
Expand Down
2 changes: 1 addition & 1 deletion deploy/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,6 @@
#
ontologies_folder = "ontologies"

alphanumeric_terms = ['libraryStrategy', 'molecularAttributes.geneIds', 'diseases.ageOfOnset.iso8601duration']
alphanumeric_terms = ['libraryStrategy', 'molecularAttributes.geneIds', 'diseases.ageOfOnset.iso8601duration', 'molecularAttributes.aminoacidChanges']

ontology_files={"NCIT": "http://purl.obolibrary.org/obo/NCIT.obo"}
11 changes: 10 additions & 1 deletion permissions/public_datasets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,13 @@ public_datasets:
- AV_Dataset
- rd-connect_dataset
- coadread_tcga_pan_can_atlas_2018
- B1MG-COADREAD
- B1MG-COADREAD
- HGI_BelCovid_2
- HGI_BRACOVID
- HGI_GEN-COVID
- HGI_Hostage_1
- HGI_Hostage_2
- HGI_Hostage_3
- HGI_Hostage_4
- HGI_INMUNGEN_CoV2
- HGI_SPGRX

0 comments on commit 34f6dad

Please sign in to comment.