Age | Commit message (Collapse) | Author |
|
* gn3/heatmaps.py (build_heatmap): Break down call to run_reaper
command into many lines to fix pylint error.
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
|
|
Originally the system would get the path from the environment
|
|
To avoid reliance of `flask.current_app.config` or on `gn3.settings` modules
globally, this commit passes in the appropriate configurations as arguments to
the relevant functions.
|
|
Rename the `gn3.random` module to gn3.chancy to avoid conflicts with Python's
`random` module.
* gn3/random.py -> gn3/chancy.py: rename module
* gn3/commands.py: update import
* gn3/computations/partial_correlations.py: update import
* gn3/computations/qtlreaper.py: update import
* gn3/computations/rust_correlation.py: update import
* gn3/db/correlations.py: update import
* gn3/db/traits.py: update import
* gn3/heatmaps.py: update import
* tests/integration/conftest.py: update import
|
|
* Use `with` in place of plain `open`
* Use f-strings in place of `str.format()`
* Remove string interpolation from queries - provide data as query parameters
* other minor fixes
|
|
The Pearson correlation coefficient always has a value between -1 and 1. So,
this check is redundant.
* gn3/heatmaps.py (cluster_traits.__compute_corr): Remove redundant check on
the Pearson correlation coefficient.
|
|
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.
|
|
|
|
Issue:
https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/non-clustered-heatmaps-and-flipping.gmi
* Update the code to enable the generation of the heatmap in both the
horizontal and vertical orientations.
|
|
Issue:
https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/non-clustered-heatmaps-and-flipping.gmi
* Switch the axis labels to make them less confusing for the user.
|
|
Issue:
https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/non-clustered-heatmaps-and-flipping.gmi
* Add type-hints to the functions
* Merge the axis data and labels to simpler dict arguments to reduce number of
parameters to the function.
|
|
Issue:
https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/non-clustered-heatmaps-and-flipping.gmi
* Remove file I/O from the function. If file I/O is needed, it will be
provided outside of this function.
|
|
Issue:
https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/clustering.gmi
* Provide the loci names to the heatmaps so that hovering over the heatmap
cells displays the associated locus name.
|
|
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.
|
|
Issue:
https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/clustering.gmi
* To provide a somewhat similar experience to GeneNetwork1, this commit
approximates the single-spectrum colour scale in GeneNetwork1 for the
heatmaps in GeneNetwork3.
Work to get the multiple-spectrum colour sc(ales/hemes) will be done in
other commits, since that might require digging even deeper into Plotly's
guts to figure out.
|
|
Issue:
https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/clustering.gmi
* Update terminology to use the appropriate domain terminology according to
Zachary's direction at
https://github.com/genenetwork/genenetwork3/pull/37#issuecomment-926041744
|
|
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
|
|
* Ignore some errors
* Update typing definitions for some portions of code
* Add missing imports
|
|
* Add missing function and module docstrings
* Remove unused imports
* Fix import order
* Rework some code sections to fix issues
* Disable some pylint errors.
|
|
Issue:
https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/clustering.gmi
* gn3/api/heatmaps.py: Serialize the figure to JSON
* gn3/heatmaps.py: Return the figure object
Serialize the Plotly figure into JSON, and return that, so that it can be
used on the client to display the image.
|
|
Issue:
https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/clustering.gmi
* gn3/api/heatmaps.py: Parse incoming data to build up correct trait names and
respond with only the computed heatmap data.
* gn3/heatmaps.py: Return only the computed data for heatmaps and clustering.
Since GN3 is supposed to handle only the data, and db-access, this commit
ensures that GN3 responds to the client with only the computed heatmap data,
and does not try to generate the heatmaps themselves.
The generation of the heatmaps will be delegated to the UI clients, such as
GeneNetwork2.
|
|
Issue:
https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/clustering.gmi
|
|
Issue:
https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/clustering.gmi
* Update the plot layouts and size to display the dendrogram and individual
chromosome heatmaps side by side
* Update the colour scale to begin with the grays rather than absolute black
|
|
Issue:
https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/clustering.gmi
* Provide the clustering data to be used for the creation of the clustering
dendrogram in the final clustered heatmap plot.
|
|
Issue:
https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/clustering.gmi
* Fix a few minor bugs left over from the integration of code from the
proof-of-concept code.
|
|
Issue:
https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/clustering.gmi
* Add missing imports that are needed in the code.
|
|
Issue:
https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/clustering.gmi
* Copy over code from the proof-of-concept implementation and clean it up a
little for the entry-point function for heatmap generation via the API
|
|
Issue:
https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/clustering.gmi
* Add a function to generate the heatmaps for each chromosome into a single
plot.
|
|
* 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.
|
|
* 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.
|
|
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.
|