From 88022d6c26b320cb614454b706fad26fcd34033e Mon Sep 17 00:00:00 2001
From: root
Date: Thu, 31 May 2012 17:10:28 -0500
Subject: On branch develop Changes to be committed: modified:
web/javascript/jqueryFunction.js modified:
web/webqtl/correlation/CorrelationPage.py modified:
web/webqtl/showTrait/DataEditingPage.py
---
web/javascript/jqueryFunction.js | 2041 ++++++++++++++---------------
web/webqtl/correlation/CorrelationPage.py | 1118 +++++++++-------
web/webqtl/showTrait/DataEditingPage.py | 35 +-
3 files changed, 1648 insertions(+), 1546 deletions(-)
mode change 100644 => 100755 web/javascript/jqueryFunction.js
mode change 100644 => 100755 web/webqtl/showTrait/DataEditingPage.py
(limited to 'web')
diff --git a/web/javascript/jqueryFunction.js b/web/javascript/jqueryFunction.js
old mode 100644
new mode 100755
index 5e6641cd..e612098b
--- a/web/javascript/jqueryFunction.js
+++ b/web/javascript/jqueryFunction.js
@@ -1,80 +1,75 @@
/*
jquery part
*/
-
/*
used by index (base/indexBody.py)
*/
-
-$(document).ready(function(){
+$(document).ready(function () {
options_visible = 0; //Whether advanced options are being shown
-
$('tr .advanced_option').hide();
- $('.toggle_advanced').click(function(){
+ $('.toggle_advanced').click(function () {
$('tr .advanced_option').toggle();
-
- if (options_visible = 0) {
- $('.full_search_td').css('display','none;');
- $('.search_td').css('display','inline');
- options_visible = 1;
- }
- else {
- if ($('#type_menu.type_menu').val() = 'Hippocampus'){
- $('.search_td').css('display','none;');
- $('.full_search_td').css('display','inline');
- }
- options_visible = 0;
- }
+
+ if (options_visible = 0) {
+ $('.full_search_td').css('display', 'none;');
+ $('.search_td').css('display', 'inline');
+ options_visible = 1;
+ } else {
+ if ($('#type_menu.type_menu').val() = 'Hippocampus') {
+ $('.search_td').css('display', 'none;');
+ $('.full_search_td').css('display', 'inline');
+ }
+ options_visible = 0;
+ }
});
- $('#full_search').click(function(){
+ $('#full_search').click(function () {
gene_symbol = $('input[name=keyword]').val();
scriptable_interface_url = 'http://alexandria.uthsc.edu:89/webqtl/main.py?cmd=sch&gene=' + gene_symbol;
- window.open(scriptable_interface_url,'_self');
+ window.open(scriptable_interface_url, '_self');
});
});
-$('select.type_menu').live('change', function() {
+$('select.type_menu').live('change', function () {
var trait_type = $('select.type_menu option:selected').val();
- $('#tissue').val(trait_type);
- $('#tissue').trigger('change');
+ $('#tissue').val(trait_type);
+ $('#tissue').trigger('change');
});
/*
used by CorrelationPage.py, AddToSelectionPage.py, and SearchResultPage.py
*/
-$(document).ready(function(){
- $('img[name=addselect], img[name=networkgraph], img[name=corrmatrix], img[name=partialCorr], img[name=comparecorr], img[name=mintmap], img[name=heatmap]').click(function(){
- if ($('input[name=searchResult]:checked').length < 1){
- for (i=0; i<10; i++){
- $('input[name=searchResult]:eq('+i+')').attr('checked',true);
+$(document).ready(function () {
+ $('img[name=addselect], img[name=networkgraph], img[name=corrmatrix], img[name=partialCorr], img[name=comparecorr], img[name=mintmap], img[name=heatmap]').click(function () {
+ if ($('input[name=searchResult]:checked').length < 1) {
+ for (i = 0; i < 10; i++) {
+ $('input[name=searchResult]:eq(' + i + ')').attr('checked', true);
}
}
});
- $('img[name=addselect]').click(function(){
- addRmvSelection($('input[name=RISet]').val(), document.getElementsByName('showDatabase'+ $('input[name=RISet]').val())[0], 'addToSelection');
+ $('img[name=addselect]').click(function () {
+ addRmvSelection($('input[name=RISet]').val(), document.getElementsByName('showDatabase' + $('input[name=RISet]').val())[0], 'addToSelection');
});
- $('.toggleShowHide').click(function(){
+ $('.toggleShowHide').click(function () {
var className = '.extra_options';
- if ($(className).css('display') == 'none'){
- var less = 'less';
- $('input[name=showHideOptions]').val(less);
+ if ($(className).css('display') == 'none') {
+ var less = 'less';
+ $('input[name=showHideOptions]').val(less);
$(className).show();
$('input[name=options]').val('Fewer Options');
var display = $('input[name=options]').css('display')
- $(display).val('block');
- }
- else {
- var more = 'more';
- $('input[name=showHideOptions]').val(more);
- $(className).hide();
- $('input[name=options]').val('More Options');
- var display = $('input[name=showHideOptions]').css('display')
- $(display).val('block');
+ $(display).val('block');
+ } else {
+ var more = 'more';
+ $('input[name=showHideOptions]').val(more);
+ $(className).hide();
+ $('input[name=options]').val('More Options');
+ var display = $('input[name=showHideOptions]').css('display')
+ $(display).val('block');
}
});
});
@@ -83,82 +78,91 @@ $(document).ready(function(){
used by AddToSelectionPage.py
*/
function validateTraitNumber() {
- var checkBoxes = $('.checkallbox');
- if (checkBoxes.filter(":checked").length < 2) {
- alert("Please select at least two traits.");
- return false;
- }
- else {
- return true;
- }
+ var checkBoxes = $('.checkallbox');
+ if (checkBoxes.filter(":checked").length < 2) {
+ alert("Please select at least two traits.");
+ return false;
+ } else {
+ return true;
+ }
}
/*
used by TextSearchPage.py
*/
-$(document).ready(function(){
-
- $('.add_traits').click(function(){
- $('input[name=searchResult]').each(function(){
- if ($(this).is(':checked')){
- groupName = $(this).parents().next().next().children('[href]').text();
- addORrmv = 'addToSelection';
- thisForm = $('form[name=showDatabase]');
- addRmvSelection_allGroups(groupName, thisForm, addORrmv);
- }
- });
- });
-
- function addRmvSelection_allGroups(groupName, thisForm, addORrmv){
- thisForm.attr('target',groupName);
- thisForm.children('input[name=FormID]:hidden').val(addORrmv);
- thisForm.children('input[name=RISet]:hidden').val(groupName);
- var newWindow = open("",thisForm.attr('target'),"menubar=1,toolbar=1,location=1,resizable=1,status=1,scrollbars=1,directories=1,width=900");
- thisForm.submit();
- }
-
- $('.tab_content').hide(); //Hide all tab content
- $('div.tab_container').each(function(){
- $(this).parent('td').find('div.tab_container:first').find('div.tab_content:first').show();
- });
- $('ul.tabs').each(function(){
- $(this).find('li:first').addClass('active');
- });
- $('ul.tabs:first').find('li:first').show();
- $('.tab_container:first').find('.tab_content:first').show();
-
- //On Click Event
- $('ul.tabs li').click(function() {
- $('ul.tabs').find('li').removeClass('last_viewed');
- if($(this).parent('ul.tabs').next('div.tab_container').attr('id').indexOf('stats') != 1){
- $(this).addClass('last_viewed');
- }
- $(this).parent('ul.tabs').find('li').removeClass('active');
- $(this).addClass('active');
- $(this).parent('ul.tabs').next('div.tab_container').find('.tab_content').hide();
- var activeTab = $(this).find('a').attr('href');
- if ($.browser.msie)
- {$(activeTab).show();}
- else
- {$(activeTab).fadeIn();} //Fade in the active ID content
-
- return false;
- });
+$(document).ready(function () {
+
+ $('.add_traits').click(function () {
+ $('input[name=searchResult]').each(function () {
+ if ($(this).is(':checked')) {
+ groupName = $(this).parents().next().next().children('[href]').text();
+ addORrmv = 'addToSelection';
+ thisForm = $('form[name=showDatabase]');
+ addRmvSelection_allGroups(groupName, thisForm, addORrmv);
+ }
+ });
+ });
+
+ function addRmvSelection_allGroups(groupName, thisForm, addORrmv) {
+ thisForm.attr('target', groupName);
+ thisForm.children('input[name=FormID]:hidden').val(addORrmv);
+ thisForm.children('input[name=RISet]:hidden').val(groupName);
+ var newWindow = open("", thisForm.attr('target'), "menubar=1,toolbar=1,location=1,resizable=1,status=1,scrollbars=1,directories=1,width=900");
+ thisForm.submit();
+ }
+
+ $('.tab_content').hide(); //Hide all tab content
+ $('div.tab_container').each(function () {
+ $(this).parent('td').find('div.tab_container:first').find('div.tab_content:first').show();
+ });
+ $('ul.tabs').each(function () {
+ $(this).find('li:first').addClass('active');
+ });
+ $('ul.tabs:first').find('li:first').show();
+ $('.tab_container:first').find('.tab_content:first').show();
+
+ //On Click Event
+ $('ul.tabs li').click(function () {
+ $('ul.tabs').find('li').removeClass('last_viewed');
+ if ($(this).parent('ul.tabs').next('div.tab_container').attr('id').indexOf('stats') != 1) {
+ $(this).addClass('last_viewed');
+ }
+ $(this).parent('ul.tabs').find('li').removeClass('active');
+ $(this).addClass('active');
+ $(this).parent('ul.tabs').next('div.tab_container').find('.tab_content').hide();
+ var activeTab = $(this).find('a').attr('href');
+ if ($.browser.msie) {
+ $(activeTab).show();
+ } else {
+ $(activeTab).fadeIn();
+ } //Fade in the active ID content
+ return false;
+ });
});
/*
used by DataEditingPage.py
*/
-$(document).ready(function() {
+$(document).ready(function () {
+
+ // ZS: This checks the number of columns in order to determine which column to not sort; in this case the plus-minus symbol shouldn't be sortable
+ $('#sortable1,#sortable2').find('th').each(function () {
+ if ($(this).text() == 'SE') {
+ $.tablesorter.defaults.headers = {
+ 3: {
+ sorter: false
+ }
+ };
+ return false;
+ }
+ });
+
+ if ($('#sortable1,#sortable2').find('.outlier').size() > 0) {
+ $('input[name=sample_method]:eq(1)').attr('checked','checked');
+ $('input[name=tissue_method]:eq(1)').attr('checked','checked');
+ }
- // ZS: This checks the number of columns in order to determine which column to not sort; in this case the plus-minus symbol shouldn't be sortable
- $('#sortable1,#sortable2').find('th').each(function() {
- if ($(this).text() == 'SE'){
- $.tablesorter.defaults.headers = { 3: {sorter: false} };
- return false;
- }
- });
/*
ZS: This segment is called by tablesorter.js; it determines where to get the text used when sorting, based on the type of cell.
@@ -167,949 +171,922 @@ $(document).ready(function() {
This segment is repeated twice. Ideally this wouldn't be the case, but I can't find a way to reuse the inner textExtraction function.
*/
- //ZS: Defining these here, so they don't need to be searched for in the DOM for every single node
- primaryTable = $("#sortable1");
- otherTable = $("#sortable2");
-
- primaryValueHeader = primaryTable.find('th:contains("Value"):eq(0)');
- primarySEHeader = primaryTable.find('th:contains("SE"):eq(0)');
- otherValueHeader = otherTable.find('th:contains("Value"):eq(1)');
- otherSEHeader = otherTable.find('th:contains("SE"):eq(1)');
-
- $("#sortable1").tablesorter({
- textExtraction: function(node) {
- if ((node.children[0] == "[object HTMLInputElement]" && node.children[0].type == "text") || (/\S/.test(node.id))) {
- cellId = node.id;
- thisCell = $('#'+cellId).children(':eq(0)')
- valueClassNames = thisCell.attr('class').split(/\s+/);
- capitalized_column_name = cellId.split('_')[0].charAt(0).toUpperCase() + cellId.split('_')[0].slice(1);
- value = valueClassNames[valueClassNames.length - 1];
- newValue = thisCell.val();
-
- if (newValue == 'x' || value == '9999' || value == '-9999') {
- valueType = cellId.split('_')[0];
- if (valueType == 'value'){
- header = primaryValueHeader;
- } else {
- header = primarySEHeader;
- }
-
- if (header.hasClass('headerSortUp')){
- sort_order = 'desc';
- } else if (header.hasClass('headerSortDown')){
- sort_order = 'asc';
- } else {
- sort_order = 'desc';
- }
-
- if (sort_order == 'desc') {
- value = 9999;
- thisCell.removeClass(value).addClass('9999');
- } else if (sort_order == 'asc'){
- value = -9999;
- thisCell.removeClass(value).addClass('-9999');
- } else {
- value = 9999;
- thisCell.removeClass(value).addClass('9999');
- }
- }
-
- text = value;
- }
-
- else {
- if (node.textContent) {
- text = node.textContent;
- } else {
- if (node.childNodes[0] && node.childNodes[0].hasChildNodes()) {
- text = node.childNodes[0].innerHTML;
- } else {
- text = node.innerText;
- }
- }
- }
- return text
- }
- });
-
- $("#sortable2").tablesorter({
- textExtraction: function(node) {
- if ((node.children[0] == "[object HTMLInputElement]" && node.children[0].type == "text") || (/\S/.test(node.id))) {
- cellId = node.id;
- thisCell = $('#'+cellId).children(':eq(0)')
- valueClassNames = thisCell.attr('class').split(/\s+/);
- capitalized_column_name = cellId.split('_')[0].charAt(0).toUpperCase() + cellId.split('_')[0].slice(1);
- value = valueClassNames[valueClassNames.length - 1];
- newValue = thisCell.val();
-
- if (newValue == 'x' || value == '9999' || value == '-9999') {
- valueType = cellId.split('_')[0];
- if (valueType == 'value'){
- header = otherValueHeader;
- } else {
- header = otherSEHeader;
- }
-
- if (header.hasClass('headerSortUp')){
- sort_order = 'desc';
- } else if (header.hasClass('headerSortDown')){
- sort_order = 'asc';
- } else {
- sort_order = 'desc';
- }
-
- if (sort_order == 'desc') {
- value = 9999;
- thisCell.removeClass(value).addClass('9999');
- } else if (sort_order == 'asc'){
- value = -9999;
- thisCell.removeClass(value).addClass('-9999');
- } else {
- value = 9999;
- thisCell.removeClass(value).addClass('9999');
- }
- }
-
- text = value;
- }
-
- else {
- if (node.textContent) {
- text = node.textContent;
- } else {
- if (node.childNodes[0] && node.childNodes[0].hasChildNodes()) {
- text = node.childNodes[0].innerHTML;
- } else {
- text = node.innerText;
- }
- }
- }
- return text
- }
- });
+ //ZS: Defining these here, so they don't need to be searched for in the DOM for every single node
+ primaryTable = $("#sortable1");
+ otherTable = $("#sortable2");
+
+ primaryValueHeader = primaryTable.find('th:contains("Value"):eq(0)');
+ primarySEHeader = primaryTable.find('th:contains("SE"):eq(0)');
+ otherValueHeader = otherTable.find('th:contains("Value"):eq(1)');
+ otherSEHeader = otherTable.find('th:contains("SE"):eq(1)');
+
+ $("#sortable1").tablesorter({
+ textExtraction: function (node) {
+ if ((node.children[0] == "[object HTMLInputElement]" && node.children[0].type == "text") || (/\S/.test(node.id))) {
+ cellId = node.id;
+ thisCell = $('#' + cellId).children(':eq(0)')
+ valueClassNames = thisCell.attr('class').split(/\s+/);
+ capitalized_column_name = cellId.split('_')[0].charAt(0).toUpperCase() + cellId.split('_')[0].slice(1);
+ value = valueClassNames[valueClassNames.length - 1];
+ newValue = thisCell.val();
+
+ if (newValue == 'x' || value == '9999' || value == '-9999') {
+ valueType = cellId.split('_')[0];
+ if (valueType == 'value') {
+ header = primaryValueHeader;
+ } else {
+ header = primarySEHeader;
+ }
+
+ if (header.hasClass('headerSortUp')) {
+ sort_order = 'desc';
+ } else if (header.hasClass('headerSortDown')) {
+ sort_order = 'asc';
+ } else {
+ sort_order = 'desc';
+ }
+
+ if (sort_order == 'desc') {
+ value = 9999;
+ thisCell.removeClass(value).addClass('9999');
+ } else if (sort_order == 'asc') {
+ value = -9999;
+ thisCell.removeClass(value).addClass('-9999');
+ } else {
+ value = 9999;
+ thisCell.removeClass(value).addClass('9999');
+ }
+ }
-/*
+ text = value;
+ } else {
+ if (node.textContent) {
+ text = node.textContent;
+ } else {
+ if (node.childNodes[0] && node.childNodes[0].hasChildNodes()) {
+ text = node.childNodes[0].innerHTML;
+ } else {
+ text = node.innerText;
+ }
+ }
+ }
+ return text
+ }
+ });
+
+ $("#sortable2").tablesorter({
+ textExtraction: function (node) {
+ if ((node.children[0] == "[object HTMLInputElement]" && node.children[0].type == "text") || (/\S/.test(node.id))) {
+ cellId = node.id;
+ thisCell = $('#' + cellId).children(':eq(0)')
+ valueClassNames = thisCell.attr('class').split(/\s+/);
+ capitalized_column_name = cellId.split('_')[0].charAt(0).toUpperCase() + cellId.split('_')[0].slice(1);
+ value = valueClassNames[valueClassNames.length - 1];
+ newValue = thisCell.val();
+
+ if (newValue == 'x' || value == '9999' || value == '-9999') {
+ valueType = cellId.split('_')[0];
+ if (valueType == 'value') {
+ header = otherValueHeader;
+ } else {
+ header = otherSEHeader;
+ }
+
+ if (header.hasClass('headerSortUp')) {
+ sort_order = 'desc';
+ } else if (header.hasClass('headerSortDown')) {
+ sort_order = 'asc';
+ } else {
+ sort_order = 'desc';
+ }
+
+ if (sort_order == 'desc') {
+ value = 9999;
+ thisCell.removeClass(value).addClass('9999');
+ } else if (sort_order == 'asc') {
+ value = -9999;
+ thisCell.removeClass(value).addClass('-9999');
+ } else {
+ value = 9999;
+ thisCell.removeClass(value).addClass('9999');
+ }
+ }
+
+ text = value;
+ } else {
+ if (node.textContent) {
+ text = node.textContent;
+ } else {
+ if (node.childNodes[0] && node.childNodes[0].hasChildNodes()) {
+ text = node.childNodes[0].innerHTML;
+ } else {
+ text = node.innerText;
+ }
+ }
+ }
+ return text
+ }
+ });
+
+ /*
ZS: When the user changes the value in the text field, the new value is added as a class. This is because
$('input[type=text]').val() gets the value attribute, which is always the default value, instead of the
value property (which can be changed)
*/
- var thisTable = $('#sortable1,#sortable2');
-
- thisTable.bind("update propertychange keyup input paste", function(e){
-
- var target = e.target;
- $target = $(target);
-
- if (target.nodeName.toLowerCase() == 'input'){
- thisClassNames = $target.attr('class').split(/\s+/);
- valueClass = thisClassNames[thisClassNames.length - 1];
- newValue = $target.val();
- thisParent = $target.parent('td');
- thisParentId = thisParent.attr('id');
-
- $target.removeClass(valueClass);
-
- if (newValue == 'x'){
- thisParent.parent('tr').addClass('blocked');
- } else {
- $('#'+thisParentId).children('input.valueField:eq(0)').addClass(newValue);
- }
- }
- });
-
- ////////////////////////////////////
- // Initially close tabs
- ////////////////////////////////////
-
- thisForm = $('form[name="dataInput"]');
-
- $('#sectionbody2').hide();
- $('#sectionbody3').hide();
- $('#sectionbody4').hide();
-
- $('#title1').click(function() {
- $('#sectionbody1').toggle();
- return false;
- });
- $('#title2').click(function() {
- $('#sectionbody2').toggle();
- return false;
- });
- $('#title3').click(function() {
- $('#sectionbody3').toggle();
- return false;
- });
- $('#title4').click(function() {
- $('#sectionbody4').toggle();
- return false;
- });
- $('#title5').click(function() {
- $('#sectionbody5').toggle();
- return false;
- });
-
-
-
- //////////////////////////////////////////////////////////////
- // Switch out + and - icon when you click each section header
- //////////////////////////////////////////////////////////////
-
- var expand_html = "";
- var contract_html = "";
-
- $('#title2, #title3, #title4').prepend(expand_html).addClass('1');
-
- $('#title1, #title5').prepend(contract_html).addClass('0');
-
- for(i=1;i<=5;i++){
- $('#title'+i).click(function(){
- if ($(this).hasClass('0')) {
- $(this).find('span').replaceWith(expand_html);
- $(this).removeClass('0');
- $(this).addClass('1');
- }
- else {
- $(this).find('span').replaceWith(contract_html);
- $(this).removeClass('1');
- $(this).addClass('0');
- }
- });
- }
-
- // Exclude cases by attributes
-
- $('div.attribute_values:first').css('display', 'inline'); //Display the dropdown menu with the first attribute's distinct values
-
- $('select[name=exclude_menu]').change(function(){
- $('div.attribute_values').css('display', 'none'); //clear all other menus when a new attribute is selected
- attribute = $(this).val();
- //attribute = $('select[name=exclude_menu]').val();
- menu = $('div.attribute_values').find('[name=\''+attribute+'\']');
- menu.parent().css('display', 'inline');
- });
-
- primary_row_count = $('#primary').find('tr').length - 1;
- other_row_count = $('#other').find('tr').length - 1;
-
- if (primary_row_count >= other_row_count) {
- row_count = primary_row_count;
- }
- else {
- row_count = other_row_count;
- }
-
- $('div.attribute_values').children('select').change(function(){
- exclude_value = $(this).val();
- });
-});
-
-$(window).load(function(){
-
- //ZS: These are needed in a few places; looping through rows by index is faster than doing a "find" search
- numPrimaryRows = $('#sortable1').find('tr').length;
- numOtherRows = $('#sortable2').find('tr').length;
-
-
-///////////////////////////////
-//Basic Statistics
-///////////////////////////////
-
- /////////////////////////////////////////////////////////////////
- // Hide unselected Basic Statistics tabs (when just BXD strains
- // are selected, hide the results for all strains/non-BXD)
- /////////////////////////////////////////////////////////////////
-
- $('#stats_tabs1').hide();
- $('#stats_tabs2').hide();
-
- $('#sectionbody2').find('select[name=stats_mdp]').change(function(){
- selected = $('#sectionbody2').find('select[name=stats_mdp] option:selected').val();
- for (i=0;i<=2;i++){
- $('#stats_tabs'+i).hide();
- }
- $('#stats_tabs'+selected).show();
- });
-
- ////////////////////////////////////////////////////////////////////////
- // Select the same tab across each sample group (when a Box Plot is
- // selected for BXD, switching to Non-BXD will also display a Box Plot)
- ////////////.///////////////////////////////////////////////////////////
-
- var $tabs1 = $('#stats_tabs0').tabs();
- var $tabs2 = $('#stats_tabs1').tabs();
- var $tabs3 = $('#stats_tabs2').tabs();
-
- $tabs1.tabs({
- show: function(event, ui) {
- var selected = $tabs1.tabs('option','selected');
- $tabs2.tabs('select',selected);
- $tabs3.tabs('select',selected);
- }
- });
- $tabs2.tabs({
- show: function(event, ui) {
- var selected = $tabs2.tabs('option','selected');
- $tabs1.tabs('select',selected);
- $tabs3.tabs('select',selected);
- }
- });
- $tabs3.tabs({
- show: function(event, ui) {
- var selected = $tabs3.tabs('option','selected');
- $tabs1.tabs('select',selected);
- $tabs2.tabs('select',selected);
- }
- });
-
-
-///////////////////////////////
-//Calculate Correlations
-///////////////////////////////
-
- $('#sectionbody3').find('input[name="sample_corr"]').click(function() {
- dbValue = $('select[name=database1] option:selected').val();
- $('input[name=database]').val(dbValue);
- criteriaValue = $('select[name=criteria1] option:selected').val();
- $('input[name=criteria]').val(criteriaValue);
- MDPValue = $('select[name=MDPChoice1] option:selected').val();
- $('input[name=MDPChoice]').val(MDPValue);
-
- methodValue = $('input[name=sample_method]:checked').val();
-
- //This simple method can be used now that 'method' is defaulted to None instead of ''
- if (methodValue == "1"){
- $('input[name=method]').val('1');
- }
- else{
- $('input[name=method]').val('2');
- }
-
- dataEditingFunc(this.form,'correlation');
- });
-
- $('#sectionbody3').find('input[name="lit_corr"]').click(function() {
- dbValue = $('select[name=database2] option:selected').val();
- $('input[name=database]').val(dbValue);
- criteriaValue = $('select[name=criteria2] option:selected').val();
- $('input[name=criteria]').val(criteriaValue);
- MDPValue = $('select[name=MDPChoice2] option:selected').val();
- $('input[name=MDPChoice]').val(MDPValue);
-
- $('input[name=method]').val('3');
-
- dataEditingFunc(this.form,'correlation');
- });
-
- $('#sectionbody3').find('input[name="tiss_corr"]').click(function() {
- dbValue = $('select[name=database3] option:selected').val();
- $('input[name=database]').val(dbValue);
- criteriaValue = $('select[name=criteria3] option:selected').val();
- $('input[name=criteria]').val(criteriaValue);
- MDPValue = $('select[name=MDPChoice3] option:selected').val();
- $('input[name=MDPChoice]').val(MDPValue);
-
- methodValue = $('input[name=tissue_method]:checked').val();
-
- if (methodValue == "4"){
- $('input[name=method]').val('4');
- }
- else{
- $('input[name=method]').val('5');
- }
- dataEditingFunc(this.form,'correlation');
- });
-
-///////////////////////////////
-//Mapping Tools
-///////////////////////////////
-
- $('#sectionbody4').find('input[name=interval]').click(function() {
- chrValue = $('select[name=chromosomes1] option:selected').val();
- $('input[name=chromosomes]').val(chrValue);
- scaleValue = $('select[name=scale1] option:selected').val();
- $('input[name=scale]').val(scaleValue);
- $('input[name=controlLocus]').val('');
-
- //Changed the way permValue, bootValue, and parentsValue are acquired; before it was $(____).is(':checked');
- permValue = $('input[name=permCheck1]:checked').val();
- $('input[name=permCheck]').val(permValue);
-
- bootValue = $('input[name=bootCheck1]:checked').val();
- $('input[name=bootCheck]').val(bootValue);
-
- if ($('input[name=parentsf14regression1]:checked').length > 0){
- $('input[name=parentsf14regression]').val('on');
- } else {
- $('input[name=parentsf14regression]').val('off');
- }
-
- varValue = $('input[name=applyVarianceSE1]:checked').val();
- $('input[name=applyVarianceSE]').val(varValue);
-
- dataEditingFunc(this.form,'intervalMap');
- });
-
- var tiptext = "e.g., rs12345";
- controlLocus = $('#sectionbody4').find('input[name=controlLocus]');
-
- if(controlLocus.val() == '' || controlLocus == tiptext) {
- controlLocus.addClass('searchtip').val(tiptext);
- }
-
- controlLocus.focus(function(e) {
- if(controlLocus.val() == tiptext) {
- controlLocus.val('');
- }
- controlLocus.removeClass('searchtip');
- });
-
- controlLocus.blur(function(e) {
- if(controlLocus.val() == '') {
- controlLocus.addClass('searchtip').val(tiptext);
- } else if(controlLocus.val() == tiptext) {
- controlLocus.addClass('searchtip');
- } else {
- controlLocus.removeClass('searchtip');
- }
- });
-
- $('#sectionbody4').find('input[name=composite]').click(function() {
- chrValue = $('select[name=chromosomes2] option:selected').val();
- $('input[name=chromosomes]').val(chrValue);
- scaleValue = $('select[name=scale2] option:selected').val();
- $('input[name=scale]').val(scaleValue);
- controlValue = controlLocus.val();
- if (controlValue != tiptext){
- controlLocus.val(controlValue);
- }
- else{
- controlLocus.val('');
- }
-
- //Changed the way permValue, bootValue, and parentsValue are acquired; before it was $(____).is(':checked');
- permValue = $('input[name=permCheck2]:checked').val();
- $('input[name=permCheck]').val(permValue);
-
- bootValue = $('input[name=bootCheck2]:checked').val();
- $('input[name=bootCheck]').val(bootValue);
-
- if ($('input[name=parentsf14regression3]:checked').length > 0){
- $('input[name=parentsf14regression]').val('on');
- } else {
- $('input[name=parentsf14regression]').val('off');
- }
-
- dataEditingFunc(this.form,'intervalMap');
-
- });
-
- $('#sectionbody4').find('input[name=marker]').click(function() {
- //Changed the way parentsValue is acquired; before it was $(____).is(':checked');
- if ($('input[name=parentsf14regression2]:checked').length > 0){
- $('input[name=parentsf14regression]').val('on');
- } else {
- $('input[name=parentsf14regression]').val('off');
- }
-
- varValue = $('input[name=applyVarianceSE2]:checked').val();
- $('input[name=applyVarianceSE]').val(varValue);
-
- dataEditingFunc(this.form,'markerRegression');
- });
-
-///////////////////////////////
-//Review and Edit Data
-///////////////////////////////
-
- $('input[name=excludeGroup]').click(function(){
- for (i = 1;i <= Math.max(primary_row_count,other_row_count)-1; i++){
- valueExists = 0;
- $('#Primary_'+i+',#Other_'+i).children().each(function(){
- if ($(this).text() == exclude_value) {
- $('#Primary_'+i+',#Other_'+i).addClass('blocked').find('input[type=text]').val('x');
- valueExists = 1;
- return false;
- }
- });
- }
- });
-
- $('.update').click(function(){
- windowName = 'formTarget' + (new Date().getTime());
- newWindow = open("",windowName,"menubar=1,toolbar=1,location=1,resizable=1,status=1,scrollbars=0,directories=1,width=900");
- document.dataInput.target = windowName;
- document.dataInput.submitID.value = "basicStatistics";
-
- primaryData = getTraitData()[0];
- otherData = getTraitData()[1];
- allData = getTraitData()[2];
-
- if (otherData[0].length > 0) {
- if ($('select[name="stats_mdp"] option:selected').val() == 0) {
- document.dataInput.strainNames.value = allData[0].toString();
- document.dataInput.strainVals.value = allData[1].toString();
- document.dataInput.strainVars.value = allData[2].toString();
- }
- else if ($('select[name="stats_mdp"] option:selected').val() == 1) {
- document.dataInput.strainNames.value = primaryData[0].toString();
- document.dataInput.strainVals.value = primaryData[1].toString();
- document.dataInput.strainVars.value = primaryData[2].toString();
- }
- else {
- document.dataInput.strainNames.value = otherData[0].toString();
- document.dataInput.strainVals.value = otherData[1].toString();
- document.dataInput.strainVars.value = otherData[2].toString();
- }
- }
- else {
- document.dataInput.strainNames.value = allData[0].toString();
- document.dataInput.strainVals.value = allData[1].toString();
- document.dataInput.strainVars.value = allData[2].toString();
- }
-
- document.dataInput.submit();
- });
-
- $('input[name="export"]').click(function(){
- windowName = 'formTarget' + (new Date().getTime());
- newWindow = open("",windowName,"menubar=1,toolbar=1,location=1,resizable=1,status=1,scrollbars=0,directories=1,width=900");
- document.dataInput.target = windowName;
- document.dataInput.submitID.value = "exportData";
-
- primaryData = getTraitData()[0];
- otherData = getTraitData()[1];
-
- document.dataInput.strainNames.value = primaryData[0].toString();
- document.dataInput.strainVals.value = primaryData[1].toString();
- document.dataInput.strainVars.value = primaryData[2].toString();
-
- document.dataInput.otherStrainNames.value = otherData[0].toString();
- document.dataInput.otherStrainVals.value = otherData[1].toString();
- document.dataInput.otherStrainVars.value = otherData[2].toString();
-
- attribute_names = new Array();
- $('#primary,#other').find('th.attribute_name').each(function(){
- attribute_names.push($(this).val().toString());
- });
-
- primary_attribute_values = ""; //This string will be structured as a dictionary with a set of values for each attribute; it will be parsed in the ExportPage class
- other_attribute_values = "";
-
- attr_counter = 1; // Counter for each different attribute
- row_counter = 1; // Counter for each value for each attribute
- while (attr_counter <= attribute_names.length){
- attribute_name = $('#primary,#other').find('th.attribute_name:eq('+ (attr_counter-1).toString() + ')').text();
- primary_row_count = $('#primary').find('tr').length - 1;
- other_row_count = $('#other').find('tr').length - 1;
-
- primary_attribute_values += attribute_name + " : ";
- other_attribute_values += attribute_name + " : ";
-
- primary_value_string = ""; //This string of values (in the format 'a,b,c', etc) will be appended to the primary_attribute_values string
- for (row_counter = 1;row_counter <= numPrimaryRows; row_counter++){
- value = $('#primary_attribute'+attr_counter.toString()+'_sample'+row_counter.toString()).text();
- if (row_counter == primary_row_count) {
- primary_value_string += (value + " / ");
- }
- else{
- primary_value_string += (value + ",");
- }
- }
-
- primary_attribute_values += primary_value_string;
-
- other_value_string = ""; //This string of values (in the format 'a,b,c', etc) will be appended to the other_attribute_values string
- for (row_counter = 1;row_counter <= numOtherRows; row_counter++){
- value = $('#other_attribute'+attr_counter.toString()+'_sample'+row_counter.toString()).text();
- if (row_counter == other_row_count) {
- other_value_string += (value + " / ");
- }
- else{
- other_value_string += (value + ",");
- }
- }
- other_attribute_values += other_value_string;
- attr_counter += 1
- }
-
- document.dataInput.extra_attributes.value = primary_attribute_values;
- document.dataInput.other_extra_attributes.value = other_attribute_values;
-
- document.dataInput.submit();
- });
-
- var thisTable = $('#sortable1,#sortable2'); //ZS: variable representing each table, because it's used often
-
- thisTable.find('input[name="selectCheck"]').click(function(){
- if($(this).is(':checked')){
- $(this).parent("").parent("").children("td").css("background-color", "yellow");
- }
- else{
- if(!($(this).parent().parent().hasClass('outlier'))){
- $(this).parent().parent().children("td").css("background-color", "white");
- }
- }
- });
-
- $('input[name=resetButton]').click(function(){
-
- //ZS: Reset "hide no value" and "hide outliers"
- $('#showHideOptions').find('input[name=showHideNoValue]').val(' Hide No Value ');
- $('#showHideOptions').find('input[name=showHideOutliers]').val(' Hide Outliers ');
- noValShown = 1;
- outliersShown = 1;
-
- for (i=1;i<=numPrimaryRows-1;i++){
- var thisRow = $('#Primary_'+i);
- if (thisRow.is('.invisible')){
- thisRow.removeClass('invisible');
- }
- if (thisRow.is('.blocked')){
- thisRow.removeClass('blocked');
- }
- if (thisRow.is(':not(.outlier)')){
- thisRow.css("background-color", "white");
- }
-
- var thisValueField = thisRow.find('.valueField');
-
- var originalValue = thisValueField[0].defaultValue;
- var thisClassNames = thisRow.find('input:eq(1)').attr('class').split(/\s+/);
- var valueClass = thisClassNames[thisClassNames.length-1];
- thisRow.find('input:eq(1)').removeClass(valueClass).addClass(originalValue).val(originalValue);
-
- if (thisValueField.length > 1){
- var originalValue = thisValueField[1].defaultValue;
- var thisClassNames = thisRow.find('input:eq(2)').attr('class').split(/\s+/);
- var valueClass = thisClassNames[thisClassNames.length-1];
- thisRow.find('input:eq(2)').removeClass(valueClass).addClass(originalValue).val(originalValue);
- }
- }
- for (i=1;i<=numOtherRows-1;i++){
- var thisRow = $('#Other_'+i);
- if (thisRow.is('.invisible')){
- thisRow.removeClass('invisible')
- }
- if (thisRow.is('.blocked')){
- thisRow.removeClass('blocked');
- }
- if (thisRow.is(':not(.outlier)')){
- thisRow.css("background-color", "white");
- }
-
- var thisValueField = thisRow.find('.valueField');
-
- var originalValue = thisValueField[0].defaultValue;
- var thisClassNames = thisRow.find('input:eq(1)').attr('class').split(/\s+/);
- var valueClass = thisClassNames[thisClassNames.length-1];
- thisRow.find('input:eq(1)').removeClass(valueClass).addClass(originalValue).val(originalValue);
-
- if (thisValueField.length > 1){
- var originalValue = thisValueField[1].defaultValue;
- var thisClassNames = thisRow.find('input:eq(2)').attr('class').split(/\s+/);
- var valueClass = thisClassNames[thisClassNames.length-1];
- thisRow.find('input:eq(2)').removeClass(valueClass).addClass(originalValue).val(originalValue);
- }
- }
- });
-
- var tiptext2 = "e.g., 4, 6-30, 43";
- var blockField = $('#showHideOptions').find('input[name=removeField]'); //ZS: Field where user inputs the index of the samples he/she wants to block; created variable because it's used often
-
- if(blockField.val() == '' || blockField.val() == tiptext2) {
- blockField.addClass('searchtip');
- blockField.val(tiptext2);
- }
-
- blockField.focus(function(e) {
- if(blockField.val() == tiptext2) {
- blockField.val('');
- }
- blockField.removeClass('searchtip');
- });
-
- blockField.blur(function(e) {
- if(blockField.val() == '') {
- blockField.addClass('searchtip');
- blockField.val(tiptext2);
- } else if(blockField.val() == tiptext2) {
- blockField.addClass('searchtip');
- } else {
- blockField.removeClass('searchtip');
- }
- });
-
- var noValShown = new Boolean(1);
- var outliersShown = new Boolean(1);
-
- $('#showHideOptions').bind('click', function(e){
- var target = e.target;
- $target = $(target);
-
- if (target.name === 'blockSamples'){
- if (blockField.val() == tiptext2){
- blockField.val('')
- }
- blockedText = blockField.val();
- blockedTextSplit = new Array();
- blockedItems = new Array();
-
- blockedTextSplit = blockedText.split(/\,/);
-
- for (i=0;i<=blockedTextSplit.length-1;i++) {
- var item = blockedTextSplit[i];
- if(item.indexOf('-') != -1){
- subArray = new Array();
- subArray = item.split('-');
- num1 = parseInt(subArray[0]);
- num2 = parseInt(subArray[1]);
- for (j=num1;j<=num2;j=j+1){
- blockedItems.push(j);
- }
- }
- else if(!(isNaN(item))) {
- blockedItems.push(item);
- }
- }
-
- for (i=0;i<=blockedItems.length-1;i++) {
- item = blockedItems[i];
- if ($('select[name=block_method]').val() == '0') {
- var thisRow = $('#Other_'+item);
- }
- else {
- var thisRow = $('#Primary_'+item);
- }
-
- if (thisRow.is('.novalue')) {
- continue;
- }
- else {
- thisRow.addClass('blocked').find('input.valueField').val('x');
- }
-
- //First look at value cell
- var thisCell = thisRow.find('input:eq(1)');
- var thisClassNames = thisCell.attr('class').split(/\s+/);
- var valueClass = thisClassNames[thisClassNames.length-1];
- var header = thisRow.parents('table.tablesorter').find('th.header:contains("Value"):eq(0)');
- if (header.hasClass('headerSortUp')){
- thisCell.removeClass(valueClass).addClass('-9999');
- } else if (header.hasClass('headerSortDown')){
- thisCell.removeClass(valueClass).addClass('9999');
- } else {
- thisCell.removeClass(valueClass).addClass('-9999');
- }
-
- //Check if there is an SE column
- if (thisRow.find('input.valueField').length > 1) {
- var thisCell = thisRow.find('input:eq(2)');
- var thisClassNames = thisCell.attr('class').split(/\s+/);
- var valueClass = thisClassNames[thisClassNames.length-1];
- var header = thisRow.parents('table.tablesorter').find('th.header:contains("SE"):eq(0)');
- if (header.hasClass('headerSortUp')){
- thisCell.removeClass(valueClass).addClass('-9999');
- } else if (header.hasClass('headerSortDown')){
- thisCell.removeClass(valueClass).addClass('9999');
- } else {
- thisCell.removeClass(valueClass).addClass('-9999');
- }
- }
- }
- }
-
- else if (target.name === 'showHideNoValue'){
- if (noValShown) {
- $('#showHideOptions').find('input[name=showHideNoValue]').val(' Show No Value ');
- for (i=1;i<=Math.max(numPrimaryRows,numOtherRows)-1;i++) {
- if (i<=numPrimaryRows-1) {
- var thisRow = $('#Primary_'+i);
- if (thisRow.is('.novalue:visible') || thisRow.is('.blocked:visible')){
- jQuery(thisRow).addClass('invisible');
- }
- }
- if (i<=numOtherRows-1){
- var thisOtherRow = $('#Other_'+i);
- if (thisOtherRow.is('.novalue:visible') || thisOtherRow.is('.blocked:visible')){
- if (thisOtherRow.is(':visible')){
- jQuery(thisOtherRow).addClass('invisible');
- }
- }
- }
- }
- noValShown = 0;
- }
- else {
- $('#showHideOptions').find('input[name=showHideNoValue]').val(' Hide No Value ');
- for (i=1;i<=Math.max(numPrimaryRows,numOtherRows)-1;i++) {
- if (i<=numPrimaryRows-1) {
- var thisRow = $('#Primary_'+i);
- if (thisRow.is('.novalue') || thisRow.is('.blocked')){
- jQuery(thisRow).removeClass('invisible');
- if (!(outliersShown)) {
- if (thisRow.is('.outlier:visible')){
- jQuery(thisRow).addClass('invisible');
- }
- }
- }
- }
- if (i<=numOtherRows-1){
- var thisOtherRow = $('#Other_'+i);
- if (thisOtherRow.is('.novalue') || thisOtherRow.is('.blocked')){
- jQuery(thisOtherRow).removeClass('invisible');
- if (!(outliersShown)) {
- if (thisOtherRow.is('.outlier:visible')){
- jQuery(thisOtherRow).addClass('invisible');
- }
- }
- }
- }
- }
- noValShown = 1;
- }
- }
-
- else if (target.name === 'showHideOutliers'){
- if (outliersShown){
- $('#showHideOptions').find('input[name=showHideOutliers]').val(' Show Outliers ');
- for (i=1;i<=Math.max(numPrimaryRows,numOtherRows)-1;i++) {
- if (i<=numPrimaryRows-1) {
- thisRow = $('#Primary_'+i);
- if (thisRow.is('.outlier:visible') && (!(thisRow.is('.invisible')))) {
- thisRow.addClass('invisible')
- }
- }
- if (i<=numOtherRows-1) {
- thisOtherRow = $('#Other_'+i);
- if (thisOtherRow.is('.outlier:visible') && (!(thisOtherRow.is('.invisible')))) {
- thisOtherRow.addClass('invisible')
- }
- }
- }
- outliersShown = 0;
- }
- else {
- $('#showHideOptions').find('input[name=showHideOutliers]').val(' Hide Outliers ');
- for (i=1;i<=Math.max(numPrimaryRows,numOtherRows)-1;i++) {
- if (i<=numPrimaryRows-1) {
- thisRow = $('#Primary_'+i);
- if (thisRow.is('.outlier') && (!(thisRow.is(':visible')))) {
- if (!(noValShown)) {
- if (thisRow.is('.blocked')){
- continue;
- }
- }
- jQuery(thisRow).removeClass('invisible')
- }
- }
- if (i<=numOtherRows-1) {
- thisOtherRow = $('#Other_'+i);
- if (thisOtherRow.is('.outlier') && (!(thisOtherRow.is(':visible')))) {
- if (!(noValShown)) {
- if (thisOtherRow.is('.blocked')){
- continue;
- }
- }
- jQuery(thisOtherRow).removeClass('invisible')
- }
- }
- }
- outliersShown = 1;
- }
- }
- return false;
- });
-});
-
-function getTraitData(){
- primary_row_count = $('#sortable1').find('tr').length - 1;
- other_row_count = $('#sortable2').find('tr').length - 1;
-
- primaryStrainNames = new Array();
- primaryVals = new Array();
- primaryVars = new Array();
-
- allStrainNames = new Array();
- allVals = new Array();
- allVars = new Array();
-
- for (i = 1;i <= primary_row_count; i++){
- thisRow = $('#Primary_'+i);
- strainName = thisRow.find('span:first').text();
- primaryStrainNames.push(strainName);
- allStrainNames.push(strainName);
- strainVal = thisRow.find('input:eq(1)').val();
- primaryVals.push(strainVal);
- allVals.push(strainVal);
- strainVar = ''; // Just to initialize it in case there is no var
- strainVar = thisRow.find('input:eq(2)').val();
- primaryVars.push(strainVar);
- allVars.push(strainVar);
- }
-
- otherStrainNames = new Array();
- otherVals = new Array();
- otherVars = new Array();
-
- for (j = 1;j <= other_row_count; j++){
- thisRow = $('#Other_'+j)
- strainName = thisRow.find('span:first').text();
- otherStrainNames.push(strainName);
- strainVal = thisRow.find('input:eq(1)').val();
- otherVals.push(strainVal);
- strainVar = ''; // Just to initialize it in case there is no var
- strainVar = thisRow.find('input:eq(2)').val();
- otherVars.push(strainVar);
-
- if (jQuery.inArray(strainName, allStrainNames) == -1) {
- allStrainNames.push(strainName);
- allVals.push(strainVal);
- allVars.push(strainVar);
- }
- }
-
- primaryData = [primaryStrainNames, primaryVals, primaryVars];
- otherData = [otherStrainNames, otherVals, otherVars];
- allData = [allStrainNames, allVals, allVars];
-
- return [primaryData, otherData, allData];
-}
+ var thisTable = $('#sortable1,#sortable2');
+ thisTable.bind("update propertychange keyup input paste", function (e) {
-/*
-used by networkGraphPageBody.py
-*/
+ var target = e.target;
+ $target = $(target);
-//Default to plain text + symbol for the "Export Graph File" button
-$('input[name=exportGraphFile]').live('click', function() { window.open($('input[name=exportFilename]').val() + "_plain_symbol.txt") });
+ if (target.nodeName.toLowerCase() == 'input') {
+ thisClassNames = $target.attr('class').split(/\s+/);
+ valueClass = thisClassNames[thisClassNames.length - 1];
+ newValue = $target.val();
+ thisParent = $target.parent('td');
+ thisParentId = thisParent.attr('id');
+
+ $target.removeClass(valueClass);
+
+ if (newValue == 'x') {
+ thisParent.parent('tr').addClass('blocked');
+ } else {
+ $('#' + thisParentId).children('input.valueField:eq(0)').addClass(newValue);
+ }
+ }
+ });
+
+ ////////////////////////////////////
+ // Initially close tabs
+ ////////////////////////////////////
+ thisForm = $('form[name="dataInput"]');
+
+ $('#sectionbody2').hide();
+ $('#sectionbody3').hide();
+ $('#sectionbody4').hide();
+
+ $('#title1').click(function () {
+ $('#sectionbody1').toggle();
+ return false;
+ });
+ $('#title2').click(function () {
+ $('#sectionbody2').toggle();
+ return false;
+ });
+ $('#title3').click(function () {
+ $('#sectionbody3').toggle();
+ return false;
+ });
+ $('#title4').click(function () {
+ $('#sectionbody4').toggle();
+ return false;
+ });
+ $('#title5').click(function () {
+ $('#sectionbody5').toggle();
+ return false;
+ });
-function changeFormat(graphName){
- var graphFormat = $('#exportFormat').val();
- var traitType = $('#traitType').val();
- $('input[name=exportGraphFile]').die('click');
- if (graphFormat=="xgmml"){
- if (traitType=="symbol"){
- var graphFile = graphName+ "_xgmml_symbol.txt";
- $('input[name=exportGraphFile]').live('click', function() { window.open(graphFile) });
+ //////////////////////////////////////////////////////////////
+ // Switch out + and - icon when you click each section header
+ //////////////////////////////////////////////////////////////
+ var expand_html = "";
+ var contract_html = "";
+
+ $('#title2, #title3, #title4').prepend(expand_html).addClass('1');
+
+ $('#title1, #title5').prepend(contract_html).addClass('0');
+
+ for (i = 1; i <= 5; i++) {
+ $('#title' + i).click(function () {
+ if ($(this).hasClass('0')) {
+ $(this).find('span').replaceWith(expand_html);
+ $(this).removeClass('0');
+ $(this).addClass('1');
+ } else {
+ $(this).find('span').replaceWith(contract_html);
+ $(this).removeClass('1');
+ $(this).addClass('0');
+ }
+ });
+ }
+
+ // Exclude cases by attributes
+ $('div.attribute_values:first').css('display', 'inline'); //Display the dropdown menu with the first attribute's distinct values
+ $('select[name=exclude_menu]').change(function () {
+ $('div.attribute_values').css('display', 'none'); //clear all other menus when a new attribute is selected
+ attribute = $(this).val();
+ //attribute = $('select[name=exclude_menu]').val();
+ menu = $('div.attribute_values').find('[name=\'' + attribute + '\']');
+ menu.parent().css('display', 'inline');
+ });
+
+ primary_row_count = $('#primary').find('tr').length - 1;
+ other_row_count = $('#other').find('tr').length - 1;
+
+ if (primary_row_count >= other_row_count) {
+ row_count = primary_row_count;
+ } else {
+ row_count = other_row_count;
+ }
+
+ $('div.attribute_values').children('select').change(function () {
+ exclude_value = $(this).val();
+ });
+});
+
+$(window).load(function () {
+
+ //ZS: These are needed in a few places; looping through rows by index is faster than doing a "find" search
+ numPrimaryRows = $('#sortable1').find('tr').length;
+ numOtherRows = $('#sortable2').find('tr').length;
+
+
+ ///////////////////////////////
+ //Basic Statistics
+ ///////////////////////////////
+ /////////////////////////////////////////////////////////////////
+ // Hide unselected Basic Statistics tabs (when just BXD strains
+ // are selected, hide the results for all strains/non-BXD)
+ /////////////////////////////////////////////////////////////////
+ $('#stats_tabs1').hide();
+ $('#stats_tabs2').hide();
+
+ $('#sectionbody2').find('select[name=stats_mdp]').change(function () {
+ selected = $('#sectionbody2').find('select[name=stats_mdp] option:selected').val();
+ for (i = 0; i <= 2; i++) {
+ $('#stats_tabs' + i).hide();
+ }
+ $('#stats_tabs' + selected).show();
+ });
+
+ ////////////////////////////////////////////////////////////////////////
+ // Select the same tab across each sample group (when a Box Plot is
+ // selected for BXD, switching to Non-BXD will also display a Box Plot)
+ ////////////.///////////////////////////////////////////////////////////
+ var $tabs1 = $('#stats_tabs0').tabs();
+ var $tabs2 = $('#stats_tabs1').tabs();
+ var $tabs3 = $('#stats_tabs2').tabs();
+
+ $tabs1.tabs({
+ show: function (event, ui) {
+ var selected = $tabs1.tabs('option', 'selected');
+ $tabs2.tabs('select', selected);
+ $tabs3.tabs('select', selected);
+ }
+ });
+ $tabs2.tabs({
+ show: function (event, ui) {
+ var selected = $tabs2.tabs('option', 'selected');
+ $tabs1.tabs('select', selected);
+ $tabs3.tabs('select', selected);
+ }
+ });
+ $tabs3.tabs({
+ show: function (event, ui) {
+ var selected = $tabs3.tabs('option', 'selected');
+ $tabs1.tabs('select', selected);
+ $tabs2.tabs('select', selected);
+ }
+ });
+
+
+ ///////////////////////////////
+ //Calculate Correlations
+ ///////////////////////////////
+ $('#sectionbody3').find('input[name="sample_corr"]').click(function () {
+ dbValue = $('select[name=database1] option:selected').val();
+ $('input[name=database]').val(dbValue);
+ criteriaValue = $('select[name=criteria1] option:selected').val();
+ $('input[name=criteria]').val(criteriaValue);
+ MDPValue = $('select[name=MDPChoice1] option:selected').val();
+ $('input[name=MDPChoice]').val(MDPValue);
+
+ methodValue = $('input[name=sample_method]:checked').val();
+
+ //This simple method can be used now that 'method' is defaulted to None instead of ''
+ if (methodValue == "1") {
+ $('input[name=method]').val('1');
+ } else {
+ $('input[name=method]').val('2');
+ }
+
+ dataEditingFunc(this.form, 'correlation');
+ });
+
+ $('#sectionbody3').find('input[name="lit_corr"]').click(function () {
+ dbValue = $('select[name=database2] option:selected').val();
+ $('input[name=database]').val(dbValue);
+ criteriaValue = $('select[name=criteria2] option:selected').val();
+ $('input[name=criteria]').val(criteriaValue);
+ MDPValue = $('select[name=MDPChoice2] option:selected').val();
+ $('input[name=MDPChoice]').val(MDPValue);
+
+ $('input[name=method]').val('3');
+
+ dataEditingFunc(this.form, 'correlation');
+ });
+
+ $('#sectionbody3').find('input[name="tiss_corr"]').click(function () {
+ dbValue = $('select[name=database3] option:selected').val();
+ $('input[name=database]').val(dbValue);
+ criteriaValue = $('select[name=criteria3] option:selected').val();
+ $('input[name=criteria]').val(criteriaValue);
+ MDPValue = $('select[name=MDPChoice3] option:selected').val();
+ $('input[name=MDPChoice]').val(MDPValue);
+
+ methodValue = $('input[name=tissue_method]:checked').val();
+
+ if (methodValue == "4") {
+ $('input[name=method]').val('4');
+ } else {
+ $('input[name=method]').val('5');
+ }
+ dataEditingFunc(this.form, 'correlation');
+ });
+
+ ///////////////////////////////
+ //Mapping Tools
+ ///////////////////////////////
+ $('#sectionbody4').find('input[name=interval]').click(function () {
+ chrValue = $('select[name=chromosomes1] option:selected').val();
+ $('input[name=chromosomes]').val(chrValue);
+ scaleValue = $('select[name=scale1] option:selected').val();
+ $('input[name=scale]').val(scaleValue);
+ $('input[name=controlLocus]').val('');
+
+ //Changed the way permValue, bootValue, and parentsValue are acquired; before it was $(____).is(':checked');
+ permValue = $('input[name=permCheck1]:checked').val();
+ $('input[name=permCheck]').val(permValue);
+
+ bootValue = $('input[name=bootCheck1]:checked').val();
+ $('input[name=bootCheck]').val(bootValue);
+
+ if ($('input[name=parentsf14regression1]:checked').length > 0) {
+ $('input[name=parentsf14regression]').val('on');
+ } else {
+ $('input[name=parentsf14regression]').val('off');
+ }
+
+ varValue = $('input[name=applyVarianceSE1]:checked').val();
+ $('input[name=applyVarianceSE]').val(varValue);
+
+ dataEditingFunc(this.form, 'intervalMap');
+ });
+
+ var tiptext = "e.g., rs12345";
+ controlLocus = $('#sectionbody4').find('input[name=controlLocus]');
+
+ if (controlLocus.val() == '' || controlLocus == tiptext) {
+ controlLocus.addClass('searchtip').val(tiptext);
+ }
+
+ controlLocus.focus(function (e) {
+ if (controlLocus.val() == tiptext) {
+ controlLocus.val('');
+ }
+ controlLocus.removeClass('searchtip');
+ });
+
+ controlLocus.blur(function (e) {
+ if (controlLocus.val() == '') {
+ controlLocus.addClass('searchtip').val(tiptext);
+ } else if (controlLocus.val() == tiptext) {
+ controlLocus.addClass('searchtip');
+ } else {
+ controlLocus.removeClass('searchtip');
+ }
+ });
+
+ $('#sectionbody4').find('input[name=composite]').click(function () {
+ chrValue = $('select[name=chromosomes2] option:selected').val();
+ $('input[name=chromosomes]').val(chrValue);
+ scaleValue = $('select[name=scale2] option:selected').val();
+ $('input[name=scale]').val(scaleValue);
+ controlValue = controlLocus.val();
+ if (controlValue != tiptext) {
+ controlLocus.val(controlValue);
+ } else {
+ controlLocus.val('');
+ }
+
+ //Changed the way permValue, bootValue, and parentsValue are acquired; before it was $(____).is(':checked');
+ permValue = $('input[name=permCheck2]:checked').val();
+ $('input[name=permCheck]').val(permValue);
+
+ bootValue = $('input[name=bootCheck2]:checked').val();
+ $('input[name=bootCheck]').val(bootValue);
+
+ if ($('input[name=parentsf14regression3]:checked').length > 0) {
+ $('input[name=parentsf14regression]').val('on');
+ } else {
+ $('input[name=parentsf14regression]').val('off');
+ }
+
+ dataEditingFunc(this.form, 'intervalMap');
+
+ });
+
+ $('#sectionbody4').find('input[name=marker]').click(function () {
+ //Changed the way parentsValue is acquired; before it was $(____).is(':checked');
+ if ($('input[name=parentsf14regression2]:checked').length > 0) {
+ $('input[name=parentsf14regression]').val('on');
+ } else {
+ $('input[name=parentsf14regression]').val('off');
+ }
+
+ varValue = $('input[name=applyVarianceSE2]:checked').val();
+ $('input[name=applyVarianceSE]').val(varValue);
+
+ dataEditingFunc(this.form, 'markerRegression');
+ });
+
+ ///////////////////////////////
+ //Review and Edit Data
+ ///////////////////////////////
+ $('input[name=excludeGroup]').click(function () {
+ for (i = 1; i <= Math.max(primary_row_count, other_row_count) - 1; i++) {
+ valueExists = 0;
+ $('#Primary_' + i + ',#Other_' + i).children().each(function () {
+ if ($(this).text() == exclude_value) {
+ $('#Primary_' + i + ',#Other_' + i).addClass('blocked').find('input[type=text]').val('x');
+ valueExists = 1;
+ return false;
}
- else if (traitType=="name"){
- var graphFile = graphName+ "_xgmml_name.txt";
- $('input[name=exportGraphFile]').live('click', function() { window.open(graphFile) });
+ });
+ }
+ });
+
+ $('.update').click(function () {
+ windowName = 'formTarget' + (new Date().getTime());
+ var windowHeight; // windowHeight and windowWidth are used to place the window in the center of the screen
+ var windowWidth;
+ windowHeight = (window.screen.height/2) - (350 + 10)
+ windowWidth = (window.screen.width/2) - (450 + 50)
+ newWindow = open("",windowName,"menubar=1,toolbar=1,resizable=1,left=" + windowWidth + ",top=" + windowHeight + ",screenX=" + windowWidth + ",screenY=" + windowHeight + ",status=1,scrollbars=0,directories=1");
+
+ document.dataInput.target = windowName;
+ document.dataInput.submitID.value = "basicStatistics";
+
+ primaryData = getTraitData()[0];
+ otherData = getTraitData()[1];
+ allData = getTraitData()[2];
+
+ if (otherData[0].length > 0) {
+ if ($('select[name="stats_mdp"] option:selected').val() == 0) {
+ document.dataInput.strainNames.value = allData[0].toString();
+ document.dataInput.strainVals.value = allData[1].toString();
+ document.dataInput.strainVars.value = allData[2].toString();
+ } else if ($('select[name="stats_mdp"] option:selected').val() == 1) {
+ document.dataInput.strainNames.value = primaryData[0].toString();
+ document.dataInput.strainVals.value = primaryData[1].toString();
+ document.dataInput.strainVars.value = primaryData[2].toString();
+ } else {
+ document.dataInput.strainNames.value = otherData[0].toString();
+ document.dataInput.strainVals.value = otherData[1].toString();
+ document.dataInput.strainVars.value = otherData[2].toString();
+ }
+ } else {
+ document.dataInput.strainNames.value = allData[0].toString();
+ document.dataInput.strainVals.value = allData[1].toString();
+ document.dataInput.strainVars.value = allData[2].toString();
+ }
+
+ document.dataInput.submit();
+ });
+
+ $('input[name="export"]').click(function () {
+ windowName = 'formTarget' + (new Date().getTime());
+ newWindow = open("", windowName, "menubar=1,toolbar=1,location=1,resizable=1,status=1,scrollbars=0,directories=1,width=900");
+ document.dataInput.target = windowName;
+ document.dataInput.submitID.value = "exportData";
+
+ primaryData = getTraitData()[0];
+ otherData = getTraitData()[1];
+
+ document.dataInput.strainNames.value = primaryData[0].toString();
+ document.dataInput.strainVals.value = primaryData[1].toString();
+ document.dataInput.strainVars.value = primaryData[2].toString();
+
+ document.dataInput.otherStrainNames.value = otherData[0].toString();
+ document.dataInput.otherStrainVals.value = otherData[1].toString();
+ document.dataInput.otherStrainVars.value = otherData[2].toString();
+
+ attribute_names = new Array();
+ $('#primary,#other').find('th.attribute_name').each(function () {
+ attribute_names.push($(this).val().toString());
+ });
+
+ primary_attribute_values = ""; //This string will be structured as a dictionary with a set of values for each attribute; it will be parsed in the ExportPage class
+ other_attribute_values = "";
+
+ attr_counter = 1; // Counter for each different attribute
+ row_counter = 1; // Counter for each value for each attribute
+ while (attr_counter <= attribute_names.length) {
+ attribute_name = $('#primary,#other').find('th.attribute_name:eq(' + (attr_counter - 1).toString() + ')').text();
+ primary_row_count = $('#primary').find('tr').length - 1;
+ other_row_count = $('#other').find('tr').length - 1;
+
+ primary_attribute_values += attribute_name + " : ";
+ other_attribute_values += attribute_name + " : ";
+
+ primary_value_string = ""; //This string of values (in the format 'a,b,c', etc) will be appended to the primary_attribute_values string
+ for (row_counter = 1; row_counter <= numPrimaryRows; row_counter++) {
+ value = $('#primary_attribute' + attr_counter.toString() + '_sample' + row_counter.toString()).text();
+ if (row_counter == primary_row_count) {
+ primary_value_string += (value + " / ");
+ } else {
+ primary_value_string += (value + ",");
}
+ }
+
+ primary_attribute_values += primary_value_string;
+
+ other_value_string = ""; //This string of values (in the format 'a,b,c', etc) will be appended to the other_attribute_values string
+ for (row_counter = 1; row_counter <= numOtherRows; row_counter++) {
+ value = $('#other_attribute' + attr_counter.toString() + '_sample' + row_counter.toString()).text();
+ if (row_counter == other_row_count) {
+ other_value_string += (value + " / ");
+ } else {
+ other_value_string += (value + ",");
+ }
+ }
+ other_attribute_values += other_value_string;
+ attr_counter += 1
+ }
+
+ document.dataInput.extra_attributes.value = primary_attribute_values;
+ document.dataInput.other_extra_attributes.value = other_attribute_values;
+
+ document.dataInput.submit();
+ });
+
+ var thisTable = $('#sortable1,#sortable2'); //ZS: variable representing each table, because it's used often
+ thisTable.find('input[name="selectCheck"]').click(function () {
+ if ($(this).is(':checked')) {
+ $(this).parent("").parent("").children("td").css("background-color", "yellow");
+ } else {
+ if (!($(this).parent().parent().hasClass('outlier'))) {
+ $(this).parent().parent().children("td").css("background-color", "white");
+ }
}
+ });
- else if (graphFormat=="plain"){
- if (traitType=="symbol"){
- var graphFile = graphName+ "_plain_symbol.txt";
- $('input[name=exportGraphFile]').live('click', function() { window.open(graphFile) });
+ $('input[name=resetButton]').click(function () {
+
+ //ZS: Reset "hide no value" and "hide outliers"
+ $('#showHideOptions').find('input[name=showHideNoValue]').val(' Hide No Value ');
+ $('#showHideOptions').find('input[name=showHideOutliers]').val(' Hide Outliers ');
+ noValShown = 1;
+ outliersShown = 1;
+
+ for (i = 1; i <= numPrimaryRows - 1; i++) {
+ var thisRow = $('#Primary_' + i);
+ if (thisRow.is('.invisible')) {
+ thisRow.removeClass('invisible');
+ }
+ if (thisRow.is('.blocked')) {
+ thisRow.removeClass('blocked');
+ }
+ if (thisRow.is(':not(.outlier)')) {
+ thisRow.css("background-color", "white");
+ }
+
+ var thisValueField = thisRow.find('.valueField');
+
+ var originalValue = thisValueField[0].defaultValue;
+ var thisClassNames = thisRow.find('input:eq(1)').attr('class').split(/\s+/);
+ var valueClass = thisClassNames[thisClassNames.length - 1];
+ thisRow.find('input:eq(1)').removeClass(valueClass).addClass(originalValue).val(originalValue);
+
+ if (thisValueField.length > 1) {
+ var originalValue = thisValueField[1].defaultValue;
+ var thisClassNames = thisRow.find('input:eq(2)').attr('class').split(/\s+/);
+ var valueClass = thisClassNames[thisClassNames.length - 1];
+ thisRow.find('input:eq(2)').removeClass(valueClass).addClass(originalValue).val(originalValue);
+ }
+ }
+ for (i = 1; i <= numOtherRows - 1; i++) {
+ var thisRow = $('#Other_' + i);
+ if (thisRow.is('.invisible')) {
+ thisRow.removeClass('invisible')
+ }
+ if (thisRow.is('.blocked')) {
+ thisRow.removeClass('blocked');
+ }
+ if (thisRow.is(':not(.outlier)')) {
+ thisRow.css("background-color", "white");
+ }
+
+ var thisValueField = thisRow.find('.valueField');
+
+ var originalValue = thisValueField[0].defaultValue;
+ var thisClassNames = thisRow.find('input:eq(1)').attr('class').split(/\s+/);
+ var valueClass = thisClassNames[thisClassNames.length - 1];
+ thisRow.find('input:eq(1)').removeClass(valueClass).addClass(originalValue).val(originalValue);
+
+ if (thisValueField.length > 1) {
+ var originalValue = thisValueField[1].defaultValue;
+ var thisClassNames = thisRow.find('input:eq(2)').attr('class').split(/\s+/);
+ var valueClass = thisClassNames[thisClassNames.length - 1];
+ thisRow.find('input:eq(2)').removeClass(valueClass).addClass(originalValue).val(originalValue);
+ }
+ }
+ });
+
+ var tiptext2 = "e.g., 4, 6-30, 43";
+ var blockField = $('#showHideOptions').find('input[name=removeField]'); //ZS: Field where user inputs the index of the samples he/she wants to block; created variable because it's used often
+ if (blockField.val() == '' || blockField.val() == tiptext2) {
+ blockField.addClass('searchtip');
+ blockField.val(tiptext2);
+ }
+
+ blockField.focus(function (e) {
+ if (blockField.val() == tiptext2) {
+ blockField.val('');
+ }
+ blockField.removeClass('searchtip');
+ });
+
+ blockField.blur(function (e) {
+ if (blockField.val() == '') {
+ blockField.addClass('searchtip');
+ blockField.val(tiptext2);
+ } else if (blockField.val() == tiptext2) {
+ blockField.addClass('searchtip');
+ } else {
+ blockField.removeClass('searchtip');
+ }
+ });
+
+ var noValShown = new Boolean(1);
+ var outliersShown = new Boolean(1);
+
+ $('#showHideOptions').bind('click', function (e) {
+ var target = e.target;
+ $target = $(target);
+
+ if (target.name === 'blockSamples') {
+ if (blockField.val() == tiptext2) {
+ blockField.val('')
+ }
+ blockedText = blockField.val();
+ blockedTextSplit = new Array();
+ blockedItems = new Array();
+
+ blockedTextSplit = blockedText.split(/\,/);
+
+ for (i = 0; i <= blockedTextSplit.length - 1; i++) {
+ var item = blockedTextSplit[i];
+ if (item.indexOf('-') != -1) {
+ subArray = new Array();
+ subArray = item.split('-');
+ num1 = parseInt(subArray[0]);
+ num2 = parseInt(subArray[1]);
+ for (j = num1; j <= num2; j = j + 1) {
+ blockedItems.push(j);
+ }
+ } else if (!(isNaN(item))) {
+ blockedItems.push(item);
+ }
+ }
+
+ for (i = 0; i <= blockedItems.length - 1; i++) {
+ item = blockedItems[i];
+ if ($('select[name=block_method]').val() == '0') {
+ var thisRow = $('#Other_' + item);
+ } else {
+ var thisRow = $('#Primary_' + item);
+ }
+
+ if (thisRow.is('.novalue')) {
+ continue;
+ } else {
+ thisRow.addClass('blocked').find('input.valueField').val('x');
+ }
+
+ //First look at value cell
+ var thisCell = thisRow.find('input:eq(1)');
+ var thisClassNames = thisCell.attr('class').split(/\s+/);
+ var valueClass = thisClassNames[thisClassNames.length - 1];
+ var header = thisRow.parents('table.tablesorter').find('th.header:contains("Value"):eq(0)');
+ if (header.hasClass('headerSortUp')) {
+ thisCell.removeClass(valueClass).addClass('-9999');
+ } else if (header.hasClass('headerSortDown')) {
+ thisCell.removeClass(valueClass).addClass('9999');
+ } else {
+ thisCell.removeClass(valueClass).addClass('-9999');
+ }
+
+ //Check if there is an SE column
+ if (thisRow.find('input.valueField').length > 1) {
+ var thisCell = thisRow.find('input:eq(2)');
+ var thisClassNames = thisCell.attr('class').split(/\s+/);
+ var valueClass = thisClassNames[thisClassNames.length - 1];
+ var header = thisRow.parents('table.tablesorter').find('th.header:contains("SE"):eq(0)');
+ if (header.hasClass('headerSortUp')) {
+ thisCell.removeClass(valueClass).addClass('-9999');
+ } else if (header.hasClass('headerSortDown')) {
+ thisCell.removeClass(valueClass).addClass('9999');
+ } else {
+ thisCell.removeClass(valueClass).addClass('-9999');
+ }
+ }
+ }
+ } else if (target.name === 'showHideNoValue') {
+ if (noValShown) {
+ $('#showHideOptions').find('input[name=showHideNoValue]').val(' Show No Value ');
+ for (i = 1; i <= Math.max(numPrimaryRows, numOtherRows) - 1; i++) {
+ if (i <= numPrimaryRows - 1) {
+ var thisRow = $('#Primary_' + i);
+ if (thisRow.is('.novalue:visible') || thisRow.is('.blocked:visible')) {
+ jQuery(thisRow).addClass('invisible');
+ }
+ }
+ if (i <= numOtherRows - 1) {
+ var thisOtherRow = $('#Other_' + i);
+ if (thisOtherRow.is('.novalue:visible') || thisOtherRow.is('.blocked:visible')) {
+ if (thisOtherRow.is(':visible')) {
+ jQuery(thisOtherRow).addClass('invisible');
+ }
+ }
+ }
+ }
+ noValShown = 0;
+ } else {
+ $('#showHideOptions').find('input[name=showHideNoValue]').val(' Hide No Value ');
+ for (i = 1; i <= Math.max(numPrimaryRows, numOtherRows) - 1; i++) {
+ if (i <= numPrimaryRows - 1) {
+ var thisRow = $('#Primary_' + i);
+ if (thisRow.is('.novalue') || thisRow.is('.blocked')) {
+ jQuery(thisRow).removeClass('invisible');
+ if (!(outliersShown)) {
+ if (thisRow.is('.outlier:visible')) {
+ jQuery(thisRow).addClass('invisible');
+ }
+ }
+ }
+ }
+ if (i <= numOtherRows - 1) {
+ var thisOtherRow = $('#Other_' + i);
+ if (thisOtherRow.is('.novalue') || thisOtherRow.is('.blocked')) {
+ jQuery(thisOtherRow).removeClass('invisible');
+ if (!(outliersShown)) {
+ if (thisOtherRow.is('.outlier:visible')) {
+ jQuery(thisOtherRow).addClass('invisible');
+ }
+ }
+ }
+ }
}
- else if (traitType=="name"){
- var graphFile = graphName+ "_plain_name.txt";
- $('input[name=exportGraphFile]').live('click', function() { window.open(graphFile) });
+ noValShown = 1;
+ }
+ } else if (target.name === 'showHideOutliers') {
+ if (outliersShown) {
+ $('#showHideOptions').find('input[name=showHideOutliers]').val(' Show Outliers ');
+ for (i = 1; i <= Math.max(numPrimaryRows, numOtherRows) - 1; i++) {
+ if (i <= numPrimaryRows - 1) {
+ thisRow = $('#Primary_' + i);
+ if (thisRow.is('.outlier:visible') && (!(thisRow.is('.invisible')))) {
+ thisRow.addClass('invisible')
+ }
+ }
+ if (i <= numOtherRows - 1) {
+ thisOtherRow = $('#Other_' + i);
+ if (thisOtherRow.is('.outlier:visible') && (!(thisOtherRow.is('.invisible')))) {
+ thisOtherRow.addClass('invisible')
+ }
+ }
+ }
+ outliersShown = 0;
+ } else {
+ $('#showHideOptions').find('input[name=showHideOutliers]').val(' Hide Outliers ');
+ for (i = 1; i <= Math.max(numPrimaryRows, numOtherRows) - 1; i++) {
+ if (i <= numPrimaryRows - 1) {
+ thisRow = $('#Primary_' + i);
+ if (thisRow.is('.outlier') && (!(thisRow.is(':visible')))) {
+ if (!(noValShown)) {
+ if (thisRow.is('.blocked')) {
+ continue;
+ }
+ }
+ jQuery(thisRow).removeClass('invisible')
+ }
+ }
+ if (i <= numOtherRows - 1) {
+ thisOtherRow = $('#Other_' + i);
+ if (thisOtherRow.is('.outlier') && (!(thisOtherRow.is(':visible')))) {
+ if (!(noValShown)) {
+ if (thisOtherRow.is('.blocked')) {
+ continue;
+ }
+ }
+ jQuery(thisOtherRow).removeClass('invisible')
+ }
+ }
}
+ outliersShown = 1;
+ }
+ }
+ return false;
+ });
+});
+
+function getTraitData() {
+ primary_row_count = $('#sortable1').find('tr').length - 1;
+ other_row_count = $('#sortable2').find('tr').length - 1;
+
+ primaryStrainNames = new Array();
+ primaryVals = new Array();
+ primaryVars = new Array();
+
+ allStrainNames = new Array();
+ allVals = new Array();
+ allVars = new Array();
+
+ for (i = 1; i <= primary_row_count; i++) {
+ thisRow = $('#Primary_' + i);
+ strainName = thisRow.find('span:first').text();
+ primaryStrainNames.push(strainName);
+ allStrainNames.push(strainName);
+ strainVal = thisRow.find('input:eq(1)').val();
+ primaryVals.push(strainVal);
+ allVals.push(strainVal);
+ strainVar = ''; // Just to initialize it in case there is no var
+ strainVar = thisRow.find('input:eq(2)').val();
+ primaryVars.push(strainVar);
+ allVars.push(strainVar);
+ }
+
+ otherStrainNames = new Array();
+ otherVals = new Array();
+ otherVars = new Array();
+
+ for (j = 1; j <= other_row_count; j++) {
+ thisRow = $('#Other_' + j)
+ strainName = thisRow.find('span:first').text();
+ otherStrainNames.push(strainName);
+ strainVal = thisRow.find('input:eq(1)').val();
+ otherVals.push(strainVal);
+ strainVar = ''; // Just to initialize it in case there is no var
+ strainVar = thisRow.find('input:eq(2)').val();
+ otherVars.push(strainVar);
+
+ if (jQuery.inArray(strainName, allStrainNames) == -1) {
+ allStrainNames.push(strainName);
+ allVals.push(strainVal);
+ allVars.push(strainVar);
}
+ }
+
+ primaryData = [primaryStrainNames, primaryVals, primaryVars];
+ otherData = [otherStrainNames, otherVals, otherVars];
+ allData = [allStrainNames, allVals, allVars];
+
+ return [primaryData, otherData, allData];
}
+/*
+used by networkGraphPageBody.py
+*/
+
+//Default to plain text + symbol for the "Export Graph File" button
+$('input[name=exportGraphFile]').live('click', function () {
+ window.open($('input[name=exportFilename]').val() + "_plain_symbol.txt")
+});
+
+function changeFormat(graphName) {
+ var graphFormat = $('#exportFormat').val();
+ var traitType = $('#traitType').val();
+
+ $('input[name=exportGraphFile]').die('click');
+
+ if (graphFormat == "xgmml") {
+ if (traitType == "symbol") {
+ var graphFile = graphName + "_xgmml_symbol.txt";
+ $('input[name=exportGraphFile]').live('click', function () {
+ window.open(graphFile)
+ });
+ } else if (traitType == "name") {
+ var graphFile = graphName + "_xgmml_name.txt";
+ $('input[name=exportGraphFile]').live('click', function () {
+ window.open(graphFile)
+ });
+ }
+ } else if (graphFormat == "plain") {
+ if (traitType == "symbol") {
+ var graphFile = graphName + "_plain_symbol.txt";
+ $('input[name=exportGraphFile]').live('click', function () {
+ window.open(graphFile)
+ });
+ } else if (traitType == "name") {
+ var graphFile = graphName + "_plain_name.txt";
+ $('input[name=exportGraphFile]').live('click', function () {
+ window.open(graphFile)
+ });
+ }
+ }
+}
\ No newline at end of file
diff --git a/web/webqtl/correlation/CorrelationPage.py b/web/webqtl/correlation/CorrelationPage.py
index 8ce669cb..1fd16021 100755
--- a/web/webqtl/correlation/CorrelationPage.py
+++ b/web/webqtl/correlation/CorrelationPage.py
@@ -23,6 +23,9 @@
# Created by GeneNetwork Core Team 2010/08/10
#
# Last updated by NL 2011/02/11
+# Last updated by Christian Fernandez 2012/04/07
+# Refactored correlation calculation into smaller functions in preparation of
+# separating html from existing code
import string
from math import *
@@ -47,447 +50,324 @@ from dbFunction import webqtlDatabaseFunction
import utility.webqtlUtil #this is for parallel computing only.
from correlation import correlationFunction
+import logging
+logging.basicConfig(filename="/tmp/gn_log", level=logging.INFO)
+_log = logging.getLogger("correlation")
-class CorrelationPage(templatePage):
+METHOD_SAMPLE_PEARSON = "1"
+METHOD_SAMPLE_RANK = "2"
+METHOD_LIT = "3"
+METHOD_TISSUE_PEARSON = "4"
+METHOD_TISSUE_RANK = "5"
- corrMinInformative = 4
+TISSUE_METHODS = [METHOD_TISSUE_PEARSON, METHOD_TISSUE_RANK]
- def __init__(self, fd):
+TISSUE_MOUSE_DB = 1
- #XZ, 01/14/2009: This method is for parallel computing only.
- #XZ: It is supposed to be called when "Genetic Correlation, Pearson's r" (method 1)
- #XZ: or "Genetic Correlation, Spearman's rho" (method 2) is selected
- def compute_corr( input_nnCorr, input_trait, input_list, computing_method):
+class AuthException(Exception): pass
- allcorrelations = []
- for line in input_list:
- tokens = line.split('","')
- tokens[-1] = tokens[-1][:-2] #remove the last "
- tokens[0] = tokens[0][1:] #remove the first "
+class Trait(object):
+ def __init__(self, name, raw_values = None, lit_corr = None, tissue_corr = None, p_tissue = None):
+ self.name = name
+ self.raw_values = raw_values
+ self.lit_corr = lit_corr
+ self.tissue_corr = tissue_corr
+ self.p_tissue = p_tissue
+ self.correlation = 0
+ self.p_value = 0
- traitdataName = tokens[0]
- database_trait = tokens[1:]
+ @staticmethod
+ def from_csv(line, data_start = 1):
+ name = line[0]
+ numbers = line[data_start:]
+ # _log.info(numbers)
+ numbers = [ float(number) for number in numbers ]
- if computing_method == "1": #XZ: Pearson's r
- corr,nOverlap = utility.webqtlUtil.calCorrelationText(input_trait, database_trait, input_nnCorr)
- else: #XZ: Spearman's rho
- corr,nOverlap = utility.webqtlUtil.calCorrelationRankText(input_trait, database_trait, input_nnCorr)
- traitinfo = [traitdataName,corr,nOverlap]
- allcorrelations.append(traitinfo)
+ return Trait(name, raw_values = numbers)
- return allcorrelations
+ def calculate_correlation(self, values, method):
+ """Calculate the correlation value and p value according to the method specified"""
+ #ZS: This takes the list of values of the trait our selected trait is being correlated against and removes the values of the samples our trait has no value for
+ #There's probably a better way of dealing with this, but I'll have to ask Christian
+ updated_raw_values = []
+ updated_values = []
+ for i in range(len(values)):
+ if values[i] != "None":
+ updated_raw_values.append(self.raw_values[i])
+ updated_values.append(values[i])
- templatePage.__init__(self, fd)
+ self.raw_values = updated_raw_values
+ values = updated_values
- if not self.openMysql():
- return
-
- if not fd.genotype:
- fd.readGenotype()
+ if method == METHOD_SAMPLE_PEARSON or method == METHOD_LIT or method == METHOD_TISSUE_PEARSON:
+ corr,nOverlap = webqtlUtil.calCorrelation(self.raw_values, values, len(values))
+ else:
+ corr,nOverlap = webqtlUtil.calCorrelationRank(self.raw_values, values, len(values))
- #XZ, 09/18/2008: get the information such as value, variance of the input strain names from the form.
- if fd.allstrainlist:
- mdpchoice = fd.formdata.getvalue('MDPChoice')
- #XZ, in HTML source code, it is "BXD Only" or "BXH only", and so on
- if mdpchoice == "1":
- strainlist = fd.f1list + fd.strainlist
- #XZ, in HTML source code, it is "MDP Only"
- elif mdpchoice == "2":
- strainlist = []
- strainlist2 = fd.f1list + fd.strainlist
- for strain in fd.allstrainlist:
- if strain not in strainlist2:
- strainlist.append(strain)
- #So called MDP Panel
- if strainlist:
- strainlist = fd.f1list+fd.parlist+strainlist
- #XZ, in HTML source code, it is "All Cases"
+ self.correlation = corr
+ self.overlap = nOverlap
+
+ if self.overlap < 3:
+ self.p_value = 1.0
+ else:
+ #ZS - This is probably the wrong way to deal with this. Correlation values of 1.0 definitely exist (the trait correlated against itself), so zero division needs to br prevented.
+ if abs(self.correlation) >= 1.0:
+ self.p_value = 0.0
else:
- strainlist = fd.allstrainlist
- #XZ, 09/18/2008: put the trait data into dictionary fd.allTraitData
- fd.readData(fd.allstrainlist)
- else:
- mdpchoice = None
- strainlist = fd.strainlist
- #XZ, 09/18/2008: put the trait data into dictionary fd.allTraitData
- fd.readData()
+ ZValue = 0.5*log((1.0+self.correlation)/(1.0-self.correlation))
+ ZValue = ZValue*sqrt(self.overlap-3)
+ self.p_value = 2.0*(1.0 - reaper.normp(abs(ZValue)))
- #XZ, 3/16/2010: variable RISet must be pass by the form
- RISet = fd.RISet
- #XZ, 12/12/2008: get species infomation
- species = webqtlDatabaseFunction.retrieveSpecies(cursor=self.cursor, RISet=RISet)
+
- #XZ, 09/18/2008: get all information about the user selected database.
- self.target_db_name = fd.formdata.getvalue('database')
+#XZ, 01/14/2009: This method is for parallel computing only.
+#XZ: It is supposed to be called when "Genetic Correlation, Pearson's r" (method 1)
+#XZ: or "Genetic Correlation, Spearman's rho" (method 2) is selected
+def compute_corr( input_nnCorr, input_trait, input_list, computing_method):
+
+ allcorrelations = []
+
+ for line in input_list:
+ tokens = line.split('","')
+ tokens[-1] = tokens[-1][:-2] #remove the last "
+ tokens[0] = tokens[0][1:] #remove the first "
+
+ traitdataName = tokens[0]
+ database_trait = tokens[1:]
+
+ if computing_method == "1": #XZ: Pearson's r
+ corr,nOverlap = utility.webqtlUtil.calCorrelationText(input_trait, database_trait, input_nnCorr)
+ else: #XZ: Spearman's rho
+ corr,nOverlap = utility.webqtlUtil.calCorrelationRankText(input_trait, database_trait, input_nnCorr)
+ traitinfo = [traitdataName,corr,nOverlap]
+ allcorrelations.append(traitinfo)
+
+ return allcorrelations
+
+def get_correlation_method_key(form_data):
+ #XZ, 09/28/2008: if user select "1", then display 1, 3 and 4.
+ #XZ, 09/28/2008: if user select "2", then display 2, 3 and 5.
+ #XZ, 09/28/2008: if user select "3", then display 1, 3 and 4.
+ #XZ, 09/28/2008: if user select "4", then display 1, 3 and 4.
+ #XZ, 09/28/2008: if user select "5", then display 2, 3 and 5.
+
+ method = form_data.formdata.getvalue("method")
+ if method not in ["1", "2", "3" ,"4", "5"]:
+ return "1"
+
+ return method
+
+
+def get_custom_trait(form_data, cursor):
+ """Pulls the custom trait, if it exists, out of the form data"""
+ trait_name = form_data.formdata.getvalue('fullname')
+
+ if trait_name:
+ trait = webqtlTrait(fullname=trait_name, cursor=cursor)
+ trait.retrieveInfo()
+ return trait
+ else:
+ return None
+
+
+#XZ, 09/18/2008: get the information such as value, variance of the input strain names from the form.
+def get_sample_data(form_data):
+ if form_data.allstrainlist:
+ mdpchoice = form_data.formdata.getvalue('MDPChoice')
+ #XZ, in HTML source code, it is "BXD Only" or "BXH only", and so on
+ if mdpchoice == "1":
+ strainlist = form_data.f1list + form_data.strainlist
+ #XZ, in HTML source code, it is "MDP Only"
+ elif mdpchoice == "2":
+ strainlist = []
+ strainlist2 = form_data.f1list + form_data.strainlist
+ for strain in form_data.allstrainlist:
+ if strain not in strainlist2:
+ strainlist.append(strain)
+ #So called MDP Panel
+ if strainlist:
+ strainlist = form_data.f1list+form_data.parlist+strainlist
+ #XZ, in HTML source code, it is "All Cases"
+ else:
+ strainlist = form_data.allstrainlist
+ #XZ, 09/18/2008: put the trait data into dictionary form_data.allTraitData
+ form_data.readData(form_data.allstrainlist)
+ else:
+ mdpchoice = None
+ strainlist = form_data.strainlist
+ #XZ, 09/18/2008: put the trait data into dictionary form_data.allTraitData
+ form_data.readData()
+
+ return strainlist
+
+
+def get_mdp_choice(form_data):
+ if form_data.allstrainlist:
+ return form_data.formdata.getvalue("MDPChoice")
+ else:
+ return None
+
+
+def get_species(fd, cursor):
+ #XZ, 3/16/2010: variable RISet must be pass by the form
+ RISet = fd.RISet
+ #XZ, 12/12/2008: get species infomation
+ species = webqtlDatabaseFunction.retrieveSpecies(cursor=cursor, RISet=RISet)
+ return species
+
+
+def sortTraitCorrelations(traits, method="1"):
+ if method in TISSUE_METHODS:
+ traits.sort(key=lambda trait: trait.tissue_corr != None and abs(trait.tissue_corr), reverse=True)
+ elif method == METHOD_LIT:
+ traits.sort(key=lambda trait: trait.lit_corr != None and abs(trait.lit_corr), reverse=True)
+ else:
+ traits.sort(key=lambda trait: trait.correlation != None and abs(trait.correlation), reverse=True)
+
+ return traits
+
+
+def auth_user_for_db(db, cursor, target_db_name, privilege, username):
+ """Authorize a user for access to a database if that database is
+ confidential. A db (identified by a record in ProbeSetFreeze) contains a
+ list of authorized users who may access it, as well as its confidentiality
+ level.
+
+ If the current user's privilege level is greater than 'user', ie: root or
+ admin, then they are automatically authed, otherwise, check the
+ AuthorizedUsers field for the presence of their name."""
+
+ if db.type == 'ProbeSet':
+ cursor.execute('SELECT Id, Name, FullName, confidentiality, AuthorisedUsers FROM ProbeSetFreeze WHERE Name = "%s"' % target_db_name)
+ indId, indName, indFullName, confidential, AuthorisedUsers = cursor.fetchall()[0]
+
+ if confidential:
+ authorized = 0
+
+ #for the dataset that confidentiality is 1
+ #1. 'admin' and 'root' can see all of the dataset
+ #2. 'user' can see the dataset that AuthorisedUsers contains his id(stored in the Id field of User table)
+ if webqtlConfig.USERDICT[privilege] > webqtlConfig.USERDICT['user']:
+ authorized = 1
+ else:
+ if username in AuthorisedUsers.split(","):
+ authorized = 1
+
+ if not authorized:
+ raise AuthException("The %s database you selected is not open to the public at this time, please go back and select other database." % indFullName)
- try:
- self.db = webqtlDataset(self.target_db_name, self.cursor)
- except:
- heading = "Correlation Table"
- detail = ["The database you just requested has not been established yet."]
- self.error(heading=heading,detail=detail)
- return
- #XZ, 09/18/2008: check if user has the authority to get access to the database.
- if self.db.type == 'ProbeSet':
- self.cursor.execute('SELECT Id, Name, FullName, confidentiality, AuthorisedUsers FROM ProbeSetFreeze WHERE Name = "%s"' % self.target_db_name)
- indId, indName, indFullName, confidential, AuthorisedUsers = self.cursor.fetchall()[0]
+class CorrelationPage(templatePage):
- if confidential == 1:
- access_to_confidential_dataset = 0
+ corrMinInformative = 4
- #for the dataset that confidentiality is 1
- #1. 'admin' and 'root' can see all of the dataset
- #2. 'user' can see the dataset that AuthorisedUsers contains his id(stored in the Id field of User table)
- if webqtlConfig.USERDICT[self.privilege] > webqtlConfig.USERDICT['user']:
- access_to_confidential_dataset = 1
- else:
- AuthorisedUsersList=AuthorisedUsers.split(',')
- if AuthorisedUsersList.__contains__(self.userName):
- access_to_confidential_dataset = 1
+ PAGE_HEADING = "Correlation Table"
+ CORRELATION_METHODS = {"1" : "Genetic Correlation (Pearson's r)",
+ "2" : "Genetic Correlation (Spearman's rho)",
+ "3" : "SGO Literature Correlation",
+ "4" : "Tissue Correlation (Pearson's r)",
+ "5" : "Tissue Correlation (Spearman's rho)"}
- if not access_to_confidential_dataset:
- #Error, Confidential Database
- heading = "Correlation Table"
- detail = ["The %s database you selected is not open to the public at this time, please go back and select other database." % indFullName]
- self.error(heading=heading,detail=detail,error="Confidential Database")
- return
+ RANK_ORDERS = {"1": 0, "2": 1, "3": 0, "4": 0, "5": 1}
- #XZ, 09/18/2008: filter out the strains that have no value.
- _strains, _vals, _vars, N = fd.informativeStrains(strainlist)
- N = len(_strains)
+ def error(self, message, error="Error", heading = None):
+ heading = heading or self.PAGE_HEADING
+ return templatePage.error(heading = heading, detail = [message], error=error)
- if N < self.corrMinInformative:
- heading = "Correlation Table"
- detail = ['Fewer than %d strain data were entered for %s data set. No calculation of correlation has been attempted.' % (self.corrMinInformative, RISet)]
- self.error(heading=heading,detail=detail)
+ def __init__(self, fd):
+
+ # Call the superclass constructor
+ templatePage.__init__(self, fd)
+
+ # Connect to the database
+ if not self.openMysql():
return
- #XZ, 09/28/2008: if user select "1", then display 1, 3 and 4.
- #XZ, 09/28/2008: if user select "2", then display 2, 3 and 5.
- #XZ, 09/28/2008: if user select "3", then display 1, 3 and 4.
- #XZ, 09/28/2008: if user select "4", then display 1, 3 and 4.
- #XZ, 09/28/2008: if user select "5", then display 2, 3 and 5.
- methodDict = {"1":"Genetic Correlation (Pearson's r)","2":"Genetic Correlation (Spearman's rho)","3":"SGO Literature Correlation","4":"Tissue Correlation (Pearson's r)", "5":"Tissue Correlation (Spearman's rho)"}
- self.method = fd.formdata.getvalue('method')
- if self.method not in ("1","2","3","4","5"):
- self.method = "1"
+ # Read the genotype from a file
+ if not fd.genotype:
+ fd.readGenotype()
- self.returnNumber = int(fd.formdata.getvalue('criteria'))
+ sample_list = get_sample_data(fd)
+ mdp_choice = get_mdp_choice(fd) # No idea what this is yet
+ self.species = get_species(fd, self.cursor)
- myTrait = fd.formdata.getvalue('fullname')
- if myTrait:
- myTrait = webqtlTrait(fullname=myTrait, cursor=self.cursor)
- myTrait.retrieveInfo()
+ #XZ, 09/18/2008: get all information about the user selected database.
+ target_db_name = fd.formdata.getvalue('database')
+ self.target_db_name = target_db_name
- # We will not get Literature Correlations if there is no GeneId because there is nothing to look against
try:
- input_trait_GeneId = int(fd.formdata.getvalue('GeneId'))
+ self.db = webqtlDataset(target_db_name, self.cursor)
except:
- input_trait_GeneId = None
+ detail = ["The database you just requested has not been established yet."]
+ self.error(detail)
+ return
- # We will not get Tissue Correlations if there is no gene symbol because there is nothing to look against
+ # Auth if needed
try:
- input_trait_symbol = myTrait.symbol
- except:
- input_trait_symbol = None
-
-
- #XZ, 12/12/2008: if the species is rat or human, translate the geneid to mouse geneid
- input_trait_mouse_geneid = self.translateToMouseGeneID(species, input_trait_GeneId)
-
-
- #XZ: As of Nov/13/2010, this dataset is 'UTHSC Illumina V6.2 RankInv B6 D2 average CNS GI average (May 08)'
- TissueProbeSetFreezeId = 1
-
- #XZ, 09/22/2008: If we need search by GeneId,
- #XZ, 09/22/2008: we have to check if this GeneId is in the literature or tissue correlation table.
- #XZ, 10/15/2008: We also to check if the selected database is probeset type.
- if self.method == "3" or self.method == "4" or self.method == "5":
- if self.db.type != "ProbeSet":
- self.error(heading="Wrong correlation type",detail="It is not possible to compute the %s between your trait and data in this %s database. Please try again after selecting another type of correlation." % (methodDict[self.method],self.db.name),error="Correlation Type Error")
- return
-
- """
- if not input_trait_GeneId:
- self.error(heading="No Associated GeneId",detail="This trait has no associated GeneId, so we are not able to show any literature or tissue related information.",error="No GeneId Error")
- return
- """
-
- #XZ: We have checked geneid did exist
-
- if self.method == "3":
- if not input_trait_GeneId or not self.checkForLitInfo(input_trait_mouse_geneid):
- self.error(heading="No Literature Info",detail="This gene does not have any associated Literature Information.",error="Literature Correlation Error")
- return
-
- if self.method == "4" or self.method == "5":
- if not input_trait_symbol:
- self.error(heading="No Tissue Correlation Information",detail="This gene does not have any associated Tissue Correlation Information.",error="Tissue Correlation Error")
- return
-
- if not self.checkSymbolForTissueCorr(TissueProbeSetFreezeId, myTrait.symbol):
- self.error(heading="No Tissue Correlation Information",detail="This gene does not have any associated Tissue Correlation Information.",error="Tissue Correlation Error")
- return
-
-############################################################################################################################################
-
- allcorrelations = []
- nnCorr = len(_vals)
-
- #XZ: Use the fast method only for probeset dataset, and this dataset must have been created.
- #XZ: Otherwise, use original method
-
- useFastMethod = False
-
- if self.db.type == "ProbeSet":
-
- DatabaseFileName = self.getFileName( target_db_name=self.target_db_name )
- DirectoryList = os.listdir(webqtlConfig.TEXTDIR) ### List of existing text files. Used to check if a text file already exists
-
- if DatabaseFileName in DirectoryList:
- useFastMethod = True
-
- if useFastMethod:
- if 1:
- #try:
- useLit = False
- if self.method == "3":
- litCorrs = self.fetchLitCorrelations(species=species, GeneId=input_trait_GeneId, db=self.db, returnNumber=self.returnNumber)
- useLit = True
-
- useTissueCorr = False
- if self.method == "4" or self.method == "5":
- tissueCorrs = self.fetchTissueCorrelations(db=self.db, primaryTraitSymbol=input_trait_symbol, TissueProbeSetFreezeId=TissueProbeSetFreezeId, method=self.method, returnNumber = self.returnNumber)
- useTissueCorr = True
-
- datasetFile = open(webqtlConfig.TEXTDIR+DatabaseFileName,'r')
-
- #XZ, 01/08/2009: read the first line
- line = datasetFile.readline()
- dataset_strains = webqtlUtil.readLineCSV(line)[1:]
-
- #XZ, 01/08/2009: This step is critical. It is necessary for this new method.
- #XZ: The original function fetchAllDatabaseData uses all strains stored in variable _strains to
- #XZ: retrieve the values of each strain from database in real time.
- #XZ: The new method uses all strains stored in variable dataset_strains to create a new variable
- #XZ: _newvals. _newvals has the same length as dataset_strains. The items in _newvals is in
- #XZ: the same order of items in dataset_strains. The value of each item in _newvals is either
- #XZ: the value of correspinding strain in _vals or 'None'.
- _newvals = []
- for item in dataset_strains:
- if item in _strains:
- _newvals.append(_vals[_strains.index(item)])
- else:
- _newvals.append('None')
-
- nnCorr = len(_newvals)
-
- #XZ, 01/14/2009: If literature corr or tissue corr is selected,
- #XZ: there is no need to use parallel computing.
- if useLit or useTissueCorr:
- for line in datasetFile:
- traitdata=webqtlUtil.readLineCSV(line)
- traitdataName = traitdata[0]
- traitvals = traitdata[1:]
-
- if useLit:
- if not litCorrs.has_key( traitdataName ):
- continue
-
- if useTissueCorr:
- if not tissueCorrs.has_key( traitdataName ):
- continue
-
- if self.method == "3" or self.method == "4":
- corr,nOverlap = webqtlUtil.calCorrelationText(traitvals,_newvals,nnCorr)
- else:
- corr,nOverlap = webqtlUtil.calCorrelationRankText(traitvals,_newvals,nnCorr)
-
- traitinfo = [traitdataName,corr,nOverlap]
-
- if useLit:
- traitinfo.append(litCorrs[traitdataName])
-
- if useTissueCorr:
- tempCorr, tempPValue = tissueCorrs[traitdataName]
- traitinfo.append(tempCorr)
- traitinfo.append(tempPValue)
-
- allcorrelations.append(traitinfo)
- #XZ, 01/14/2009: If genetic corr is selected, use parallel computing
- else:
- input_line_list = datasetFile.readlines()
- all_line_number = len(input_line_list)
-
- step = 1000
- job_number = math.ceil( float(all_line_number)/step )
-
- job_input_lists = []
-
- for job_index in range( int(job_number) ):
- starti = job_index*step
- endi = min((job_index+1)*step, all_line_number)
-
- one_job_input_list = []
-
- for i in range( starti, endi ):
- one_job_input_list.append( input_line_list[i] )
-
- job_input_lists.append( one_job_input_list )
-
- ppservers = ()
- # Creates jobserver with automatically detected number of workers
- job_server = pp.Server(ppservers=ppservers)
-
- jobs = []
- results = []
-
- for one_job_input_list in job_input_lists: #pay attention to modules from outside
- jobs.append( job_server.submit(func=compute_corr, args=(nnCorr, _newvals, one_job_input_list, self.method), depfuncs=(), modules=("utility.webqtlUtil",)) )
-
- for one_job in jobs:
- one_result = one_job()
- results.append( one_result )
-
- for one_result in results:
- for one_traitinfo in one_result:
- allcorrelations.append( one_traitinfo )
-
- datasetFile.close()
- totalTraits = len(allcorrelations)
- #except:
- # useFastMethod = False
- # self.error(heading="No computation method",detail="Something is wrong within the try except block in CorrelationPage python module.",error="Computation Error")
- # return
-
- #XZ, 01/08/2009: use the original method to retrieve from database and compute.
- if not useFastMethod:
-
- traitdatabase, dataStartPos = self.fetchAllDatabaseData(species=species, GeneId=input_trait_GeneId, GeneSymbol=input_trait_symbol, strains=_strains, db=self.db, method=self.method, returnNumber=self.returnNumber, tissueProbeSetFreezeId=TissueProbeSetFreezeId)
-
- totalTraits = len(traitdatabase) #XZ, 09/18/2008: total trait number
-
- for traitdata in traitdatabase:
- traitdataName = traitdata[0]
- traitvals = traitdata[dataStartPos:]
- if self.method == "1" or self.method == "3" or self.method == "4":
- corr,nOverlap = webqtlUtil.calCorrelation(traitvals,_vals,nnCorr)
- else:
- corr,nOverlap = webqtlUtil.calCorrelationRank(traitvals,_vals,nnCorr)
-
- traitinfo = [traitdataName,corr,nOverlap]
-
- #XZ, 09/28/2008: if user select '3', then fetchAllDatabaseData would give us LitCorr in the [1] position
- #XZ, 09/28/2008: if user select '4' or '5', then fetchAllDatabaseData would give us Tissue Corr in the [1] position
- #XZ, 09/28/2008: and Tissue Corr P Value in the [2] position
- if input_trait_GeneId and self.db.type == "ProbeSet":
- if self.method == "3":
- traitinfo.append( traitdata[1] )
- if self.method == "4" or self.method == "5":
- traitinfo.append( traitdata[1] )
- traitinfo.append( traitdata[2] )
-
- allcorrelations.append(traitinfo)
+ auth_user_for_db(self.db, self.cursor, target_db_name, self.privilege, self.userName)
+ except AuthException, e:
+ detail = [e.message]
+ return self.error(detail)
+ #XZ, 09/18/2008: filter out the strains that have no value.
+ self.sample_names, vals, vars, N = fd.informativeStrains(sample_list)
-#############################################################
+ #CF - If less than a minimum number of strains/cases in common, don't calculate anything
+ if len(self.sample_names) < self.corrMinInformative:
+ detail = ['Fewer than %d strain data were entered for %s data set. No calculation of correlation has been attempted.' % (self.corrMinInformative, fd.RISet)]
+ self.error(heading=PAGE_HEADING,detail=detail)
- if self.method == "3" and input_trait_GeneId:
- allcorrelations.sort(webqtlUtil.cmpLitCorr)
- #XZ, 3/31/2010: Theoretically, we should create one function 'comTissueCorr'
- #to compare each trait by their tissue corr p values.
- #But because the tissue corr p values are generated by permutation test,
- #the top ones always have p value 0. So comparing p values actually does nothing.
- #In addition, for the tissue data in our database, the N is always the same.
- #So it's safe to compare with tissue corr statistic value.
- #That's the same as literature corr.
- elif self.method in ["4","5"] and input_trait_GeneId:
- allcorrelations.sort(webqtlUtil.cmpLitCorr)
- else:
- allcorrelations.sort(webqtlUtil.cmpCorr)
+ self.method = get_correlation_method_key(fd)
+ correlation_method = self.CORRELATION_METHODS[self.method]
+ rankOrder = self.RANK_ORDERS[self.method]
- #XZ, 09/20/2008: we only need the top ones.
- self.returnNumber = min(self.returnNumber,len(allcorrelations))
- allcorrelations = allcorrelations[:self.returnNumber]
+ # CF - Number of results returned
+ self.returnNumber = int(fd.formdata.getvalue('criteria'))
- addLiteratureCorr = False
- addTissueCorr = False
+ self.record_count = 0
- traitList = []
- for item in allcorrelations:
- thisTrait = webqtlTrait(db=self.db, name=item[0], cursor=self.cursor)
- thisTrait.retrieveInfo( QTL='Yes' )
+ myTrait = get_custom_trait(fd, self.cursor)
- nOverlap = item[2]
- corr = item[1]
- #XZ: calculate corrPValue
- if nOverlap < 3:
- corrPValue = 1.0
- else:
- if abs(corr) >= 1.0:
- corrPValue = 0.0
- else:
- ZValue = 0.5*log((1.0+corr)/(1.0-corr))
- ZValue = ZValue*sqrt(nOverlap-3)
- corrPValue = 2.0*(1.0 - reaper.normp(abs(ZValue)))
-
- thisTrait.Name = item[0]
- thisTrait.corr = corr
- thisTrait.nOverlap = nOverlap
- thisTrait.corrPValue = corrPValue
- # NL, 07/19/2010
- # js function changed, add a new parameter rankOrder for js function 'showTissueCorrPlot'
- rankOrder = 0;
- if self.method in ["2","5"]:
- rankOrder = 1;
- thisTrait.rankOrder =rankOrder
-
- #XZ, 26/09/2008: Method is 4 or 5. Have fetched tissue corr, but no literature correlation yet.
- if len(item) == 5:
- thisTrait.tissueCorr = item[3]
- thisTrait.tissuePValue = item[4]
- addLiteratureCorr = True
+ # We will not get Literature Correlations if there is no GeneId because there is nothing to look against
+ self.gene_id = int(fd.formdata.getvalue('GeneId') or 0)
- #XZ, 26/09/2008: Method is 3, Have fetched literature corr, but no tissue corr yet.
- elif len(item) == 4:
- thisTrait.LCorr = item[3]
- thisTrait.mouse_geneid = self.translateToMouseGeneID(species, thisTrait.geneid)
- addTissueCorr = True
+ # We will not get Tissue Correlations if there is no gene symbol because there is nothing to look against
+ self.trait_symbol = myTrait.symbol
+
- #XZ, 26/09/2008: Method is 1 or 2. Have NOT fetched literature corr and tissue corr yet.
- # Phenotype data will not have geneid, and neither will some probes
- # we need to handle this because we will get an attribute error
- else:
- if input_trait_mouse_geneid and self.db.type=="ProbeSet":
- addLiteratureCorr = True
- if input_trait_symbol and self.db.type=="ProbeSet":
- addTissueCorr = True
+ #XZ, 12/12/2008: if the species is rat or human, translate the geneid to mouse geneid
+ self.input_trait_mouse_gene_id = self.translateToMouseGeneID(self.species, self.gene_id)
- traitList.append(thisTrait)
+ #XZ: As of Nov/13/2010, this dataset is 'UTHSC Illumina V6.2 RankInv B6 D2 average CNS GI average (May 08)'
+ self.tissue_probeset_freeze_id = 1
- if addLiteratureCorr:
- traitList = self.getLiteratureCorrelationByList(input_trait_mouse_geneid, species, traitList)
- if addTissueCorr:
- traitList = self.getTissueCorrelationByList( primaryTraitSymbol=input_trait_symbol, traitList=traitList,TissueProbeSetFreezeId =TissueProbeSetFreezeId, method=self.method)
+ traitList = self.correlate(vals)
+
+ _log.info("Done doing correlation calculation")
-########################################################
+############################################################################################################################################
TD_LR = HT.TD(height=200,width="100%",bgColor='#eeeeee')
mainfmName = webqtlUtil.genRandStr("fm_")
form = HT.Form(cgi= os.path.join(webqtlConfig.CGIDIR, webqtlConfig.SCRIPTFILE), enctype='multipart/form-data', name= mainfmName, submit=HT.Input(type='hidden'))
- hddn = {'FormID':'showDatabase', 'ProbeSetID':'_','database':self.target_db_name, 'databaseFull':self.db.fullname, 'CellID':'_', 'RISet':RISet, 'identification':fd.identification}
+ hddn = {'FormID': 'showDatabase',
+ 'ProbeSetID': '_',
+ 'database': self.target_db_name,
+ 'databaseFull': self.db.fullname,
+ 'CellID': '_',
+ 'RISet': fd.RISet,
+ 'identification': fd.identification}
if myTrait:
hddn['fullname']=fd.formdata.getvalue('fullname')
- if mdpchoice:
- hddn['MDPChoice']=mdpchoice
+ if mdp_choice:
+ hddn['MDPChoice']=mdp_choice
#XZ, 09/18/2008: pass the trait data to next page by hidden parameters.
@@ -510,13 +390,13 @@ class CorrelationPage(templatePage):
#XZ, 3/11/2010: add one parameter to record if the method is rank order.
form.append(HT.Input(name="rankOrder", value="%s" % rankOrder, type='hidden'))
- form.append(HT.Input(name="TissueProbeSetFreezeId", value="%s" % TissueProbeSetFreezeId, type='hidden'))
+ form.append(HT.Input(name="TissueProbeSetFreezeId", value="%s" % self.tissue_probeset_freeze_id, type='hidden'))
####################################
# generate the info on top of page #
####################################
- info = self.getTopInfo(myTrait=myTrait, method=self.method, db=self.db, target_db_name=self.target_db_name, returnNumber=self.returnNumber, methodDict=methodDict, totalTraits=totalTraits, identification=fd.identification )
+ info = self.getTopInfo(myTrait=myTrait, method=self.method, db=self.db, target_db_name=self.target_db_name, returnNumber=self.returnNumber, methodDict=self.CORRELATION_METHODS, totalTraits=traitList, identification=fd.identification )
##############
# Excel file #
@@ -536,7 +416,7 @@ class CorrelationPage(templatePage):
#####################################################################
-
+ #Select All, Deselect All, Invert Selection, Add to Collection
mintmap = HT.Href(url="#redirect", onClick="databaseFunc(document.getElementsByName('%s')[0], 'showIntMap');" % mainfmName)
mintmap_img = HT.Image("/images/multiple_interval_mapping1_final.jpg", name='mintmap', alt="Multiple Interval Mapping", title="Multiple Interval Mapping", style="border:none;")
mintmap.append(mintmap_img)
@@ -555,10 +435,10 @@ class CorrelationPage(templatePage):
partialCorr = HT.Href(url="#redirect", onClick="databaseFunc(document.getElementsByName('%s')[0], 'partialCorrInput');" % mainfmName)
partialCorr_img = HT.Image("/images/partial_correlation_final.jpg", name='partialCorr', alt="Partial Correlation", title="Partial Correlation", style="border:none;")
partialCorr.append(partialCorr_img)
- addselect = HT.Href(url="#redirect", onClick="addRmvSelection('%s', document.getElementsByName('%s')[0], 'addToSelection');" % (RISet, mainfmName))
+ addselect = HT.Href(url="#redirect", onClick="addRmvSelection('%s', document.getElementsByName('%s')[0], 'addToSelection');" % (fd.RISet, mainfmName))
addselect_img = HT.Image("/images/add_collection1_final.jpg", name="addselect", alt="Add To Collection", title="Add To Collection", style="border:none;")
addselect.append(addselect_img)
- selectall = HT.Href(url="#redirect", onClick="checkAll(document.getElementsByName('%s')[0]);" % mainfmName)
+ selectall = HT.Href(url="#redirect", onClick="checkAll(document.getElementsByName('%s')[0]);" % mainfmName)
selectall_img = HT.Image("/images/select_all2_final.jpg", name="selectall", alt="Select All", title="Select All", style="border:none;")
selectall.append(selectall_img)
selectinvert = HT.Href(url="#redirect", onClick = "checkInvert(document.getElementsByName('%s')[0]);" % mainfmName)
@@ -575,20 +455,90 @@ class CorrelationPage(templatePage):
selectandor.append(('OR','or'))
selectandor.selected.append('AND')
- pageTable = HT.TableLite(cellSpacing=0,cellPadding=0,width="100%", border=0, align="Left")
- containerTable = HT.TableLite(cellSpacing=0,cellPadding=0,width="90%",border=0, align="Left")
+ #External analysis tools
+ GCATButton = HT.Href(url="#redirect", onClick="databaseFunc(document.getElementsByName('%s')[0], 'GCAT');" % mainfmName)
+ GCATButton_img = HT.Image("/images/GCAT_logo_final.jpg", name="GCAT", alt="GCAT", title="GCAT", style="border:none")
+ GCATButton.append(GCATButton_img)
+
+ ODE = HT.Href(url="#redirect", onClick="databaseFunc(document.getElementsByName('%s')[0], 'ODE');" % mainfmName)
+ ODE_img = HT.Image("/images/ODE_logo_final.jpg", name="ode", alt="ODE", title="ODE", style="border:none")
+ ODE.append(ODE_img)
+
+ '''
+ #XZ, 07/07/2010: I comment out this block of code.
+ WebGestaltScript = HT.Script(language="Javascript")
+ WebGestaltScript.append("""
+setTimeout('openWebGestalt()', 2000);
+function openWebGestalt(){
+var thisForm = document['WebGestalt'];
+makeWebGestaltTree(thisForm, '%s', %d, 'edag_only.php');
+}
+ """ % (mainfmName, len(traitList)))
+ '''
+
+ self.cursor.execute('SELECT GeneChip.GO_tree_value FROM GeneChip, ProbeFreeze, ProbeSetFreeze WHERE GeneChip.Id = ProbeFreeze.ChipId and ProbeSetFreeze.ProbeFreezeId = ProbeFreeze.Id and ProbeSetFreeze.Name = "%s"' % self.db.name)
+ result = self.cursor.fetchone()
+
+ if result:
+ GO_tree_value = result[0]
+
+ if GO_tree_value:
+
+ WebGestalt = HT.Href(url="#redirect", onClick="databaseFunc(document.getElementsByName('%s')[0], 'GOTree');" % mainfmName)
+ WebGestalt_img = HT.Image("/images/webgestalt_icon_final.jpg", name="webgestalt", alt="Gene Set Analysis Toolkit", title="Gene Set Analysis Toolkit", style="border:none")
+ WebGestalt.append(WebGestalt_img)
+
+ hddnWebGestalt = {
+ 'id_list':'',
+ 'correlation':'',
+ 'id_value':'',
+ 'llid_list':'',
+ 'id_type':GO_tree_value,
+ 'idtype':'',
+ 'species':'',
+ 'list':'',
+ 'client':''}
+
+ hddnWebGestalt['ref_type'] = hddnWebGestalt['id_type']
+ hddnWebGestalt['cat_type'] = 'GO'
+ hddnWebGestalt['significancelevel'] = 'Top10'
+
+ if self.species == 'rat':
+ hddnWebGestalt['org'] = 'Rattus norvegicus'
+ elif self.species == 'human':
+ hddnWebGestalt['org'] = 'Homo sapiens'
+ elif self.species == 'mouse':
+ hddnWebGestalt['org'] = 'Mus musculus'
+ else:
+ hddnWebGestalt['org'] = ''
+
+ for key in hddnWebGestalt.keys():
+ form.append(HT.Input(name=key, value=hddnWebGestalt[key], type='hidden'))
+
- optionsTable = HT.TableLite(cellSpacing=2, cellPadding=0,width="320", height="80", border=0, align="Left")
- optionsTable.append(HT.TR(HT.TD(selectall), HT.TD(reset), HT.TD(selectinvert), HT.TD(addselect), align="left"))
- optionsTable.append(HT.TR(HT.TD(" "*1,"Select"), HT.TD("Deselect"), HT.TD(" "*1,"Invert"), HT.TD(" "*3,"Add")))
+ #Create tables with options, etc
+
+ pageTable = HT.TableLite(cellSpacing=0,cellPadding=0,width="100%", border=0, align="Left")
+
+ containerTable = HT.TableLite(cellSpacing=0,cellPadding=0,width="90%",border=0, align="Left")
+
+
+ if not GO_tree_value:
+ optionsTable = HT.TableLite(cellSpacing=2, cellPadding=0,width="480", height="80", border=0, align="Left")
+ optionsTable.append(HT.TR(HT.TD(selectall), HT.TD(reset), HT.TD(selectinvert), HT.TD(addselect), HT.TD(GCATButton), HT.TD(ODE), align="left"))
+ optionsTable.append(HT.TR(HT.TD(" "*1,"Select"), HT.TD("Deselect"), HT.TD(" "*1,"Invert"), HT.TD(" "*3,"Add"), HT.TD("Gene Set"), HT.TD(" "*2,"GCAT")))
+ else:
+ optionsTable = HT.TableLite(cellSpacing=2, cellPadding=0,width="560", height="80", border=0, align="Left")
+ optionsTable.append(HT.TR(HT.TD(selectall), HT.TD(reset), HT.TD(selectinvert), HT.TD(addselect), HT.TD(GCATButton), HT.TD(ODE), HT.TD(WebGestalt), align="left"))
+ optionsTable.append(HT.TR(HT.TD(" "*1,"Select"), HT.TD("Deselect"), HT.TD(" "*1,"Invert"), HT.TD(" "*3,"Add"), HT.TD("Gene Set"), HT.TD(" "*2,"GCAT"), HT.TD(" "*3, "ODE")))
containerTable.append(HT.TR(HT.TD(optionsTable)))
functionTable = HT.TableLite(cellSpacing=2,cellPadding=0,width="480",height="80", border=0, align="Left")
functionRow = HT.TR(HT.TD(networkGraph, width="16.7%"), HT.TD(cormatrix, width="16.7%"), HT.TD(partialCorr, width="16.7%"), HT.TD(mcorr, width="16.7%"), HT.TD(mintmap, width="16.7%"), HT.TD(heatmap), align="left")
labelRow = HT.TR(HT.TD(" "*1,HT.Text("Graph")), HT.TD(" "*1,HT.Text("Matrix")), HT.TD(" "*1,HT.Text("Partial")), HT.TD(HT.Text("Compare")), HT.TD(HT.Text("QTL Map")), HT.TD(HT.Text(text="Heat Map")))
functionTable.append(functionRow, labelRow)
- containerTable.append(HT.TR(HT.TD(functionTable), HT.BR()))
+ containerTable.append(HT.TR(HT.TD(functionTable), HT.BR()))
#more_options = HT.Image("/images/more_options1_final.jpg", name='more_options', alt="Expand Options", title="Expand Options", style="border:none;", Class="toggleShowHide")
@@ -597,12 +547,14 @@ class CorrelationPage(templatePage):
moreOptions = HT.Input(type='button',name='options',value='More Options', onClick="",Class="toggle")
fewerOptions = HT.Input(type='button',name='options',value='Fewer Options', onClick="",Class="toggle")
+ """
if (fd.formdata.getvalue('showHideOptions') == 'less'):
- containerTable.append(HT.TR(HT.TD(" "), height="10"), HT.TR(HT.TD(HT.Div(fewerOptions, Class="toggleShowHide"))))
- containerTable.append(HT.TR(HT.TD(" ")))
+ containerTable.append(HT.TR(HT.TD(" "), height="10"), HT.TR(HT.TD(HT.Div(fewerOptions, Class="toggleShowHide"))))
+ containerTable.append(HT.TR(HT.TD(" ")))
else:
- containerTable.append(HT.TR(HT.TD(" "), height="10"), HT.TR(HT.TD(HT.Div(moreOptions, Class="toggleShowHide"))))
- containerTable.append(HT.TR(HT.TD(" ")))
+ containerTable.append(HT.TR(HT.TD(" "), height="10"), HT.TR(HT.TD(HT.Div(moreOptions, Class="toggleShowHide"))))
+ containerTable.append(HT.TR(HT.TD(" ")))
+ """
containerTable.append(HT.TR(HT.TD(HT.Span(selecttraits,' with r > ',selectgt, ' ',selectandor, ' r < ',selectlt,Class="bd1 cbddf fs11")), style="display:none;", Class="extra_options"))
@@ -615,9 +567,9 @@ class CorrelationPage(templatePage):
if self.db.type=="Geno":
- containerTable.append(HT.TR(HT.TD(xlsUrl, height=40)))
+ containerTable.append(HT.TR(HT.TD(xlsUrl, height=60)))
- pageTable.append(HT.TR(HT.TD(containerTable)))
+ pageTable.append(HT.TR(HT.TD(containerTable)))
tblobj['header'], worksheet = self.getTableHeaderForGeno( method=self.method, worksheet=worksheet, newrow=newrow, headingStyle=headingStyle)
newrow += 1
@@ -636,9 +588,9 @@ class CorrelationPage(templatePage):
div = HT.Div(webqtlUtil.genTableObj(tblobj=tblobj, file=filename, sortby=sortby, tableID = "sortable", addIndex = "1"), corrScript, Id="sortable")
- pageTable.append(HT.TR(HT.TD(div)))
+ pageTable.append(HT.TR(HT.TD(div)))
- form.append(HT.Input(name='ShowStrains',type='hidden', value =1),
+ form.append(HT.Input(name='ShowStrains',type='hidden', value =1),
HT.Input(name='ShowLine',type='hidden', value =1),
HT.P(), HT.P(), pageTable)
TD_LR.append(corrHeading, info, form, HT.P())
@@ -649,9 +601,9 @@ class CorrelationPage(templatePage):
elif self.db.type=="Publish":
- containerTable.append(HT.TR(HT.TD(xlsUrl, height=40)))
+ containerTable.append(HT.TR(HT.TD(xlsUrl, height=40)))
- pageTable.append(HT.TR(HT.TD(containerTable)))
+ pageTable.append(HT.TR(HT.TD(containerTable)))
tblobj['header'], worksheet = self.getTableHeaderForPublish(method=self.method, worksheet=worksheet, newrow=newrow, headingStyle=headingStyle)
newrow += 1
@@ -661,7 +613,7 @@ class CorrelationPage(templatePage):
corrScript = HT.Script(language="Javascript")
corrScript.append("var corrArray = new Array();")
- tblobj['body'], worksheet, corrScript = self.getTableBodyForPublish(traitList=traitList, formName=mainfmName, worksheet=worksheet, newrow=newrow, corrScript=corrScript, species=species)
+ tblobj['body'], worksheet, corrScript = self.getTableBodyForPublish(traitList=traitList, formName=mainfmName, worksheet=worksheet, newrow=newrow, corrScript=corrScript, species=self.species)
workbook.close()
@@ -671,7 +623,7 @@ class CorrelationPage(templatePage):
# NL, 07/27/2010. genTableObj function has been moved from templatePage.py to webqtlUtil.py;
div = HT.Div(webqtlUtil.genTableObj(tblobj=tblobj, file=filename, sortby=sortby, tableID = "sortable", addIndex = "1"), corrScript, Id="sortable")
- pageTable.append(HT.TR(HT.TD(div)))
+ pageTable.append(HT.TR(HT.TD(div)))
form.append(
HT.Input(name='ShowStrains',type='hidden', value =1),
@@ -685,7 +637,6 @@ class CorrelationPage(templatePage):
elif self.db.type=="ProbeSet":
-
tblobj['header'], worksheet = self.getTableHeaderForProbeSet(method=self.method, worksheet=worksheet, newrow=newrow, headingStyle=headingStyle)
newrow += 1
@@ -694,7 +645,7 @@ class CorrelationPage(templatePage):
corrScript = HT.Script(language="Javascript")
corrScript.append("var corrArray = new Array();")
- tblobj['body'], worksheet, corrScript = self.getTableBodyForProbeSet(traitList=traitList, primaryTrait=myTrait, formName=mainfmName, worksheet=worksheet, newrow=newrow, corrScript=corrScript, species=species)
+ tblobj['body'], worksheet, corrScript = self.getTableBodyForProbeSet(traitList=traitList, primaryTrait=myTrait, formName=mainfmName, worksheet=worksheet, newrow=newrow, corrScript=corrScript, species=self.species)
workbook.close()
objfile = open('%s.obj' % (webqtlConfig.TMPDIR+filename), 'wb')
@@ -741,95 +692,21 @@ class CorrelationPage(templatePage):
#updated by NL. Delete function generateJavaScript, move js files to dhtml.js, webqtl.js and jqueryFunction.js
#variables: filename, strainIds and vals are required by getquerystring function
- strainIds=self.getStrainIds(species=species, strains=_strains)
+ strainIds=self.getStrainIds(species=self.species, strains=self.sample_names)
var1 = HT.Input(name="filename", value=filename, type='hidden')
var2 = HT.Input(name="strainIds", value=strainIds, type='hidden')
- var3 = HT.Input(name="vals", value=_vals, type='hidden')
+ var3 = HT.Input(name="vals", value=vals, type='hidden')
customizerButton = HT.Input(type="button", Class="button", value="Add Correlation", onClick = "xmlhttpPost('%smain.py?FormID=AJAX_table', 'sortable', (getquerystring(this.form)))" % webqtlConfig.CGIDIR)
containerTable.append(HT.TR(HT.TD(HT.Span(var1,var2,var3,customizerButton, "with", dbCustomizer, Class="bd1 cbddf fs11"), HT.BR(), HT.BR()), style="display:none;", Class="extra_options"))
- #outside analysis part
- GCATButton = HT.Href(url="#redirect", onClick="databaseFunc(document.getElementsByName('%s')[0], 'GCAT');" % mainfmName)
- GCATButton_img = HT.Image("/images/GCAT_logo_final.jpg", name="GCAT", alt="GCAT", title="GCAT", style="border:none")
- GCATButton.append(GCATButton_img)
-
- ODE = HT.Href(url="#redirect", onClick="databaseFunc(document.getElementsByName('%s')[0], 'ODE');" % mainfmName)
- ODE_img = HT.Image("/images/ODE_logo_final.jpg", name="ode", alt="ODE", title="ODE", style="border:none")
- ODE.append(ODE_img)
+ containerTable.append(HT.TR(HT.TD(xlsUrl, HT.BR(), HT.BR())))
- '''
- #XZ, 07/07/2010: I comment out this block of code.
- WebGestaltScript = HT.Script(language="Javascript")
- WebGestaltScript.append("""
-setTimeout('openWebGestalt()', 2000);
-function openWebGestalt(){
- var thisForm = document['WebGestalt'];
- makeWebGestaltTree(thisForm, '%s', %d, 'edag_only.php');
-}
- """ % (mainfmName, len(traitList)))
- '''
-
- self.cursor.execute('SELECT GeneChip.GO_tree_value FROM GeneChip, ProbeFreeze, ProbeSetFreeze WHERE GeneChip.Id = ProbeFreeze.ChipId and ProbeSetFreeze.ProbeFreezeId = ProbeFreeze.Id and ProbeSetFreeze.Name = "%s"' % self.db.name)
- result = self.cursor.fetchone()
+ pageTable.append(HT.TR(HT.TD(containerTable)))
- if result:
- GO_tree_value = result[0]
+ pageTable.append(HT.TR(HT.TD(div)))
- if GO_tree_value:
-
- WebGestalt = HT.Href(url="#redirect", onClick="databaseFunc(document.getElementsByName('%s')[0], 'GOTree');" % mainfmName)
- WebGestalt_img = HT.Image("/images/webgestalt_icon_final.jpg", name="webgestalt", alt="Gene Set Analysis Toolkit", title="Gene Set Analysis Toolkit", style="border:none")
- WebGestalt.append(WebGestalt_img)
-
- hddnWebGestalt = {
- 'id_list':'',
- 'correlation':'',
- 'id_value':'',
- 'llid_list':'',
- 'id_type':GO_tree_value,
- 'idtype':'',
- 'species':'',
- 'list':'',
- 'client':''}
-
- hddnWebGestalt['ref_type'] = hddnWebGestalt['id_type']
- hddnWebGestalt['cat_type'] = 'GO'
- hddnWebGestalt['significancelevel'] = 'Top10'
-
- if species == 'rat':
- hddnWebGestalt['org'] = 'Rattus norvegicus'
- elif species == 'human':
- hddnWebGestalt['org'] = 'Homo sapiens'
- elif species == 'mouse':
- hddnWebGestalt['org'] = 'Mus musculus'
- else:
- hddnWebGestalt['org'] = ''
-
- for key in hddnWebGestalt.keys():
- form.append(HT.Input(name=key, value=hddnWebGestalt[key], type='hidden'))
-
-
- LinkOutTable = HT.TableLite(cellSpacing=2,cellPadding=0,width="320",height="80", border=0, align="Left")
-
- if not GO_tree_value:
- LinkOutRow = HT.TR(HT.TD(GCATButton, width="50%"), HT.TD(ODE, width="50%"), align="left")
- LinkOutLabels = HT.TR(HT.TD(" ", HT.Text("GCAT"), width="50%"), HT.TD(" ",HT.Text("ODE"), width="50%"), align="left")
- else:
- LinkOutRow = HT.TR(HT.TD(WebGestalt, width="25%"), HT.TD(GCATButton, width="25%"), HT.TD(ODE, width="25%"), align="left")
- LinkOutLabels = HT.TR(HT.TD(HT.Text("Gene Set")), HT.TD(" "*2, HT.Text("GCAT")), HT.TD(" "*3, HT.Text("ODE")), style="display:none;", Class="extra_options")
-
- LinkOutTable.append(LinkOutRow,LinkOutLabels)
-
- containerTable.append(HT.TR(HT.TD(LinkOutTable), Class="extra_options", style="display:none;"))
-
- containerTable.append(HT.TR(HT.TD(xlsUrl, HT.BR(), HT.BR())))
-
- pageTable.append(HT.TR(HT.TD(containerTable)))
-
- pageTable.append(HT.TR(HT.TD(div)))
-
- if species == 'human':
+ if self.species == 'human':
heatmap = ""
form.append(HT.Input(name='ShowStrains',type='hidden', value =1),
@@ -1009,7 +886,7 @@ Resorting this table
tempTable = self.getTempLiteratureTable(species=species, input_species_geneid=GeneId, returnNumber=returnNumber)
if method == "4" or method == "5":
- tempTable = self.getTempTissueCorrTable(primaryTraitSymbol=GeneSymbol, TissueProbeSetFreezeId=tissueProbeSetFreezeId, method=method, returnNumber=returnNumber)
+ tempTable = self.getTempTissueCorrTable(primaryTraitSymbol=GeneSymbol, TissueProbeSetFreezeId=TISSUE_MOUSE_DB, method=method, returnNumber=returnNumber)
for step in range(nnn):
temp = []
@@ -1068,18 +945,30 @@ Resorting this table
oridata.append(results)
datasize = len(oridata[0])
- traitdatabase = []
- # put all of the seperate data together into a huge list of lists
+ traits = []
+ # put all of the separate data together into a huge list of lists
for j in range(datasize):
traitdata = list(oridata[0][j])
for i in range(1,nnn):
traitdata += list(oridata[i][j][dataStartPos:])
- traitdatabase.append(traitdata)
+
+ trait = Trait(traitdata[0], traitdata[dataStartPos:])
+
+ if method == METHOD_LIT:
+ trait.lit_corr = traitdata[1]
+
+ if method in TISSUE_METHODS:
+ trait.tissue_corr = traitdata[1]
+ trait.p_tissue = traitdata[2]
+
+ traits.append(trait)
if tempTable:
self.cursor.execute( 'DROP TEMPORARY TABLE %s' % tempTable )
- return traitdatabase, dataStartPos
+ return traits
+
+
# XZ, 09/20/2008: This function creates TEMPORARY TABLE tmpTableName_2 and return its name.
@@ -1159,7 +1048,7 @@ Resorting this table
except:
return 0
- symbolCorrDict, symbolPvalueDict = self.calculateCorrOfAllTissueTrait(primaryTraitSymbol=primaryTraitSymbol, TissueProbeSetFreezeId=TissueProbeSetFreezeId, method=method)
+ symbolCorrDict, symbolPvalueDict = self.calculateCorrOfAllTissueTrait(primaryTraitSymbol=primaryTraitSymbol, TissueProbeSetFreezeId=TISSUE_MOUSE_DB, method=method)
symbolCorrList = symbolCorrDict.items()
@@ -1216,7 +1105,7 @@ Resorting this table
Returns a dictionary of 'TraitID':(tissueCorr, tissuePValue) for the requested correlation"""
- tempTable = self.getTempTissueCorrTable(primaryTraitSymbol=primaryTraitSymbol, TissueProbeSetFreezeId=TissueProbeSetFreezeId, method=method, returnNumber=returnNumber)
+ tempTable = self.getTempTissueCorrTable(primaryTraitSymbol=primaryTraitSymbol, TissueProbeSetFreezeId=TISSUE_MOUSE_DB, method=method, returnNumber=returnNumber)
query = "SELECT ProbeSet.Name, %s.Correlation, %s.PValue" % (tempTable, tempTable)
query += ' FROM (ProbeSet, ProbeSetXRef, ProbeSetFreeze)'
@@ -1276,6 +1165,225 @@ Resorting this table
return traitList
+ def get_trait(self, cached, vals):
+
+ if cached:
+ _log.info("Using the fast method because the file exists")
+ lit_corrs = {}
+ tissue_corrs = {}
+ use_lit = False
+ if self.method == METHOD_LIT:
+ lit_corrs = self.fetchLitCorrelations(species=self.species, GeneId=self.gene_id, db=self.db, returnNumber=self.returnNumber)
+ use_lit = True
+
+ use_tissue_corr = False
+ if self.method in TISSUE_METHODS:
+ tissue_corrs = self.fetchTissueCorrelations(db=self.db, primaryTraitSymbol=self.trait_symbol, TissueProbeSetFreezeId=TISSUE_MOUSE_DB, method=self.method, returnNumber = self.returnNumber)
+ use_tissue_corr = True
+
+ DatabaseFileName = self.getFileName( target_db_name=self.target_db_name )
+ datasetFile = open(webqtlConfig.TEXTDIR+DatabaseFileName,'r')
+
+ #XZ, 01/08/2009: read the first line
+ line = datasetFile.readline()
+ cached_sample_names = webqtlUtil.readLineCSV(line)[1:]
+
+ #XZ, 01/08/2009: This step is critical. It is necessary for this new method.
+ #XZ: The original function fetchAllDatabaseData uses all strains stored in variable _strains to
+ #XZ: retrieve the values of each strain from database in real time.
+ #XZ: The new method uses all strains stored in variable dataset_strains to create a new variable
+ #XZ: _newvals. _newvals has the same length as dataset_strains. The items in _newvals is in
+ #XZ: the same order of items in dataset_strains. The value of each item in _newvals is either
+ #XZ: the value of correspinding strain in _vals or 'None'.
+ new_vals = []
+ for name in cached_sample_names:
+ if name in self.sample_names:
+ new_vals.append(float(vals[self.sample_names.index(name)]))
+ else:
+ new_vals.append('None')
+
+ nnCorr = len(new_vals)
+
+ #XZ, 01/14/2009: If literature corr or tissue corr is selected,
+ #XZ: there is no need to use parallel computing.
+
+ traits = []
+ data_start = 1
+ for line in datasetFile:
+ raw_trait = webqtlUtil.readLineCSV(line)
+ trait = Trait.from_csv(raw_trait, data_start)
+ trait.lit_corr = lit_corrs.get(trait.name)
+ trait.tissue_corr, trait.p_tissue = tissue_corrs.get(trait.name, (None, None))
+ traits.append(trait)
+
+ return traits, new_vals
+
+ else:
+ _log.info("Using the slow method for correlation")
+
+ _log.info("Fetching from database")
+ traits = self.fetchAllDatabaseData(species=self.species, GeneId=self.gene_id, GeneSymbol=self.trait_symbol, strains=self.sample_names, db=self.db, method=self.method, returnNumber=self.returnNumber, tissueProbeSetFreezeId= self.tissue_probeset_freeze_id)
+ _log.info("Done fetching from database")
+ totalTraits = len(traits) #XZ, 09/18/2008: total trait number
+
+ return traits, vals
+
+
+ def do_parallel_correlation(self):
+ _log.info("Invoking parallel computing")
+ input_line_list = datasetFile.readlines()
+ _log.info("Read lines from the file")
+ all_line_number = len(input_line_list)
+
+ step = 1000
+ job_number = math.ceil( float(all_line_number)/step )
+
+ job_input_lists = []
+
+ _log.info("Configuring jobs")
+
+ for job_index in range( int(job_number) ):
+ starti = job_index*step
+ endi = min((job_index+1)*step, all_line_number)
+
+ one_job_input_list = []
+
+ for i in range( starti, endi ):
+ one_job_input_list.append( input_line_list[i] )
+
+ job_input_lists.append( one_job_input_list )
+
+ _log.info("Creating pp servers")
+
+ ppservers = ()
+ # Creates jobserver with automatically detected number of workers
+ job_server = pp.Server(ppservers=ppservers)
+
+ _log.info("Done creating servers")
+
+ jobs = []
+ results = []
+
+ _log.info("Starting parallel computation, submitting jobs")
+ for one_job_input_list in job_input_lists: #pay attention to modules from outside
+ jobs.append( job_server.submit(func=compute_corr, args=(nnCorr, _newvals, one_job_input_list, self.method), depfuncs=(), modules=("utility.webqtlUtil",)) )
+ _log.info("Done submitting jobs")
+
+ for one_job in jobs:
+ one_result = one_job()
+ results.append( one_result )
+
+ _log.info("Acquiring results")
+
+ for one_result in results:
+ for one_traitinfo in one_result:
+ allcorrelations.append( one_traitinfo )
+
+ _log.info("Appending the results")
+
+ datasetFile.close()
+ totalTraits = len(allcorrelations)
+ _log.info("Done correlating using the fast method")
+
+
+ def correlate(self, vals):
+
+ correlations = []
+
+ #XZ: Use the fast method only for probeset dataset, and this dataset must have been created.
+ #XZ: Otherwise, use original method
+ _log.info("Entering correlation")
+
+ db_filename = self.getFileName( target_db_name=self.target_db_name )
+
+ cache_available = db_filename in os.listdir(webqtlConfig.TEXTDIR)
+
+ # If the cache file exists, do a cached correlation for probeset data
+ if self.db.type == "ProbeSet":
+# if self.method in [METHOD_SAMPLE_PEARSON, METHOD_SAMPLE_RANK] and cache_available:
+# traits = do_parallel_correlation()
+#
+# else:
+
+ (traits, vals) = self.get_trait(cache_available, vals)
+
+ for trait in traits:
+ trait.calculate_correlation(vals, self.method)
+
+ self.record_count = len(traits) #ZS: This isn't a good way to get this value, so I need to change it later
+
+ #XZ, 3/31/2010: Theoretically, we should create one function 'comTissueCorr'
+ #to compare each trait by their tissue corr p values.
+ #But because the tissue corr p values are generated by permutation test,
+ #the top ones always have p value 0. So comparing p values actually does nothing.
+ #In addition, for the tissue data in our database, the N is always the same.
+ #So it's safe to compare with tissue corr statistic value.
+ #That's the same as literature corr.
+ #if self.method in [METHOD_LIT, METHOD_TISSUE_PEARSON, METHOD_TISSUE_RANK] and self.gene_id:
+ # traits.sort(webqtlUtil.cmpLitCorr)
+ #else:
+ #if self.method in TISSUE_METHODS:
+ # sort(traits, key=lambda A: math.fabs(A.tissue_corr))
+ #elif self.method == METHOD_LIT:
+ # traits.sort(traits, key=lambda A: math.fabs(A.lit_corr))
+ #else:
+ traits = sortTraitCorrelations(traits, self.method)
+
+ # Strip to the top N correlations
+ traits = traits[:min(self.returnNumber, len(traits))]
+
+ addLiteratureCorr = False
+ addTissueCorr = False
+
+ trait_list = []
+ for trait in traits:
+ db_trait = webqtlTrait(db=self.db, name=trait.name, cursor=self.cursor)
+ db_trait.retrieveInfo( QTL='Yes' )
+
+ db_trait.Name = trait.name
+ db_trait.corr = trait.correlation
+ db_trait.nOverlap = trait.overlap
+ db_trait.corrPValue = trait.p_value
+
+ # NL, 07/19/2010
+ # js function changed, add a new parameter rankOrder for js function 'showTissueCorrPlot'
+ db_trait.RANK_ORDER = self.RANK_ORDERS[self.method]
+
+ #XZ, 26/09/2008: Method is 4 or 5. Have fetched tissue corr, but no literature correlation yet.
+ if self.method in TISSUE_METHODS:
+ db_trait.tissueCorr = trait.tissue_corr
+ db_trait.tissuePValue = trait.p_tissue
+ addTissueCorr = True
+
+
+ #XZ, 26/09/2008: Method is 3, Have fetched literature corr, but no tissue corr yet.
+ elif self.method == METHOD_LIT:
+ db_trait.LCorr = trait.lit_corr
+ db_trait.mouse_geneid = self.translateToMouseGeneID(self.species, db_trait.geneid)
+ addLiteratureCorr = True
+
+ #XZ, 26/09/2008: Method is 1 or 2. Have NOT fetched literature corr and tissue corr yet.
+ # Phenotype data will not have geneid, and neither will some probes
+ # we need to handle this because we will get an attribute error
+ else:
+ if self.input_trait_mouse_gene_id and self.db.type=="ProbeSet":
+ addLiteratureCorr = True
+ if self.trait_symbol and self.db.type=="ProbeSet":
+ addTissueCorr = True
+
+ trait_list.append(db_trait)
+
+ if addLiteratureCorr:
+ trait_list = self.getLiteratureCorrelationByList(self.input_trait_mouse_gene_id,
+ self.species, trait_list)
+ if addTissueCorr:
+ trait_list = self.getTissueCorrelationByList(
+ primaryTraitSymbol = self.trait_symbol,
+ traitList = trait_list,
+ TissueProbeSetFreezeId = TISSUE_MOUSE_DB,
+ method=self.method)
+
+ return trait_list
def calculateCorrOfAllTissueTrait(self, primaryTraitSymbol=None, TissueProbeSetFreezeId=None, method=None):
@@ -1283,10 +1391,10 @@ Resorting this table
symbolCorrDict = {}
symbolPvalueDict = {}
- primaryTraitSymbolValueDict = correlationFunction.getGeneSymbolTissueValueDictForTrait(cursor=self.cursor, GeneNameLst=[primaryTraitSymbol], TissueProbeSetFreezeId=TissueProbeSetFreezeId)
+ primaryTraitSymbolValueDict = correlationFunction.getGeneSymbolTissueValueDictForTrait(cursor=self.cursor, GeneNameLst=[primaryTraitSymbol], TissueProbeSetFreezeId=TISSUE_MOUSE_DB)
primaryTraitValue = primaryTraitSymbolValueDict.values()[0]
- SymbolValueDict = correlationFunction.getGeneSymbolTissueValueDictForTrait(cursor=self.cursor, GeneNameLst=[], TissueProbeSetFreezeId=TissueProbeSetFreezeId)
+ SymbolValueDict = correlationFunction.getGeneSymbolTissueValueDictForTrait(cursor=self.cursor, GeneNameLst=[], TissueProbeSetFreezeId=TISSUE_MOUSE_DB)
if method in ["2","5"]:
symbolCorrDict, symbolPvalueDict = correlationFunction.batchCalTissueCorr(primaryTraitValue,SymbolValueDict,method='spearman')
@@ -1301,7 +1409,7 @@ Resorting this table
#XZ, 10/13/2010
def getTissueCorrelationByList(self, primaryTraitSymbol=None, traitList=None, TissueProbeSetFreezeId=None, method=None):
- primaryTraitSymbolValueDict = correlationFunction.getGeneSymbolTissueValueDictForTrait(cursor=self.cursor, GeneNameLst=[primaryTraitSymbol], TissueProbeSetFreezeId=TissueProbeSetFreezeId)
+ primaryTraitSymbolValueDict = correlationFunction.getGeneSymbolTissueValueDictForTrait(cursor=self.cursor, GeneNameLst=[primaryTraitSymbol], TissueProbeSetFreezeId=TISSUE_MOUSE_DB)
if primaryTraitSymbol.lower() in primaryTraitSymbolValueDict:
primaryTraitValue = primaryTraitSymbolValueDict[primaryTraitSymbol.lower()]
@@ -1312,7 +1420,7 @@ Resorting this table
if hasattr(thisTrait, 'symbol'):
geneSymbolList.append(thisTrait.symbol)
- SymbolValueDict = correlationFunction.getGeneSymbolTissueValueDictForTrait(cursor=self.cursor, GeneNameLst=geneSymbolList, TissueProbeSetFreezeId=TissueProbeSetFreezeId)
+ SymbolValueDict = correlationFunction.getGeneSymbolTissueValueDictForTrait(cursor=self.cursor, GeneNameLst=geneSymbolList, TissueProbeSetFreezeId=TISSUE_MOUSE_DB)
for thisTrait in traitList:
if hasattr(thisTrait, 'symbol') and thisTrait.symbol and thisTrait.symbol.lower() in SymbolValueDict:
@@ -1339,7 +1447,7 @@ Resorting this table
if myTrait:
if method in ["1","2"]: #genetic correlation
info = HT.Paragraph("Values of Record %s in the " % myTrait.getGivenName(), HT.Href(text=myTrait.db.fullname,url=webqtlConfig.INFOPAGEHREF % myTrait.db.name,target="_blank", Class="fwn"),
- " database were compared to all %d records in the " % totalTraits, HT.Href(text=db.fullname,url=webqtlConfig.INFOPAGEHREF % target_db_name,target="_blank", Class="fwn"),
+ " database were compared to all %d records in the " % self.record_count, HT.Href(text=db.fullname,url=webqtlConfig.INFOPAGEHREF % target_db_name,target="_blank", Class="fwn"),
' database. The top %d correlations ranked by the %s are displayed.' % (returnNumber,methodDict[method]),
' You can resort this list using the small arrowheads in the top row.')
else:
@@ -1359,7 +1467,7 @@ Resorting this table
' You can resort this list using the small arrowheads in the top row.' )
elif identification:
- info = HT.Paragraph('Values of %s were compared to all %d traits in ' % (identification, totalTraits),
+ info = HT.Paragraph('Values of %s were compared to all %d traits in ' % (identification, self.record_count),
HT.Href(text=db.fullname,url=webqtlConfig.INFOPAGEHREF % target_db_name,target="_blank",Class="fwn"),
' database. The TOP %d correlations ranked by the %s are displayed.' % (returnNumber,methodDict[method]),
' You can resort this list using the small arrowheads in the top row.')
@@ -1934,7 +2042,7 @@ Resorting this table
TCorr = thisTrait.tissueCorr
TCorrStr = "%2.3f" % thisTrait.tissueCorr
# NL, 07/19/2010: add a new parameter rankOrder for js function 'showTissueCorrPlot'
- rankOrder = thisTrait.rankOrder
+ rankOrder = self.RANK_ORDERS[self.method]
TCorrPlotURL = "javascript:showTissueCorrPlot('%s','%s','%s',%d)" %(formName, primaryTrait.symbol, thisTrait.symbol,rankOrder)
tr.append(TDCell(HT.TD(HT.Href(text=TCorrStr, url=TCorrPlotURL, Class="fs12 fwn ff1"), Class="fs12 fwn ff1 b1 c222", align='right'), TCorrStr, abs(TCorr)))
else:
diff --git a/web/webqtl/showTrait/DataEditingPage.py b/web/webqtl/showTrait/DataEditingPage.py
old mode 100644
new mode 100755
index f38b9880..974b2ed5
--- a/web/webqtl/showTrait/DataEditingPage.py
+++ b/web/webqtl/showTrait/DataEditingPage.py
@@ -416,13 +416,15 @@ class DataEditingPage(templatePage):
UTHSC_BLAT_URL = ""
if UCSC_BLAT_URL:
- verifyButton = HT.Href(url="#redirect", onClick="openNewWin('%s')" % UCSC_BLAT_URL)
- verifyButtonImg = HT.Image("/images/verify_icon.jpg", name="addselect", alt=" Check probe locations at UCSC ", title=" Check probe locations at UCSC ", style="border:none;")
+ verifyButton = HT.Href(url="#")
+ verifyButtonImg = HT.Image("/images/verify_icon.jpg", name="verify", alt=" Check probe locations at UCSC ",
+ title=" Check probe locations at UCSC ", onClick="javascript:openNewWin('%s'); return false;" % UCSC_BLAT_URL, style="border:none;")
verifyButton.append(verifyButtonImg)
verifyText = 'Verify'
if UTHSC_BLAT_URL:
- rnaseqButton = HT.Href(url="#redirect", onClick="openNewWin('%s')" % UTHSC_BLAT_URL)
- rnaseqButtonImg = HT.Image("/images/rnaseq_icon.jpg", name="addselect", alt=" View probes, SNPs, and RNA-seq at UTHSC ", title=" View probes, SNPs, and RNA-seq at UTHSC ", style="border:none;")
+ rnaseqButton = HT.Href(url="#")
+ rnaseqButtonImg = HT.Image("/images/rnaseq_icon.jpg", name="rnaseq", alt=" View probes, SNPs, and RNA-seq at UTHSC ",
+ title=" View probes, SNPs, and RNA-seq at UTHSC ", onClick="javascript:openNewWin('%s'); return false;" % UTHSC_BLAT_URL, style="border:none;")
rnaseqButton.append(rnaseqButtonImg)
rnaseqText = 'RNA-seq'
tSpan.append(HT.BR())
@@ -590,10 +592,24 @@ class DataEditingPage(templatePage):
url="http://string.embl.de/newstring_cgi/show_link_summary.pl?identifier=%s" \
% thisTrait.symbol,Class="fs14 fwn", \
title="Protein interactions: known and inferred"), style=linkStyle), " "*2)
- if thisTrait.geneid:
+ if thisTrait.symbol:
+ #ZS: The "species scientific" converts the plain English species names we're using to their scientific names, which are needed for PANTHER's input
+ #We should probably use the scientific name along with the English name (if not instead of) elsewhere as well, given potential non-English speaking users
+ if _Species == "mouse":
+ species_scientific = "Mus%20musculus"
+ elif _Species == "rat":
+ species_scientific = "Rattus%20norvegicus"
+ elif _Species == "human":
+ species_scientific = "Homo%20sapiens"
+ elif _Species == "drosophila":
+ species_scientific = "Drosophila%20melanogaster"
+ else:
+ species_scientific = "all"
+
+ species_scientific
tSpan.append(HT.Span(HT.Href(text= 'PANTHER',target="mainFrame", \
- url="http://www.pantherdb.org/genes/gene.do?acc=%s" \
- % thisTrait.geneid,Class="fs14 fwn", \
+ url="http://www.pantherdb.org/genes/geneList.do?searchType=basic&fieldName=all&organism=%s&listType=1&fieldValue=%s" \
+ % (species_scientific, thisTrait.symbol),Class="fs14 fwn", \
title="Gene and protein data resources from Celera-ABI"), style=linkStyle), " "*2)
else:
pass
@@ -755,11 +771,12 @@ class DataEditingPage(templatePage):
UCSC_BLAT_URL = ""
UTHSC_BLAT_URL = ""
if UCSC_BLAT_URL:
- verifyButton = HT.Href(url="#redirect", onClick="openNewWin('%s')" % UCSC_BLAT_URL)
+ #verifyButton = HT.Href(url="#", onClick="openNewWin('%s')" % UCSC_BLAT_URL)
+ verifyButton = HT.Href(url="#")
verifyButtonImg = HT.Image("/images/verify_icon.jpg", name="addselect", alt=" Check probe locations at UCSC ", title=" Check probe locations at UCSC ", style="border:none;")
verifyButton.append(verifyButtonImg)
verifyText = "Verify"
- rnaseqButton = HT.Href(url="#redirect", onClick="openNewWin('%s')" % UTHSC_BLAT_URL)
+ rnaseqButton = HT.Href(url="#", onClick="openNewWin('%s')" % UTHSC_BLAT_URL)
rnaseqButtonImg = HT.Image("/images/rnaseq_icon.jpg", name="addselect", alt=" View probes, SNPs, and RNA-seq at UTHSC ", title=" View probes, SNPs, and RNA-seq at UTHSC ", style="border:none;")
rnaseqButton.append(rnaseqButtonImg)
rnaseqText = "RNA-seq"
--
cgit v1.2.3
From 63297d5f4eb61541cb98dcbca668410f6550257a Mon Sep 17 00:00:00 2001
From: Sam Ockman
Date: Fri, 1 Jun 2012 02:03:02 -0400
Subject: Views and templates modified to allow template analysis
---
web/javascript/webqtl.js | 184 +++++++++++-----------
wqflask/runserver.py | 6 +
wqflask/wqflask/search_results.py | 6 +-
wqflask/wqflask/templates/search_result_page.html | 5 +-
wqflask/wqflask/views.py | 4 +
5 files changed, 111 insertions(+), 94 deletions(-)
(limited to 'web')
diff --git a/web/javascript/webqtl.js b/web/javascript/webqtl.js
index 19ecf3b7..536e7d26 100755
--- a/web/javascript/webqtl.js
+++ b/web/javascript/webqtl.js
@@ -38,16 +38,16 @@ function makeTree(thisForm, nnn){
j += 1;
}
}
-
+
var windowName = 'formTarget' + (new Date().getTime());
var newWindow = open("", windowName,"width=900,menubar=0,toolbar=1,resizable=1,status=1,scrollbars=1");
var html = "";
if (j > 0)
- {
+ {
var waithtml1 ="
Your list of "+j+" transcripts is being exported to the Gene Ontology Tree Machine for analysis. This window will soon be replaced with the main GOTM results.
";
}
else
- {
+ {
var waithtml1 ="
Your should select at least one transcript to export to the Gene Ontology Tree Machine for analysis.
";
}
html += waithtml1;
@@ -152,7 +152,11 @@ function showDatabase3(formName, Database,ProbeSetID,CellID){
document[formName].database.value = Database;
document[formName].ProbeSetID.value = ProbeSetID;
document[formName].CellID.value = CellID;
- document[formName].submit();
+ console.log("formName:", formName)
+ console.log("document[formName]:", document[formName])
+ console.log("submit turned off for debugging")
+ console.log("showDatabase3 is deprecated for the flask version of this site")
+ //document[formName].submit();
}
@@ -188,10 +192,10 @@ function showTrait(fmName){
var thisForm = getForm(fmName);
if (thisForm == null || showTrait.arguments.length < 2)
return;
-
+
windowName = genNewWin();
thisForm.target = windowName;
-
+
thisForm.FormID.value = "showDatabase";
thisForm.ProbeSetID.value = showTrait.arguments[1];
if (showTrait.arguments.length > 2)
@@ -205,10 +209,10 @@ function showCateGraph(fmName){
var thisForm = getForm(fmName);
if (thisForm == null || showCateGraph.arguments.length < 2)
return;
-
+
windowName = genNewWin();
thisForm.target = windowName;
-
+
thisForm.FormID.value = "showCategoryGraph";
thisForm.interval1.value = showCateGraph.arguments[1];
thisForm.interval2.value = showCateGraph.arguments[2];
@@ -219,22 +223,22 @@ function showCorrPlot(fmName){
var thisForm = getForm(fmName);
if (thisForm == null || showCorrPlot.arguments.length < 2)
return;
-
+
windowName = genNewWin();
thisForm.target = windowName;
-
+
thisForm.FormID.value = "showCorrelationPlot";
thisForm.ProbeSetID.value = showCorrPlot.arguments[1];
if (showCorrPlot.arguments.length > 2)
thisForm.CellID.value = showCorrPlot.arguments[2];
else
thisForm.CellID.value = "";
-
+
thisForm.X_geneSymbol.value = null;
thisForm.Y_geneSymbol.value = null;
thisForm.submit();
-
+
}
@@ -242,12 +246,12 @@ function showCorrPlotThird(fmName){
var thisForm = getForm(fmName);
if (thisForm == null || showCorrPlotThird.arguments.length < 3)
return;
-
+
windowName = genNewWin();
thisForm.target = windowName;
-
+
var olddb = thisForm.database.value;
-
+
thisForm.FormID.value = "showCorrelationPlot";
thisForm.database.value = showCorrPlotThird.arguments[1];
thisForm.ProbeSetID.value = showCorrPlotThird.arguments[2];
@@ -284,15 +288,15 @@ function ODE(thisForm, script){
var windowName = 'formTarget' + (new Date().getTime());
var newWindow = open("", windowName, "width=900,menubar=0,toolbar=1,resizable=1,status=1,scrollbars=1");
var html = "";
- if (j == 0){
+ if (j == 0){
j = length;
trait_list2 = trait_list_all;
correlation2 = correlation_all;
llid_list2 = llid_list_all;
}
-
+
var waithtml1 ="
Your list of "+j+" transcripts is being exported to the ODE for analysis. This window will soon be replaced with the results.
";
-
+
html += waithtml1;
newWindow.document.write(html);
newWindow.document.close();
@@ -302,14 +306,14 @@ function ODE(thisForm, script){
thisForm.correlation.value = correlation2.join(',');
thisForm.id_value.value = thisForm.correlation.value;
thisForm.llid_list.value = llid_list2.join(',');
-
+
// ODE
-
+
thisForm.idtype.value = thisForm.id_type.value;
thisForm.species.value = thisForm.org.value;
thisForm.list.value = thisForm.id_list.value;
thisForm.client.value = "genenetwork";
-
+
thisForm.target = windowName;
var oldaction = thisForm.action;
thisForm.action = script;
@@ -318,13 +322,13 @@ function ODE(thisForm, script){
}
}
*/
-// 02/12/2009
+// 02/12/2009
// Lei Yan
/*scripts in the Dataediting form*/
function dataEditingFunc(thisForm,submitIdValue){
-
+
windowName = 'formTarget' + (new Date().getTime());
if (thisForm.FormID.value!='secondRegression'){
@@ -336,7 +340,7 @@ function dataEditingFunc(thisForm,submitIdValue){
}
else if (submitIdValue == "addRecord"){
- windowName = thisForm.RISet.value;
+ windowName = thisForm.RISet.value;
var name = thisForm.identification.value;
if (name != ""){
}
@@ -352,7 +356,7 @@ function dataEditingFunc(thisForm,submitIdValue){
newWindow = open("",windowName,"menubar=1,toolbar=1,location=1,resizable=1,status=1,scrollbars=1,directories=1,width=900");
thisForm.target = windowName;
- newWindow.focus();
+ newWindow.focus();
thisForm.submitID.value = submitIdValue;
thisForm.submit();
}
@@ -394,7 +398,7 @@ function addRmvSelection(windowName, thisForm, addORrmv){
thisForm.target = windowName;
thisForm.FormID.value = addORrmv;
thisForm.submit();
- newWindow.focus();
+ newWindow.focus();
}
function batchSelection(thisForm){
@@ -424,7 +428,7 @@ function showTop10(formName, submitIdValue){
if ((submitIdValue == "markerRegression")||(submitIdValue == "compositeRegression")){
thisForm.topten.value = "topten";
}
-
+
thisForm.submitID.value = submitIdValue;
thisForm.submit();
}
@@ -441,12 +445,12 @@ function showIndividualChromosome(formName, submitIdValue, ii){
}
if (match == 0)
return;
-
+
windowName = 'formTarget' + (new Date().getTime());
newWindow = open("",windowName,"menubar=1,toolbar=1,location=1,resizable=1,status=1,scrollbars=1,directories=1,width=900");
newWindow.focus();
thisForm.target = windowName;
-
+
if (submitIdValue == "showIntMap"){
thisForm.chromosomes.value = ii;
}
@@ -529,10 +533,10 @@ function dataWindow(form){
}
-function xchange() {
+function xchange() {
var select = document.crossChoice.RISet;
var value = select.options[select.selectedIndex].value;
-
+
if (value !="BDAI") return;
document.crossChoice.variance.checked = false;
}
@@ -580,97 +584,97 @@ function crossinfo2(){
function checkWidth(){
var width = document.getElementsByName('plotSize')[0].value
-
+
if (width < 600) {
alert("Plot size is too small - setting size to 600")
document.getElementsByName('plotSize')[0].value = 600
- }
+ }
}
function changeLineColor(){
var lineColor = document.getElementsByName('lineColorSel')[0].value
-
+
document.getElementsByName('lineColor')[0].value = lineColor
}
function changeLineSize(){
var lineSize = document.getElementsByName('lineSizeSel')[0].value
-
+
document.getElementsByName('lineSize')[0].value = lineSize
}
function changeIdColor(){
var idColor = document.getElementsByName('idColorSel')[0].value
-
+
document.getElementsByName('idColor')[0].value = idColor
}
function changeIdFont(){
var idFont = document.getElementsByName('idFontSel')[0].value
-
+
document.getElementsByName('idFont')[0].value = idFont
}
function changeIdSize(){
var idSize = document.getElementsByName('idSizeSel')[0].value
-
+
document.getElementsByName('idSize')[0].value = idSize
}
function changeSymbolColor(){
var symbolColor = document.getElementsByName('colorSel')[0].value
-
+
document.getElementsByName('symbolColor')[0].value = symbolColor
}
function changeSymbol(){
var symbol = document.getElementsByName('symbolSel')[0].value
-
+
document.getElementsByName('symbol')[0].value = symbol
}
function changeFilled(){
var filled = document.getElementsByName('fillSel')[0].value
-
+
document.getElementsByName('filled')[0].value = filled
}
function changeSize(){
var symbolSize = document.getElementsByName('sizeSel')[0].value
-
+
document.getElementsByName('symbolSize')[0].value = symbolSize
}
-function checkAll(thisForm){
+function checkAll(thisForm){
var length = thisForm.searchResult.length;
for(var i = 0; i < length; i++)
{
thisForm.searchResult[i].checked = true;
highlight(thisForm.searchResult[i]);
}
-}
+}
-function checkNone(thisForm){
+function checkNone(thisForm){
var length = thisForm.searchResult.length;
for(var i = 0; i < length; i++)
{
thisForm.searchResult[i].checked = false;
highlight(thisForm.searchResult[i]);
}
-}
+}
-function checkInvert(thisForm){
+function checkInvert(thisForm){
var length = thisForm.searchResult.length;
for(var i = 0; i < length; i++)
{
thisForm.searchResult[i].checked = !(thisForm.searchResult[i].checked);
highlight(thisForm.searchResult[i]);
}
-}
+}
/*Not used anymore*/
-function checkTraits2(thisForm){
+function checkTraits2(thisForm){
var length = thisForm.searchResult.length;
var category = thisForm.selectmenu.value;
for(var i = 0; i < length; i++)
@@ -720,18 +724,18 @@ function checkTraits2(thisForm){
else
{}
}
-}
+}
function checkNumeric(field,limit,resetvalue,compares,fdname)
{
- pattern = /^-?[0-9]*\.?[0-9]*$/;
+ pattern = /^-?[0-9]*\.?[0-9]*$/;
if(pattern.test(field.value)==false)
{
alert("Not numeric in " + fdname);
field.value = resetvalue;
}
- else
+ else
{
if (compares == 'gthan') {
if(field.value > limit)
@@ -748,7 +752,7 @@ function checkNumeric(field,limit,resetvalue,compares,fdname)
}
}
-function checkTraits(thisForm){
+function checkTraits(thisForm){
var length = thisForm.searchResult.length;
var andor = thisForm.selectandor.value;
var gthan = parseFloat(thisForm.selectgt.value);
@@ -780,7 +784,7 @@ function checkTraits(thisForm){
}
-function checkPM(thisForm){
+function checkPM(thisForm){
var length = thisForm.searchResult.length;
for(var i = 0; i < length; i++)
{
@@ -792,8 +796,8 @@ function checkPM(thisForm){
{thisForm.searchResult[i].checked = false;}
highlight(thisForm.searchResult[i]);
}
-}
-function checkMM(thisForm){
+}
+function checkMM(thisForm){
var length = thisForm.searchResult.length;
for(var i = 0; i < length; i++)
{
@@ -804,14 +808,14 @@ function checkMM(thisForm){
{thisForm.searchResult[i].checked = false;}
highlight(thisForm.searchResult[i]);
}
-}
+}
-function directPermuAlert(thisForm){
- if (thisForm.directPermuCheckbox.checked){
- alert("Interaction permutation will take long time to compute.\n Check this box only when necessary.");
+function directPermuAlert(thisForm){
+ if (thisForm.directPermuCheckbox.checked){
+ alert("Interaction permutation will take long time to compute.\n Check this box only when necessary.");
}
-}
+}
function cliqueDatabase(pid){
var windowName = 'clique';
@@ -869,7 +873,7 @@ function snpbrowser_function_refresh() {
for (var i=1; i
- Outliers highlighted in yellow can be hidden using
- the Hide Outliers button,
- and samples with no value (x) can be hidden by clicking Hide No Value .
+ Outliers highlighted in
+ yellow
+ can be hidden using
+ the Hide Outliers button,
+
+ and samples with no value (x) can be hidden by clicking
+ Hide No Valuet.
+
@@ -1280,36 +1285,44 @@
{% endif %}
{% for attribute in sample_type.attributes|sort() %}
-
{{ sample_type.attributes[attribute].name }}
+
+ {{ sample_type.attributes[attribute].name }}
+
{% endfor %}
{% for sample in sample_type.sample_list %}
-
+
{{ loop.index }}
-
+
-
- {{ sample.name }}
+
+
+ {{ sample.name }}
+
{# Todo: Add IDs #}
-
-
+
{% if sample_type.se_exists() %}
-
+
±
{# Todo: Add IDs #}
-
-
+
@@ -1317,7 +1330,7 @@
{# Loop through each attribute type and input value #}
{% for attribute in sample_type.attributes|sort() %}
-
--
cgit v1.2.3
From d53c70c1f2eb71077086ca7ad13eb59158d1351b Mon Sep 17 00:00:00 2001
From: Zachary Sloan
Date: Fri, 19 Oct 2012 14:39:37 -0500
Subject: Reindented genSelectDatasetJS as gen_select_dataset
---
web/webqtl/maintainance/genSelectDatasetJS.py | 3 +
wqflask/maintenance/gen_select_dataset.py | 640 ++++++++++++++++++++++++++
wqflask/wqflask/views.py | 1 +
3 files changed, 644 insertions(+)
create mode 100644 wqflask/maintenance/gen_select_dataset.py
(limited to 'web')
diff --git a/web/webqtl/maintainance/genSelectDatasetJS.py b/web/webqtl/maintainance/genSelectDatasetJS.py
index bc88beec..d03cc7af 100755
--- a/web/webqtl/maintainance/genSelectDatasetJS.py
+++ b/web/webqtl/maintainance/genSelectDatasetJS.py
@@ -27,6 +27,9 @@
# created by Ning Liu 07/01/2010
# This script is to generate selectDatasetMenu.js file for cascade menu in the main search page http://www.genenetwork.org/.
# This script will be run automatically every one hour or manually when database has been changed .
+
+from __future__ import print_function, division
+
import sys, os
current_file_name = __file__
diff --git a/wqflask/maintenance/gen_select_dataset.py b/wqflask/maintenance/gen_select_dataset.py
new file mode 100644
index 00000000..7d2605c1
--- /dev/null
+++ b/wqflask/maintenance/gen_select_dataset.py
@@ -0,0 +1,640 @@
+# Copyright (C) University of Tennessee Health Science Center, Memphis, TN.
+#
+# This program is free software: you can redistribute it and/or modify it
+# under the terms of the GNU Affero General Public License
+# as published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the GNU Affero General Public License for more details.
+#
+# This program is available from Source Forge: at GeneNetwork Project
+# (sourceforge.net/projects/genenetwork/).
+#
+# Contact Drs. Robert W. Williams and Xiaodong Zhou (2010)
+# at rwilliams@uthsc.edu and xzhou15@uthsc.edu
+#
+#
+#
+# This module is used by GeneNetwork project (www.genenetwork.org)
+#
+# Created by GeneNetwork Core Team 2010/08/10
+#
+# Last updated by NL 2011/01/27
+
+# created by Ning Liu 07/01/2010
+# This script is to generate selectDatasetMenu.js file for cascade menu in the main search page http://www.genenetwork.org/.
+# This script will be run automatically every one hour or manually when database has been changed .
+
+from __future__ import print_function, division
+
+import sys, os
+
+current_file_name = __file__
+pathname = os.path.dirname( current_file_name )
+abs_path = os.path.abspath(pathname)
+sys.path.insert(0, abs_path + '/..')
+
+import MySQLdb
+import os
+import string
+import time
+import datetime
+
+from base import template
+from base import webqtlConfig
+
+#################################################################################
+# input: searchArray, targetValue
+# function: retrieve index info of target value in designated array (searchArray)
+# output: return index info
+##################################################################################
+def getIndex(searchArray=None, targetValue=None):
+ for index in range(len(searchArray)):
+ if searchArray[index][0]==targetValue:
+ return index
+
+# build MySql database connection
+con = MySQLdb.Connect(db=webqtlConfig.DB_NAME,host=webqtlConfig.MYSQL_SERVER, user=webqtlConfig.DB_USER,passwd=webqtlConfig.DB_PASSWD)
+cursor = con.cursor()
+
+# create js_select.js file
+fileHandler = open(webqtlConfig.HTMLPATH + 'javascript/selectDatasetMenu.js', 'w')
+
+# define SpeciesString, GroupString, TypeString, DatabasingString, LinkageString for output
+# outputSpeciesStr is for building Species Array(sArr) in js file; outputGroupStr is for Group Array(gArr)
+# outputTypeStr is for Type Array(tArr); outputDatabaseStr is for Database Array(dArr)
+# outputLinkStr is for Linkage Array(lArr)
+outputTimeStr ="/* Generated Date : %s , Time : %s */ \n" % (datetime.date.today(),time.strftime("%H:%M ", time.localtime()))
+outputTimeStr =""
+outputSpeciesStr ='var sArr = [\n{txt:\'\',val:\'\'},\n'
+outputGroupStr ='var gArr = [\n{txt:\'\',val:\'\'},\n'
+outputTypeStr ='var tArr = [\n{txt:\'\',val:\'\'},\n'
+outputDatabaseStr ='var dArr = [\n{txt:\'\',val:\'\'},\n'
+outputLinkStr ='var lArr = [\n null,\n'
+
+# built speices array in js file for select menu in the main search page http://www.genenetwork.org/
+cursor.execute("select Name, MenuName from Species order by OrderId")
+speciesResult = cursor.fetchall()
+speciesTotalResult = list(speciesResult)
+speciesResultsTotalNum = cursor.rowcount
+if speciesResultsTotalNum >0:
+ for speciesItem in speciesResult:
+ speciesVal = speciesItem[0]
+ speciesTxt = speciesItem[1]
+ outputSpeciesStr += '{txt:\'%s\',val:\'%s\'},\n'%(speciesTxt,speciesVal)
+# 'All Species' option for 'Species' select menu
+outputSpeciesStr +='{txt:\'All Species\',val:\'All Species\'}];\n\n'
+#speciesTotalResult is a list which inclues all species' options
+speciesTotalResult.append(('All Species','All Species'))
+
+# built group array in js file for select menu in the main search page http://www.genenetwork.org/
+cursor.execute("select distinct InbredSet.Name, InbredSet.FullName from InbredSet, Species, ProbeFreeze, GenoFreeze, PublishFreeze where InbredSet.SpeciesId= Species.Id and InbredSet.Name != 'BXD300' and (PublishFreeze.InbredSetId = InbredSet.Id or GenoFreeze.InbredSetId = InbredSet.Id or ProbeFreeze.InbredSetId = InbredSet.Id) order by InbredSet.Name")
+groupResults = cursor.fetchall()
+groupTotalResults = list(groupResults)
+groupResultsTotalNum = cursor.rowcount
+if groupResultsTotalNum > 0:
+ for groupItem in groupResults:
+ groupVal = groupItem[0]
+ groupTxt = groupItem[1]
+ outputGroupStr += '{txt:\'%s\',val:\'%s\'},\n'%(groupTxt,groupVal)
+# add 'All Groups' option for 'Group' select menu
+outputGroupStr +='{txt:\'All Groups\',val:\'all groups\'}];\n\n'
+# groupTotalResults is a list which inclues all groups' options
+groupTotalResults.append(('all groups','All Groups'))
+
+# built type array in js file for select menu in the main search page http://www.genenetwork.org/
+cross = groupVal
+cursor.execute("select distinct Tissue.Name, concat(Tissue.Name, ' mRNA') from ProbeFreeze, ProbeSetFreeze, InbredSet, Tissue where ProbeFreeze.TissueId = Tissue.Id and ProbeFreeze.InbredSetId = InbredSet.Id and ProbeSetFreeze.ProbeFreezeId = ProbeFreeze.Id and ProbeSetFreeze.public > %d order by Tissue.Name" % (webqtlConfig.PUBLICTHRESH))
+typeResults = cursor.fetchall()
+typeTotalResults = list(typeResults)
+typeResultsTotalNum = cursor.rowcount
+if typeResultsTotalNum > 0:
+ for typeItem in typeResults:
+ typeVal = typeItem[0]
+ typeTxt = typeItem[1]
+ outputTypeStr += '{txt:\'%s\',val:\'%s\'},\n'%(typeTxt,typeVal)
+# add 'Phenotypes' and 'Genotypes' options for 'Type' select menu
+outputTypeStr +='{txt:\'Phenotypes\',val:\'Phenotypes\'},\n'
+outputTypeStr +='{txt:\'Genotypes\',val:\'Genotypes\'}];\n\n'
+# typeTotalResults is a list which inclues all types' options
+typeTotalResults.append(('Phenotypes','Phenotypes'))
+typeTotalResults.append(('Genotypes','Genotypes'))
+
+# built dataset array in js file for select menu in the main search page http://www.genenetwork.org/
+tissue = typeVal
+cursor.execute("select ProbeSetFreeze.Name, ProbeSetFreeze.FullName from ProbeSetFreeze, ProbeFreeze, InbredSet, Tissue where ProbeSetFreeze.ProbeFreezeId = ProbeFreeze.Id and ProbeFreeze.TissueId = Tissue.Id and ProbeFreeze.InbredSetId = InbredSet.Id and ProbeSetFreeze.public > %d order by ProbeSetFreeze.CreateTime desc" % (webqtlConfig.PUBLICTHRESH))
+datasetResults = cursor.fetchall()
+datasetTotalResults = list(datasetResults)
+datasetResultsTotalNum = cursor.rowcount
+if datasetResultsTotalNum > 0:
+ for datasetItem in datasetResults:
+ datasetVal = datasetItem[0]
+ datasetTxt = datasetItem[1]
+ outputDatabaseStr += '{txt:\'%s\',val:\'%s\'},\n'%(datasetTxt,datasetVal)
+
+# This part is to built linkage array in js file, the linkage is among Species, Group, Type and Database.
+# The format of linkage array is [speciesIndex, groupIndex, typeIndex, databaseIndex]
+if speciesResultsTotalNum >0:
+ for speciesItem in speciesResult:
+ speciesVal = speciesItem[0]
+ sIndex = getIndex(searchArray=speciesTotalResult,targetValue=speciesVal)+1
+
+ # retrieve group info based on specie
+ cursor.execute("select distinct InbredSet.Name, InbredSet.FullName from InbredSet, Species, ProbeFreeze, GenoFreeze, PublishFreeze where InbredSet.SpeciesId= Species.Id and Species.Name='%s' and InbredSet.Name != 'BXD300' and (PublishFreeze.InbredSetId = InbredSet.Id or GenoFreeze.InbredSetId = InbredSet.Id or ProbeFreeze.InbredSetId = InbredSet.Id) order by InbredSet.Name" % speciesVal)
+ groupResults = cursor.fetchall()
+ groupResultsNum = cursor.rowcount
+
+ if groupResultsNum > 0:
+ for groupItem in groupResults:
+ groupVal = groupItem[0]
+ gIndex = getIndex(searchArray=groupTotalResults, targetValue=groupVal)+1
+
+ cross = groupVal
+ # if group also exists in PublishFreeze table, then needs to add related Published Phenotypes in Database Array(dArr) and Linkage Array(lArr)
+ # 'MDP' case is related to 'Mouse Phenome Database'
+ cursor.execute("select PublishFreeze.Id from PublishFreeze, InbredSet where PublishFreeze.InbredSetId = InbredSet.Id and InbredSet.Name = '%s'" % cross)
+ if (cursor.fetchall()):
+ typeVal = "Phenotypes"
+ if cross=='MDP':
+ datasetTxt = "Mouse Phenome Database"
+ else:
+ datasetTxt = "%s Published Phenotypes" % cross
+ datasetVal = "%sPublish" % cross
+ outputDatabaseStr += '{txt:\'%s\',val:\'%s\'},\n'% (datasetTxt,datasetVal)
+ datasetTotalResults.append(('%s'% datasetVal,'%s' % datasetTxt))
+
+ tIndex = getIndex(searchArray=typeTotalResults,targetValue=typeVal)+1
+ dIndex = getIndex(searchArray=datasetTotalResults, targetValue=datasetVal)+1
+ outputLinkStr +='[%d,%d,%d,%d],\n'%(sIndex,gIndex,tIndex,dIndex)
+
+ # if group also exists in GenoFreeze table, then needs to add related Genotypes in database Array(dArr)
+ cursor.execute("select GenoFreeze.Id from GenoFreeze, InbredSet where GenoFreeze.InbredSetId = InbredSet.Id and InbredSet.Name = '%s'" % cross)
+ if (cursor.fetchall()):
+ typeVal = "Genotypes"
+ datasetTxt = "%s Genotypes" % cross
+ datasetVal = "%sGeno" % cross
+ outputDatabaseStr += '{txt:\'%s\',val:\'%s\'},\n'%(datasetTxt,datasetVal)
+ typeTotalResults.append(('Genotypes','Genotypes'))
+ datasetTotalResults.append(('%s'% datasetVal,'%s' % datasetTxt))
+
+ tIndex = getIndex(searchArray=typeTotalResults,targetValue=typeVal)+1
+ dIndex = getIndex(searchArray=datasetTotalResults, targetValue=datasetVal)+1
+ outputLinkStr +='[%d,%d,%d,%d],\n'%(sIndex,gIndex,tIndex,dIndex)
+
+ # retrieve type(tissue) info based on group
+ # if cross is equal to 'BXD', then need to seach for 'BXD' and 'BXD300' InbredSet
+ if cross == "BXD":
+ cross2 = "BXD', 'BXD300"
+ else:
+ cross2 = cross
+ cursor.execute("select distinct Tissue.Name, concat(Tissue.Name, ' mRNA') from ProbeFreeze, ProbeSetFreeze, InbredSet, Tissue where ProbeFreeze.TissueId = Tissue.Id and ProbeFreeze.InbredSetId = InbredSet.Id and InbredSet.Name in ('%s') and ProbeSetFreeze.ProbeFreezeId = ProbeFreeze.Id and ProbeSetFreeze.public > %d order by Tissue.Name" % (cross2, webqtlConfig.PUBLICTHRESH))
+ typeResults = cursor.fetchall()
+ typeResultsNum = cursor.rowcount
+
+ if typeResultsNum > 0:
+ for typeItem in typeResults:
+ typeVal = typeItem[0]
+ tIndex = getIndex(searchArray=typeTotalResults, targetValue=typeVal)+1
+ # retrieve database(dataset) info based on group(InbredSet) and type(Tissue)
+ tissue = typeVal
+ cursor.execute("select ProbeSetFreeze.Name, ProbeSetFreeze.FullName from ProbeSetFreeze, ProbeFreeze, InbredSet, Tissue where ProbeSetFreeze.ProbeFreezeId = ProbeFreeze.Id and ProbeFreeze.TissueId = Tissue.Id and ProbeFreeze.InbredSetId = InbredSet.Id and InbredSet.Name in ('%s') and Tissue.name = '%s' and ProbeSetFreeze.public > %d order by ProbeSetFreeze.CreateTime desc" % (cross2, tissue, webqtlConfig.PUBLICTHRESH))
+ datasetResults = cursor.fetchall()
+ datasetResultsNum = cursor.rowcount
+
+ if datasetResultsNum > 0:
+ for datasetItem in datasetResults:
+ datasetVal = datasetItem[0]
+ dIndex = getIndex(searchArray=datasetTotalResults, targetValue=datasetVal)+1
+ outputLinkStr +='[%d,%d,%d,%d],\n'%(sIndex,gIndex,tIndex,dIndex)
+
+# add 'All Phenotypes' option for 'Database' select menu
+# for 'All Species'option in 'Species' select menu, 'Database' select menu will show 'All Phenotypes' option
+outputDatabaseStr += '{txt:\'%s\',val:\'%s\'}];\n\n'%('All Phenotypes','_allPublish')
+datasetTotalResults.append(('_allPublish','All Phenotypes'))
+
+sIndex = getIndex(searchArray=speciesTotalResult,targetValue='All Species')+1
+gIndex = getIndex(searchArray=groupTotalResults, targetValue='all groups')+1
+tIndex = getIndex(searchArray=typeTotalResults,targetValue='Phenotypes')+1
+dIndex = getIndex(searchArray=datasetTotalResults, targetValue='_allPublish')+1
+outputLinkStr +='[%d,%d,%d,%d]];\n\n'%(sIndex,gIndex,tIndex,dIndex)
+
+# Combine sArr, gArr, tArr, dArr and lArr output string together
+outputStr = outputTimeStr+outputSpeciesStr+outputGroupStr+outputTypeStr+outputDatabaseStr+outputLinkStr
+outputStr +='''
+
+/*
+* function: based on different browser use, will have different initial actions;
+* Once the index.html page is loaded, this function will be called
+*/
+function initialDatasetSelection()
+{
+ defaultSpecies =getDefaultValue('species');
+ defaultSet =getDefaultValue('cross');
+ defaultType =getDefaultValue('tissue');
+ defaultDB =getDefaultValue('database');
+
+ if (navigator.userAgent.indexOf('MSIE')>=0)
+ {
+ sOptions = fillOptionsForIE(null,defaultSpecies);
+ var menu0 ="";
+ document.getElementById('menu0').innerHTML = menu0;
+
+ gOptions = fillOptionsForIE('species',defaultSet);
+ var menu1 ="";
+ document.getElementById('menu1').innerHTML =menu1;
+
+ tOptions = fillOptionsForIE('cross',defaultType);
+ var menu2 ="";
+ document.getElementById('menu2').innerHTML =menu2;
+
+ dOptions = fillOptionsForIE('tissue',defaultDB);
+ var menu3 ="";
+ document.getElementById('menu3').innerHTML =menu3;
+
+ }else{
+ fillOptions(null);
+ }
+ searchtip();
+}
+
+/*
+* input: selectObjId (designated select menu, such as species, cross, etc... )
+* defaultValue (default Value of species, cross,tissue or database)
+* function: special for IE browser,setting options value for select menu dynamically based on linkage array(lArr),
+* output: options string
+*/
+function fillOptionsForIE(selectObjId,defaultValue)
+{
+ var options='';
+ if(selectObjId==null)
+ {
+ var len = sArr.length;
+ for (var i=1; i < len; i++) {
+ // setting Species' option
+ if( sArr[i].val==defaultValue){
+ options =options+"";
+ }else{
+ options =options+"";
+ }
+ }
+ }else if(selectObjId=='species')
+ {
+ var speciesObj = document.getElementById('species');
+ var len = lArr.length;
+ var arr = [];
+ var idx = 0;
+ for (var i=1; i < len; i++) {
+ //get group(cross) info from lArr
+ if(lArr[i][0]==(getIndexByValue('species',speciesObj.value)).toString()&&!Contains(arr,lArr[i][1]))
+ {
+ arr[idx++]=lArr[i][1];
+ }
+ }
+ idx=0;
+ len = arr.length;
+ removeOptions("cross");
+ for (var i=0; i < len; i++) {
+ // setting Group's option
+ if( gArr[arr[i]].val==defaultValue){
+ options =options+"";
+ }else{
+ options =options+"";
+ }
+
+ }
+ }else if(selectObjId=='cross')
+ {
+ var speciesObj = document.getElementById('species');
+ var groupObj = document.getElementById('cross');
+ var len = lArr.length;
+ var arr = [];
+ var idx = 0;
+ for (var i=1; i < len; i++) {
+ //get type(tissue) info from lArr
+ if(lArr[i][0]==(getIndexByValue('species',speciesObj.value)).toString()&&lArr[i][1]==(getIndexByValue('cross',groupObj.value)).toString()&&!Contains(arr,lArr[i][2]))
+ {
+ arr[idx++]=lArr[i][2];
+ }
+ }
+ idx=0;
+ len = arr.length;
+ removeOptions("tissue");
+ for (var i=0; i < len; i++) {
+ // setting Type's option
+ if( tArr[arr[i]].val==defaultValue){
+ options =options+"";
+ }else{
+ options =options+"";
+ }
+ }
+
+ }else if(selectObjId=='tissue')
+ {
+ var speciesObj = document.getElementById('species');
+ var groupObj = document.getElementById('cross');
+ var typeObj = document.getElementById('tissue');
+
+ var len = lArr.length;
+ var arr = [];
+ var idx = 0;
+ for (var i=1; i < len; i++) {
+ //get dataset(database) info from lArr
+ if(lArr[i][0]==(getIndexByValue('species',speciesObj.value)).toString()&&lArr[i][1]==(getIndexByValue('cross',groupObj.value)).toString()&&lArr[i][2]==(getIndexByValue('tissue',typeObj.value)).toString()&&!Contains(arr,lArr[i][3]))
+ {
+ arr[idx++]=lArr[i][3];
+ }
+ }
+ idx=0;
+ len = arr.length;
+ removeOptions("database");
+ for (var i=0; i < len; i++) {
+ // setting Database's option
+ if( dArr[arr[i]].val==defaultValue){
+ options =options+"";
+ }else{
+ options =options+"";
+ }
+ }
+ }
+ return options;
+}
+/*
+* input: selectObjId (designated select menu, such as species, cross, etc... )
+* function: setting options value for select menu dynamically based on linkage array(lArr)
+* output: null
+*/
+function fillOptions(selectObjId)
+{
+ if(selectObjId==null)
+ {
+
+ var speciesObj = document.getElementById('species');
+ var len = sArr.length;
+ for (var i=1; i < len; i++) {
+ // setting Species' option
+ speciesObj.options[i-1] = new Option(sArr[i].txt, sArr[i].val);
+ }
+ updateChocie('species');
+
+ }else if(selectObjId=='species')
+ {
+ var speciesObj = document.getElementById('species');
+ var groupObj = document.getElementById('cross');
+ var len = lArr.length;
+ var arr = [];
+ var idx = 0;
+ for (var i=1; i < len; i++) {
+ //get group(cross) info from lArr
+ if(lArr[i][0]==(getIndexByValue('species',speciesObj.value)).toString()&&!Contains(arr,lArr[i][1]))
+ {
+ arr[idx++]=lArr[i][1];
+ }
+ }
+ idx=0;
+ len = arr.length;
+ removeOptions("cross");
+ for (var i=0; i < len; i++) {
+ // setting Group's option
+ groupObj.options[idx++] = new Option(gArr[arr[i]].txt, gArr[arr[i]].val);
+ }
+ updateChocie('cross');
+
+ }else if(selectObjId=='cross')
+ {
+ var speciesObj = document.getElementById('species');
+ var groupObj = document.getElementById('cross');
+ var typeObj = document.getElementById('tissue');
+ var len = lArr.length;
+ var arr = [];
+ var idx = 0;
+ for (var i=1; i < len; i++) {
+ //get type(tissue) info from lArr
+ if(lArr[i][0]==(getIndexByValue('species',speciesObj.value)).toString()&&lArr[i][1]==(getIndexByValue('cross',groupObj.value)).toString()&&!Contains(arr,lArr[i][2]))
+ {
+ arr[idx++]=lArr[i][2];
+ }
+ }
+ idx=0;
+ len = arr.length;
+ removeOptions("tissue");
+ for (var i=0; i < len; i++) {
+ // setting Type's option
+ typeObj.options[idx++] = new Option(tArr[arr[i]].txt, tArr[arr[i]].val);
+ }
+ updateChocie('tissue');
+
+ }else if(selectObjId=='tissue')
+ {
+ var speciesObj = document.getElementById('species');
+ var groupObj = document.getElementById('cross');
+ var typeObj = document.getElementById('tissue');
+ var databaseObj = document.getElementById('database');
+
+ var len = lArr.length;
+ var arr = [];
+ var idx = 0;
+ for (var i=1; i < len; i++) {
+ //get dataset(database) info from lArr
+ if(lArr[i][0]==(getIndexByValue('species',speciesObj.value)).toString()&&lArr[i][1]==(getIndexByValue('cross',groupObj.value)).toString()&&lArr[i][2]==(getIndexByValue('tissue',typeObj.value)).toString()&&!Contains(arr,lArr[i][3]))
+ {
+ arr[idx++]=lArr[i][3];
+ }
+ }
+ idx=0;
+ len = arr.length;
+ removeOptions("database");
+ for (var i=0; i < len; i++) {
+ // setting Database's option
+ databaseObj.options[idx++] = new Option(dArr[arr[i]].txt, dArr[arr[i]].val);
+ }
+ updateChocie('database');
+ }
+}
+
+/*
+* input: arr (targeted array); obj (targeted value)
+* function: check whether targeted array contains targeted value or not
+* output: return true, if array contains targeted value, otherwise return false
+*/
+function Contains(arr,obj) {
+ var i = arr.length;
+ while (i--) {
+ if (arr[i] == obj) {
+ return true;
+ }
+ }
+ return false;
+}
+
+/*
+* input: selectObj (designated select menu, such as species, cross, etc... )
+* function: clear designated select menu's option
+* output: null
+*/
+function removeOptions(selectObj) {
+ if (typeof selectObj != 'object'){
+ selectObj = document.getElementById(selectObj);
+ }
+ var len = selectObj.options.length;
+ for (var i=0; i < len; i++) {
+ // clear current selection
+ selectObj.options[0] = null;
+ }
+}
+
+/*
+* input: selectObjId (designated select menu, such as species, cross, etc... )
+* Value: target value
+* function: retrieve Index info of target value in designated array
+* output: index info
+*/
+function getIndexByValue(selectObjId,val)
+{
+ if(selectObjId=='species')
+ {
+ for(var i=1;i=0){
+ //setting option's selected status
+ Obj.options[idx].selected=true;
+ //update the following select menu
+ fillOptions(objId);
+ }else{
+ Obj.options[0].selected=true;
+ fillOptions(objId);
+ }
+}
+
+// setting option's selected status based on default setting or cookie setting for Species, Group, Type and Database select menu in the main search page http://www.genenetwork.org/
+function updateChocie(selectObjId){
+
+ if (selectObjId =='species')
+ {
+ defaultSpecies= getDefaultValue('species');
+ //setting option's selected status
+ setChoice('species',defaultSpecies);
+ }else if (selectObjId =='cross')
+ {
+ defaultSet= getDefaultValue('cross');
+ //setting option's selected status
+ setChoice('cross',defaultSet);
+ }else if (selectObjId =='tissue')
+ {
+ defaultType= getDefaultValue('tissue');
+ //setting option's selected status
+ setChoice('tissue',defaultType);
+ }else if (selectObjId =='database')
+ {
+ defaultDB= getDefaultValue('database');
+ //setting option's selected status
+ setChoice('database',defaultDB);
+ }
+}
+
+//get default value;if cookie exists, then use cookie value, otherwise use default value
+function getDefaultValue(selectObjId){
+ //define default value
+ var defaultSpecies = 'mouse'
+ var defaultSet = 'BXD'
+ var defaultType = 'Hippocampus'
+ var defaultDB = 'HC_M2_0606_P'
+
+ if (selectObjId =='species')
+ {
+ //if cookie exists, then use cookie value, otherwise use default value
+ var cookieSpecies = getCookie('defaultSpecies');
+ if(cookieSpecies)
+ {
+ defaultSpecies= cookieSpecies;
+ }
+ return defaultSpecies;
+ }else if (selectObjId =='cross'){
+ var cookieSet = getCookie('defaultSet');
+ if(cookieSet){
+ defaultSet= cookieSet;
+ }
+ return defaultSet;
+ }else if (selectObjId =='tissue'){
+ var cookieType = getCookie('defaultType');
+ if(cookieType){
+ defaultType= cookieType;
+ }
+ return defaultType;
+ }else if (selectObjId =='database')
+ {
+ var cookieDB = getCookie('defaultDB');
+ if(cookieDB){
+ defaultDB= cookieDB;
+ }
+ return defaultDB;
+ }
+
+}
+
+//setting default value into cookies for the dropdown menus: Species,Group, Type, and Database
+function setDefault(thisform){
+
+ setCookie('cookieTest', 'cookieTest', 1);
+ var cookieTest = getCookie('cookieTest');
+ delCookie('cookieTest');
+ if (cookieTest){
+ var defaultSpecies = thisform.species.value;
+ setCookie('defaultSpecies', defaultSpecies, 10);
+ var defaultSet = thisform.cross.value;
+ setCookie('defaultSet', defaultSet, 10);
+ var defaultType = thisform.tissue.value;
+ setCookie('defaultType', defaultType, 10);
+ var defaultDB = thisform.database.value;
+ setCookie('defaultDB', defaultDB, 10);
+ updateChocie('species');
+ updateChocie('cross');
+ updateChocie('tissue');
+ updateChocie('database');
+ alert("The current settings are now your default");
+ }
+ else{
+ alert("You need to enable Cookies in your browser.");
+ }
+}
+
+'''
+# write all strings' info into selectDatasetMenu.js file
+fileHandler.write(outputStr)
+fileHandler.close()
diff --git a/wqflask/wqflask/views.py b/wqflask/wqflask/views.py
index 2933b428..e7e260fe 100644
--- a/wqflask/wqflask/views.py
+++ b/wqflask/wqflask/views.py
@@ -33,6 +33,7 @@ def index_page():
@app.route("/new")
def new_index_page():
print("Sending index_page")
+
return render_template("new_index_page.html")
@app.route("/data_sharing")
--
cgit v1.2.3
From 82bcb31455d658a462bfde711c862480fc9acd05 Mon Sep 17 00:00:00 2001
From: Zachary Sloan
Date: Thu, 25 Oct 2012 18:09:11 -0500
Subject: Worked on search page code; got to the part that actually does the
search
Renamed RISet and cross to "group" throughout webqtlDataset.py and search_results.py
---
web/javascript/header.js | 122 ++---
wqflask/base/webqtlDataset.py | 28 +-
wqflask/wqflask/search_results.py | 215 ++++-----
wqflask/wqflask/templates/index_page.html | 669 +++++++++++++++-----------
wqflask/wqflask/templates/new_index_page.html | 423 ----------------
wqflask/wqflask/templates/old_index_page.html | 320 ++++++++++++
wqflask/wqflask/views.py | 7 -
7 files changed, 882 insertions(+), 902 deletions(-)
delete mode 100644 wqflask/wqflask/templates/new_index_page.html
create mode 100644 wqflask/wqflask/templates/old_index_page.html
(limited to 'web')
diff --git a/web/javascript/header.js b/web/javascript/header.js
index 59fcacd8..65ba1bd6 100755
--- a/web/javascript/header.js
+++ b/web/javascript/header.js
@@ -1,62 +1,62 @@
-ctext = ''
-ctext += '
You can also use advanced
- commands. Copy these simple examples
- into the Get Any or Combined search fields:
-
-
-
POSITION=(chr1 25 30) finds genes, markers, or transcripts on
- chromosome 1 between 25 and 30 Mb.
-
-
MEAN=(15 16) LRS=(23 46) in the Combined field finds
- highly expressed genes (15 to 16 log2 units) AND with peak LRS linkage between 23 and 46.
-
-
RIF=mitochondrial searches RNA databases for GeneRIF links.
-
-
WIKI=nicotine searches GeneWiki for genes that you or other users have annotated
- with the word nicotine.
-
-
GO:0045202 searches for synapse-associated genes listed in the
- Gene Ontology.
-
-
GO:0045202 LRS=(9 99 Chr4 122 155) cisLRS=(9 999 10)
- in Combined finds synapse-associated genes with cis eQTL on Chr 4 from 122 and 155 Mb with LRS scores
- between 9 and 999.
-
-
RIF=diabetes LRS=(9 999 Chr2 100 105) transLRS=(9 999 10)
- in Combined finds diabetes-associated transcripts with peak trans eQTLs on Chr 2 between 100 and 105 Mb with LRS
- scores between 9 and 999.
GeneNetwork supports a variety of advanced searches.
-
History and
- Archive
-
-
-
GeneNetwork's Time
- Machine links to earlier versions that correspond to specific
- publication dates.
-
-
-
-
-
-
-
-
-
-{% endblock %}
+
To try them out copy these examples into the search field:
+
+
+
POSITION=(chr1 25 30) finds genes, markers, or transcripts on
+ chromosome 1 between 25 and 30 Mb.
+
MEAN=(15 16) LRS=(23 46) in the Combined field finds
+ highly expressed genes (15 to 16 log2 units) AND with peak LRS
+ linkage between 23 and 46.
+
+
RIF=mitochondrial searches RNA databases for
+ GeneRIF links.
+
+
WIKI=nicotine searches
+ GeneWiki for genes that you or other users have annotated
+ with the word nicotine.
+
+
GO:0045202 searches for synapse-associated genes listed in the
+
+ Gene Ontology.
+
+
GO:0045202 LRS=(9 99 Chr4 122 155) cisLRS=(9 999 10)
+ finds synapse-associated genes with
+ cis eQTL on Chr 4 from 122 and 155 Mb with LRS scores
+ between 9 and 999.
+
+
RIF=diabetes LRS=(9 999 Chr2 100 105) transLRS=(9 999 10)
+ finds diabetes-associated transcripts with peak
+ trans eQTLs on Chr 2 between 100 and 105 Mb with LRS
+ scores between 9 and 999.
+
+
+
+
+
+
Tour and more info
+
+
+
Thirty minute tour
+
+ Take the 30 minute
+ GeneNetwork tour that includes screen shots and
+ typical steps in the analysis.
+
+
+
Even more info
+
+ For information about
+ resources and methods, select the Info buttons next to the Group
+ and Database fields above.
+
+
+
The conditions
+ and contact
+ pages have information on the status of data sets
+ and advice on their use and citation.
GeneNetwork supports a variety of advanced searches.
-
-
To try them out copy these examples into the search field:
-
-
-
POSITION=(chr1 25 30) finds genes, markers, or transcripts on
- chromosome 1 between 25 and 30 Mb.
-
-
MEAN=(15 16) LRS=(23 46) in the Combined field finds
- highly expressed genes (15 to 16 log2 units) AND with peak LRS
- linkage between 23 and 46.
-
-
RIF=mitochondrial searches RNA databases for
- GeneRIF links.
-
-
WIKI=nicotine searches
- GeneWiki for genes that you or other users have annotated
- with the word nicotine.
-
-
GO:0045202 searches for synapse-associated genes listed in the
-
- Gene Ontology.
-
-
GO:0045202 LRS=(9 99 Chr4 122 155) cisLRS=(9 999 10)
- finds synapse-associated genes with
- cis eQTL on Chr 4 from 122 and 155 Mb with LRS scores
- between 9 and 999.
-
-
RIF=diabetes LRS=(9 999 Chr2 100 105) transLRS=(9 999 10)
- finds diabetes-associated transcripts with peak
- trans eQTLs on Chr 2 between 100 and 105 Mb with LRS
- scores between 9 and 999.
-
-
-
-
-
-
Tour and more info
-
-
-
Thirty minute tour
-
- Take the 30 minute
- GeneNetwork tour that includes screen shots and
- typical steps in the analysis.
-
-
-
Even more info
-
- For information about
- resources and methods, select the Info buttons next to the Group
- and Database fields above.
-
-
-
The conditions
- and contact
- pages have information on the status of data sets
- and advice on their use and citation.
You can also use advanced
+ commands. Copy these simple examples
+ into the Get Any or Combined search fields:
+
+
+
POSITION=(chr1 25 30) finds genes, markers, or transcripts on
+ chromosome 1 between 25 and 30 Mb.
+
+
MEAN=(15 16) LRS=(23 46) in the Combined field finds
+ highly expressed genes (15 to 16 log2 units) AND with peak LRS linkage between 23 and 46.
+
+
RIF=mitochondrial searches RNA databases for GeneRIF links.
+
+
WIKI=nicotine searches GeneWiki for genes that you or other users have annotated
+ with the word nicotine.
+
+
GO:0045202 searches for synapse-associated genes listed in the
+ Gene Ontology.
+
+
GO:0045202 LRS=(9 99 Chr4 122 155) cisLRS=(9 999 10)
+ in Combined finds synapse-associated genes with cis eQTL on Chr 4 from 122 and 155 Mb with LRS scores
+ between 9 and 999.
+
+
RIF=diabetes LRS=(9 999 Chr2 100 105) transLRS=(9 999 10)
+ in Combined finds diabetes-associated transcripts with peak trans eQTLs on Chr 2 between 100 and 105 Mb with LRS
+ scores between 9 and 999.