From 6d2ff0251158b2afc965b6b32f642692f56260bc Mon Sep 17 00:00:00 2001 From: vecerkovakaterina Date: Tue, 22 Oct 2024 10:38:24 +0200 Subject: [PATCH 1/5] enable querying multiple genes at once for _bgee_expression --- gget/gget_bgee.py | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/gget/gget_bgee.py b/gget/gget_bgee.py index 4a9c9f8f..4229ee56 100644 --- a/gget/gget_bgee.py +++ b/gget/gget_bgee.py @@ -100,35 +100,47 @@ def _bgee_orthologs(gene_id, json=False, verbose=True): return df -def _bgee_expression(gene_id, json=False, verbose=True): +def _bgee_expression(gene_ids, json=False, verbose=True): """ Get expression data from Bgee Args: - :param gene_id: Ensembl gene ID + :param gene_ids: Ensembl gene ID(s) :param json: return JSON instead of DataFrame :param verbose: log progress Returns requested information as a DataFrame or JSON """ - # must first obtain species - species = _bgee_species(gene_id, verbose=verbose) + # if single Ensembl ID passed as string, convert to list + if isinstance(gene_ids, str): + gene_ids = [gene_ids] + + # make sure all gene IDs correspond to the same species + species_set = {_bgee_species(gene_id, verbose=verbose) for gene_id in gene_ids} + print(species_set) + + if len(species_set) != 1: + raise RuntimeError("All gene_ids must be from a single species.") + + # get the single species from the set + species = species_set.pop() if verbose: - logger.info(f"Getting expression data for gene {gene_id} from Bgee") + logger.info(f"Getting expression data for gene {', '.join(gene_ids)} from Bgee") # then obtain expression data response = requests.get( "https://bgee.org/api/", params={ "display_type": "json", - "page": "gene", - "action": "expression", - "gene_id": gene_id, + "page": "data", + "action": "expr_calls", + "gene_id": gene_ids, "species_id": species, "cond_param": ["anat_entity", "cell_type"], "data_type": "all", + "get_results": "true", }, ) @@ -138,7 +150,7 @@ def _bgee_expression(gene_id, json=False, verbose=True): "Please double-check the arguments and try again.\n" ) - expression_data = response.json()["data"]["calls"] + expression_data = response.json()["data"]["expressionData"]["expressionCalls"] df = json_list_to_df( expression_data, @@ -182,3 +194,9 @@ def bgee( return _bgee_orthologs(gene_id, json=json, verbose=verbose) else: raise ValueError(f"Unknown type: {type}") + + +# Test code +if __name__ == "__main__": + result = _bgee_expression(["ENSBTAG00000047356"]) + print(result) From ede596ae00a01ed719e337f0ce21ab07b220ef42 Mon Sep 17 00:00:00 2001 From: vecerkovakaterina Date: Tue, 22 Oct 2024 10:38:50 +0200 Subject: [PATCH 2/5] Update query result --- tests/fixtures/test_bgee.json | 778 ++++++++++++++++++++++++++++------ 1 file changed, 648 insertions(+), 130 deletions(-) diff --git a/tests/fixtures/test_bgee.json b/tests/fixtures/test_bgee.json index 4e4ab266..0207a180 100644 --- a/tests/fixtures/test_bgee.json +++ b/tests/fixtures/test_bgee.json @@ -7,186 +7,704 @@ }, "expected_result": [ [ - "UBERON:0001968", - "semen", - 97.46, - "high", - "expressed" + "UBERON:0001017", + "central nervous system", + 18.13, + "high", + "not_expressed" ], [ - "UBERON:0001954", - "Ammon's horn", - 53.61, - "high", - "expressed" + "UBERON:0002616", + "regional part of brain", + 15.85, + "high", + "not_expressed" ], [ - "UBERON:0001801", - "anterior segment of eyeball", - 51.28, - "high", - "expressed" + "BGEE:0000000", + "anatomical entity and cellular component", + 19.69, + "high", + "expressed" ], [ - "UBERON:0002367", - "prostate gland", - 49.46, - "high", - "expressed" + "UBERON:0002530", + "gland", + 18.02, + "high", + "not_expressed" ], [ - "UBERON:0007358", - "abomasum", - 45.43, - "high", - "expressed" + "UBERON:0013702", + "body proper", + 24.62, + "high", + "expressed" ], [ - "UBERON:0000947", - "aorta", - 45.09, - "high", - "expressed" + "UBERON:0009854", + "digestive tract diverticulum", + 19.94, + "high", + "not_expressed" ], [ - "UBERON:0001225", - "cortex of kidney", - 43.64, - "high", - "expressed" + "UBERON:0002416", + "integumental system", + 25.87, + "high", + "expressed" ], [ - "UBERON:0010533", - "metanephros cortex", - 43.51, - "high", - "expressed" + "UBERON:0000992", + "ovary", + 20.93, + "high", + "not_expressed" ], [ - "UBERON:0002000", - "gluteal muscle", - 41.91, - "high", - "expressed" + "UBERON:0000014", + "zone of skin", + 17.95, + "high", + "not_expressed" ], [ - "UBERON:0001891", - "midbrain", - 35.41, - "high", - "expressed" + "UBERON:0000072", + "proximo-distal subdivision of respiratory tract", + 26.62, + "high", + "expressed" ], [ - "CL:0000711", - "cumulus cell", - 32.33, - "high", - "expressed" + "UBERON:0001013", + "adipose tissue", + 15.98, + "high", + "not_expressed" ], [ - "UBERON:0001158", - "descending colon", - 28.93, - "high", - "expressed" + "UBERON:0000459", + "uterine wall", + 17.43, + "high", + "not_expressed" ], [ - "UBERON:0001870", - "frontal cortex", - 28.83, - "high", - "expressed" + "UBERON:0000483", + "epithelium", + 25.32, + "high", + "not_expressed" ], [ - "UBERON:0002107", - "liver", - 27.93, - "high", - "expressed" + "UBERON:0001276", + "epithelium of stomach", + 25.22, + "high", + "expressed" ], [ - "CL:0000576", - "monocyte", - 27.18, - "high", - "expressed" + "UBERON:0000383", + "musculature of body", + 21.31, + "high", + "not_expressed" ], [ - "UBERON:0001111", - "intercostal muscle", - 26.73, - "high", - "expressed" + "UBERON:0003833", + "abdominal segment muscle", + 25.74, + "high", + "not_expressed" ], [ - "UBERON:0000569", - "ileocecal valve", - 24.96, - "high", - "expressed" + "UBERON:0002190", + "subcutaneous adipose tissue", + 18.88, + "high", + "not_expressed" ], [ - "UBERON:0001134", - "skeletal muscle tissue", - 22.99, - "high", - "expressed" + "UBERON:0000061", + "anatomical structure", + 18.62, + "high", + "not_expressed" ], [ - "UBERON:0007365", - "rumen", - 22.88, - "high", - "expressed" + "UBERON:0003984", + "uterine tube infundibulum", + 21.64, + "high", + "not_expressed" ], [ - "UBERON:0002114", - "duodenum", - 22.34, - "high", - "expressed" + "UBERON:0003296", + "gland of diencephalon", + 15.85, + "high", + "not_expressed" ], [ - "UBERON:0010239", - "spiral colon", - 22.25, - "high", - "expressed" + "CL:0000988", + "hematopoietic cell", + 34.82, + "high", + "expressed" ], [ - "UBERON:0001911", - "mammary gland", - 22.19, - "high", - "expressed" + "UBERON:0002107", + "liver", + 24.48, + "high", + "not_expressed" ], [ - "UBERON:0002048", - "lung", - 21.36, - "high", - "expressed" + "UBERON:0013768", + "great vessel of heart", + 45.06, + "high", + "expressed" ], [ - "UBERON:0000459", - "uterine wall", - 21.27, - "high", - "expressed" + "UBERON:0000992", + "ovary", + 15.25, + "high", + "not_expressed" ], [ - "UBERON:0001295", - "endometrium", - 21.26, - "high", - "expressed" + "UBERON:0000467", + "anatomical system", + 20.96, + "high", + "not_expressed" ], [ - "UBERON:0002115", - "jejunum", - 20.7, - "high", - "expressed" + "UBERON:0000970", + "eye", + 42.01, + "high", + "expressed" + ], + [ + "UBERON:0010890", + "pelvic complex muscle", + 23.49, + "high", + "not_expressed" + ], + [ + "UBERON:0002416", + "integumental system", + 16.36, + "high", + "not_expressed" + ], + [ + "UBERON:0000468", + "multicellular organism", + 27.94, + "high", + "not_expressed" + ], + [ + "UBERON:0001378", + "rectus femoris", + 23.84, + "high", + "not_expressed" + ], + [ + "UBERON:0001890", + "forebrain", + 18.13, + "high", + "not_expressed" + ], + [ + "UBERON:0001375", + "semitendinosus", + 22.34, + "high", + "not_expressed" + ], + [ + "UBERON:0001801", + "anterior segment of eyeball", + 51.28, + "high", + "expressed" + ], + [ + "UBERON:0000165", + "mouth", + 25.6, + "high", + "not_expressed" + ], + [ + "UBERON:0002616", + "regional part of brain", + 14.41, + "high", + "not_expressed" + ], + [ + "UBERON:0003309", + "floor plate of diencephalon", + 19.35, + "high", + "not_expressed" + ], + [ + "UBERON:0004572", + "arterial system", + 45.06, + "high", + "expressed" + ], + [ + "UBERON:0003133", + "reproductive organ", + 17.59, + "high", + "not_expressed" + ], + [ + "UBERON:0000916", + "abdomen", + 18.59, + "high", + "not_expressed" + ], + [ + "UBERON:0000467", + "anatomical system", + 23.37, + "high", + "expressed" + ], + [ + "UBERON:0000029", + "lymph node", + 25.04, + "high", + "not_expressed" + ], + [ + "UBERON:0001739", + "laryngeal cartilage", + 21.89, + "high", + "not_expressed" + ], + [ + "UBERON:0000990", + "reproductive system", + 21.24, + "low", + "expressed" + ], + [ + "UBERON:0000483", + "epithelium", + 21.38, + "high", + "not_expressed" + ], + [ + "UBERON:0002199", + "integument", + 18.17, + "high", + "not_expressed" + ], + [ + "UBERON:0000468", + "multicellular organism", + 26.59, + "high", + "not_expressed" + ], + [ + "UBERON:0001199", + "mucosa of stomach", + 24.51, + "high", + "not_expressed" + ], + [ + "UBERON:0007625", + "pigment epithelium of eye", + 33.9, + "high", + "not_expressed" + ], + [ + "UBERON:0001630", + "muscle organ", + 17.52, + "high", + "not_expressed" + ], + [ + "UBERON:0002416", + "integumental system", + 17.95, + "high", + "not_expressed" + ], + [ + "UBERON:0002020", + "gray matter", + 17.97, + "high", + "not_expressed" + ], + [ + "CL:0000766", + "myeloid leukocyte", + 27.18, + "high", + "expressed" + ], + [ + "UBERON:0000072", + "proximo-distal subdivision of respiratory tract", + 16.94, + "high", + "not_expressed" + ], + [ + "CL:0002320", + "connective tissue cell", + 23.9, + "high", + "not_expressed" + ], + [ + "UBERON:0010153", + "rumen papilla", + 26.03, + "high", + "not_expressed" + ], + [ + "UBERON:0000915", + "thoracic segment of trunk", + 18.89, + "high", + "not_expressed" + ], + [ + "UBERON:0001295", + "endometrium", + 24.72, + "high", + "expressed" + ], + [ + "UBERON:0001062", + "anatomical entity", + 21.14, + "high", + "not_expressed" + ], + [ + "UBERON:0000465", + "material anatomical entity", + 23.29, + "high", + "expressed" + ], + [ + "UBERON:0001460", + "arm", + 26.68, + "high", + "not_expressed" + ], + [ + "UBERON:0000465", + "material anatomical entity", + 15.83, + "high", + "not_expressed" + ], + [ + "UBERON:0002462", + "erector spinae muscle group", + 22.15, + "high", + "not_expressed" + ], + [ + "UBERON:0005281", + "ventricular system of central nervous system", + 32.47, + "high", + "not_expressed" + ], + [ + "UBERON:0002416", + "integumental system", + 19.06, + "low", + "expressed" + ], + [ + "UBERON:0000465", + "material anatomical entity", + 21.86, + "high", + "expressed" + ], + [ + "UBERON:0001017", + "central nervous system", + 20.99, + "high", + "not_expressed" + ], + [ + "UBERON:0001911", + "mammary gland", + 22.31, + "high", + "expressed" + ], + [ + "UBERON:0004121", + "ectoderm-derived structure", + 32.29, + "high", + "expressed" + ], + [ + "UBERON:0000383", + "musculature of body", + 19.25, + "high", + "not_expressed" + ], + [ + "UBERON:0000978", + "leg", + 23.44, + "high", + "not_expressed" + ], + [ + "UBERON:0010314", + "structure with developmental contribution from neural crest", + 18.13, + "high", + "not_expressed" + ], + [ + "UBERON:0000995", + "uterus", + 18.89, + "high", + "not_expressed" + ], + [ + "UBERON:0001295", + "endometrium", + 21.85, + "high", + "expressed" + ], + [ + "UBERON:0003929", + "digestive tract epithelium", + 27.9, + "high", + "not_expressed" + ], + [ + "UBERON:0003101", + "male organism", + 21.24, + "low", + "expressed" + ], + [ + "UBERON:0001911", + "mammary gland", + 22.31, + "high", + "expressed" + ], + [ + "UBERON:0007271", + "appendage musculature", + 25.17, + "high", + "not_expressed" + ], + [ + "UBERON:0001016", + "nervous system", + 14.41, + "high", + "not_expressed" + ], + [ + "UBERON:0000467", + "anatomical system", + 20.39, + "high", + "not_expressed" + ], + [ + "UBERON:0018254", + "skeletal musculature", + 17.95, + "high", + "not_expressed" + ], + [ + "UBERON:0007367", + "surface of tongue", + 25.09, + "high", + "not_expressed" + ], + [ + "UBERON:0007362", + "omasum", + 21.54, + "high", + "not_expressed" + ], + [ + "UBERON:0001801", + "anterior segment of eyeball", + 51.28, + "high", + "expressed" + ], + [ + "UBERON:0003101", + "male organism", + 21.24, + "low", + "expressed" + ], + [ + "UBERON:0000392", + "longissimus muscle", + 33.04, + "high", + "not_expressed" + ], + [ + "CL:0011115", + "precursor cell", + 27.18, + "high", + "expressed" + ], + [ + "UBERON:0000992", + "ovary", + 26.21, + "high", + "not_expressed" + ], + [ + "UBERON:0002075", + "viscus", + 18.7, + "high", + "not_expressed" + ], + [ + "UBERON:0000033", + "head", + 30.13, + "high", + "expressed" + ], + [ + "BGEE:0000000", + "anatomical entity and cellular component", + 15.83, + "high", + "not_expressed" + ], + [ + "UBERON:0000483", + "epithelium", + 31.33, + "high", + "not_expressed" + ], + [ + "UBERON:0003897", + "axial muscle", + 33.04, + "high", + "not_expressed" + ], + [ + "UBERON:0001015", + "musculature", + 23.21, + "low", + "expressed" + ], + [ + "UBERON:0002190", + "subcutaneous adipose tissue", + 18.88, + "high", + "not_expressed" + ], + [ + "UBERON:0000995", + "uterus", + 21.08, + "high", + "expressed" + ], + [ + "UBERON:0000203", + "pallium", + 25.67, + "high", + "expressed" + ], + [ + "UBERON:0002365", + "exocrine gland", + 20.99, + "high", + "not_expressed" + ], + [ + "CL:0002174", + "follicular cell of ovary", + 27.08, + "high", + "not_expressed" + ], + [ + "UBERON:0000081", + "metanephros", + 43.51, + "high", + "expressed" + ], + [ + "UBERON:0000019", + "camera-type eye", + 51.28, + "high", + "expressed" ] ] }, From 87e82f4dfd63ad874e75b4b6f78529b82da02150 Mon Sep 17 00:00:00 2001 From: vecerkovakaterina Date: Tue, 22 Oct 2024 11:17:00 +0200 Subject: [PATCH 3/5] Update documentation --- docs/src/en/bgee.md | 4 ++-- docs/src/es/bgee.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/src/en/bgee.md b/docs/src/en/bgee.md index 1c3e942e..752cc971 100644 --- a/docs/src/en/bgee.md +++ b/docs/src/en/bgee.md @@ -9,8 +9,8 @@ Return format: JSON/CSV (command-line) or data frame (Python). This module was written by [Sam Wagenaar](https://github.com/techno-sam). **Positional argument** -`ens_id` -Ensembl gene ID, e.g. ENSG00000169194 or ENSSSCG00000014725. +`ens_ids` +One or more Ensembl gene IDs, e.g. ENSG00000169194 or ENSSSCG00000014725. NOTE: Some of the species in [Bgee](https://www.bgee.org/) are not in Ensembl or Ensembl metazoa, and for those you can use NCBI gene IDs, e.g. 118215821 (a gene in _Anguilla anguilla_). diff --git a/docs/src/es/bgee.md b/docs/src/es/bgee.md index 73793ae0..bc6fcbad 100644 --- a/docs/src/es/bgee.md +++ b/docs/src/es/bgee.md @@ -11,7 +11,7 @@ Este módulo fue escrito por [Sam Wagenaar](https://github.com/techno-sam). **Argumento posicional** `ens_id` -ID de gen Ensembl, por ejemplo, ENSG00000169194 o ENSSSCG00000014725. +Uno o varios ID de gen Ensembl, por ejemplo, ENSG00000169194 o ENSSSCG00000014725. NOTA: Algunas de las especies en [Bgee](https://www.bgee.org/) no están en Ensembl, y para ellas puede utilizar los ID de genes del NCBI, p. 118215821 (un gen en _Anguilla anguilla_). From d1aa4affb458aba50c1decc1810e6f6bc48eee32 Mon Sep 17 00:00:00 2001 From: vecerkovakaterina Date: Tue, 22 Oct 2024 11:17:19 +0200 Subject: [PATCH 4/5] Add test for querying multiple gene_ids at once --- tests/fixtures/test_bgee.json | 709 ++++++++++++++++++++++++++++++++++ 1 file changed, 709 insertions(+) diff --git a/tests/fixtures/test_bgee.json b/tests/fixtures/test_bgee.json index 0207a180..3f613a43 100644 --- a/tests/fixtures/test_bgee.json +++ b/tests/fixtures/test_bgee.json @@ -1216,5 +1216,714 @@ "gene_id": "ENSBTAG00000047356" }, "expected_result": "ValueError" + }, + "test_bgee_expression_multiple": { + "type": "assert_equal", + "args": { + "type": "expression", + "gene_id": ["ENSBTAG00000047356", "ENSBTAG00000018317"] + }, + "expected_result": [ + [ + "UBERON:0001017", + "central nervous system", + 92.15, + "high", + "expressed" + ], + [ + "UBERON:0002616", + "regional part of brain", + 79.01, + "high", + "expressed" + ], + [ + "BGEE:0000000", + "anatomical entity and cellular component", + 89.12, + "high", + "expressed" + ], + [ + "UBERON:0002530", + "gland", + 78.42, + "high", + "expressed" + ], + [ + "UBERON:0013702", + "body proper", + 90.53, + "high", + "expressed" + ], + [ + "UBERON:0009854", + "digestive tract diverticulum", + 90.42, + "high", + "expressed" + ], + [ + "UBERON:0002416", + "integumental system", + 89.76, + "high", + "expressed" + ], + [ + "UBERON:0000992", + "ovary", + 93.84, + "high", + "expressed" + ], + [ + "UBERON:0000014", + "zone of skin", + 93.04, + "high", + "expressed" + ], + [ + "UBERON:0000072", + "proximo-distal subdivision of respiratory tract", + 89.26, + "high", + "expressed" + ], + [ + "UBERON:0001013", + "adipose tissue", + 87.24, + "high", + "expressed" + ], + [ + "UBERON:0000459", + "uterine wall", + 91.88, + "high", + "expressed" + ], + [ + "UBERON:0000483", + "epithelium", + 92.96, + "high", + "expressed" + ], + [ + "UBERON:0001276", + "epithelium of stomach", + 93.28, + "high", + "expressed" + ], + [ + "UBERON:0000383", + "musculature of body", + 93.12, + "high", + "expressed" + ], + [ + "UBERON:0003833", + "abdominal segment muscle", + 94.77, + "high", + "expressed" + ], + [ + "UBERON:0002190", + "subcutaneous adipose tissue", + 88.51, + "high", + "expressed" + ], + [ + "UBERON:0000061", + "anatomical structure", + 92.6, + "high", + "expressed" + ], + [ + "UBERON:0003984", + "uterine tube infundibulum", + 91.54, + "high", + "expressed" + ], + [ + "UBERON:0003296", + "gland of diencephalon", + 79.01, + "high", + "expressed" + ], + [ + "CL:0000988", + "hematopoietic cell", + 87.97, + "high", + "expressed" + ], + [ + "UBERON:0002107", + "liver", + 87.39, + "high", + "expressed" + ], + [ + "UBERON:0013768", + "great vessel of heart", + 89.29, + "high", + "expressed" + ], + [ + "UBERON:0000992", + "ovary", + 93.74, + "high", + "expressed" + ], + [ + "UBERON:0000467", + "anatomical system", + 89.14, + "high", + "expressed" + ], + [ + "UBERON:0000970", + "eye", + 89.23, + "high", + "expressed" + ], + [ + "UBERON:0010890", + "pelvic complex muscle", + 92.81, + "high", + "expressed" + ], + [ + "UBERON:0002416", + "integumental system", + 86.66, + "high", + "expressed" + ], + [ + "UBERON:0000468", + "multicellular organism", + 90.38, + "high", + "expressed" + ], + [ + "UBERON:0001378", + "rectus femoris", + 94.84, + "high", + "expressed" + ], + [ + "UBERON:0001890", + "forebrain", + 92.15, + "high", + "expressed" + ], + [ + "UBERON:0001375", + "semitendinosus", + 92.71, + "high", + "expressed" + ], + [ + "UBERON:0001801", + "anterior segment of eyeball", + 88.9, + "high", + "expressed" + ], + [ + "UBERON:0000165", + "mouth", + 92.88, + "high", + "expressed" + ], + [ + "UBERON:0002616", + "regional part of brain", + 92.58, + "high", + "expressed" + ], + [ + "UBERON:0003309", + "floor plate of diencephalon", + 93.87, + "high", + "expressed" + ], + [ + "UBERON:0004572", + "arterial system", + 89.29, + "high", + "expressed" + ], + [ + "UBERON:0003133", + "reproductive organ", + 91.76, + "high", + "expressed" + ], + [ + "UBERON:0000916", + "abdomen", + 91.21, + "high", + "expressed" + ], + [ + "UBERON:0000467", + "anatomical system", + 90.65, + "high", + "expressed" + ], + [ + "UBERON:0000029", + "lymph node", + 91.03, + "high", + "expressed" + ], + [ + "UBERON:0001739", + "laryngeal cartilage", + 89.87, + "high", + "expressed" + ], + [ + "UBERON:0000990", + "reproductive system", + 90.7, + "high", + "expressed" + ], + [ + "UBERON:0000483", + "epithelium", + 94.15, + "high", + "expressed" + ], + [ + "UBERON:0002199", + "integument", + 90.78, + "high", + "expressed" + ], + [ + "UBERON:0000468", + "multicellular organism", + 86.65, + "high", + "expressed" + ], + [ + "UBERON:0001199", + "mucosa of stomach", + 94.57, + "high", + "expressed" + ], + [ + "UBERON:0007625", + "pigment epithelium of eye", + 89.52, + "high", + "expressed" + ], + [ + "UBERON:0001630", + "muscle organ", + 94.4, + "high", + "expressed" + ], + [ + "UBERON:0002416", + "integumental system", + 93.04, + "high", + "expressed" + ], + [ + "UBERON:0002020", + "gray matter", + 94.52, + "high", + "expressed" + ], + [ + "CL:0000766", + "myeloid leukocyte", + 90.77, + "high", + "expressed" + ], + [ + "UBERON:0000072", + "proximo-distal subdivision of respiratory tract", + 91.6, + "high", + "expressed" + ], + [ + "CL:0002320", + "connective tissue cell", + 91.04, + "high", + "expressed" + ], + [ + "UBERON:0010153", + "rumen papilla", + 95.38, + "high", + "expressed" + ], + [ + "UBERON:0000915", + "thoracic segment of trunk", + 92.4, + "high", + "expressed" + ], + [ + "UBERON:0001295", + "endometrium", + 92.48, + "high", + "expressed" + ], + [ + "UBERON:0001062", + "anatomical entity", + 91.2, + "high", + "expressed" + ], + [ + "UBERON:0000465", + "material anatomical entity", + 90.66, + "high", + "expressed" + ], + [ + "UBERON:0001460", + "arm", + 94.97, + "high", + "expressed" + ], + [ + "UBERON:0000465", + "material anatomical entity", + 87.12, + "high", + "expressed" + ], + [ + "UBERON:0002462", + "erector spinae muscle group", + 93.35, + "high", + "expressed" + ], + [ + "UBERON:0005281", + "ventricular system of central nervous system", + 93.9, + "high", + "expressed" + ], + [ + "UBERON:0002416", + "integumental system", + 89.57, + "high", + "expressed" + ], + [ + "UBERON:0000465", + "material anatomical entity", + 90.97, + "high", + "expressed" + ], + [ + "UBERON:0001017", + "central nervous system", + 92.23, + "high", + "expressed" + ], + [ + "UBERON:0001911", + "mammary gland", + 91.16, + "high", + "expressed" + ], + [ + "UBERON:0004121", + "ectoderm-derived structure", + 90.99, + "high", + "expressed" + ], + [ + "UBERON:0000383", + "musculature of body", + 94.64, + "high", + "expressed" + ], + [ + "UBERON:0000978", + "leg", + 92.73, + "high", + "expressed" + ], + [ + "UBERON:0010314", + "structure with developmental contribution from neural crest", + 92.15, + "high", + "expressed" + ], + [ + "UBERON:0000995", + "uterus", + 95.6, + "high", + "expressed" + ], + [ + "UBERON:0001295", + "endometrium", + 93.72, + "high", + "expressed" + ], + [ + "UBERON:0003929", + "digestive tract epithelium", + 94.13, + "high", + "expressed" + ], + [ + "UBERON:0003101", + "male organism", + 90.7, + "high", + "expressed" + ], + [ + "UBERON:0001911", + "mammary gland", + 91.16, + "high", + "expressed" + ], + [ + "UBERON:0007271", + "appendage musculature", + 93.99, + "high", + "expressed" + ], + [ + "UBERON:0001016", + "nervous system", + 92.58, + "high", + "expressed" + ], + [ + "UBERON:0000467", + "anatomical system", + 90.72, + "high", + "expressed" + ], + [ + "UBERON:0018254", + "skeletal musculature", + 94.21, + "high", + "expressed" + ], + [ + "UBERON:0007367", + "surface of tongue", + 95.15, + "high", + "expressed" + ], + [ + "UBERON:0007362", + "omasum", + 92.49, + "high", + "expressed" + ], + [ + "UBERON:0001801", + "anterior segment of eyeball", + 88.9, + "high", + "expressed" + ], + [ + "UBERON:0003101", + "male organism", + 90.7, + "high", + "expressed" + ], + [ + "UBERON:0000392", + "longissimus muscle", + 87.36, + "high", + "expressed" + ], + [ + "CL:0011115", + "precursor cell", + 90.77, + "high", + "expressed" + ], + [ + "UBERON:0000992", + "ovary", + 91.62, + "high", + "expressed" + ], + [ + "UBERON:0002075", + "viscus", + 90.47, + "high", + "expressed" + ], + [ + "UBERON:0000033", + "head", + 91.49, + "high", + "expressed" + ], + [ + "BGEE:0000000", + "anatomical entity and cellular component", + 87.12, + "high", + "expressed" + ], + [ + "UBERON:0000483", + "epithelium", + 91.49, + "high", + "expressed" + ], + [ + "UBERON:0003897", + "axial muscle", + 87.36, + "high", + "expressed" + ], + [ + "UBERON:0001015", + "musculature", + 92.66, + "high", + "expressed" + ], + [ + "UBERON:0002190", + "subcutaneous adipose tissue", + 88.51, + "high", + "expressed" + ], + [ + "UBERON:0000995", + "uterus", + 93.29, + "high", + "expressed" + ], + [ + "UBERON:0000203", + "pallium", + 91.81, + "high", + "expressed" + ], + [ + "UBERON:0002365", + "exocrine gland", + 86.67, + "high", + "expressed" + ], + [ + "CL:0002174", + "follicular cell of ovary", + 91.39, + "high", + "expressed" + ], + [ + "UBERON:0000081", + "metanephros", + 87.11, + "high", + "expressed" + ], + [ + "UBERON:0000019", + "camera-type eye", + 88.9, + "high", + "expressed" + ] + ] } } \ No newline at end of file From a9c915cd2bb0ab989f0101afc5b55b6e0675821b Mon Sep 17 00:00:00 2001 From: vecerkovakaterina Date: Tue, 22 Oct 2024 11:18:22 +0200 Subject: [PATCH 5/5] Format file --- gget/gget_bgee.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/gget/gget_bgee.py b/gget/gget_bgee.py index 4229ee56..90b4cf2b 100644 --- a/gget/gget_bgee.py +++ b/gget/gget_bgee.py @@ -162,6 +162,7 @@ def _bgee_expression(gene_ids, json=False, verbose=True): ("expression_state", "expressionState"), ], ) + df["score"] = df["score"].astype(float) if json: @@ -194,9 +195,3 @@ def bgee( return _bgee_orthologs(gene_id, json=json, verbose=verbose) else: raise ValueError(f"Unknown type: {type}") - - -# Test code -if __name__ == "__main__": - result = _bgee_expression(["ENSBTAG00000047356"]) - print(result)