Age | Commit message (Collapse) | Author |
|
* wqflask/wqflask/gsearch.py: Do not import types.
(is_permitted_for_listing): Delete function.
(GSearch.__init__): Do not call is_permitted_for_listing.
|
|
|
|
* wqflask/wqflask/gsearch.py (GSearch.__init__): Curry function passed
to Maybe.apply to construct the display name.
|
|
* wqflask/wqflask/gsearch.py (MAX_SEARCH_RESULTS): New constant.
(GSearch.__init__): Hard-limit the number of search results to
MAX_SEARCH_RESULTS.
|
|
* wqflask/wqflask/gsearch.py (GSearch.__init__): Support prefix search
and range queries.
|
|
* 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.
|
|
* wqflask/scripts/index.py (main): Index fields with prefixes, and add
values for range queries.
|
|
* 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.
|
|
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.
|
|
* wqflask/utility/monads.py (MonadicDict, MonadicDictCursor): Remove
empty first line in docstrings.
|
|
* wqflask/utility/monads.py (MonadicDict.__init__): Ignore None values
early instead of converting them to Nothing and then ignoring them.
|
|
* wqflask/utility/monads.py (MonadicDictCursor.fetchone): Return
monadic value.
|
|
* wqflask/scripts/index.py (write_document): New function.
(main): Use write_document.
|
|
* wqflask/wqflask/database.py (xapian_database,
xapian_writable_database): Close xapian database even if error occurs.
|
|
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.
|
|
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.
|
|
|
|
|
|
|
|
|
|
|
|
* 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".
|
|
* wqflask/scripts/index.py: New file.
|
|
* etc/default_settings.py (XAPIAN_DB_PATH): New variable.
* wqflask/wqflask/database.py: Import xapian.
(xapian_database, xapian_writable_database): New functions.
|
|
* wqflask/wqflask/database.py (sql_uri): Generalize to get_setting.
(database_connection): Call get_setting instead of sql_uri.
|
|
|
|
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.
|
|
|
|
|
|
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.
|
|
|
|
__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
|
|
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.
|
|
|
|
|
|
Not sure why this was removed...I guess it looked like an unused import?
|
|
|
|
|
|
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.
|
|
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.
|
|
Use the `self.conn` variable to prevent test from failing.
|
|
|
|
|
|
|
|
To ease future refactors on the code, decompose the file into a module
with multiple modules that can be refactored semi-independently.
|
|
|
|
Provide the following (empty) files to be used for the test
* wqflask/tests/unit/wqflask/marker_regression/genotype/bimbam/file_geno.txt
* wqflask/tests/unit/wqflask/marker_regression/genotype/bimbam/file_snps.txt
Rework the paths in
`wqflask/tests/unit/wqflask/marker_regression/test_gemma_mapping.py`
such that they point to the files added above for testing.
Do not require that the phenotype file exists in
`wqflask/wqflask/marker_regression/gemma_mapping.py` before attempting
the mapping.
|
|
The assertions was checking that the function was implemented a certain
way, rather than whether the function was doing the correct thing.
|
|
* Check that the required file paths exist
* Check the bimbam directory path only once
|
|
* wqflask/wqflask/marker_regression/exceptions.py: new
NoMappingResultsError exception
* wqflask/wqflask/templates/mapping_error.html: reword display of the
errors
* wqflask/wqflask/views.py: Raise the NoMappingResultsError exception
in the case where there are no results for the mapping.
|