aboutsummaryrefslogtreecommitdiff
path: root/wqflask
diff options
context:
space:
mode:
authorzsloan2017-12-04 17:50:14 +0000
committerzsloan2017-12-04 17:50:14 +0000
commit5813a1a3006dc67278eb094513c455b9cb2fa91f (patch)
tree34d8d12f4363326bb1505eded6126b3e7a4c5c56 /wqflask
parent09fb1581bd403f88df403939a931c8c3bbfa1ad0 (diff)
downloadgenenetwork2-5813a1a3006dc67278eb094513c455b9cb2fa91f.tar.gz
Fixed drop-down scripts to more appropriately deal with BXD300 groups (though there's still a minor issue with a few datasets)
Added some header data to mapping output file Fixed links in Network Group nodes/edges
Diffstat (limited to 'wqflask')
-rw-r--r--wqflask/maintenance/gen_select_dataset.py5
-rw-r--r--wqflask/wqflask/marker_regression/marker_regression.py26
-rw-r--r--wqflask/wqflask/static/new/javascript/dataset_menu_structure.json96
-rw-r--r--wqflask/wqflask/static/new/javascript/dataset_select_menu_orig.js5
-rw-r--r--wqflask/wqflask/static/new/javascript/network_graph.js11
5 files changed, 122 insertions, 21 deletions
diff --git a/wqflask/maintenance/gen_select_dataset.py b/wqflask/maintenance/gen_select_dataset.py
index 6553f090..1123f997 100644
--- a/wqflask/maintenance/gen_select_dataset.py
+++ b/wqflask/maintenance/gen_select_dataset.py
@@ -96,13 +96,14 @@ def get_groups(species):
Cursor.execute("""select InbredSet.Name, InbredSet.FullName from InbredSet,
Species,
ProbeFreeze, GenoFreeze, PublishFreeze where Species.Name = '%s'
- and InbredSet.SpeciesId = Species.Id and InbredSet.Name != 'BXD300' and
+ and InbredSet.SpeciesId = Species.Id and
(PublishFreeze.InbredSetId = InbredSet.Id
or GenoFreeze.InbredSetId = InbredSet.Id
or ProbeFreeze.InbredSetId = InbredSet.Id)
group by InbredSet.Name
order by InbredSet.Name""" % species_name)
- groups[species_name] = list(Cursor.fetchall())
+ results = Cursor.fetchall()
+ groups[species_name] = list(results)
return groups
diff --git a/wqflask/wqflask/marker_regression/marker_regression.py b/wqflask/wqflask/marker_regression/marker_regression.py
index 9e01be3e..bcb14451 100644
--- a/wqflask/wqflask/marker_regression/marker_regression.py
+++ b/wqflask/wqflask/marker_regression/marker_regression.py
@@ -277,7 +277,7 @@ class MarkerRegression(object):
if ('lod_score' in marker.keys()) or ('lrs_value' in marker.keys()):
self.qtl_results.append(marker)
- export_mapping_results(self.qtl_results, self.mapping_results_path, self.mapping_scale, self.score_type)
+ export_mapping_results(self.dataset, self.this_trait, self.qtl_results, self.mapping_results_path, self.mapping_scale, self.score_type)
self.trimmed_markers = trim_markers_for_table(results)
@@ -608,29 +608,35 @@ def create_snp_iterator_file(group):
with gzip.open(snp_file_base, "wb") as fh:
pickle.dump(data, fh, pickle.HIGHEST_PROTOCOL)
-def export_mapping_results(markers, results_path, mapping_scale, score_type):
+def export_mapping_results(dataset, trait, markers, results_path, mapping_scale, score_type):
with open(results_path, "w+") as output_file:
- output_file.write("Name\tChr\t")
+ output_file.write("Population: " + dataset.group.species.title() + " " + dataset.group.name + "\n")
+ output_file.write("Data Set: " + dataset.fullname + "\n")
+ if dataset.type == "ProbeSet":
+ output_file.write("Gene Symbol: " + trait.symbol + "\n")
+ output_file.write("Location: " + str(trait.chr) + " @ " + str(trait.mb) + " Mb\n")
+ output_file.write("\n")
+ output_file.write("Name,Chr,")
if mapping_scale == "physic":
- output_file.write("Mb\t" + score_type)
+ output_file.write("Mb," + score_type)
else:
- output_file.write("Cm\t" + score_type)
+ output_file.write("Cm," + score_type)
if "additive" in markers[0].keys():
- output_file.write("\tAdditive")
+ output_file.write(",Additive")
if "dominance" in markers[0].keys():
- output_file.write("\tDominance")
+ output_file.write(",Dominance")
output_file.write("\n")
for i, marker in enumerate(markers):
logger.debug("THE MARKER:", marker)
- output_file.write(marker['name'] + "\t" + str(marker['chr']) + "\t" + str(marker['Mb']) + "\t")
+ output_file.write(marker['name'] + "," + str(marker['chr']) + "," + str(marker['Mb']) + ",")
if "lod_score" in marker.keys():
output_file.write(str(marker['lod_score']))
else:
output_file.write(str(marker['lrs_value']))
if "additive" in marker.keys():
- output_file.write("\t" + str(marker['additive']))
+ output_file.write("," + str(marker['additive']))
if "dominance" in marker.keys():
- output_file.write("\t" + str(marker['dominance']))
+ output_file.write("," + str(marker['dominance']))
if i < (len(markers) - 1):
output_file.write("\n")
diff --git a/wqflask/wqflask/static/new/javascript/dataset_menu_structure.json b/wqflask/wqflask/static/new/javascript/dataset_menu_structure.json
index 75767f47..8bdd91db 100644
--- a/wqflask/wqflask/static/new/javascript/dataset_menu_structure.json
+++ b/wqflask/wqflask/static/new/javascript/dataset_menu_structure.json
@@ -2021,6 +2021,21 @@
"UCHSC BXD Whole Brain M430 2.0 (Nov06) RMA"
],
[
+ "113",
+ "IBR_M_0606_R",
+ "INIA Brain mRNA M430 (Jun06) RMA"
+ ],
+ [
+ "101",
+ "IBR_M_0106_P",
+ "INIA Brain mRNA M430 (Jan06) PDNN"
+ ],
+ [
+ "102",
+ "IBR_M_0106_R",
+ "INIA Brain mRNA M430 (Jan06) RMA"
+ ],
+ [
"95",
"BR_U_1105_P",
"UTHSC Brain mRNA U74Av2 (Nov05) PDNN"
@@ -2065,6 +2080,36 @@
],
"Cerebellum mRNA": [
[
+ "72",
+ "GCB_M2_0505_R",
+ "GE-NIAAA Cerebellum mRNA M430v2 (May05) RMA"
+ ],
+ [
+ "73",
+ "GCB_M2_0505_P",
+ "GE-NIAAA Cerebellum mRNA M430v2 (May05) PDNN"
+ ],
+ [
+ "71",
+ "GCB_M2_0505_M",
+ "GE-NIAAA Cerebellum mRNA M430v2 (May05) MAS5"
+ ],
+ [
+ "56",
+ "CB_M_0305_R",
+ "SJUT Cerebellum mRNA M430 (Mar05) RMA"
+ ],
+ [
+ "55",
+ "CB_M_0305_P",
+ "SJUT Cerebellum mRNA M430 (Mar05) PDNN"
+ ],
+ [
+ "54",
+ "CB_M_0305_M",
+ "SJUT Cerebellum mRNA M430 (Mar05) MAS5"
+ ],
+ [
"46",
"CB_M_1004_R",
"SJUT Cerebellum mRNA M430 (Oct04) RMA"
@@ -2909,6 +2954,39 @@
]
]
},
+ "BXD300": {
+ "Genotypes": [
+ [
+ "None",
+ "BXD300Geno",
+ "BXD300 Genotypes"
+ ]
+ ],
+ "Liver mRNA": [
+ [
+ "105",
+ "LV_G_0106_B",
+ "UNC Agilent G4121A Liver LOWESS Stanford (Jan06) Both Sexes"
+ ],
+ [
+ "103",
+ "LV_G_0106_M",
+ "UNC Agilent G4121A Liver LOWESS Stanford (Jan06) Males"
+ ],
+ [
+ "104",
+ "LV_G_0106_F",
+ "UNC Agilent G4121A Liver LOWESS Stanford (Jan06) Females"
+ ]
+ ],
+ "Phenotypes": [
+ [
+ "None",
+ "BXD300Publish",
+ "BXD300 Published Phenotypes"
+ ]
+ ]
+ },
"BXH": {
"Bone Femur mRNA": [
[
@@ -3766,6 +3844,10 @@
"BXD Bone"
],
[
+ "BXD300",
+ "BXD300"
+ ],
+ [
"BXH",
"BXH"
],
@@ -4905,6 +4987,20 @@
"Phenotypes"
]
],
+ "BXD300": [
+ [
+ "Phenotypes",
+ "Phenotypes"
+ ],
+ [
+ "Genotypes",
+ "Genotypes"
+ ],
+ [
+ "Liver mRNA",
+ "Liver mRNA"
+ ]
+ ],
"BXH": [
[
"Phenotypes",
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 fd96eb78..d5ce6f84 100644
--- a/wqflask/wqflask/static/new/javascript/dataset_select_menu_orig.js
+++ b/wqflask/wqflask/static/new/javascript/dataset_select_menu_orig.js
@@ -24,6 +24,11 @@ $(function() {
console.log("in populate group");
species = $('#species').val();
group_list = this.jdata.groups[species];
+ for (_i = 0, _len = group_list.length; _i < (_len - 1); _i++) {
+ if (group_list[_i][0] == "BXD300"){
+ group_list.splice(_i, 1)
+ }
+ }
redo_dropdown($('#group'), group_list);
if ($('#type').length > 0) { //This is to determine if it's the index page or the submit_trait page (which only has species and group selection and no make default option)
return populate_type();
diff --git a/wqflask/wqflask/static/new/javascript/network_graph.js b/wqflask/wqflask/static/new/javascript/network_graph.js
index 0129bcae..0ecf4743 100644
--- a/wqflask/wqflask/static/new/javascript/network_graph.js
+++ b/wqflask/wqflask/static/new/javascript/network_graph.js
@@ -82,7 +82,7 @@ window.onload=function() {
cy.nodes().qtip({
content: function(){
qtip_content = ''
- gn_link = '<b>'+'<a href="http://gn2.genenetwork.org/show_trait?trait_id=' + this.data().id + '&dataset=' + this.data().dataset + '" >'+this.data().id +'</a>'+'</b><br>'
+ gn_link = '<b>'+'<a href="http://gn2.genenetwork.org/show_trait?trait_id=' + this.data().id.split(":")[0] + '&dataset=' + this.data().id.split(":")[1] + '" >'+this.data().id +'</a>'+'</b><br>'
qtip_content += gn_link
if (typeof(this.data().geneid) !== 'undefined'){
ncbi_link = '<a href="http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?db=gene&cmd=Retrieve&dopt=Graphics&list_uids=' + this.data().geneid + '" >NCBI<a>'+'<br>'
@@ -92,15 +92,8 @@ window.onload=function() {
omim_link = '<a href="http://www.ncbi.nlm.nih.gov/omim/' + this.data().omim + '" >OMIM<a>'+'<br>'
qtip_content += omim_link
}
- //qtip_content = gn_link + ncbi_link + omim_link
return qtip_content
- //return '<b>'+'<a href="http://gn2.genenetwork.org/show_trait?trait_id=' + this.data().id + '&dataset=' + this.data().dataset + '" >'+this.data().id +'<a>'+'</b>'
},
- // content: {
- // title: '<b>'+'<a href="http://gn2.genenetwork.org/show_trait?trait_id=' + this.target() + '&dataset=' + this.dataset() + '" >'+this.target() +'<a>'+'</b>',
- // text: this.target,
- // button: true
- // },
position: {
my: 'top center',
at: 'bottom center'
@@ -119,7 +112,7 @@ window.onload=function() {
correlation_line = '<b>Sample r: ' + this.data().correlation + '</b><br>'
p_value_line = 'Sample p(r): ' + this.data().p_value + '<br>'
overlap_line = 'Overlap: ' + this.data().overlap + '<br>'
- scatter_plot = '<a href="http://gn2-zach.genenetwork.org/corr_scatter_plot?dataset_1=' + this.data().source_dataset + '&dataset_2=' + this.data().target_dataset + '&trait_1=' + this.data().source + '&trait_2=' + this.data().target + '" >View Scatterplot</a>'
+ scatter_plot = '<a href="http://gn2-zach.genenetwork.org/corr_scatter_plot?dataset_1=' + this.data().source.split(":")[1] + '&dataset_2=' + this.data().target.split(":")[1] + '&trait_1=' + this.data().source.split(":")[0] + '&trait_2=' + this.data().target.split(":")[0] + '" >View Scatterplot</a>'
return correlation_line + p_value_line + overlap_line + scatter_plot
},
position: {