More information on R/qtl mapping models and methods can be found
here.
--
cgit v1.2.3
From b1367445f4258f2651d5306aff02736200d407e0 Mon Sep 17 00:00:00 2001
From: zsloan
Date: Fri, 27 Mar 2020 21:44:51 -0500
Subject: Fixed issue where GEMMA wasn't showing up for certain groups
---
wqflask/base/data_set.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'wqflask/base/data_set.py')
diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py
index abfdd277..5b32c5ae 100644
--- a/wqflask/base/data_set.py
+++ b/wqflask/base/data_set.py
@@ -309,7 +309,7 @@ class DatasetGroup(object):
if mapping_id == "1":
mapping_names = ["GEMMA", "QTLReaper", "R/qtl"]
elif mapping_id == "2":
- mapping_names = []
+ mapping_names = ["GEMMA"]
elif mapping_id == "3":
mapping_names = ["R/qtl"]
elif mapping_id == "4":
--
cgit v1.2.3
From 9e6b8a2b2adfb4b41867ecd6932ce899872eea9e Mon Sep 17 00:00:00 2001
From: zsloan
Date: Mon, 6 Apr 2020 17:41:19 -0500
Subject: Added Mean column for phenotype traits in search and global search
result tables
---
wqflask/base/data_set.py | 2 ++
wqflask/base/trait.py | 5 +++--
wqflask/wqflask/do_search.py | 1 +
wqflask/wqflask/gsearch.py | 7 ++++++-
wqflask/wqflask/search_results.py | 3 +++
wqflask/wqflask/templates/gsearch_pheno.html | 6 ++++++
wqflask/wqflask/templates/search_result_page.html | 7 +++++++
7 files changed, 28 insertions(+), 3 deletions(-)
(limited to 'wqflask/base/data_set.py')
diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py
index 5b32c5ae..ebf3f021 100644
--- a/wqflask/base/data_set.py
+++ b/wqflask/base/data_set.py
@@ -710,6 +710,7 @@ class PhenotypeDataSet(DataSet):
'Phenotype.Pre_publication_description',
'Phenotype.Pre_publication_abbreviation',
'Phenotype.Post_publication_abbreviation',
+ 'PublishXRef.mean',
'Phenotype.Lab_code',
'Publication.PubMed_ID',
'Publication.Abstract',
@@ -725,6 +726,7 @@ class PhenotypeDataSet(DataSet):
'original_description',
'pre_publication_abbreviation',
'post_publication_abbreviation',
+ 'mean',
'lab_code',
'submitter', 'owner',
'authorized_users',
diff --git a/wqflask/base/trait.py b/wqflask/base/trait.py
index 8e779a11..5525472e 100644
--- a/wqflask/base/trait.py
+++ b/wqflask/base/trait.py
@@ -354,7 +354,7 @@ def retrieve_trait_info(trait, dataset, get_qtl_info=False):
SELECT
PublishXRef.Id, InbredSet.InbredSetCode, Publication.PubMed_ID,
Phenotype.Pre_publication_description, Phenotype.Post_publication_description, Phenotype.Original_description,
- Phenotype.Pre_publication_abbreviation, Phenotype.Post_publication_abbreviation,
+ Phenotype.Pre_publication_abbreviation, Phenotype.Post_publication_abbreviation, PublishXRef.mean,
Phenotype.Lab_code, Phenotype.Submitter, Phenotype.Owner, Phenotype.Authorized_Users,
Publication.Authors, Publication.Title, Publication.Abstract,
Publication.Journal, Publication.Volume, Publication.Pages,
@@ -503,8 +503,9 @@ def retrieve_trait_info(trait, dataset, get_qtl_info=False):
#LRS and its location
trait.LRS_score_repr = "N/A"
trait.LRS_location_repr = "N/A"
- trait.locus = trait.locus_chr = trait.locus_mb = trait.lrs = trait.pvalue = trait.mean = trait.additive = ""
+ trait.locus = trait.locus_chr = trait.locus_mb = trait.lrs = trait.pvalue = trait.additive = ""
if dataset.type == 'ProbeSet' and not trait.cellid:
+ trait.mean = ""
query = """
SELECT
ProbeSetXRef.Locus, ProbeSetXRef.LRS, ProbeSetXRef.pValue, ProbeSetXRef.mean, ProbeSetXRef.additive
diff --git a/wqflask/wqflask/do_search.py b/wqflask/wqflask/do_search.py
index b56a858a..05caa100 100644
--- a/wqflask/wqflask/do_search.py
+++ b/wqflask/wqflask/do_search.py
@@ -218,6 +218,7 @@ class PhenotypeSearch(DoSearch):
header_fields = ['Index',
'Record',
'Description',
+ 'Mean',
'Authors',
'Year',
'Max LRS',
diff --git a/wqflask/wqflask/gsearch.py b/wqflask/wqflask/gsearch.py
index 12813e9a..3d9b508a 100644
--- a/wqflask/wqflask/gsearch.py
+++ b/wqflask/wqflask/gsearch.py
@@ -139,7 +139,8 @@ class GSearch(object):
Publication.`PubMed_ID`,
PublishXRef.`LRS`,
PublishXRef.`additive`,
- InbredSet.`InbredSetCode`
+ InbredSet.`InbredSetCode`,
+ PublishXRef.`mean`
FROM Species,InbredSet,PublishFreeze,PublishXRef,Phenotype,Publication
WHERE PublishXRef.`InbredSetId`=InbredSet.`Id`
AND PublishFreeze.`InbredSetId`=InbredSet.`Id`
@@ -183,6 +184,10 @@ class GSearch(object):
this_trait['description'] = line[5].decode('utf-8', 'replace')
else:
this_trait['description'] = "N/A"
+ if line[13] != None and line[13] != "":
+ this_trait['mean'] = line[13]
+ else:
+ this_trait['mean'] = "N/A"
this_trait['authors'] = line[7]
this_trait['year'] = line[8]
if this_trait['year'].isdigit():
diff --git a/wqflask/wqflask/search_results.py b/wqflask/wqflask/search_results.py
index 34c647f4..698389ab 100644
--- a/wqflask/wqflask/search_results.py
+++ b/wqflask/wqflask/search_results.py
@@ -143,6 +143,9 @@ views.py).
trait_dict['pubmed_id'] = this_trait.pubmed_id
trait_dict['pubmed_link'] = this_trait.pubmed_link
trait_dict['pubmed_text'] = this_trait.pubmed_text
+ trait_dict['mean'] = "N/A"
+ if this_trait.mean != "" and this_trait.mean != None:
+ trait_dict['mean'] = '%.3f' % this_trait.mean
trait_dict['lrs_score'] = this_trait.LRS_score_repr
trait_dict['lrs_location'] = this_trait.LRS_location_repr
trait_dict['additive'] = "N/A"
diff --git a/wqflask/wqflask/templates/gsearch_pheno.html b/wqflask/wqflask/templates/gsearch_pheno.html
index 4d5238ef..f6ffff47 100644
--- a/wqflask/wqflask/templates/gsearch_pheno.html
+++ b/wqflask/wqflask/templates/gsearch_pheno.html
@@ -189,6 +189,12 @@
}
}
},
+ {
+ 'title': "Mean",
+ 'type': "natural",
+ 'width': "10%",
+ 'data': "mean"
+ },
{
'title': "Authors",
'type': "natural",
diff --git a/wqflask/wqflask/templates/search_result_page.html b/wqflask/wqflask/templates/search_result_page.html
index 13457030..162bde08 100644
--- a/wqflask/wqflask/templates/search_result_page.html
+++ b/wqflask/wqflask/templates/search_result_page.html
@@ -349,6 +349,13 @@
}
}
},
+ {
+ 'title': "Mean",
+ 'type': "natural",
+ 'width': "110px",
+ 'data': "mean",
+ 'orderSequence': [ "desc", "asc"]
+ },
{
'title': "Authors",
'type': "natural",
--
cgit v1.2.3
From 2a119affad1830d5a693860279ca2aa2897d84ef Mon Sep 17 00:00:00 2001
From: zsloan
Date: Fri, 24 Apr 2020 12:58:39 -0500
Subject: Made a fix that should prevent the issue where new datasets cause an
error when they're in search results
---
wqflask/base/data_set.py | 62 +++++++++++++++++++++++++++++++++++++++++++++---
1 file changed, 59 insertions(+), 3 deletions(-)
(limited to 'wqflask/base/data_set.py')
diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py
index ebf3f021..fae62875 100644
--- a/wqflask/base/data_set.py
+++ b/wqflask/base/data_set.py
@@ -67,7 +67,6 @@ DS_NAME_MAP = {}
def create_dataset(dataset_name, rebuild=True, dataset_type = None, get_samplelist = True, group_name = None):
if not dataset_type:
dataset_type = Dataset_Getter(dataset_name)
- logger.debug("dataset_type", dataset_type)
dataset_ob = DS_NAME_MAP[dataset_type]
dataset_class = globals()[dataset_ob]
@@ -96,7 +95,6 @@ Publish or ProbeSet. E.g.
self.datasets = {}
if rebuild: #ZS: May make this the only option
data = json.loads(requests.get("http://gn2.genenetwork.org/api/v_pre1/gen_dropdown").content)
- logger.debug("THE DATA:", data)
#data = gen_menu.gen_dropdown_json()
else:
file_name = "wqflask/static/new/javascript/dataset_menu_structure.json"
@@ -120,7 +118,65 @@ Publish or ProbeSet. E.g.
logger.debugf(5, "datasets",self.datasets)
def __call__(self, name):
- return self.datasets[name]
+ if name not in self.datasets:
+ mrna_expr_query = """
+ SELECT
+ ProbeSetFreeze.Id
+ FROM
+ ProbeSetFreeze
+ WHERE
+ ProbeSetFreeze.Name = "{0}"
+ """.format(name)
+
+ results = g.db.execute(geno_query).fetchall()
+ if len(results):
+ self.datasets[name] = "ProbeSet"
+ return self.datasets[name]
+
+ group_name = name.replace("Publish", "")
+
+ pheno_query = """SELECT InfoFiles.GN_AccesionId
+ FROM InfoFiles, PublishFreeze, InbredSet
+ WHERE InbredSet.Name = '{0}' AND
+ PublishFreeze.InbredSetId = InbredSet.Id AND
+ InfoFiles.InfoPageName = PublishFreeze.Name""".format(group_name)
+
+ results = g.db.execute(pheno_query).fetchall()
+ if len(results):
+ self.datasets[name] = "Publish"
+ return self.datasets[name]
+
+ #ZS: For when there isn't an InfoFiles ID; not sure if this and the preceding query are both necessary
+ other_pheno_query = """SELECT PublishFreeze.Name
+ FROM PublishFreeze, InbredSet
+ WHERE InbredSet.Name = '{}' AND
+ PublishFreeze.InbredSetId = InbredSet.Id""".format(group_name)
+
+ results = g.db.execute(other_pheno_query).fetchall()
+ if len(results):
+ self.datasets[name] = "Publish"
+ return self.datasets[name]
+
+ geno_query = """
+ SELECT
+ GenoFreezeId
+ FROM
+ GenoFreeze
+ WHERE
+ GenoFreeze.Name = "{0}"
+ {1}
+ """.format(name)
+
+ results = g.db.execute(geno_query).fetchall()
+ if len(results):
+ self.datasets[name] = "Geno"
+ return self.datasets[name]
+
+ #ZS: It shouldn't ever reach this
+ return None
+
+ else:
+ return self.datasets[name]
# Do the intensive work at startup one time only
Dataset_Getter = Dataset_Types()
--
cgit v1.2.3
From be09d207ee4e2705e358102f8bdbcd1da7f70ca2 Mon Sep 17 00:00:00 2001
From: zsloan
Date: Fri, 24 Apr 2020 16:06:36 -0500
Subject: Replaced hard-coded instances of GN2 urls with ones pulled from
settings file
---
doc/API_readme.md | 42 +++++++++++-----------
wqflask/base/data_set.py | 4 +--
wqflask/base/trait.py | 7 ++--
wqflask/utility/tools.py | 2 ++
wqflask/wqflask/ctl/ctl_analysis.py | 4 ++-
wqflask/wqflask/do_search.py | 3 +-
wqflask/wqflask/network_graph/network_graph.py | 2 ++
wqflask/wqflask/search_results.py | 3 +-
wqflask/wqflask/static/new/javascript/ctl_graph.js | 8 +----
.../new/javascript/dataset_select_menu_orig.js | 1 -
.../wqflask/static/new/javascript/network_graph.js | 4 +--
wqflask/wqflask/templates/ctl_results.html | 1 +
wqflask/wqflask/templates/index_page.html | 4 +--
wqflask/wqflask/templates/index_page_orig.html | 4 +--
wqflask/wqflask/templates/network_graph.html | 1 +
15 files changed, 47 insertions(+), 43 deletions(-)
(limited to 'wqflask/base/data_set.py')
diff --git a/doc/API_readme.md b/doc/API_readme.md
index 652376a0..be6668dc 100644
--- a/doc/API_readme.md
+++ b/doc/API_readme.md
@@ -6,17 +6,17 @@
To get a list of species with data available in GN (and their associated names and ids):
```
-curl http://gn2.genenetwork.org/api/v_pre1/species
+curl http://genenetwork.org/api/v_pre1/species
[ { "FullName": "Mus musculus", "Id": 1, "Name": "mouse", "TaxonomyId": 10090 }, ... { "FullName": "Populus trichocarpa", "Id": 10, "Name": "poplar", "TaxonomyId": 3689 } ]
```
Or to get a single species info:
```
-curl http://gn2.genenetwork.org/api/v_pre1/species/mouse
+curl http://genenetwork.org/api/v_pre1/species/mouse
```
OR
```
-curl http://gn2.genenetwork.org/api/v_pre1/species/mouse.json
+curl http://genenetwork.org/api/v_pre1/species/mouse.json
```
*For all queries where the last field is a user-specified name/ID, there will be the option to append a file format type. Currently there is only JSON (and it will default to JSON if none is provided), but other formats will be added later*
@@ -26,33 +26,33 @@ curl http://gn2.genenetwork.org/api/v_pre1/species/mouse.json
This query can optionally filter by species:
```
-curl http://gn2.genenetwork.org/api/v_pre1/groups (for all species)
+curl http://genenetwork.org/api/v_pre1/groups (for all species)
```
OR
```
-curl http://gn2.genenetwork.org/api/v_pre1/groups/mouse (for just mouse groups/RISets)
+curl http://genenetwork.org/api/v_pre1/groups/mouse (for just mouse groups/RISets)
[ { "DisplayName": "BXD", "FullName": "BXD RI Family", "GeneticType": "riset", "Id": 1, "MappingMethodId": "1", "Name": "BXD", "SpeciesId": 1, "public": 2 }, ... { "DisplayName": "AIL LGSM F34 and F39-43 (GBS)", "FullName": "AIL LGSM F34 and F39-43 (GBS)", "GeneticType": "intercross", "Id": 72, "MappingMethodId": "2", "Name": "AIL-LGSM-F34-F39-43-GBS", "SpeciesId": 1, "public": 2 } ]
```
## Fetch Genotypes for Group/RISet ##
```
-curl http://gn2.genenetwork.org/api/v_pre1/genotypes/bimbam/BXD
-curl http://gn2.genenetwork.org/api/v_pre1/genotypes/BXD.bimbam
+curl http://genenetwork.org/api/v_pre1/genotypes/bimbam/BXD
+curl http://genenetwork.org/api/v_pre1/genotypes/BXD.bimbam
```
Returns a group's genotypes in one of several formats - bimbam, rqtl2, or geno (a format used by qtlreaper which is just a CSV file consisting of marker positions and genotypes)
Rqtl2 genotype queries can also include the dataset name and will return a zip of the genotypes, phenotypes, and gene map (marker names/positions). For example:
```
-curl http://gn2.genenetwork.org/api/v_pre1/genotypes/rqtl2/BXD/HC_M2_0606_P.zip
+curl http://genenetwork.org/api/v_pre1/genotypes/rqtl2/BXD/HC_M2_0606_P.zip
```
## Fetch Datasets ##
```
-curl http://gn2.genenetwork.org/api/v_pre1/datasets/bxd
+curl http://genenetwork.org/api/v_pre1/datasets/bxd
```
OR
```
-curl http://gn2.genenetwork.org/api/v_pre1/datasets/mouse/bxd
+curl http://genenetwork.org/api/v_pre1/datasets/mouse/bxd
[ { "AvgID": 1, "CreateTime": "Fri, 01 Aug 2003 00:00:00 GMT", "DataScale": "log2", "FullName": "UTHSC/ETHZ/EPFL BXD Liver Polar Metabolites Extraction A, CD Cohorts (Mar 2017) log2", "Id": 1, "Long_Abbreviation": "BXDMicroArray_ProbeSet_August03", "ProbeFreezeId": 3, "ShortName": "Brain U74Av2 08/03 MAS5", "Short_Abbreviation": "Br_U_0803_M", "confidentiality": 0, "public": 0 }, ... { "AvgID": 3, "CreateTime": "Tue, 14 Aug 2018 00:00:00 GMT", "DataScale": "log2", "FullName": "EPFL/LISP BXD CD Liver Affy Mouse Gene 1.0 ST (Aug18) RMA", "Id": 859, "Long_Abbreviation": "EPFLMouseLiverCDRMAApr18", "ProbeFreezeId": 181, "ShortName": "EPFL/LISP BXD CD Liver Affy Mouse Gene 1.0 ST (Aug18) RMA", "Short_Abbreviation": "EPFLMouseLiverCDRMA0818", "confidentiality": 0, "public": 1 } ]
```
(I added the option to specify species just in case we end up with the same group name across multiple species at some point, though it's currently unnecessary)
@@ -61,11 +61,11 @@ curl http://gn2.genenetwork.org/api/v_pre1/datasets/mouse/bxd
### For mRNA Assay/"ProbeSet" ###
```
-curl http://gn2.genenetwork.org/api/v_pre1/dataset/HC_M2_0606_P
+curl http://genenetwork.org/api/v_pre1/dataset/HC_M2_0606_P
```
OR
```
-curl http://gn2.genenetwork.org/api/v_pre1/dataset/bxd/HC_M2_0606_P```
+curl http://genenetwork.org/api/v_pre1/dataset/bxd/HC_M2_0606_P```
{ "confidential": 0, "data_scale": "log2", "dataset_type": "mRNA expression", "full_name": "Hippocampus Consortium M430v2 (Jun06) PDNN", "id": 112, "name": "HC_M2_0606_P", "public": 2, "short_name": "Hippocampus M430v2 BXD 06/06 PDNN", "tissue": "Hippocampus mRNA", "tissue_id": 9 }
```
(This also has the option to specify group/riset)
@@ -73,26 +73,26 @@ curl http://gn2.genenetwork.org/api/v_pre1/dataset/bxd/HC_M2_0606_P```
### For "Phenotypes" (basically non-mRNA Expression; stuff like weight, sex, etc) ###
For these traits, the query fetches publication info and takes the group and phenotype 'ID' as input. For example:
```
-curl http://gn2.genenetwork.org/api/v_pre1/dataset/bxd/10001
+curl http://genenetwork.org/api/v_pre1/dataset/bxd/10001
{ "dataset_type": "phenotype", "description": "Central nervous system, morphology: Cerebellum weight, whole, bilateral in adults of both sexes [mg]", "id": 10001, "name": "CBLWT2", "pubmed_id": 11438585, "title": "Genetic control of the mouse cerebellum: identification of quantitative trait loci modulating size and architecture", "year": "2001" }
```
## Fetch Sample Data for Dataset ##
```
-curl http://gn2.genenetwork.org/api/v_pre1/sample_data/HSNIH-PalmerPublish.csv
+curl http://genenetwork.org/api/v_pre1/sample_data/HSNIH-PalmerPublish.csv
```
Returns a CSV file with sample/strain names as the columns and trait IDs as rows
## Fetch Sample Data for Single Trait ##
```
-curl http://gn2.genenetwork.org/api/v_pre1/sample_data/HC_M2_0606_P/1436869_at
+curl http://genenetwork.org/api/v_pre1/sample_data/HC_M2_0606_P/1436869_at
[ { "data_id": 23415463, "sample_name": "129S1/SvImJ", "sample_name_2": "129S1/SvImJ", "se": 0.123, "value": 8.201 }, { "data_id": 23415463, "sample_name": "A/J", "sample_name_2": "A/J", "se": 0.046, "value": 8.413 }, { "data_id": 23415463, "sample_name": "AKR/J", "sample_name_2": "AKR/J", "se": 0.134, "value": 8.856 }, ... ]
```
## Fetch Trait List for Dataset ##
```
-curl http://gn2.genenetwork.org/api/v_pre1/traits/HXBBXHPublish.json
+curl http://genenetwork.org/api/v_pre1/traits/HXBBXHPublish.json
[ { "Additive": 0.0499967532467532, "Id": 10001, "LRS": 16.2831307029479, "Locus": "rs106114574", "PhenotypeId": 1449, "PublicationId": 319, "Sequence": 1 }, ... ]
```
@@ -101,7 +101,7 @@ Both JSON and CSV formats can be specified, with JSON as default. There is also
## Fetch Trait Info (Name, Description, Location, etc) ##
### For mRNA Expression/"ProbeSet" ###
```
-curl http://gn2.genenetwork.org/api/v_pre1/trait/HC_M2_0606_P/1436869_at
+curl http://genenetwork.org/api/v_pre1/trait/HC_M2_0606_P/1436869_at
{ "additive": -0.214087568058076, "alias": "HHG1; HLP3; HPE3; SMMCI; Dsh; Hhg1", "chr": "5", "description": "sonic hedgehog (hedgehog)", "id": 99602, "locus": "rs8253327", "lrs": 12.7711275309832, "mb": 28.457155, "mean": 9.27909090909091, "name": "1436869_at", "p_value": 0.306, "se": null, "symbol": "Shh" }
```
@@ -110,7 +110,7 @@ For phenotypes this just gets the max LRS, its location, and additive effect (a
Since each group/riset only has one phenotype "dataset", this query takes either the group/riset name or the group/riset name + "Publish" (for example "BXDPublish", which is the dataset name in the DB) as input
```
-curl http://gn2.genenetwork.org/api/v_pre1/trait/BXD/10001
+curl http://genenetwork.org/api/v_pre1/trait/BXD/10001
{ "additive": 2.39444435069444, "id": 4, "locus": "rs48756159", "lrs": 13.4974911471087 }
```
@@ -130,7 +130,7 @@ Each method's query takes the following parameters respectively (more will be ad
Example query:
```
-curl http://gn2.genenetwork.org/api/v_pre1/mapping?trait_id=10015&db=BXDPublish&method=gemma&use_loco=true
+curl http://genenetwork.org/api/v_pre1/mapping?trait_id=10015&db=BXDPublish&method=gemma&use_loco=true
```
### R/qtl ###
@@ -146,7 +146,7 @@ curl http://gn2.genenetwork.org/api/v_pre1/mapping?trait_id=10015&db=BXDPublish&
Example query:
```
-curl http://gn2.genenetwork.org/api/v_pre1/mapping?trait_id=1418701_at&db=HC_M2_0606_P&method=rqtl&num_perm=100
+curl http://genenetwork.org/api/v_pre1/mapping?trait_id=1418701_at&db=HC_M2_0606_P&method=rqtl&num_perm=100
```
Some combinations of methods/models may not make sense. The R/qtl manual should be referred to for any questions on its use (specifically the scanone function in this case)
@@ -164,6 +164,6 @@ This query currently takes the following parameters (though more will be added):
Example query:
```
-curl http://gn2.genenetwork.org/api/v_pre1/correlation?trait_id=1427571_at&db=HC_M2_0606_P&target_db=BXDPublish&type=sample&return_count=100
+curl http://genenetwork.org/api/v_pre1/correlation?trait_id=1427571_at&db=HC_M2_0606_P&target_db=BXDPublish&type=sample&return_count=100
[ { "#_strains": 6, "p_value": 0.004804664723032055, "sample_r": -0.942857142857143, "trait": 20511 }, { "#_strains": 6, "p_value": 0.004804664723032055, "sample_r": -0.942857142857143, "trait": 20724 }, { "#_strains": 12, "p_value": 1.8288943424888848e-05, "sample_r": -0.9233615170820528, "trait": 13536 }, { "#_strains": 7, "p_value": 0.006807187408935392, "sample_r": 0.8928571428571429, "trait": 10157 }, { "#_strains": 7, "p_value": 0.006807187408935392, "sample_r": -0.8928571428571429, "trait": 20392 }, ... ]
```
diff --git a/wqflask/base/data_set.py b/wqflask/base/data_set.py
index fae62875..8652e6b7 100644
--- a/wqflask/base/data_set.py
+++ b/wqflask/base/data_set.py
@@ -56,7 +56,7 @@ from pprint import pformat as pf
from db.gn_server import menu_main
from db.call import fetchall,fetchone,fetch1
-from utility.tools import USE_GN_SERVER, USE_REDIS, flat_files, flat_file_exists
+from utility.tools import USE_GN_SERVER, USE_REDIS, flat_files, flat_file_exists, GN2_BASE_URL
from utility.logger import getLogger
logger = getLogger(__name__ )
@@ -94,7 +94,7 @@ Publish or ProbeSet. E.g.
"""
self.datasets = {}
if rebuild: #ZS: May make this the only option
- data = json.loads(requests.get("http://gn2.genenetwork.org/api/v_pre1/gen_dropdown").content)
+ data = json.loads(requests.get(GN2_BASE_URL + "/api/v_pre1/gen_dropdown").content)
#data = gen_menu.gen_dropdown_json()
else:
file_name = "wqflask/static/new/javascript/dataset_menu_structure.json"
diff --git a/wqflask/base/trait.py b/wqflask/base/trait.py
index 5525472e..e454c593 100644
--- a/wqflask/base/trait.py
+++ b/wqflask/base/trait.py
@@ -14,6 +14,7 @@ from base.data_set import create_dataset
from db import webqtlDatabaseFunction
from utility import webqtlUtil
from utility import hmac
+from utility.tools import GN2_BASE_URL
from wqflask import app
@@ -135,9 +136,9 @@ class GeneralTrait(object):
alias = 'Not available'
if self.symbol:
- human_response = requests.get("http://gn2.genenetwork.org/gn3/gene/aliases/" + self.symbol.upper())
- mouse_response = requests.get("http://gn2.genenetwork.org/gn3/gene/aliases/" + self.symbol.capitalize())
- other_response = requests.get("http://gn2.genenetwork.org/gn3/gene/aliases/" + self.symbol.lower())
+ human_response = requests.get(GN2_BASE_URL + "gn3/gene/aliases/" + self.symbol.upper())
+ mouse_response = requests.get(GN2_BASE_URL + "gn3/gene/aliases/" + self.symbol.capitalize())
+ other_response = requests.get(GN2_BASE_URL + "gn3/gene/aliases/" + self.symbol.lower())
if human_response and mouse_response and other_response:
alias_list = json.loads(human_response.content) + json.loads(mouse_response.content) + json.loads(other_response.content)
diff --git a/wqflask/utility/tools.py b/wqflask/utility/tools.py
index 0fbedccb..9354ece6 100644
--- a/wqflask/utility/tools.py
+++ b/wqflask/utility/tools.py
@@ -234,6 +234,8 @@ def show_settings():
GN_VERSION = get_setting('GN_VERSION')
HOME = get_setting('HOME')
WEBSERVER_MODE = get_setting('WEBSERVER_MODE')
+GN2_BASE_URL = get_setting('GN2_BASE_URL')
+GN2_BRANCH_URL = get_setting('GN2_BRANCH_URL')
GN_SERVER_URL = get_setting('GN_SERVER_URL')
SERVER_PORT = get_setting_int('SERVER_PORT')
SQL_URI = get_setting('SQL_URI')
diff --git a/wqflask/wqflask/ctl/ctl_analysis.py b/wqflask/wqflask/ctl/ctl_analysis.py
index 6fda02fd..4415b86a 100644
--- a/wqflask/wqflask/ctl/ctl_analysis.py
+++ b/wqflask/wqflask/ctl/ctl_analysis.py
@@ -20,7 +20,7 @@ from base import data_set
from base import trait as TRAIT
from utility import helper_functions
-from utility.tools import locate
+from utility.tools import locate, GN2_BRANCH_URL
from rpy2.robjects.packages import importr
@@ -56,6 +56,8 @@ class CTL(object):
self.edges_list = []
logger.info("Obtained pointers to CTL functions")
+ self.gn2_url = GN2_BRANCH_URL
+
def addNode(self, gt):
node_dict = { 'data' : {'id' : str(gt.name) + ":" + str(gt.dataset.name),
'sid' : str(gt.name),
diff --git a/wqflask/wqflask/do_search.py b/wqflask/wqflask/do_search.py
index 05caa100..b0ca5ced 100644
--- a/wqflask/wqflask/do_search.py
+++ b/wqflask/wqflask/do_search.py
@@ -13,6 +13,7 @@ import sys
# sys.path.append("..") Never in a running webserver
from db import webqtlDatabaseFunction
+from utility.tools import GN2_BASE_URL
import logging
from utility.logger import getLogger
@@ -919,7 +920,7 @@ def get_aliases(symbol, species):
return []
filtered_aliases = []
- response = requests.get("http://gn2.genenetwork.org/gn3/gene/aliases/" + symbol_string)
+ response = requests.get(GN2_BASE_URL + "/gn3/gene/aliases/" + symbol_string)
if response:
alias_list = json.loads(response.content)
diff --git a/wqflask/wqflask/network_graph/network_graph.py b/wqflask/wqflask/network_graph/network_graph.py
index a332db46..152e4168 100644
--- a/wqflask/wqflask/network_graph/network_graph.py
+++ b/wqflask/wqflask/network_graph/network_graph.py
@@ -47,6 +47,7 @@ from utility.TDCell import TDCell
from base.trait import GeneralTrait
from base import data_set
from utility import webqtlUtil, helper_functions, corr_result_helpers
+from utility.tools import GN2_BRANCH_URL
from db import webqtlDatabaseFunction
import utility.webqtlUtil #this is for parallel computing only.
from wqflask.correlation import correlation_functions
@@ -195,6 +196,7 @@ class NetworkGraph(object):
self.nodes_list.append(node_dict)
self.elements = json.dumps(self.nodes_list + self.edges_list)
+ self.gn2_url = GN2_BRANCH_URL
groups = []
for sample in self.all_sample_list:
diff --git a/wqflask/wqflask/search_results.py b/wqflask/wqflask/search_results.py
index 698389ab..8f702d58 100644
--- a/wqflask/wqflask/search_results.py
+++ b/wqflask/wqflask/search_results.py
@@ -28,6 +28,7 @@ from flask import render_template, Flask, g
from utility import formatting
from utility import hmac
+from utility.tools import GN2_BASE_URL
from utility.type_checking import is_float, is_int, is_str, get_float, get_int, get_string
from utility.logger import getLogger
@@ -295,7 +296,7 @@ def get_aliases(symbol_list, species):
symbols_string = ",".join(updated_symbols)
filtered_aliases = []
- response = requests.get("http://gn2.genenetwork.org/gn3/gene/aliases2/" + symbols_string)
+ response = requests.get(GN2_BASE_URL + "/gn3/gene/aliases2/" + symbols_string)
if response:
alias_lists = json.loads(response.content)
seen = set()
diff --git a/wqflask/wqflask/static/new/javascript/ctl_graph.js b/wqflask/wqflask/static/new/javascript/ctl_graph.js
index 94bd7e9d..bd950592 100644
--- a/wqflask/wqflask/static/new/javascript/ctl_graph.js
+++ b/wqflask/wqflask/static/new/javascript/ctl_graph.js
@@ -82,18 +82,12 @@ window.onload=function() {
function create_qtips(cy){
cy.nodes().qtip({
content: function(){
- gn_link = '
'+''+this.data().id +''+''
+ gn_link = '
'+''+this.data().id +''+''
ncbi_link = '
NCBI'+'
'
omim_link = 'OMIM'+'
'
qtip_content = gn_link + ncbi_link + omim_link
return qtip_content
- //return ''+''+this.data().id +''+''
},
- // content: {
- // title: ''+''+this.target() +''+'',
- // text: this.target,
- // button: true
- // },
position: {
my: 'top center',
at: 'bottom center'
diff --git a/wqflask/wqflask/static/new/javascript/dataset_select_menu_orig.js b/wqflask/wqflask/static/new/javascript/dataset_select_menu_orig.js
index fad600d2..794804f4 100644
--- a/wqflask/wqflask/static/new/javascript/dataset_select_menu_orig.js
+++ b/wqflask/wqflask/static/new/javascript/dataset_select_menu_orig.js
@@ -74,7 +74,6 @@ redo_dropdown = function(dropdown, items) {
this_opt_group = null
for (_i = 0, _len = group_family_list.length; _i < _len; _i++) {
item = group_family_list[_i];
- console.log("THE ITEM:", item)
if (item[2] != "None" && current_family == ""){
current_family = item[2]
this_opt_group = $("