aboutsummaryrefslogtreecommitdiff
path: root/wqflask
AgeCommit message (Collapse)Author
2022-10-04Fix bug where dataset_name was being passed into get_samplelist query ↵zsloan
instead of group_id
2022-10-04Pass redis_conn to get_samplelistzsloan
2022-10-04Initialize result_list for /traits endpoint JSON outputzsloan
2022-10-04Remove unnecessary variableFrederick Muriuki Muriithi
Just assign the value of the function call directly to the dictionary key rather than using an intermediate variable.
2022-10-04Add more information to exception to help in debuggingFrederick Muriuki Muriithi
2022-10-03Bug: Don't process data for output earlyFrederick Muriuki Muriithi
* The ",".join(...) call was processing the data for output to file, way too early, which would lead to errors down the line, very far removed from the actual cause of the error.
2022-09-30Reformat statementFrederick Muriuki Muriithi
2022-09-30Remove unused table and simplify queryFrederick Muriuki Muriithi
2022-09-30Raise hard-limit on search results to 10k.Arun Isaac
* wqflask/wqflask/gsearch.py (MAX_SEARCH_RESULTS): Set to 10k.
2022-09-30Disregard permissions when displaying search results.Arun Isaac
* wqflask/wqflask/gsearch.py: Do not import types. (is_permitted_for_listing): Delete function. (GSearch.__init__): Do not call is_permitted_for_listing.
2022-09-29Fix identation issues in attribute query codezsloan
2022-09-29Curry function passed to Maybe.apply.Arun Isaac
* wqflask/wqflask/gsearch.py (GSearch.__init__): Curry function passed to Maybe.apply to construct the display name.
2022-09-29Hard-limit the number of search results.Arun Isaac
* wqflask/wqflask/gsearch.py (MAX_SEARCH_RESULTS): New constant. (GSearch.__init__): Hard-limit the number of search results to MAX_SEARCH_RESULTS.
2022-09-29Support prefix search and range queries.Arun Isaac
* wqflask/wqflask/gsearch.py (GSearch.__init__): Support prefix search and range queries.
2022-09-29Retrieve year as integer.Arun Isaac
* wqflask/scripts/index.py (main): Retrieve year as an integer from the SQL database. * wqflask/wqflask/gsearch.py (GSearch.__init__): Convert year from integer to string.
2022-09-29Index prefixed fields and add values.Arun Isaac
* wqflask/scripts/index.py (main): Index fields with prefixes, and add values for range queries.
2022-09-29Replace MonadicDictCursor with generator function.Arun Isaac
* wqflask/utility/monads.py (MonadicDictCursor): Delete class. (sql_query_mdict): New function. * wqflask/scripts/index.py: Import sql_query_mdict instead of MonadicDictCursor. (main): Use sql_query_mdict.
2022-09-29Open xapian database once, but SQL database once for each query.Arun Isaac
We reopen the SQL database once for each query because it times out if kept waiting. * wqflask/scripts/index.py (main): Open xapian database once, but SQL database once for each query.
2022-09-29Remove empty first line in docstrings.Arun Isaac
* wqflask/utility/monads.py (MonadicDict, MonadicDictCursor): Remove empty first line in docstrings.
2022-09-29Ignore None values early when initializing MonadicDict.Arun Isaac
* wqflask/utility/monads.py (MonadicDict.__init__): Ignore None values early instead of converting them to Nothing and then ignoring them.
2022-09-29Return monadic value from MonadicDictCursor.fetchone.Arun Isaac
* wqflask/utility/monads.py (MonadicDictCursor.fetchone): Return monadic value.
2022-09-29Abstract out writing documents into a xapian database.Arun Isaac
* wqflask/scripts/index.py (write_document): New function. (main): Use write_document.
2022-09-29Close xapian database even if error occurs.Arun Isaac
* wqflask/wqflask/database.py (xapian_database, xapian_writable_database): Close xapian database even if error occurs.
2022-09-29Remove empty rows, and conversion for outputFrederick Muriuki Muriithi
Remove any rows that do not have values since they are not useful to the computations and only lead to errors. Remove the conversion to output format here: only convert the values for output at the point of output, and not earlier.
2022-09-28Do not assume transactions in database connections.Arun Isaac
Not all database queries need transactions. If transactions are required, they should be made a separate context manager and called only when required. * wqflask/wqflask/database.py (database_connection): Do not rollback or commit.
2022-09-27Fix indentation in get_species_list for-loopzsloan
2022-09-27Unit Test: Fix unit test for Chromosome functions.Frederick Muriuki Muriithi
2022-09-26Add REST API endpoint for viewing a group's genotype file metadatazsloan
2022-09-26Get heatmap and mapping working again with changing to species.pyzsloan
2022-09-26Remove unused database_connection import from species.pyzsloan
2022-09-26Implement global search using xapian.Arun Isaac
* wqflask/wqflask/gsearch.py: Import Just and Maybe from pymonad.maybe; curry from pymonad.tools; xapian; MonadicDict from utility.monads; xapian_database from wqflask.database. Do not import datetime; database_connection from wqflask.database; base.data_set; base.trait; db; utility.type_checking; utility. (is_permitted_for_listing): New function. (GSearch.__init__): Reimplement using xapian. * wqflask/wqflask/templates/gsearch_gene.html (block js): Accept dictionaries with missing keys, replacing them with "N/A".
2022-09-26Add indexing script for global search.Arun Isaac
* wqflask/scripts/index.py: New file.
2022-09-26Add xapian database connection utilities.Arun Isaac
* etc/default_settings.py (XAPIAN_DB_PATH): New variable. * wqflask/wqflask/database.py: Import xapian. (xapian_database, xapian_writable_database): New functions.
2022-09-26Generalize sql_uri function to get any setting.Arun Isaac
* wqflask/wqflask/database.py (sql_uri): Generalize to get_setting. (database_connection): Call get_setting instead of sql_uri.
2022-09-25Fix issue where the display name was used in the hmac for phenotype traitszsloan
2022-09-23Remove click handler on global search.Arun Isaac
check_search_term is not relevant to global search. It checks search terms in the unrelated #or_search and #and_search fields. * wqflask/wqflask/static/new/javascript/dataset_select_menu_orig.js: Do not call check_search_term on clicking global search button.
2022-09-22Fix bug in GeneUtil.py query where extra quotes caused an errorzsloan
2022-09-22Use passed in cursor instead of initialising a new cursor.Frederick Muriuki Muriithi
2022-09-22Provide database cursor as argument for TheSpecies and ChromosomesFrederick Muriuki Muriithi
Provide the database cursor as an argument to the methods of the two classes: * wqflask.base.species.TheSpecies * wqflask.base.species.Chromosomes Also update dependent code to initialise and pass the cursor where these classes are used.
2022-09-22Update tests: pass in missing arguments.Frederick Muriuki Muriithi
2022-09-21Added Markers/HumanMarkers import to datasetgroup.py and removed it fromzsloan
__init__.py Previously it threw an error when it tried to use Markers/HumanMarkers in datasetgroup.py; since Markers/HumanMarkers doesn't seem to be used anywhere else, I think it's okay for the import to only be in datasetgroup.py
2022-09-21Refactor: pass redis and db connections as argumentFrederick Muriuki Muriithi
Pass the redis and database connection/cursors as arguments to the class methods, and do not retain a copy of the connections/cursors. This allows us to do the connection management in the context managers elsewhere - ideally, at the top-level. For now the context manager is within the `create_dataset` function, but this should be moved out to a higher level once the lower levels are verified to be working as expected.
2022-09-20Make -logP columns uniformzsloan
2022-09-20Make -logP columns uniformzsloan
2022-09-20Re-add collect import to views.pyzsloan
Not sure why this was removed...I guess it looked like an unused import?
2022-09-20Make Search and Global Search Max -logP columns uniformzsloan
2022-09-20Fix gsearch ProbeSet queryzsloan
2022-09-20Remove global `Dataset_Getter` variableFrederick Muriuki Muriithi
Since the `__post_init__` method in the 'DatasetType' class checks whether data is in redis before hitting the database, it does not matter whether there is a global object of the type, as long as we make sure to call the object correctly. This commit makes that happen.
2022-09-20Revert "Use member variable `self.conn` to avoid test failure"Frederick Muriuki Muriithi
This reverts commit 4fafdfd8487ddf61105b2a5ca92534c8014c1db4. While using `self.conn.cursor()` works in the tests, it will not work in the application since the point of initialisation could be very different from the point where the 'property' is called.
2022-09-20Use member variable `self.conn` to avoid test failureFrederick Muriuki Muriithi
Use the `self.conn` variable to prevent test from failing.