aboutsummaryrefslogtreecommitdiff
path: root/tests/unit/test_heatmaps.py
AgeCommit message (Expand)Author
2022-02-17Use pytest's "mark" feature to categorise tests...Use pytest's `mark` feature to explicitly categorise the tests and run them per category Frederick Muriuki Muriithi
2021-11-19Replace use of assert_allclose. Disable linter error...Notes: https://github.com/genenetwork/genenetwork3/pull/56#issuecomment-973798918 * From the notes above, the assert_allclose is a better function for figuring out what failed, unlike the allclose that simply just returns a True/False value. This commit restores the use of the assert_allclose function, and then disables the linter error due to the fact that there is no use of the `self` keyword. Frederick Muriuki Muriithi
2021-11-18Fix some linting errors...Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/partial-correlations.gmi * Fix some obvious linting errors and remove obsolete code Frederick Muriuki Muriithi
2021-11-11Compare floats approximately....Floating point numbers should only be compared approximately. Different implementations of functions might produce slightly different results. * tests/unit/computations/test_correlation.py: Import assert_almost_equal from numpy.testing. (TestCorrelation.test_compute_correlation): Compare floats using assert_almost_equal instead of assertEqual. * tests/unit/test_heatmaps.py: Import assert_allclose from numpy.testing. (TestHeatmap.test_cluster_traits): Use assert_allclose instead of assertEqual. Arun Isaac
2021-10-19Move 'export_trait_data' to 'gn3.db.traits' module...Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/partial-correlations.gmi * gn3/db/traits.py: Move function `export_trait_data` here * gn3/heatmaps.py: Remove function `export_trait_data` * tests/unit/db/test_traits.py: Move function `export_trait_data` tests here * tests/unit/test_heatmaps.py: Remove function `export_trait_data` here Function `export_trait_data` more closely corresponds to the traits and is used in more than just the `gn3.heatmaps` module. This commit moves the relevant code over to the `gn3.db.traits` module and also moves the tests to the corresponding tests modules. Frederick Muriuki Muriithi
2021-09-28Retrieve loci names ordered by chromosomes...Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/clustering.gmi * gn3/heatmaps.py: implement function * tests/unit/test_heatmaps.py: add test Add a function to retrieve the loci names from the traits, ordered by chromosomes, in alphabetical order. This is useful to provide the user with more information on hovering over the heatmap cells: each cell will now display the locus name, trait name and value associated with it. Frederick Muriuki Muriithi
2021-09-27Update terminology: `strain` to `sample`...Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/clustering.gmi * Update the terminology used: use `sample` in place of `strain` according to Zachary's direction at https://github.com/genenetwork/genenetwork3/pull/37#issuecomment-926043306 Frederick Muriuki Muriithi
2021-09-23Refactor: Move common sample data to separate file...Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/clustering.gmi * Move common sample test data into a separate file where it can be imported from, to prevent pylint error R0801 which proved tricky to silence in any other way. Frederick Muriuki Muriithi
2021-09-17Fix a number of linting issues...Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/clustering.gmi Frederick Muriuki Muriithi
2021-09-15Process data into format usable by heatmaps...* gn3/heatmaps.py: implement `process_traits_data_for_heatmap` function, that will process the data into a form usable by heatmaps. * tests/unit/test_heatmaps.py: check that the function processes the data into the correct form. Frederick Muriuki Muriithi
2021-09-15Integrate get_lsr_from_chr function...* gn3/heatmaps.py: copy over function * tests/unit/test_heatmaps.py: add tests Copy function over from proof of concept and add some tests to ensure it works as expected. Frederick Muriuki Muriithi
2021-09-15Reorganise modules...Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/clustering.gmi * The heatmap generation does not fall cleanly within the computations or db modules. This commit moves it to the higher level gn3 module. Frederick Muriuki Muriithi