From 59869177b3c465f94144efc4540339384eb736d1 Mon Sep 17 00:00:00 2001
From: "Laura Luebbert, Ph.D."
<56094636+lauraluebbert@users.noreply.github.com>
Date: Wed, 25 Sep 2024 02:01:32 +0200
Subject: [PATCH 1/7] Change keywords format
---
gget/gget_cbio.py | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/gget/gget_cbio.py b/gget/gget_cbio.py
index 4adfaddd..d500190e 100644
--- a/gget/gget_cbio.py
+++ b/gget/gget_cbio.py
@@ -289,13 +289,12 @@ def _extract_study_name(name: str) -> str:
return name
-def cbio_search(*key_words: str):
+def cbio_search(key_words):
"""
Find cBioPortal study IDs by keyword.
Args:
-
- :param key_words: list of keywords to search for
+ key_words list of keywords to search for
Return:
@@ -315,6 +314,9 @@ def cbio_search(*key_words: str):
)
return []
+ if isinstance(key_words, str):
+ key_words = [key_words]
+
api = SwaggerClient.from_url(
"https://www.cbioportal.org/api/v2/api-docs",
config={
From fdecf5a25f711d43f34c9c6c88ac7c2673283c45 Mon Sep 17 00:00:00 2001
From: "Laura Luebbert, Ph.D."
<56094636+lauraluebbert@users.noreply.github.com>
Date: Wed, 25 Sep 2024 02:05:22 +0200
Subject: [PATCH 2/7] Update main.py
---
gget/main.py | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/gget/main.py b/gget/main.py
index 0d82f41c..19c13d9f 100644
--- a/gget/main.py
+++ b/gget/main.py
@@ -58,7 +58,10 @@ def _get_help_string(self, action):
help_str += " (default: %(default)s)"
return help_str
-
+def convert_to_list(*args):
+ args_list = list(args)
+ return args_list
+
def int_or_str(value):
try:
return int(value)
@@ -3314,7 +3317,7 @@ def main():
## cbio return
if args.command == "cbio":
if args.subcommand == "search":
- cbio_results = cbio_search(*args.keywords)
+ cbio_results = cbio_search(convert_to_list(*args.keywords))
print(json.dumps(cbio_results, ensure_ascii=False, indent=4))
elif args.subcommand == "plot":
cbio_plot(
From ca9bf65cd5374be9f01cddaa370c1d57420cfe0f Mon Sep 17 00:00:00 2001
From: "Laura Luebbert, Ph.D."
<56094636+lauraluebbert@users.noreply.github.com>
Date: Wed, 25 Sep 2024 02:06:52 +0200
Subject: [PATCH 3/7] Update cbio.md
---
docs/src/en/cbio.md | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/docs/src/en/cbio.md b/docs/src/en/cbio.md
index d663548f..84ffd01e 100644
--- a/docs/src/en/cbio.md
+++ b/docs/src/en/cbio.md
@@ -13,7 +13,8 @@ Return format: JSON (command-line) or string list (Python).
**Positional argument**
`keywords`
-Space-separated list of keywords to search for, e.g. breast lung
.
+Space-separated list of keywords to search for, e.g. breast lung
.
+Python: Pass keywords as a list of strings.
### `plot` subcommand (Python: `gget.cbio_plot`)
Plot cancer genomics heatmaps using data from cBioPortal.
@@ -89,7 +90,7 @@ gget cbio search esophag ovary ovarian
```python
# Python
import gget
-gget.cbio_search('esophag', 'ovary', 'ovarian')
+gget.cbio_search(['esophag', 'ovary', 'ovarian'])
```
→ Returns a list of studies with cancer types matching the keywords `esophag`, `ovary`, or `ovarian`.
From d8ca77d1c643b547aee3a87de9254a005833324f Mon Sep 17 00:00:00 2001
From: "Laura Luebbert, Ph.D."
<56094636+lauraluebbert@users.noreply.github.com>
Date: Wed, 25 Sep 2024 02:07:49 +0200
Subject: [PATCH 4/7] Update SUMMARY.md
---
docs/src/SUMMARY.md | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/docs/src/SUMMARY.md b/docs/src/SUMMARY.md
index ef091474..485ae350 100644
--- a/docs/src/SUMMARY.md
+++ b/docs/src/SUMMARY.md
@@ -9,9 +9,11 @@
# Manual
* [gget alphafold](en/alphafold.md)
-* [gget archs4](en/archs4.md)
+* [gget archs4](en/archs4.md)
+* [gget bgee](en/bgee.md)
* [gget blast](en/blast.md)
-* [gget blat](en/blat.md)
+* [gget blat](en/blat.md)
+* [gget cbio](en/cbio.md)
* [gget cellxgene](en/cellxgene.md)
* [gget cosmic](en/cosmic.md)
* [gget diamond](en/diamond.md)
@@ -20,15 +22,13 @@
* [gget gpt](en/gpt.md)
* [gget info](en/info.md)
* [gget muscle](en/muscle.md)
-* [gget mutate](en/mutate.md)
+* [gget mutate](en/mutate.md)
+* [gget opentargets](en/opentargets.md)
* [gget pdb](en/pdb.md)
* [gget ref](en/ref.md)
* [gget search](en/search.md)
* [gget setup](en/setup.md)
-* [gget seq](en/seq.md)
-* [gget opentargets](en/opentargets.md)
-* [gget cbio](en/cbio.md)
-* [gget bgee](en/bgee.md)
+* [gget seq](en/seq.md)
---
From 61dd4fb3620d961057c1ed48b30f186afbc2c48a Mon Sep 17 00:00:00 2001
From: "Laura Luebbert, Ph.D."
<56094636+lauraluebbert@users.noreply.github.com>
Date: Wed, 25 Sep 2024 02:14:38 +0200
Subject: [PATCH 5/7] Update test_cbio_search.json
---
tests/fixtures/test_cbio_search.json | 29 +++++++++++++++-------------
1 file changed, 16 insertions(+), 13 deletions(-)
diff --git a/tests/fixtures/test_cbio_search.json b/tests/fixtures/test_cbio_search.json
index 119f56ba..64c4b7a9 100644
--- a/tests/fixtures/test_cbio_search.json
+++ b/tests/fixtures/test_cbio_search.json
@@ -7,26 +7,29 @@
"ovarian"
],
"expected_result": [
+ "egc_tmucih_2015",
"egc_msk_2017",
- "egc_msk_2023",
- "egc_msk_tp53_ccr_2022",
"egc_mskcc_2020",
- "egc_tmucih_2015",
- "egc_trap_ccr_msk_2023",
- "egc_trap_msk_2020",
+ "egc_msk_tp53_ccr_2022",
+ "escc_ucla_2014",
"esca_broad",
- "esca_tcga",
- "esca_tcga_pan_can_atlas_2018",
"escc_icgc",
- "escc_ucla_2014",
+ "egc_trap_msk_2020",
"hgsoc_msk_2021",
"lgsoc_mapk_msk_2022",
- "msk_spectrum_tme_2022",
- "ov_tcga",
- "ov_tcga_pan_can_atlas_2018",
"ov_tcga_pub",
"scco_mskcc",
- "stes_tcga_pub"
+ "stes_tcga_pub",
+ "egc_trap_ccr_msk_2023",
+ "esca_tcga",
+ "egc_msk_2023",
+ "ov_tcga",
+ "msk_spectrum_tme_2022",
+ "esca_tcga_pan_can_atlas_2018",
+ "ov_tcga_pan_can_atlas_2018",
+ "esca_tcga_gdc",
+ "hgsoc_tcga_gdc",
+ "ovary_cptac_gdc"
]
}
-}
\ No newline at end of file
+}
From 583dcd72d55c5a0988b8afea3774d9a37bc3a50d Mon Sep 17 00:00:00 2001
From: "Laura Luebbert, Ph.D."
<56094636+lauraluebbert@users.noreply.github.com>
Date: Wed, 25 Sep 2024 02:25:05 +0200
Subject: [PATCH 6/7] Update fixture
---
tests/fixtures/test_cbio.json | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/fixtures/test_cbio.json b/tests/fixtures/test_cbio.json
index e179eaef..f8b766bc 100644
--- a/tests/fixtures/test_cbio.json
+++ b/tests/fixtures/test_cbio.json
@@ -27,7 +27,7 @@
"/tmp/test_cbio_download/msk_impact_2017/sv.txt": "24ce260e03b417d47929f8fc34fc49a4",
"/tmp/test_cbio_download/egc_msk_2023/clinical_patient.txt": "6fbd67c0eca7a24fa6918f37c989033f",
- "/tmp/test_cbio_download/egc_msk_2023/clinical_sample.txt": "8469bcc199fc653afb867242b3ab6e00",
+ "/tmp/test_cbio_download/egc_msk_2023/clinical_sample.txt": "a4423dfa78788df1b9f49fef31f282a9",
"/tmp/test_cbio_download/egc_msk_2023/cna.txt": "1acb67c06284754ee472402753e54263",
"/tmp/test_cbio_download/egc_msk_2023/mutations.txt": "be28497d2f95d933ad8e14a04adc2beb",
"/tmp/test_cbio_download/egc_msk_2023/sv.txt": "c1a0011480b533d2b659373ffd178c32"
@@ -42,4 +42,4 @@
},
"expected_result": false
}
-}
\ No newline at end of file
+}
From 2840ed1db692512c14c6a106f99a1b5328723d91 Mon Sep 17 00:00:00 2001
From: "Laura Luebbert, Ph.D."
<56094636+lauraluebbert@users.noreply.github.com>
Date: Wed, 25 Sep 2024 02:58:36 +0200
Subject: [PATCH 7/7] Update fixtures
---
tests/fixtures/test_enrichr.json | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/fixtures/test_enrichr.json b/tests/fixtures/test_enrichr.json
index df2c03d7..829a9694 100644
--- a/tests/fixtures/test_enrichr.json
+++ b/tests/fixtures/test_enrichr.json
@@ -5821,7 +5821,7 @@
"species": "fish"
},
"expected_result": "ValueError",
- "expected_msg": "Database 'pathway' is not supported for species 'fish'. Please select a database from the species-specific libraries listed at: https://maayanlab.cloud/FishEnrichr/#libraries."
+ "expected_msg": "Database 'pathway' is not supported for species 'fish'. Please select a database from the species-specific libraries listed at: https://maayanlab.cloud/FishEnrichr/#stats."
},
"test_enrichr_bad_background": {
"type": "error",
@@ -6310,4 +6310,4 @@
]
]
}
-}
\ No newline at end of file
+}