aboutsummaryrefslogtreecommitdiff
path: root/wqflask/base/trait.py
AgeCommit message (Collapse)Author
2023-12-29Namespace all modules under gn2.Arun Isaac
We move all modules under a gn2 directory. This is important for "correct" packaging and deployment as a Guix service.
2023-06-22Update calls to `database_connection` functionFrederick Muriuki Muriithi
Pass in the database URI at call time.
2023-05-19auth: Use auth privileges to control UI displayFrederick Muriuki Muriithi
Use the privileges from the authorisation endpoint to control which elements of the UI are displayed to the user. * wqflask/base/trait.py: Remove unused import * wqflask/wqflask/show_trait/show_trait.py: Unhook from GN-PROXY * wqflask/wqflask/templates/show_trait.html: Display or hide UI elements depending on the privileges the user has. * wqflask/wqflask/templates/show_trait_details.html: Display or hide UI elements depending on the privileges the user has. * wqflask/wqflask/views.py: Pass privileges, user, and resource details on to the UI template to be used for controlling UI element display.
2023-02-17Use abbreviation as symbol for phenotypes in collection pagezsloan
2023-02-17Default trait abbreviation to N/A and only set to ↵zsloan
pre/post_publication_abbreviation if they're not None
2023-02-14Fix collection page error when ProbeSet/Publish traits don't have a meanzsloan
2022-10-28Refactor: Pass user id to `check_resource_availability`Frederick Muriuki Muriithi
* Pass the user_id for the current user to the `check_resource_availability` function as an argument, rather than using the global `g.user_session.user_id` value.
2022-10-27init fix for querying for datasetsAlexander_Kabui
2022-10-20Cleanup: Remove unused codeFrederick Muriuki Muriithi
* Commit 49580eb9cd47bb2ce15fd44be11bb9580d85efef removed the use of the gn-proxy, but left some code that was used expressly for use with the gn-proxy. This commit removes that code.
2022-10-18Change logic in retrieve_trait_info to account for situations where a marker ↵zsloan
doesn't have a position in the DB
2022-10-12Use SQL to fetch trait metadata instead of gn-proxy, since it's dramatically ↵zsloan
faster
2022-10-12Include chr/mb values in jsonable traitzsloan
2022-10-04Add more information to exception to help in debuggingFrederick Muriuki Muriithi
2022-09-25Fix issue where the display name was used in the hmac for phenotype traitszsloan
2022-09-09Retain only a single import of the same moduleFrederick Muriuki Muriithi
2022-09-09Merge pull request #732 from BonfaceKilz/bug/fix-broken-correlationsMuriithi Frederick Muriuki
Bug/fix broken correlations
2022-09-09Add missing importMunyoki Kilyungi
* wqflask/base/trait.py: Import utility.hmac
2022-09-09Import missing module.Frederick Muriuki Muriithi
2022-09-08Fix sql queriesMunyoki Kilyungi
"%s" should only be used outside table names and column names otherwise a string literal will be inserted thereby leading to errors in the sql statements. * wqflask/base/data_set.py (geno_mrna_confidentiality): Use f-strings for table/columns/clause. * wqflask/base/trait.py (retrieve_trait_info): Ditto. * wqflask/wqflask/gsearch.py (GSearch.__init__): Ditto. * wqflask/wqflask/interval_analyst/GeneUtil.py (loadGenes): Ditto. * wqflask/wqflask/snp_browser/snp_browser.py (SnpBrowser.get_browser_results): Ditto.
2022-09-08Delete dead importsMunyoki Kilyungi
* wqflask/base/data_set.py: Remove un-used imports. * wqflask/base/trait.py: Ditto. wqflask/tests/wqflask/show_trait/test_show_trait.py: Ditto. * wqflask/wqflask/show_trait/show_trait.py: Ditto. * wqflask/wqflask/views: Ditto.
2022-09-08Delete logger importMunyoki Kilyungi
* wqflask/base/trait.py: Remove utility.logger
2022-09-08Replace assertion with Value Error for non-existent datasetMunyoki Kilyungi
* wqflask/base/trait.py (retrieve_trait_info): Wrap error message in ValueError.
2022-09-08Replace g.db with database_connection() context managerMunyoki Kilyungi
* wqflask/base/mrna_assay_tissue_data.py: Replace "flask.g" with database_connection. (MrnaAssayTissueData.__init__): Use database_connection. (MrnaAssayTissueData.get_symbol_values_pairs): Ditto. * wqflask/base/species.py: Replace "Flask.g" imports with "database_connection". (Chromosomes.chromosomes): Use database_connection. * wqflask/base/trait.py: Import database_connection. (retrieve_trait_info): Use database_connection. * wqflask/utility/authentication_tools.py: Replace "flask.g" with database_connection. (get_group_code): Use database_connection. * wqflask/utility/helper_functions.py: Replace "flask.g" with "database_connection". (get_species_groups): Use database_connection. * wqflask/wqflask/db_info.py: Replace "Flask" and "g" with "database_connection". (InfoPage.get_info): Use database_connection. * wqflask/wqflask/do_search.py (DoSearch.execute): Use database_connection(). * wqflask/wqflask/external_tools/send_to_geneweaver.py: Replace "Flask" and "g" import with database_connection. (test_chip): Use database_connection. * wqflask/wqflask/external_tools/send_to_webgestalt.py: Replace "Flask, g" imports with database_connection. (test_chip): Use database_connection. * wqflask/wqflask/gsearch.py: Replace "Flask" and "g" import with database_connection. (GSearch.__init__): Use database_connection. * wqflask/wqflask/interval_analyst/GeneUtil.py (loadGenes): Use database_connection(). * wqflask/wqflask/show_trait/SampleList.py: Replace "flask.g import" with database_connection. (SampleList.get_attributes): Use database_connection. (SampleList.get_extra_attribute_values): Ditto. * wqflask/wqflask/show_trait/show_trait.py: Replace "Flask" and "g" import with database_connection. (ShowTrait.__init__): Use database_connection. (ShowTrait.get_external_links): Ditto. (get_nearest_marker): Ditto.
2022-06-23Change jsonable in GeneralTrait so that it passes all necessary tablezsloan
information
2022-06-23Convert trait.view to string for conversion to JSONzsloan
It's originally a boolean, which causes an error when passed to the JS code as JSON
2022-06-13Check for chromosome of 'Un' and print location as 'Not available' in such caseszsloan
2022-03-25Fix issues that prevented genotype traits from being added to collectionszsloan
Some of this was caused by heatmaps supporting code; that code should probably pass the traits differently than the way it does in the "trait_info_str" function
2021-10-22Replace hardcoded GN proxy URLs in trait.py with one pulled from settingszsloan
2021-08-20Fixed some logic in trait.py that could cause a problem if a dataset_name ↵zsloan
was passed that wasn't Temp
2021-06-16Changed the function jsonable in trait.py to return a couple extra fields + ↵zsloan
take dataset as an optional argument (to avoid having to pointlessly create it)
2021-04-30autopep8: Fix W504BonfaceKilz
2021-04-29Merge branch 'testing' into Feature/Add-upload-data-formsBonfaceKilz
2021-04-29Run `sed -i 's/(object)//g'`BonfaceKilz
See: https://is.gd/pL7IJF Ran: find . \( -type d -name .git -prune \) -o -type f -print0 | xargs -0 sed -i 's/(object)//g'
2021-04-29base: trait: Remove unused functionBonfaceKilz
* wqflask/base/trait.py (jsonable_table_row): Delete it.
2021-04-28Added something to jsonable in trait.py to account for temp traits (this is ↵zsloan
necessary for them to show up correctly when selecting traits from collections in pop-up windows, like when selecting cofactors for mapping)
2021-03-03Checked if pre_publication_description is NULL, because there was an error ↵zsloan
resulting from a trait missing both pre_publication_description and pubmed ID
2021-02-18Fixed missing colonzsloan
2021-02-18Fixed checking permissions in trait.pyzsloan
2021-02-11Ensure trait description_display is setzsloan
2020-12-07Changed the logic in create_trait so that permissions should always be set, ↵zsloan
and added an assert that 'name' is passed instead of using if/else, since it should always be passed
2020-12-01Merge pull request #482 from zsloan/feature/corr_table_changeszsloan
Feature/corr table changes
2020-11-18Fixed issue where the cofactor trait descriptions didn't work correctlyzsloan
for genotype/snp cofactors (the code previously only accounted for probeset/phenotype cofactors, so it was treating genotypes/snps like phenotype traits)
2020-11-18Fixed issue that was causing scatterplot cofactors to not work if thezsloan
cofactors were genotypes (because it tried to get the "description_display" which doesn't exist for genotype traits)
2020-11-11Switched checking if a trait is confidential to checking if it has a pubmed ↵zsloan
ID for the purposes of showing pre-publication abbreviation/description
2020-10-12Merge branch 'testing' into build/python3-migrationBonfaceKilz
2020-10-09Apply PEP 8 to bufferBonfaceKilz
* wqflask/wqflask/wgcna/wgcna_analysis.py: Apply pep8 * wqflask/wqflask/collect.py: Ditto * wqflask/base/trait.py: Ditto
2020-10-02Ignore utf-8 encoding errorsBonfaceKilz
* wqflask/base/trait.py (retrieve_trait_info): Add extra param to ignore errors such as: "utf-8 codec can't decode byte 0xb5 in position 0: invalid start byte" thrown in Python3.
2020-10-01Convert trait attributes to utf-8 strings if they were bytesBonfaceKilz
2020-09-28Merge branch 'build/python3-migration' of ↵BonfaceKilz
github.com:BonfaceKilz/genenetwork2 into build/python3-migration
2020-09-28Fix casting errorBonfaceKilz
* wqflask/base/trait.py (retrieve_trait_info): If the description_string or discription_display value return a None object, evaluate to an empty string. Fixes errors related to *len(None)*.