aboutsummaryrefslogtreecommitdiff
path: root/gn3/db
AgeCommit message (Expand)Author
2023-07-18Fetch metadata for a single phenotype.Frederick Muriuki Muriithi
2023-07-18Fetch single phenotype trait by `dataset_id` and `trait_name`.Frederick Muriuki Muriithi
2023-07-18Bug: Fetch group name by dataset_id...Change the code to fetch the group name by the dataset ID, since according to usage[1] of the `retrieve_group_name` function, the value passed in is the `dataset_id` and not the `group_id`. Change the name from `retrieve_group_name` to `retrieve_phenotype_group_name` to more clearly indicate that this function concerns itself with the groups that relate to phenotypes. [1](https://github.com/genenetwork/genenetwork2/blob/1bbb0430732b7fa5102d7dcbda80ebda252f5424/wqflask/wqflask/metadata_edits.py) Frederick Muriuki Muriithi
2023-07-17Fix dict key name...Remove extra colon (:) at the end of the name that was leading to the number of cases not being presented as expected. Frederick Muriuki Muriithi
2023-07-12Bug: Set the `data_exists` variable within the context manager...The `cursor.fetchone()` call that was used as the condition to the `if` was called outside of the context manager, and therefore would always give a non-truthy value at best and an inconsistent result at worst. This commit gets the value before the context manager has exited and stores it for later use. Frederick Muriuki Muriithi
2023-07-12Bug: Retrieve configs from app, not environment...Retrieve the configuration values from the application object, not from the environment. We are assured of having the configuration values set in the application - we do not have that assurance for the environment. Frederick Muriuki Muriithi
2023-06-15Fetch genotypes from virtuoso...* gn3/api/metadata.py: Import get_genotype_metadata. (genotype): New end-point. * gn3/db/rdf.py (get_phenotype_metadata): New function. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com> Munyoki Kilyungi
2023-06-12Delete unused import...Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com> Munyoki Kilyungi
2023-06-12Fetch phenotypes from virtuoso...* gn3/api/metadata.py: Import get_phenotype_metadata. (phenotype): New end-point. * gn3/db/rdf.py (get_phenotype_metadata): New function. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com> Munyoki Kilyungi
2023-06-12Delete unused get_trait_metadata function...Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com> Munyoki Kilyungi
2023-06-07Add publication end-point...* gn3/api/metadata.py: Import get_publication_metadata (publication): New endpoint. * gn3/db/rdf.py (get_dataset_metadata): New function. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com> Munyoki Kilyungi
2023-06-07Nest duplicate entries into a list from a sparql result...Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com> Munyoki Kilyungi
2023-06-06Pass geoSeries as a URL...Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com> Munyoki Kilyungi
2023-06-06Rename gn:geoPlatform -> gn:geoPlatformUrl...Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com> Munyoki Kilyungi
2023-06-06Match how dataset metadata is fetched with GN1...* gn3/db/rdf.py (sparql_query): Parse CONSTRUCTS and SELECTS differently. (strip_url): Rename to ... (get_url_local_name): ... this. (get_dataset_metadata): Fetch extra fields in RDF. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com> Munyoki Kilyungi
2023-06-06Replace taxon prefix with ncbiTaxon which references NCBI...Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com> Munyoki Kilyungi
2023-06-02Replace SELECT with CONSTRUCT when fetching a dataset's metadata...* gn3/db/rdf.py: Importh pymonad.Nothing. (get_dataset_metadata): Replace SELECT with CONSTRUCT. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com> Munyoki Kilyungi
2023-06-02Create a function for stripping the last bit from a URL...* gn3/db/rdf.py: Import unquote and urlparse. (strip_url): New function. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com> Munyoki Kilyungi
2023-05-22Use string literal concatenation to make genofile_path line shorterzsloan
2023-05-22Fix quotes when setting genofile_pathzsloan
2023-05-22Fix return typing for get_trait_sample_datazsloan
2023-05-22Change type from 'any' to 'Any'zsloan
2023-05-22Use f-string for setting genofile_path...Also set default value for os.environ.get("GENENETWORK_FILES") zsloan
2023-05-22Include encoding in open statement to address pylint W1514zsloan
2023-05-22Initialize 'line'; previous pylint complained because line might not be initi...zsloan
2023-05-22Use 'with open()' syntax...Initialize samplelist variable zsloan
2023-05-22Remove unused variable this_datazsloan
2023-05-22Include all samples in trait sample data...This is necessary in order to allow for editing the values of samples that don't currently have values zsloan
2023-05-22Fix sample data CSV query to only fetch distinct samples...There's probably a better way to fix this query (it was previously returning each sample twice), but DISTINCT was the easiest way I could come up with zsloan
2023-05-22Fix get_trait_sample_data functionzsloan
2023-05-22Fix retrieve_sample_list function to correctly get genofile_pathzsloan
2023-05-22Commit update/insert queries, since they don't seem to be executed otherwise ...zsloan
2023-05-22Add function for retrieving group name (given group ID)zsloan
2023-05-22Add function for retrieving phenotype sample data as dictzsloan
2023-05-22Add function for retrieving samplelist from .geno filezsloan
2023-04-17Create new endpoint for fetching GeneRIF entries...* gn3/api/metadata.py: Import Template, sparql_query and RDF_PREFIXES. (get_genewiki_entries): New endpoint. * gn3/db/rdf.py: Add new constant for storing rdf prefixes. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com> Munyoki Kilyungi
2023-03-20Disable fetching case-attributes when getting sample data...* gn3/db/sample_data.py: Remove 're' import. (get_trait_csv_sample_data): Remove fetching sample data. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com> Munyoki Kilyungi
2023-03-17Add conn.commit() to queries in sample_data.pyzsloan
2023-03-17Change get_all_species query to order by Familyzsloan
2023-03-01Open lmdb path in readonly mode...* gn3/db/matrix.py (get_total_versions, get_nth_matrix, get_current_matrix): Open lmdb in readonly mode. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com> Munyoki Kilyungi
2023-03-01Fetch trait metadata from RDF...* gn3/db/rdf.py (get_dataset_metadata): New function. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com> Munyoki Kilyungi
2023-02-06Get the N-th matrix given N, an index value...* gn3/db/matrix.py (get_nth_matrix): New function. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com> Munyoki Kilyungi
2023-02-06Get total number of versions that a database has...* gn3/db/matrix.py (get_total_versions): New function. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com> Munyoki Kilyungi
2023-02-06Add method to fetch the current matrix...* gn3/db/matrix.py: New file. Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com> Munyoki Kilyungi
2022-12-21gn3: (gn3.random -> gn3.chancy): Rename module to avoid conflicts....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 Frederick Muriuki Muriithi
2022-12-08Remove unused importFrederick Muriuki Muriithi
2022-12-06Use a dataset's name to fetch it's metadata from RDF...* gn3/api/metadata.py (jsonify_dataset_metadata): Rewrite metadata end-point to use a dataset's name instead of it's accession_id. * gn3/db/rdf.py (get_dataset_metadata): Replace accession_id with name. Use one single RDF query instead of multiple queries. Munyoki Kilyungi
2022-11-16Inject SPARQLWrapper as a parameter...* gn3/db/rdf.py: Delete gn3.setting.SPARQL_ENDPOINT import. (sparql_query): Inject SPARQLWrapper. (get_dataset_metadata): Ditto. Munyoki Kilyungi
2022-11-02Re-implement RDF related code to use monads in its own module...* gn3/api/general.py: Replace gn3.db.datasets import with gn3.db.rdf. (dataset_metadata) <jsonify>: Replace datasets.dataset_metadata with rdf.get_dataset_metadata. * gn3/db/datasets.py: Remove unused imports. (sparql_query, dataset_metadata): Delete. * gn3/db/rdf.py: (sparql_query, get_dataset_metadata): New functions. Munyoki Kilyungi
2022-11-02Fix pylint and mypy errors...* gn3/db/sample_data.py (get_trait_csv_sample_data): Pass __query directly to cursor.execute. Rename value to _value in for loop to make mypy pass. * gn3/db_utils.py (Connection): Add class docstring. (Connection.cursor): Add docstring. * mypy.ini: Add an entry for xapian. Munyoki Kilyungi