Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing queries #191

Merged
merged 34 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
208d2a5
Adding tests for new added query functions
Dec 2, 2024
fcf8e61
Create functions for sources and targets lacking a corresponding query
Dec 2, 2024
f754524
Adding new parameters to the parameters dict
Dec 2, 2024
b66f01a
Use limits to reduce query run-time
Dec 2, 2024
645e06b
Add tests for the newly added functions in queries module
Dec 9, 2024
25eb0ab
Adding the remaining functions for sources and targets lacking a corr…
Dec 9, 2024
e4f4ae0
Group endpoints by functionality
Dec 9, 2024
5c31630
Add remaining subnetwork functions that were not present in apidocs
Dec 9, 2024
e313a60
Fix typo
Dec 9, 2024
b28752b
Add parameter examples in examples_dict for function indra_subnetwork_go
Dec 10, 2024
edc42fb
Add imports and namespaces for each function category
Dec 13, 2024
2580a59
Add function get_statements to evidence category and make use of Name…
Dec 13, 2024
22e9eec
Cetralize namespace definitions and groupings
Dec 16, 2024
45b011c
organize endpoints by functionality and add missing examples
Dec 16, 2024
86d6ef1
Add tests for nih reporter get_sources functions
Dec 16, 2024
7249599
Add functions to get_sources for nih reporter
Dec 16, 2024
6dd65db
Add namescapes for various category functions
Dec 16, 2024
73aa28b
Change formatting
Dec 16, 2024
3bf3e14
Update a failing test
Dec 16, 2024
5769d92
Add examples parameters in examples_dict
Dec 17, 2024
39f285b
Switch to typing.List from list
kkaris Dec 17, 2024
4540836
Assert that an exception was raised in test_validator
kkaris Dec 17, 2024
dc013e3
Rename test
kkaris Dec 17, 2024
c32e7ef
Add comments to clarify error types
kkaris Dec 17, 2024
50920e6
Refactor to use Namespaces and Category descriptions in queries_web m…
Dec 17, 2024
cbb61ab
Fix import for api
kkaris Dec 17, 2024
0037f14
Make changes according to comments in the PR. Update the examples for…
Dec 18, 2024
b5bbc19
Make a few fixes
Dec 18, 2024
e1f5df3
Update examples for trial, nih, publication, journal
Dec 19, 2024
ee94589
Update examples in test cases
Dec 19, 2024
ab10057
Reorganize the function categories
Dec 19, 2024
77be981
Add new namespaces according to the updated structure
Dec 19, 2024
8d32e34
Remove duplicate functions
Dec 19, 2024
fd39ba6
Remove unwanted/duplicate test
Dec 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
352 changes: 334 additions & 18 deletions src/indra_cogex/apps/queries_web/__init__.py

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/indra_cogex/apps/queries_web/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from more_click import make_web_command

from indra_cogex.apps.constants import INDRA_COGEX_EXTENSION
from indra_cogex.apps.queries_web import api
from indra_cogex.apps.rest_api import api
from indra_cogex.client import Neo4jClient

app = Flask(__name__)
Expand Down
56 changes: 50 additions & 6 deletions src/indra_cogex/apps/rest_api.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,61 @@
from flask_restx import Api

from .bioentity.api import bioentity_ns
from .queries_web import query_ns

__all__ = [
"api",
]
# Import and add namespaces after api is created
from .queries_web import (
gene_expression_ns,
go_terms_ns,
clinical_trials_ns,
biological_pathways_ns,
drug_side_effects_ns,
ontology_ns,
literature_metadata_ns,
statements_ns,
drug_targets_ns,
cell_markers_ns,
disease_phenotypes_ns,
gene_disease_variant_ns,
research_project_output_ns,
gene_domains_ns,
phenotype_variant_ns,
drug_indications_ns,
gene_codependence_ns,
enzyme_activity_ns,
cell_line_properties_ns,
analysis_ns,
subnetwork_ns
)


api = Api(
title="INDRA CoGEx Query API",
description="REST API for INDRA CoGEx queries",
doc="/apidocs",
)

api.add_namespace(query_ns)

# Add all namespaces
api.add_namespace(gene_expression_ns)
api.add_namespace(go_terms_ns)
api.add_namespace(clinical_trials_ns)
api.add_namespace(biological_pathways_ns)
api.add_namespace(drug_side_effects_ns)
api.add_namespace(ontology_ns)
api.add_namespace(literature_metadata_ns)
api.add_namespace(statements_ns)
api.add_namespace(drug_targets_ns)
api.add_namespace(cell_markers_ns)
api.add_namespace(disease_phenotypes_ns)
api.add_namespace(gene_disease_variant_ns)
api.add_namespace(research_project_output_ns)
api.add_namespace(gene_domains_ns)
api.add_namespace(phenotype_variant_ns)
api.add_namespace(drug_indications_ns)
api.add_namespace(gene_codependence_ns)
api.add_namespace(enzyme_activity_ns)
api.add_namespace(cell_line_properties_ns)
api.add_namespace(analysis_ns)
api.add_namespace(subnetwork_ns)
api.add_namespace(bioentity_ns)

__all__ = ["api"]
4 changes: 1 addition & 3 deletions src/indra_cogex/client/neo4j_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1151,8 +1151,6 @@ def do_cypher_tx(
) -> List[List]:
# 'parameters' and '**kwparameters' of tx.run are ultimately merged at query
# run-time

# Execute the query
result = tx.run(query, parameters=query_params)
# Return the result
return [record.values() for record in result]

Loading
Loading