aboutsummaryrefslogtreecommitdiff
path: root/gn3/api
AgeCommit message (Collapse)Author
2021-12-24Replace `NaN` with `null` in JSON stringFrederick Muriuki Muriithi
Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/partial-correlations.gmi * `NaN` is not a valid JSON value, and leads to errors in the code. This commit replaces all `NaN` values with `null`.
2021-12-24Encode the data to JSON and set the status codeFrederick Muriuki Muriithi
Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/partial-correlations.gmi * Encode bytes objects to string * Encode NaN values to "null" * gn3/api/correlation.py:
2021-12-24Add API endpoint for partial correlationsFrederick Muriuki Muriithi
Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/partial-correlations.gmi * Add an API endpoint for the partial correlation. * gn3/api/correlation.py:
2021-12-17Add API endpoint for partial correlationsFrederick Muriuki Muriithi
Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/partial-correlations.gmi * Add an API endpoint for the partial correlation.
2021-12-02Implement dataset metadata API endpoint.Arun Isaac
* guix.scm: Import (gnu packages rdf). (genenetwork3)[propagated-inputs]: Add python-sparqlwrapper. * gn3/settings.py (SPARQL_ENDPOINT): New variable. * gn3/api/general.py: Import datasets from gn3.db. (dataset_metadata): New API endpoint. * gn3/db/datasets.py: Import re, Template from string, Dict and Optional from typing, JSON and SPARQLWrapper from SPARQLWrapper, SPARQL_ENDPOINT from gn3.settings. (sparql_query, dataset_metadata): New functions.
2021-10-19Enable vertical and horizontal heatmapsFrederick Muriuki Muriithi
Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/non-clustered-heatmaps-and-flipping.gmi * Update the request endpoint, so that it produces a vertical or horizontal heatmap depending on the user's request.
2021-10-12Merge branch 'main' of https://github.com/genenetwork/genenetwork3 into ↵zsloan
bug/fix_rqtl_covariates
2021-09-27fix merge conflictsAlexander Kabui
2021-09-27Remove unnecessary variable.Frederick Muriuki Muriithi
Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/clustering.gmi * Fix issue according to review https://github.com/genenetwork/genenetwork3/pull/37#discussion_r714549781
2021-09-23minor fixes for endpointAlexander Kabui
2021-09-22Fix pylint errorsFrederick Muriuki Muriithi
* Add missing function and module docstrings * Remove unused imports * Fix import order * Rework some code sections to fix issues * Disable some pylint errors.
2021-09-22Update check: Heatmaps need at least 2 itemsFrederick Muriuki Muriithi
Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/clustering.gmi * Update the check to look for at least 2 traits before trying to generate the heatmap.
2021-09-22Return serialized plotly figureFrederick Muriuki Muriithi
Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/clustering.gmi * gn3/api/heatmaps.py: Serialize the figure to JSON * gn3/heatmaps.py: Return the figure object Serialize the Plotly figure into JSON, and return that, so that it can be used on the client to display the image.
2021-09-22jsonify resultsAlexander Kabui
2021-09-20Enable Cross-Origin Resource SharingFrederick Muriuki Muriithi
Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/clustering.gmi * gn3/api/heatmaps.py: Fix bugs in data parsing * gn3/app.py: enable CORS * gn3/settings.py: add flask-cors configurations * guix.scm: Add flask-cors dependency For easier testing of the heatmaps generation feature, this commit activates the cross-origin resource sharing for all "localhost" origins.
2021-09-20Return only the dataFrederick Muriuki Muriithi
Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/clustering.gmi * gn3/api/heatmaps.py: Parse incoming data to build up correct trait names and respond with only the computed heatmap data. * gn3/heatmaps.py: Return only the computed data for heatmaps and clustering. Since GN3 is supposed to handle only the data, and db-access, this commit ensures that GN3 responds to the client with only the computed heatmap data, and does not try to generate the heatmaps themselves. The generation of the heatmaps will be delegated to the UI clients, such as GeneNetwork2.
2021-09-17Return path to generated filename for nowFrederick Muriuki Muriithi
Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/clustering.gmi * To help with demonstrating that the code is producing the expected output, for now, we return the path to the generated html file that displays the interactive heatmap. At this point, it is mostly useful in the development environment. Moving forward, we might have to actually stream the raw html, or if we can get the Kaleido library packaged for GNU Guix, stream the images binary data instead.
2021-09-16pass user input to call scriptAlexander Kabui
2021-09-16Intergrate the heatmap generation with the APIFrederick Muriuki Muriithi
Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/clustering.gmi * Intergrate the heatmap generation code on the /api/heatmaps/clustered endpoint. The endpoint should take a json query of the form: {"traits_names": [ ... ] } where the "traits_name" value is a list of the full names of traits. A sample query to the endpoint could be something like the following: curl -i -X POST "http://localhost:8080/api/heatmaps/clustered" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -d '{ "traits_names": [ "UCLA_BXDBXH_CARTILAGE_V2::ILM103710672", "UCLA_BXDBXH_CARTILAGE_V2::ILM2260338", "UCLA_BXDBXH_CARTILAGE_V2::ILM3140576", "UCLA_BXDBXH_CARTILAGE_V2::ILM5670577", "UCLA_BXDBXH_CARTILAGE_V2::ILM2070121", "UCLA_BXDBXH_CARTILAGE_V2::ILM103990541", "UCLA_BXDBXH_CARTILAGE_V2::ILM1190722", "UCLA_BXDBXH_CARTILAGE_V2::ILM6590722", "UCLA_BXDBXH_CARTILAGE_V2::ILM4200064", "UCLA_BXDBXH_CARTILAGE_V2::ILM3140463" ] }' which should respond with a json response containing the raw binary string for the png format and possibly another for the svg format.
2021-09-16add initial endpoint for wgcnaAlexander Kabui
2021-09-03Add covarstruct as a possible keyword for the rqtl_wrapper.R script (not ↵zsloan
integrated into the script yet though)
2021-08-18Fix obvious linting errorsMuriithi Frederick Muriuki
* Fix linting errors that do not change the function of the code.
2021-08-17Fix obvious linting errorsMuriithi Frederick Muriuki
* Fix linting errors that do not change the function of the code.
2021-08-11use normal function for correlation (#34)Alexander Kabui
* use normal function for correlation + rename functions * update test for sample correlation * use normal function for tissue correlation + rename functions
2021-08-07Add gunicorn support for productionPjotr Prins
2021-06-18Fixed pylint issueszsloan
2021-06-18Fixed issue where all bool kwargs were always being passed to ↵zsloan
generate_rqtl_cmd and also made code check if output file already exists (so caching works)
2021-05-25Include code that processes rqtl output files and returns actual results ↵zsloan
instead of just the output filename
2021-05-18Account for boolean kwargs in compute() by storing them in a list, since ↵zsloan
they don't have corresponding values
2021-05-18Fixed variety of issues detected by pylintzsloan
2021-05-17Read in kwargs fromrequest and pass the command, tmpdir, and kwargs to ↵zsloan
generate_rqtl_cmd which returns the actual command and output path
2021-05-17Add rqtl.py for rqtl endpointszsloan
2021-05-13Add end-point for running an rQTL programBonfaceKilz
* gn3/api/general.py (run_r_qtl): New function. * gn3/settings.py: New variable.
2021-05-13Rename file_utils to fs_helpersBonfaceKilz
Generally avoid naming things with a "utils" prefix/ suffix since it encourages contributors to dump any new functions there; and over time, as the code grows, things get messy...
2021-05-08Fix pep-8 errorsBonfaceKilz
2021-05-08Add endpoints for (batch) entering phenotypes and genotypesBonfaceKilz
2021-05-02delete dataset and trait filesAlexander Kabui
2021-04-16benchmark normal function for sample rAlexander Kabui
2021-04-15optimization for sample correlationAlexander Kabui
2021-04-15test endpoint for fetching probeset data typesAlexander Kabui
2021-04-12replace experimental dbAlexander Kabui
2021-04-12fix merge conflictAlexander Kabui
2021-04-12Integrate correlation APIAlexander Kabui
- add new api for gn2-gn3 sample r integration - delete map for sample list to values - add db util file - add python msql-client dependency - add db for fetching lit correlation results - add unittests for db utils - add tests for db_utils - modify api for fetching lit correlation results - refactor Mock Database Connector and unittests - add sql url parser - add SQL URI env variable - refactor code for db utils - modify return data for lit correlation - refactor tissue correlation endpoint - replace db_instance with conn
2021-04-06fix DocstringsAlexander Kabui
2021-04-06delete unnecessary functions and commentsAlexander Kabui
2021-04-05fix for fetching dataset traits dataAlexander Kabui
2021-04-04refactor code for trait dataAlexander Kabui
modify unittest and integration tests for datasets
2021-03-31add fetch dataset strain id,strain name and unittestsAlexander Kabui
2021-03-31add temp_db setup and integration testsAlexander Kabui
2021-03-30refactor retrieve trait sample data and testsAlexander Kabui