aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xwqflask/maintenance/gen_select_dataset.py45
-rwxr-xr-xwqflask/wqflask/static/new/javascript/dataset_menu_structure.json99
2 files changed, 100 insertions, 44 deletions
diff --git a/wqflask/maintenance/gen_select_dataset.py b/wqflask/maintenance/gen_select_dataset.py
index fda46792..ea0d4a56 100755
--- a/wqflask/maintenance/gen_select_dataset.py
+++ b/wqflask/maintenance/gen_select_dataset.py
@@ -156,15 +156,6 @@ def build_types(species, group):
"""
- #print("""select distinct Tissue.Name
- # from ProbeFreeze, ProbeSetFreeze, InbredSet, Tissue, Species
- # where Species.Name = '{}' and Species.Id = InbredSet.SpeciesId and
- # InbredSet.Name = '{}' and
- # ProbeFreeze.TissueId = Tissue.Id and
- # ProbeFreeze.InbredSetId = InbredSet.Id and
- # ProbeSetFreeze.ProbeFreezeId = ProbeFreeze.Id and
- # ProbeSetFreeze.public > 0
- # order by Tissue.Name""".format(species, group))
Cursor.execute("""select distinct Tissue.Name
from ProbeFreeze, ProbeSetFreeze, InbredSet, Tissue, Species
where Species.Name = %s and Species.Id = InbredSet.SpeciesId and
@@ -199,6 +190,19 @@ def build_datasets(species, group, type_name):
"""Gets dataset names from database"""
dataset_text = dataset_value = None
if type_name == "Phenotypes":
+ print("GROUP:", group)
+ Cursor.execute("""select InfoFiles.GN_AccesionId from InfoFiles, PublishFreeze, InbredSet where
+ InbredSet.Name = %s and
+ PublishFreeze.InbredSetId = InbredSet.Id and
+ InfoFiles.InfoPageName = PublishFreeze.Name and
+ PublishFreeze.public > 0 order by
+ PublishFreeze.CreateTime desc""", (group))
+
+ results = Cursor.fetchone()
+ if results != None:
+ dataset_id = str(results[0])
+ else:
+ dataset_id = "None"
dataset_value = "%sPublish" % group
if group == 'MDP':
dataset_text = "Mouse Phenome Database"
@@ -206,20 +210,24 @@ def build_datasets(species, group, type_name):
dataset_text = "%s Published Phenotypes" % group
elif type_name == "Genotypes":
+ Cursor.execute("""select InfoFiles.GN_AccesionId from InfoFiles, GenoFreeze, InbredSet where
+ InbredSet.Name = %s and
+ GenoFreeze.InbredSetId = InbredSet.Id and
+ InfoFiles.InfoPageName = GenoFreeze.ShortName and
+ GenoFreeze.public > 0 order by
+ GenoFreeze.CreateTime desc""", (group))
+
+ results = Cursor.fetchone()
+ if results != None:
+ dataset_id = str(results[0])
+ else:
+ dataset_id = "None"
dataset_value = "%sGeno" % group
dataset_text = "%s Genotypes" % group
if dataset_value:
- return [(dataset_value, dataset_text)]
+ return [(dataset_id, dataset_value, dataset_text)]
else:
- #print("""select ProbeSetFreeze.Name, ProbeSetFreeze.FullName from
- # ProbeSetFreeze, ProbeFreeze, InbredSet, Tissue, Species where
- # Species.Name = '{}' and Species.Id = InbredSet.SpeciesId and
- # InbredSet.Name = '{}' and
- # ProbeSetFreeze.ProbeFreezeId = ProbeFreeze.Id and Tissue.Name = '{}'
- # and ProbeFreeze.TissueId = Tissue.Id and ProbeFreeze.InbredSetId =
- # InbredSet.Id and ProbeSetFreeze.public > 0 order by
- # ProbeSetFreeze.CreateTime desc""".format(species, group, type_name))
Cursor.execute("""select ProbeSetFreeze.Id, ProbeSetFreeze.Name, ProbeSetFreeze.FullName from
ProbeSetFreeze, ProbeFreeze, InbredSet, Tissue, Species where
Species.Name = %s and Species.Id = InbredSet.SpeciesId and
@@ -247,7 +255,6 @@ def main():
species = get_species()
groups = get_groups(species)
- print("groups:", groups)
types = get_types(groups)
datasets = get_datasets(types)
diff --git a/wqflask/wqflask/static/new/javascript/dataset_menu_structure.json b/wqflask/wqflask/static/new/javascript/dataset_menu_structure.json
index da9beb9b..5194cb96 100755
--- a/wqflask/wqflask/static/new/javascript/dataset_menu_structure.json
+++ b/wqflask/wqflask/static/new/javascript/dataset_menu_structure.json
@@ -14,12 +14,14 @@
"BayXSha": {
"Genotypes": [
[
+ "None",
"BayXShaGeno",
"BayXSha Genotypes"
]
],
"Phenotypes": [
[
+ "642",
"BayXShaPublish",
"BayXSha Published Phenotypes"
]
@@ -28,12 +30,14 @@
"ColXBur": {
"Genotypes": [
[
+ "None",
"ColXBurGeno",
"ColXBur Genotypes"
]
],
"Phenotypes": [
[
+ "623",
"ColXBurPublish",
"ColXBur Published Phenotypes"
]
@@ -42,12 +46,14 @@
"ColXCvi": {
"Genotypes": [
[
+ "None",
"ColXCviGeno",
"ColXCvi Genotypes"
]
],
"Phenotypes": [
[
+ "640",
"ColXCviPublish",
"ColXCvi Published Phenotypes"
]
@@ -99,6 +105,7 @@
],
"Genotypes": [
[
+ "615",
"SXMGeno",
"SXM Genotypes"
]
@@ -122,6 +129,7 @@
],
"Phenotypes": [
[
+ "608",
"SXMPublish",
"SXM Published Phenotypes"
]
@@ -198,6 +206,7 @@
],
"Genotypes": [
[
+ "None",
"AD-cases-controls-MyersGeno",
"AD-cases-controls-Myers Genotypes"
]
@@ -285,6 +294,7 @@
],
"Phenotypes": [
[
+ "634",
"CANDLEPublish",
"CANDLE Published Phenotypes"
]
@@ -941,6 +951,7 @@
"HCP": {
"Phenotypes": [
[
+ "None",
"HCPPublish",
"HCP Published Phenotypes"
]
@@ -966,6 +977,7 @@
],
"Phenotypes": [
[
+ "635",
"HLCPublish",
"HLC Published Phenotypes"
]
@@ -1153,6 +1165,7 @@
"AKXD": {
"Genotypes": [
[
+ "611",
"AKXDGeno",
"AKXD Genotypes"
]
@@ -1192,6 +1205,7 @@
],
"Genotypes": [
[
+ "636",
"AXBXAGeno",
"AXBXA Genotypes"
]
@@ -1212,6 +1226,7 @@
],
"Phenotypes": [
[
+ "629",
"AXBXAPublish",
"AXBXA Published Phenotypes"
]
@@ -1220,6 +1235,7 @@
"B6BTBRF2": {
"Genotypes": [
[
+ "618",
"B6BTBRF2Geno",
"B6BTBRF2 Genotypes"
]
@@ -1238,6 +1254,7 @@
],
"Phenotypes": [
[
+ "603",
"B6BTBRF2Publish",
"B6BTBRF2 Published Phenotypes"
]
@@ -1246,6 +1263,11 @@
"B6D2F2": {
"Brain mRNA": [
[
+ "77",
+ "BRF2_M_0805_R",
+ "OHSU/VA B6D2F2 Brain mRNA M430 (Aug05) RMA"
+ ],
+ [
"76",
"BRF2_M_0805_M",
"OHSU/VA B6D2F2 Brain mRNA M430 (Aug05) MAS5"
@@ -1256,11 +1278,6 @@
"OHSU/VA B6D2F2 Brain mRNA M430 (Aug05) PDNN"
],
[
- "77",
- "BRF2_M_0805_R",
- "OHSU/VA B6D2F2 Brain mRNA M430 (Aug05) RMA"
- ],
- [
"33",
"BRF2_M_0304_P",
"OHSU/VA B6D2F2 Brain mRNA M430A (Mar04) PDNN"
@@ -1278,6 +1295,7 @@
],
"Genotypes": [
[
+ "637",
"B6D2F2Geno",
"B6D2F2 Genotypes"
]
@@ -1286,6 +1304,7 @@
"B6D2F2-PSU": {
"Genotypes": [
[
+ "617",
"B6D2F2-PSUGeno",
"B6D2F2-PSU Genotypes"
]
@@ -1325,6 +1344,7 @@
"BDF2-1999": {
"Genotypes": [
[
+ "None",
"BDF2-1999Geno",
"BDF2-1999 Genotypes"
]
@@ -1340,6 +1360,7 @@
"BDF2-2005": {
"Genotypes": [
[
+ "None",
"BDF2-2005Geno",
"BDF2-2005 Genotypes"
]
@@ -1399,6 +1420,7 @@
],
"Genotypes": [
[
+ "None",
"BHF2Geno",
"BHF2 Genotypes"
]
@@ -1475,6 +1497,7 @@
],
"Genotypes": [
[
+ "None",
"BHHBF2Geno",
"BHHBF2 Genotypes"
]
@@ -1791,6 +1814,11 @@
"Eye M430v2 WT Gpnmb (Sep08) RMA **"
],
[
+ "279",
+ "Eye_M2_0908_R_WT",
+ "Eye M430v2 WT Tyrp1 (Sep08) RMA **"
+ ],
+ [
"278",
"Eye_M2_0908_R_MT",
"Eye M430v2 Mutant Tyrp1 (Sep08) RMA **"
@@ -1801,11 +1829,6 @@
"Eye M430v2 WT WT (Sep08) RMA **"
],
[
- "279",
- "Eye_M2_0908_R_WT",
- "Eye M430v2 WT Tyrp1 (Sep08) RMA **"
- ],
- [
"400",
"DBA2J-ONH-1212",
"Howell et al. 2011, DBA/2J Glaucoma Optic Nerve Head M430 2.0 (Dec12) RMA"
@@ -1825,6 +1848,7 @@
],
"Genotypes": [
[
+ "600",
"BXDGeno",
"BXD Genotypes"
]
@@ -1940,16 +1964,16 @@
"UTHSC Hippocampus Illumina v6.1 RSS (Nov12) RankInv"
],
[
- "206",
- "UMUTAffyExon_0209_RMA",
- "UMUTAffy Hippocampus Exon (Feb09) RMA"
- ],
- [
"296",
"UT_ILM_BXD_hipp_RSE_1112",
"UTHSC Hippocampus Illumina v6.1 RSE (Nov12) RankInv"
],
[
+ "206",
+ "UMUTAffyExon_0209_RMA",
+ "UMUTAffy Hippocampus Exon (Feb09) RMA"
+ ],
+ [
"242",
"UT_ILM_BXD_hipp_NON_0909",
"UTHSC Hippocampus Illumina v6.1 NON (Sep09) RankInv"
@@ -2036,16 +2060,16 @@
],
"Kidney mRNA": [
[
- "240",
- "MA_M2M_0706_R",
- "Mouse kidney M430v2 Male (Aug06) RMA"
- ],
- [
"239",
"MA_M2F_0706_R",
"Mouse kidney M430v2 Female (Aug06) RMA"
],
[
+ "240",
+ "MA_M2M_0706_R",
+ "Mouse kidney M430v2 Male (Aug06) RMA"
+ ],
+ [
"118",
"MA_M2_0806_R",
"Mouse kidney M430v2 Sex Balanced (Aug06) RMA"
@@ -2333,6 +2357,7 @@
],
"Phenotypes": [
[
+ "602",
"BXDPublish",
"BXD Published Phenotypes"
]
@@ -2640,6 +2665,7 @@
],
"Genotypes": [
[
+ "638",
"BXHGeno",
"BXH Genotypes"
]
@@ -2653,6 +2679,7 @@
],
"Phenotypes": [
[
+ "627",
"BXHPublish",
"BXH Published Phenotypes"
]
@@ -2661,12 +2688,14 @@
"C57BL-6JxC57BL-6NJF2": {
"Genotypes": [
[
+ "622",
"C57BL-6JxC57BL-6NJF2Geno",
"C57BL-6JxC57BL-6NJF2 Genotypes"
]
],
"Phenotypes": [
[
+ "620",
"C57BL-6JxC57BL-6NJF2Publish",
"C57BL-6JxC57BL-6NJF2 Published Phenotypes"
]
@@ -2709,6 +2738,7 @@
],
"Genotypes": [
[
+ "None",
"CTB6F2Geno",
"CTB6F2 Genotypes"
]
@@ -2749,6 +2779,7 @@
],
"Phenotypes": [
[
+ "630",
"CTB6F2Publish",
"CTB6F2 Published Phenotypes"
]
@@ -2757,6 +2788,7 @@
"CXB": {
"Genotypes": [
[
+ "614",
"CXBGeno",
"CXB Genotypes"
]
@@ -2775,6 +2807,7 @@
],
"Phenotypes": [
[
+ "628",
"CXBPublish",
"CXB Published Phenotypes"
]
@@ -2811,6 +2844,7 @@
],
"Phenotypes": [
[
+ "624",
"HSPublish",
"HS Published Phenotypes"
]
@@ -2828,6 +2862,7 @@
"LXS": {
"Genotypes": [
[
+ "601",
"LXSGeno",
"LXS Genotypes"
]
@@ -2869,6 +2904,11 @@
"Hippocampus Illumina (May07) RankInv"
],
[
+ "219",
+ "Illum_LXS_Hipp_NON_1008",
+ "Hippocampus Illumina NON (Oct08) RankInv beta"
+ ],
+ [
"212",
"Illum_LXS_Hipp_RSE_1008",
"Hippocampus Illumina RSE (Oct08) RankInv beta"
@@ -2887,15 +2927,11 @@
"213",
"Illum_LXS_Hipp_NOS_1008",
"Hippocampus Illumina NOS (Oct08) RankInv beta"
- ],
- [
- "219",
- "Illum_LXS_Hipp_NON_1008",
- "Hippocampus Illumina NON (Oct08) RankInv beta"
]
],
"Phenotypes": [
[
+ "606",
"LXSPublish",
"LXS Published Phenotypes"
]
@@ -2921,12 +2957,14 @@
"Linsenbardt-Boehm": {
"Genotypes": [
[
+ "None",
"Linsenbardt-BoehmGeno",
"Linsenbardt-Boehm Genotypes"
]
],
"Phenotypes": [
[
+ "645",
"Linsenbardt-BoehmPublish",
"Linsenbardt-Boehm Published Phenotypes"
]
@@ -2949,6 +2987,7 @@
],
"Genotypes": [
[
+ "609",
"MDPGeno",
"MDP Genotypes"
]
@@ -2994,6 +3033,7 @@
],
"Phenotypes": [
[
+ "605",
"MDPPublish",
"Mouse Phenome Database"
]
@@ -3009,6 +3049,7 @@
],
"Phenotypes": [
[
+ "607",
"NZBXFVB-N2Publish",
"NZBXFVB-N2 Published Phenotypes"
]
@@ -3017,6 +3058,7 @@
"SOTNOT-OHSU": {
"Genotypes": [
[
+ "613",
"SOTNOT-OHSUGeno",
"SOTNOT-OHSU Genotypes"
]
@@ -3041,6 +3083,7 @@
"HSNIH": {
"Phenotypes": [
[
+ "619",
"HSNIHPublish",
"HSNIH Published Phenotypes"
]
@@ -3056,6 +3099,7 @@
],
"Genotypes": [
[
+ "None",
"HXBBXHGeno",
"HXBBXH Genotypes"
]
@@ -3112,6 +3156,7 @@
],
"Phenotypes": [
[
+ "632",
"HXBBXHPublish",
"HXBBXH Published Phenotypes"
]
@@ -3131,12 +3176,14 @@
"J12XJ58F11": {
"Genotypes": [
[
+ "None",
"J12XJ58F11Geno",
"J12XJ58F11 Genotypes"
]
],
"Phenotypes": [
[
+ "647",
"J12XJ58F11Publish",
"J12XJ58F11 Published Phenotypes"
]
@@ -3145,6 +3192,7 @@
"J12XJ58F2": {
"Phenotypes": [
[
+ "616",
"J12XJ58F2Publish",
"J12XJ58F2 Published Phenotypes"
]
@@ -3155,6 +3203,7 @@
"LXP": {
"Phenotypes": [
[
+ "621",
"LXPPublish",
"LXP Published Phenotypes"
]