aboutsummaryrefslogtreecommitdiff
path: root/wqflask
AgeCommit message (Collapse)Author
2020-09-30Changed the logic for adding 0 to the PCA results to do so when thezsloan
shared samples are < 2 instead of 0; this fixed the error when running the correlation matrix, but results in the PCA traits having no values * wqflask/wqflask/correlation_matrx/show_corr_matrix.py - changed "if num_overlap == 0" to "if num_overlap < 2" because correlations can't be run if there are fewer than 2 shared samples (and previously would throw an error if there was exactly 1 shared sample)
2020-09-30Added "natural-minus-na" sorting for relevant columns in the correlationzsloan
page * wqflask/wqflask/templates/correlation_page.html - Added natural-minus-na type to columns that can contain N/A values, since I apparently forgot to add it to this table before
2020-09-30Fixed issue where columns sorted by inner text (text inside link tags)zsloan
didn't sort all rows when a table is paginated and has more than one page * wqflask/wqflask/static/new/javascript/search_results.js - Added "extract_inner_text" function for getting the inner text from a string containing HTML in order to avoid using DataTables' orderDataType (which can only fetch values directly from the DOM, which is why sorting wasn't working with multiple pages), and also included this function in the "natural-minus-na" data type (so columns can be sorted that contain both HTML/links and N/A values) * wqflask/wqflask/templates/collections/view.html - Changed record column to use "natural-minus-na" sort method in order to fix the inner-text sorting issue + added sorting to the checkbox column (in the same way as it already works in the search result page) * wqflask/wqflask/templates/search_results_page.html - Replaced the columns that used orderDataType with using the updated "natural-minus-na" data type * wqflask/wqflask/templates/correlation_page.html - Fixed issue where N/As in the Year column (for phenotype correlations) were still displayed as links
2020-09-30Removed unused code from TempDataSet classzsloan
* wqflask/base/data_set.py - TempDataSet class contained some code referring to the SQL DB, but temp traits aren't stored in the SQL DB anymore
2020-09-30Add missing importBonfaceKilz
* wqflask/wqflask/correlation/show_corr_results.py: Add it.
2020-09-30Apply pep 8 formattingBonfaceKilz
* wqflask/wqflask/correlation/show_corr_results.py [imports]: Apply pep8 and remove unused imports.
2020-09-30Fix StopIteration error thrown in view collections pageBonfaceKilz
* wqflask/wqflask/user_session.py (user_id): Use byte-string when fetching user_id. See: https://github.com/genenetwork/genenetwork2/pull/422#issuecomment-701082458
2020-09-30Fix import in testsBonfaceKilz
2020-09-29Trait page link-out buttons were previously inside <a> tags, but thiszsloan
caused there to be a small line between buttons when hovering over them (because the <a> tags were wider than the button itself); this was changed to instead just be an "onclick" on the button (which is also a bit more concise) * wqflask/wqflask/templates/show_trait_details.html - Replaced <a> tags with onclick for trait page link-out buttons
2020-09-29Removed "Color By Trait" button from the Bar Chart, because it was meantzsloan
to work with the figure we used before switching to Plotly. This feature will need to be redone to work with Plotly * wqflask/wqflask/templates/show_trait_statistics.html - commented out Color By Trait button until it's reimplemented
2020-09-29Made a variety of changes to table pageszsloan
* wqflask/wqflask/static/new/css/show_trait.css - Adding position relative and a 2px offset for glyphicons to make them better align with button text * wqflask/wqflask/templates/collections/view.html - Added glyphicon to Download button, changed a couple head names (Peak Location and Effect Size), made Location and Peak Location columns the same width, and made the "?" glossary links a little larger and red * wqflask/wqflask/templates/search_result_page.html - same as above * wqflask/wqflask/templates/show_trait_edit_data.html - Added glyphicon to Export button
2020-09-29Remove undefined variableBonfaceKilz
2020-09-29Apply pep 8 to bufferBonfaceKilz
* wqflask/wqflask/user_manager.py: Remove some stale comments. (imports): Apply pep-8 and remove unused imports.
2020-09-29Fixed issue where negative additive effect values weren't beingzsloan
displayed in the "view collection" page * wqflask/wqflask/templates/collections/view.html - Apparently the correct way to check if a value can be cast to a float in Jinja2 is to say "value != 0"; it previous said "value > 0" which exlcuded all negative values
2020-09-29Changed Add (to collection) button color to match other Add buttons andzsloan
changed the text for the GN1 link button * wqflask/wqflask/templates/show_trait_details.html - Changed Add button class to btn-success (to make it green like the other Add buttons) and changed text from "View in GN1" to "Go to GN1"
2020-09-29Changed the DataTables column sort arrows to a different color byzsloan
changing the image they're referencing * wqflask/wqflask/templates/base.html - Added CSS changing the table sort arrow image directly into base.html because it requires using url_for to reference the images in the GUIX profile (so it needs to be in the template and can't just be added to a CSS file)
2020-09-29Add check for bytesBonfaceKilz
* wqflask/wqflask/collect.py (process_traits): Check whether the passed "unprocessed_traits" is a byte otherwise an error is generated when bytes(the default) are passed.
2020-09-29Add test for process_traits from collections.pyBonfaceKilz
* wqflask/tests/wqflask/test_collect.py: Add it.
2020-09-28Changed add to collection to open the collection in a new tab/page sozsloan
the results on the initial page aren't lost * wqflask/wqflask/static/new/javascript/search_results.js - Changed the add to collection method name to "add_to_collection" because it was previously "add" which is a terrible method name * wqflask/wqflask/templates/collections/add.html - Added target="_blank" to the add to collection form so it will open in a new tab/window
2020-09-28Fix failing testBonfaceKilz
* wqflask/tests/base/test_trait.py: Add app_context to test class, otherwise an error related to working outside the app_context is generated. Adding the app_context is required when mocking "Flask.g".
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)*.
2020-09-28Merge branch 'testing' into build/python3-migrationBonfaceKilz
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)*.
2020-09-28Convert None to "" in if statementBonfaceKilz
* wqflask/base/trait.py: Fixes error parsing error: "(GeneNetwork error: float argument required, not NoneType)"
2020-09-28Update trait testsBonfaceKilz
* wqflask/tests/base/test_trait.py (test_retrieve_trait_info_with_non_empty_lrs): Check trait.LRS_score_repr is set correctly if trait.lrs is None. (test_retrieve_trait_info_with_empty_lrs_field): Check trait.LRS_score_repr and test_trait.LRS_location_repr is set correctly if trait.lrs is None. (test_retrieve_trait_info_with_empty_chr_field): Check test_trait.LRS_score_repr and test_trait.LRS_location_repr is set correctly if trait.locus is None.
2020-09-26Fix failing tests by replacing mock with unittest.mockBonfaceKilz
* wqflask/tests/base/test_data_set.py (imports): Run: `find . -type f -name "*py" -print0 | xargs -0 sed -i \ "s|import mock|from unittest import mock|g"` * wqflask/tests/base/test_trait.py(imports): Ditto. * wqflask/tests/utility/test_authentication_tools.py(imports): Ditto. * wqflask/tests/utility/test_hmac.py(imports). Ditto. * wqflask/tests/wqflask/api/test_gen_menu.py: Ditto
2020-09-26Fix failing testsBonfaceKilz
* wqflask/tests/base/test_trait.py: Remove decode function call which is no longer supported in python3.
2020-09-26Apply PEP 8 to bufferBonfaceKilz
* wqflask/wqflask/db_info.py: Run pep8 through buffers. Fixes inconsistent use of tabs and spaces in indentation which trips up unittests.
2020-09-26Run 2to3-8 tool through fileBonfaceKilz
* wqflask/wqflask/db_info.py: Run: 2to3-3.8 -w wqflask/wqflask/db_info.py
2020-09-26Fix inconsistent line ending in fileBonfaceKilz
* wqflask/wqflask/db_info.py: Replace ^M with proper unix line endings. See <http://ergoemacs.org/emacs/emacs_line_ending_char.html>
2020-09-26Merge branch 'testing' into build/python3-migrationBonfaceKilz
2020-09-25Fixed issue where attribute columns' alignment was offset by 1zsloan
* wqflask/wqflask/static/new/javascript/initialize_show_trait_tables.js - attribute cells' alignment and column names were wrong because they were referring to an attribute offset by 1 in the attribute list -
2020-09-25Changed edit_data_change and block_by_index to use DataTables APIzsloan
* wqflask/wqflask/static/new/javascript/show_trait.js - Changed edit_data_change to use DataTables API to fetch the list of names, values, and (where applicable) standard errors in a way that just looks at those columns (previously it iterated through all rows). block_by_index was also changed to look just at columns
2020-09-24Changed logic that defines the primary/other samplelists to be much morezsloan
efficient * wqflask/wqflask/show_trait/show_trait.py - Add an "if" statement to avoid unnecessarily running some code and changed a list to a set for the purposes of searching if it contains an element
2020-09-23Aligned relevant columns to right in mapping results tablezsloan
* wqflask/wqflask/templates/mapping_results.html - aligned score, position, additive effect, and dominance column headers to the right
2020-09-23Fix failing buildsBonfaceKilz
* wqflask/wqflask/__init__.py: Move imports from views.py to "__init__.py". Fixes failing build. * wqflask/wqflask/views.py: Ditto.
2020-09-23Fix failing testsBonfaceKilz
* wqflask/tests/base/test_trait.py: In python2 it's necessary to decode the utf-8 string.
2020-09-22Merge branch 'testing' of github.com:genenetwork/genenetwork2 into testingzsloan
2020-09-22Fixed a pretty big mistake where user accounts would be saved even whenzsloan
there was some mistake/error during registration * wqflask/wqflask/user_login.py - Previously it would still save a user even if there was some problem like their e-mail already being associated with an account. It would display the error, but still run save_user. I fixed this so that it no longer saves the user if there are any errors
2020-09-22Added something to the mapping result page CSS to change the highlightzsloan
color to match the high color in other tables * wqflask/wqflask/static/new/css/marker_regression.css - changed background color when selecting a row (i.e. "highlight color")
2020-09-22Fixed a couple mistakes in the previous commit and changed the positionzsloan
header on the mapping results page to include the mapping scale * wqflask/wqflask/marker_regression/run_mapping.py - changed how "display_pos" is defined for marker obs * wqflask/wqflask/templates/mapping_results.html - Fixed issues with last commit and changed position header name to include mapping scale
2020-09-22Replaced Chr and Mb/cM columns with a single position column in mappingzsloan
results and also changes the -log(p) to use an endash instead * wqflask/wqflask/marker_regression/run_mapping.py - added "display_pos" to each marker object that is a combination of Chr and Mb/cM * wqflask/wqflask/templates/mapping_results.html - Included "display_pos" in results table and replaced -log(p) with using an endash
2020-09-22Changed JS on trait page that updates basic stats and graphs/figures tozsloan
use the DataTables API to pull sample values * wqflask/wqflask/static/new/javascript/show_trait.js - Changed the way sample name/val/var are pulled from the table to instead use DataTables' API + removed an unused event listener * wqflask/wqflask/static/new/javascript/initialize_show_trait_tables.js - added "var" before a defined variable for consistency
2020-09-18Made some style changes with whitespace/line-breakszsloan
2020-09-18Made a bunch of changes to move trait page DataTables initialization tozsloan
a separate file (initialize_show_trait_tables.js). The biggest complication was getting the order of attributes in the rows to sync with the order of atribute namees in the column headers. Previously this logic was all in the template. * wqflask/base/webqtlCaseData.py - added attribute first_attr_col as a very awkward solution to passing the column position into the column render function in situations where there are case attribute columns (which can be variable in number) * wqflask/wqflask/show_trait/show_trait.py - Replace "attribute_names" in js_data with "attributes" (which allows the JS access to more information) and also pass new se_exists and has_num_cases variables with js_data, so the javascript has access to whether or not those columns exist in the table * wqflask/wqflask/static/new/javascript/show_trait.js - Change case attribute-related logic to use js_data.attributes instead of js_data.attribute_names * wqflask/wqflask/templates/show_trait.html - Removed table initialization from template * wqflask/wqflask/static/new/javascript/initialize_show_trait_tables.js - new file that initializes tables and reproduces what the template logic used to do with JS logic
2020-09-18Apply pep8 formattingBonfaceKilz
2020-09-17Convert "target_string" to a str typeBonfaceKilz
* wqflask/base/trait.py (retrieve_trait_info): Convert "target_string" to a str, otherwise an exception will be thrown if it's None.
2020-09-17Merge branch 'testing' into build/python3-migrationBonfaceKilz
2020-09-17Mock "SECRET_HMAC_CODE"BonfaceKilz
* wqflask/tests/utility/test_hmac.py: Mock app.config's "SECRET_HMAC_CODE" value.