Age | Commit message (Collapse) | Author |
|
|
|
|
|
* gn3/db/traits.py (get_trait_csv_sample_data): Update SQL to fix runtime
errors.
|
|
|
|
|
|
* gn3/db/traits.py (get_trait_csv_sample_data): Fetch case attribute data if
it exists.
|
|
This reverts commit 710769e84b3bc6a2bdd66effdbac0659272ed511.
|
|
|
|
* 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
|
|
If a user replaces an individual value with an "x", delete that date entry
from the respective table. Deletion here is the only option since by default
the Nstrain, PublishData and PublishSE don't accept null values. Note that
deleting all 3 values is equivalent to removing the sample from the CSV file.
* gn3/db/traits.py (update_sample_data): If a value is "x", delete it from the
respective table.
|
|
When editing values from "x" to "0"(or any other value) when editing data, an
"update" statement was being run; thereby no new value was being inserted. To
the end user, modifying an "x" value to something else meant that no value was
being inserted. This commit fixes that by doing an insert whenever a change
from "x" to "0" is performed.
* gn3/db/traits.py (update_sample_data): Add insert statements whenever an
"update" statement returns a 0 row-count.
|
|
|
|
|
|
The PublishFreeze table isn't necessary in phenotype queries, since
PublishFreeze.Id = InbredSet.Id (for the purposes of identifying traits,
at least)
|
|
In line 91 of gn3/db/traits.py, there was an if statement "if
record[key] else 'x'" that was treating values of 0 as False, so I
changed it to explicitly check that values aren't None
|
|
The PublishFreeeze table is actually unnecessary for this query, since
the group ID (inbred_set_id) should be passed in and that ID is in the
PublishXRef table (so no neeed to join with PublishFreeze)
|
|
Indent the code correctly.
|
|
The queries run in the `get_trait_csv_sample_data` and
`retrieve_publish_trait_data` functions in the `gn3.db.traits` module were
mostly similar. This commit changes that, by making the
`get_trait_csv_sample_data` function make use of the results from calling the
`retrieve_publish_trait_data` function.
|
|
The problem with using the "value" record is that it's a floating point
number. See
<https://www.bonfacemunyoki.com/post/2021-10-21-comparing-floating-point-numbers/>
on why comparing floating point numbers can be an issue.
|
|
Sometimes, a user will try to insert data twice, on in some instances, 2
different users will attempt the same inserts of the same records separately.
In such cases, ignore the insert, and return early.
|
|
In the case when the user tries to delete the same data twice, prior to this
commit, an error was being generated. This commit remedies this by checking
if a record exists prior to deleting it.
|
|
|
|
Issue:
https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/partial-correlations.gmi
* To help with debugging error conditions, provide the original name to help
with figuring out why the error was raised
|
|
|
|
Issue:
https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/partial-correlations.gmi
|
|
|
|
|
|
In excel, "\n\n" is replaced with ",,,," during upload.
|
|
|
|
|
|
In excel, "\n\n" is replaced with ",,,," during upload.
|
|
Issue:
https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/partial-correlations.gmi
* gn3/db/traits.py: Move `export_informative` function here
* gn3/partial_correlations.py: Remove `export_informative` function
* tests/unit/db/test_traits.py: Move `export_informative` function tests here
* tests/unit/test_partial_correlations.py: Remove `export_informative`
function tests
The `export_informative` function relates more to the traits than to the
partial correlations, and could find use in more than just the partial
correlations stuff. This commit moves the function to the more
traits-specific `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.
|
|
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.
|
|
* Fix some linting errors and some minor bugs caught by the linter.
Move the `random_string` function to separate module for use in multiple
places in the code.
|
|
Issue:
https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/clustering.gmi
* gn3/computations/heatmap.py: update function
* gn3/db/traits.py: new function
Remove extraneous data and arguments from the function.
- Load the genotype file
- Generate traits file
- Provide both raw traits data, and exported traits data in return
|
|
Issue:
https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/clustering.gmi
* Provide the expected, top-level `riset` key-value pair and eliminate the
redundant key-value pair.
|
|
* gn3/db/traits.py: setup `trait_dataset_type`
* tests/unit/db/test_traits.py: fix tests
The type ('Temp', 'Geno', 'Publish', and 'ProbeSet') relate to a trait's
dataset, and not the trait itself. This commit updates the code to take this
into consideration.
The dataset type is also set up from a trait's full name, therefore this
commit removes the `trait_type` argument from the `retrieve_trait_info`
function.
|
|
Issue:
https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/clustering.gmi
* Add functions to retrieve the `value`, `variance`, and `ndata` values for
any given trait.
|
|
Issue:
https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/clustering.gmi
* Fix minor bugs in the code.
|
|
Issue:
https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/clustering.gmi
* Add module, class and function docstrings
* Deactivate some irrelevant pylint errors
* Fix indentations and line-lengths
|
|
Issue:
https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/clustering.gmi
* Only load the extra trait data if the basic trait information is found.
|
|
heatmap_decompose_db_retrieval
|
|
|
|
Issue:
https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/clustering.gmi
* Reorganise the code to separate the datasets from the traits, and to more
closely conform to the same flow as that in GN1
|
|
Issue:
https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/clustering.gmi
* The full name of the traits from search contains multiple parts to it, and
as such, we use it to retrieve the appropriate data and set it up in the
final trait_info dictionary that is produced.
|
|
* gn3/computations/slink.py: remove unused imports
* gn3/db/traits.py: remove unnecessary `else` clauses
* tests/unit/db/test_traits.py: add docstrings for functions
|