aboutsummaryrefslogtreecommitdiff
path: root/gn3
AgeCommit message (Expand)Author
2021-11-11replace list with generatorsAlexander Kabui
2021-11-09Add functions for updating groupsBonfaceKilz
2021-11-09Merge branch 'main' of github.com:genenetwork/genenetwork3 into partial-corre...Frederick Muriuki Muriithi
2021-11-09Implement remaining part of `partial_correlation_recursive` function...Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/partial-correlations.gmi * gn3/computations/partial_correlations.py: implement remaining portion of `partial_correlation_recursive` function. * tests/unit/computations/test_partial_correlations.py: add parsing for new data format and update tests Frederick Muriuki Muriithi
2021-11-09Add new data processing utility...Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/partial-correlations.gmi * gn3/data_helpers.py: New function (`partition_by`) * tests/unit/test_data_helpers.py: Tests for new function Add a function that approximates Clojure's `partition-by` function, to help with processing the data in a more functional way. Frederick Muriuki Muriithi
2021-11-09Fix bug: if three columns, ensure last is "z"...Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/partial-correlations.gmi * Fix a bug, caught when the function is called in a recursive form, with the "z*" columns reducing for each cycle through the recursive form. As it was, the last cycle through the recursive form would end up with a DataFrame with the columns "x", "y", and "z0" rather than the columns "x", "y", "z". This commit handles that edge case to ensure that the column name is changed from "z0" to simply "z". Frederick Muriuki Muriithi
2021-11-04Create blackbox tests for some functions migrated from R...Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/partial-correlations.gmi * gn3/computations/partial_correlations.py: new stub functions (partial_correlation_matrix, partial_correlation_recursive) * tests/unit/computations/partial_correlations_test_data/pcor_mat_blackbox_test.csv: blackbox sample data and results for variance-covariance matrix method * tests/unit/computations/partial_correlations_test_data/pcor_rec_blackbox_test.csv: blackbox sample data and results for recursive method * tests/unit/computations/test_partial_correlations.py: Tests for new function Provide some blackbox testing sample data for checking the operation of the functions migrated from R. Frederick Muriuki Muriithi
2021-11-04Stub `determine_partials`...Issue: * Stub out `determine_partials` which is a migration of `web.webqtl.correlation.correlationFunction.determinePartialsByR` in GN1. The function in GN1 has R code from line 188 to line 344. This will need to be converted over to Python. This function will also need tests. Frederick Muriuki Muriithi
2021-11-04Implement `compute_partial_correlations_fast`...Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/partial-correlations.gmi * Implement `compute_partial_correlations_fast` that is a partial migration of `web.webqtl.correlation.PartialCorrDBPage.getPartialCorrelationsFast` in GN1. This function will probably be reworked once the dependencies are fully migrated. It also needs tests to be added. Frederick Muriuki Muriithi
2021-11-04Retrieve indices of the selected samples...Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/partial-correlations.gmi * gn3/computations/partial_correlations.py: New function (good_dataset_samples_indexes). * tests/unit/computations/test_partial_correlations.py: Tests for new function (good_dataset_samples_indexes) Get the indices of the selected samples. This is a partial migration of the `web.webqtl.correlation.PartialCorrDBPage.getPartialCorrelationsFast` function in GN1. Frederick Muriuki Muriithi
2021-11-04Fix some linting errors...Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/partial-correlations.gmi Frederick Muriuki Muriithi
2021-11-04Parse single line from CSV file...Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/partial-correlations.gmi * gn3/data_helpers.py: New function (parse_csv_line) * tests/unit/test_data_helpers.py: Add tests for new function (parse_csv_line) Add a function to parse a single line from a CSV file. Frederick Muriuki Muriithi
2021-11-04Add some condition checking functions...Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/partial-correlations.gmi * Add the `check_for_literature_info` and `check_symbol_for_tissue_correlation` functions to check for the presence of specific data. Frederick Muriuki Muriithi
2021-11-04Explicitly round the values...* Explicitly round the values to prevent issues with the type-checker Frederick Muriuki Muriithi
2021-11-04Specify ten (10) decimal places...Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/partial-correlations.gmi * gn3/computations/partial_correlations.py: specify 10 decimal places * tests/unit/computations/test_partial_correlations.py: update examples Slight differences in python implementations, possibly hardware and operating systems could cause the value of float (double) values to be different in the less significant parts of the decimal places. This commit limits the usable part of the decimals to the first 10 decimal places for now. Frederick Muriuki Muriithi
2021-11-04Fix linting and typing errors...Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/partial-correlations.gmi Frederick Muriuki Muriithi
2021-11-04Rework sorting: remove `compare_tissue_correlation_absolute_values`...Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/partial-correlations.gmi * gn3/db/correlations.py: Remove the `compare_tissue_correlation_absolute_values` function which is no longer needed. Frederick Muriuki Muriithi
2021-11-04Complete `build_temporary_tissue_correlations_table`...Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/partial-correlations.gmi * gn3/computations/partial_correlations.py: Remove comments after updating usage of the function at call point * gn3/db/correlations.py: Complete the implementation of the `build_temporary_tissue_correlations_table` function Frederick Muriuki Muriithi
2021-11-04Complete implementation of `batch_computed_tissue_correlation`...Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/partial-correlations.gmi * Complete the implementation of the `batch_computed_tissue_correlation` function Frederick Muriuki Muriithi
2021-11-04Move `correlations_of_all_tissue_traits`...Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/partial-correlations.gmi * gn3/computations/partial_correlations.py: new function (`correlations_of_all_tissue_traits`). * gn3/db/correlations.py: delete function (`correlations_of_all_tissue_traits`). Move the function to `gn3.computations.partial_correlations` module and comment out the db-access code. Rework it to receive, as arguments, the data it previously fetched from the database, and add comments on future rework to get the function working again. Frederick Muriuki Muriithi
2021-11-04Add missing comma...Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/partial-correlations.gmi Frederick Muriuki Muriithi
2021-11-04Implement `tissue_correlation` function...Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/partial-correlations.gmi * gn3/computations/partial_correlations.py: New function (tissue_correlation) * tests/unit/test_partial_correlations.py -> tests/unit/computations/test_partial_correlations.py: Move module. Implement tests for new function Migrate the `cal_tissue_corr` function embedded in the `web.webqtl.correlation.correlationFunction.batchCalTissueCorr` function in GN1 and implement tests to ensure it works correctly. Frederick Muriuki Muriithi
2021-11-04Move the function to computations module...Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/partial-correlations.gmi * The function `batch_computed_tissue_correlation` is a pure computations function with no expressions accessing the database, as far as I can tell, therefore, this commit moves the function over to the gn3.computations.partial_correlations module that holds the pure computation functions. Frederick Muriuki Muriithi
2021-11-04Move the partial_correlations module to gn3.computations...* Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/partial-correlations.gmi * Move the partial_correlations.py module to the gn3.computations module, since it contains the computations for partial correlations. Frederick Muriuki Muriithi
2021-11-04Remove if clauses: replace with dict...Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/partial-correlations.gmi * Remove the if clauses to simplify the code flow: use a dictionary of queries and select the appropriate query from the dictionary instead. Frederick Muriuki Muriithi
2021-11-04Stub out `batch_computed_tissue_correlation` function...Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/partial-correlations.gmi * Stub out `batch_computed_tissue_correlation` function to be used in implementing the function down the line. Frederick Muriuki Muriithi
2021-11-04Complete `correlations_of_all_tissue_traits`...Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/partial-correlations.gmi * Complete the implementation of the `correlations_of_all_tissue_traits` function by providing a call to a non-implemented function. Frederick Muriuki Muriithi
2021-11-04Implement `fetch_gene_symbol_tissue_value_dict_for_trait`...Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/partial-correlations.gmi * Implement `fetch_gene_symbol_tissue_value_dict_for_trait` function which is a migration of the `web.webqtl.correlation.correlationFunction.getGeneSymbolTissueValueDictForTrait` function in GeneNetwork1. Frederick Muriuki Muriithi
2021-11-04Partially implement `partial_correlation_recursive`...Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/partial-correlations.gmi * gn3/computations/partial_correlations.py: Implement one path for the `gn3.computations.partial_correlations.partial_correlation_recursive` function. * gn3/settings.py: Add a setting for how many decimal places to round to * tests/unit/computations/test_partial_correlations.py: Update test to take the number of decimal places into consideration Implement a single path (where the z value is a vector and not a matrix) for the `partial_correlation_recursive` function. Frederick Muriuki Muriithi
2021-11-04Implement `build_data_frame`...Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/partial-correlations.gmi * gn3/computations/partial_correlations.py: new function (`build_data_frame`) * tests/unit/computations/test_partial_correlations.py: Add tests for new function Add a new function to build a pandas DataFrame object from the provided values: - x: a vector of floats (represented with a tuple of floats) - y: a vector of floats (represented with a tuple of floats) - z: a vector OR matrix of floats (represented with a tuple of floats or a tuple of tuples of floats) Frederick Muriuki Muriithi
2021-11-04Create blackbox tests for some functions migrated from R...Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/partial-correlations.gmi * gn3/computations/partial_correlations.py: new stub functions (partial_correlation_matrix, partial_correlation_recursive) * tests/unit/computations/partial_correlations_test_data/pcor_mat_blackbox_test.csv: blackbox sample data and results for variance-covariance matrix method * tests/unit/computations/partial_correlations_test_data/pcor_rec_blackbox_test.csv: blackbox sample data and results for recursive method * tests/unit/computations/test_partial_correlations.py: Tests for new function Provide some blackbox testing sample data for checking the operation of the functions migrated from R. Frederick Muriuki Muriithi
2021-11-01Stub `determine_partials`...Issue: * Stub out `determine_partials` which is a migration of `web.webqtl.correlation.correlationFunction.determinePartialsByR` in GN1. The function in GN1 has R code from line 188 to line 344. This will need to be converted over to Python. This function will also need tests. Frederick Muriuki Muriithi
2021-11-01Implement `compute_partial_correlations_fast`...Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/partial-correlations.gmi * Implement `compute_partial_correlations_fast` that is a partial migration of `web.webqtl.correlation.PartialCorrDBPage.getPartialCorrelationsFast` in GN1. This function will probably be reworked once the dependencies are fully migrated. It also needs tests to be added. Frederick Muriuki Muriithi
2021-11-01Fix mypy issuesBonfaceKilz
2021-11-01Fix pylint issues in gn3.authenticationBonfaceKilz
2021-11-01Add auth moduleBonfaceKilz
2021-11-01Merge branch 'main' of github.com:genenetwork/genenetwork3 into partial-corre...Frederick Muriuki Muriithi
2021-11-01Retrieve indices of the selected samples...Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/partial-correlations.gmi * gn3/computations/partial_correlations.py: New function (good_dataset_samples_indexes). * tests/unit/computations/test_partial_correlations.py: Tests for new function (good_dataset_samples_indexes) Get the indices of the selected samples. This is a partial migration of the `web.webqtl.correlation.PartialCorrDBPage.getPartialCorrelationsFast` function in GN1. Frederick Muriuki Muriithi
2021-11-01Fix some linting errors...Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/partial-correlations.gmi Frederick Muriuki Muriithi
2021-11-01Parse single line from CSV file...Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/partial-correlations.gmi * gn3/data_helpers.py: New function (parse_csv_line) * tests/unit/test_data_helpers.py: Add tests for new function (parse_csv_line) Add a function to parse a single line from a CSV file. Frederick Muriuki Muriithi
2021-11-01Add some condition checking functions...Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/partial-correlations.gmi * Add the `check_for_literature_info` and `check_symbol_for_tissue_correlation` functions to check for the presence of specific data. Frederick Muriuki Muriithi
2021-10-29Feature/biweight reimplementation (#47)...* add biweight reimplementation with pingouin * delete biweight scripts and tests * add python-pingouin to guix file * delete biweight paths * mypy fix:pingouin mising imports * pep8 formatting && pylint fixesAlexander Kabui
2021-10-29Explicitly round the values...* Explicitly round the values to prevent issues with the type-checker Frederick Muriuki Muriithi
2021-10-29Specify ten (10) decimal places...Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/partial-correlations.gmi * gn3/computations/partial_correlations.py: specify 10 decimal places * tests/unit/computations/test_partial_correlations.py: update examples Slight differences in python implementations, possibly hardware and operating systems could cause the value of float (double) values to be different in the less significant parts of the decimal places. This commit limits the usable part of the decimals to the first 10 decimal places for now. Frederick Muriuki Muriithi
2021-10-29Fix linting and typing errors...Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/partial-correlations.gmi Frederick Muriuki Muriithi
2021-10-29Rework sorting: remove `compare_tissue_correlation_absolute_values`...Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/partial-correlations.gmi * gn3/db/correlations.py: Remove the `compare_tissue_correlation_absolute_values` function which is no longer needed. Frederick Muriuki Muriithi
2021-10-29Complete `build_temporary_tissue_correlations_table`...Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/partial-correlations.gmi * gn3/computations/partial_correlations.py: Remove comments after updating usage of the function at call point * gn3/db/correlations.py: Complete the implementation of the `build_temporary_tissue_correlations_table` function Frederick Muriuki Muriithi
2021-10-29Complete implementation of `batch_computed_tissue_correlation`...Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/partial-correlations.gmi * Complete the implementation of the `batch_computed_tissue_correlation` function Frederick Muriuki Muriithi
2021-10-29Move `correlations_of_all_tissue_traits`...Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/partial-correlations.gmi * gn3/computations/partial_correlations.py: new function (`correlations_of_all_tissue_traits`). * gn3/db/correlations.py: delete function (`correlations_of_all_tissue_traits`). Move the function to `gn3.computations.partial_correlations` module and comment out the db-access code. Rework it to receive, as arguments, the data it previously fetched from the database, and add comments on future rework to get the function working again. Frederick Muriuki Muriithi
2021-10-29Add missing comma...Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/partial-correlations.gmi Frederick Muriuki Muriithi