aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMunyoki Kilyungi2023-01-16 17:16:40 +0300
committerBonfaceKilz2023-01-20 15:02:46 +0300
commitc6d56cd53e54fd352afb91df053cbf2c4a51338b (patch)
tree68d79b8307fa74367efb14cf69c4ffbdc857ebac
parent000880beabe2fe495f048669c37634d55cfc3610 (diff)
downloadgenenetwork2-c6d56cd53e54fd352afb91df053cbf2c4a51338b.tar.gz
Add example that demos dumping data from an entire dataset
-rw-r--r--scripts/sampledata.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/scripts/sampledata.py b/scripts/sampledata.py
index fb3668d6..2aef6968 100644
--- a/scripts/sampledata.py
+++ b/scripts/sampledata.py
@@ -59,3 +59,14 @@ def fetch_all_traits(species, group, type_, dataset):
"search_terms_or": "*",
}).trait_list:
yield result.get('name')
+
+
+# Dump all traits from a given dataset
+for trait in fetch_all_traits(
+ species="mouse",
+ group="BXD",
+ type_="Phenotypes",
+ dataset="BXDPublish",
+):
+ print(json.dumps(dump_sample_data("BXDPublish", trait)))
+ break # Just do this once!