...
 
Commits (50)
[*.{js,php}]
indent_style = space
indent_size = 2
......@@ -6,11 +6,7 @@ $config["db"]["host"] = null;
$config["db"]["user"] = null;
$config["db"]["password"] = null;
$config["db"]["database"] = null;
$config["basket_db"]["host"] = null;
$config["basket_db"]["user"] = null;
$config["basket_db"]["password"] = null;
$config["basket_db"]["database"] = null;
$config["db"]["port"] = 3306;
require_once("local_config.php");
......
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
This diff is collapsed.
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
......@@ -108,132 +108,93 @@
.dataTables_scrollHead {
height: 37px;
}
.ac-container{
width: 100%;
/*margin: 4x 0px 6px 0px;*/
text-align: left;
}
.ac-container label{
font-family: 'BebasNeueRegular', 'Arial Narrow', Arial, sans-serif;
padding: 5px 20px;
position: relative;
z-index: 20;
display: block;
height: 24px;
cursor: pointer;
color: #777;
text-shadow: 1px 1px 1px rgba(255,255,255,0.8);
line-height: 26px;
font-size: 18px;
background: #ffffff;
background: -moz-linear-gradient(top, #ffffff 1%, #eaeaea 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(1%,#ffffff), color-stop(100%,#eaeaea));
background: -webkit-linear-gradient(top, #ffffff 1%,#eaeaea 100%);
background: -o-linear-gradient(top, #ffffff 1%,#eaeaea 100%);
background: -ms-linear-gradient(top, #ffffff 1%,#eaeaea 100%);
background: linear-gradient(top, #ffffff 1%,#eaeaea 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#eaeaea',GradientType=0 );
box-shadow:
0px 0px 0px 1px rgba(155,155,155,0.3),
1px 0px 0px 0px rgba(255,255,255,0.9) inset,
0px 2px 2px rgba(0,0,0,0.1);
.input-container {
display: flex;
justify-content: space-between;
}
.ac-container label:hover{
background: #fff;
.network-input {
flex-basis: 49%;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.ac-container input:checked + label,
.ac-container input:checked + label:hover{
background: #c6e1ec;
color: #3d7489;
text-shadow: 0px 1px 1px rgba(255,255,255, 0.6);
box-shadow:
0px 0px 0px 1px rgba(155,155,155,0.3),
0px 2px 2px rgba(0,0,0,0.1);
.network-input select {
font-size: 1.5em;
}
.ac-container label:after,
.ac-container input:checked + label:after{
content: '';
position: absolute;
width: 24px;
height: 24px;
right: 13px;
top: 7px;
background: transparent url(../images/arrow_down_y.png) no-repeat center center;
.network-button-container {
display: flex;
flex-wrap: wrap;
}
.ac-container input:checked + label:after{
background-image: url(../images/arrow_up_y.png);
.network-button-container .network-select {
border: 1px solid #CCCCCC;
border-radius: 5px;
margin: 0em 1em 1em 0;
padding: 10px;
}
/*.ac-container input{
display: none;
}*/
.ac-container article{
background: rgba(255, 255, 255, 0.5);
margin-top: -24px;
overflow: hidden;
height: 24px;
position: relative;
z-index: 10;
-webkit-transition: height 0.3s ease-in-out, box-shadow 0.6s linear;
-moz-transition: height 0.3s ease-in-out, box-shadow 0.6s linear;
-o-transition: height 0.3s ease-in-out, box-shadow 0.6s linear;
-ms-transition: height 0.3s ease-in-out, box-shadow 0.6s linear;
transition: height 0.3s ease-in-out, box-shadow 0.6s linear;
}
.ac-container article p{
font-style: italic;
color: #777;
line-height: 23px;
font-size: 14px;
padding: 20px;
text-shadow: 1px 1px 1px rgba(255,255,255,0.8);
.network-button-container .network-select.selected {
background-color: #2d9b2e;
color: white;
}
.ac-container input:checked ~ article{
-webkit-transition: height 0.5s ease-in-out, box-shadow 0.1s linear;
-moz-transition: height 0.5s ease-in-out, box-shadow 0.1s linear;
-o-transition: height 0.5s ease-in-out, box-shadow 0.1s linear;
-ms-transition: height 0.5s ease-in-out, box-shadow 0.1s linear;
transition: height 0.5s ease-in-out, box-shadow 0.1s linear;
box-shadow: 0px 0px 0px 1px rgba(155,155,155,0.3);
.network-button-container .network-select.active {
border: 1px solid red;
}
.ac-container input:checked ~ article.ac-small{
height: 140px;
.network-control {
flex-basis: 49%;
display: flex;
flex-direction: column;
}
.ac-container input:checked ~ article.ac-medium{
height: 180px;
.network-wrapper {
display: flex;
justify-content: space-between;
height: 100%;
}
.ac-container input:checked ~ article.ac-extra-medium{
height: auto;
.network-container {
flex-basis: 100%;
border: 1px solid #CCCCCC;
height: 700px;
}
.ac-container input:checked ~ article.ac-large{
height: 620px;
.network-table-wrapper {
display: flex;
justify-content: space-between;
}
.ac-container input:checked ~ article.ac-large-input{
height: 291px;
.network-table-wrapper div {
flex-basis: 100%;
}
.network-table-wrapper div table {
width: 100%;
}
/*AR*/
.ar-container{
.accordion{
width: 100%;
margin: 10px auto 30px auto;
/*margin: 4x 0px 6px 0px;*/
text-align: left;
}
.ar-container label{
.accordion .accordion-head {
font-family: 'BebasNeueRegular', 'Arial Narrow', Arial, sans-serif;
user-select: none;
padding: 5px 20px;
position: relative;
z-index: 20;
display: block;
height: 30px;
height: 24px;
cursor: pointer;
color: #777;
text-shadow: 1px 1px 1px rgba(255,255,255,0.8);
line-height: 33px;
font-size: 19px;
line-height: 26px;
font-size: 18px;
background: #ffffff;
background: -moz-linear-gradient(top, #ffffff 1%, #eaeaea 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(1%,#ffffff), color-stop(100%,#eaeaea));
......@@ -246,132 +207,71 @@ height: 37px;
0px 0px 0px 1px rgba(155,155,155,0.3),
1px 0px 0px 0px rgba(255,255,255,0.9) inset,
0px 2px 2px rgba(0,0,0,0.1);
}
.ar-container label:hover{
.accordion .accordion-head:hover{
background: #fff;
}
.ar-container input:checked + label,
.ar-container input:checked + label:hover{
.accordion .accordion-head.opened,
.accordion .accordion-head.opened:hover {
background: #c6e1ec;
color: #3d7489;
text-shadow: 0px 1px 1px rgba(255,255,255, 0.6);
box-shadow:
0px 0px 0px 1px rgba(155,155,155,0.3),
0px 2px 2px rgba(0,0,0,0.1);
}
.ar-container label:after,
.ar-container input:checked + label:after{
.accordion .accordion-head:after {
content: '';
position: absolute;
width: 24px;
height: 24px;
right: 13px;
top: 7px;
background: transparent url(../images/arrow_down.png) no-repeat center center;
background: transparent url(../images/arrow_up_y.png) no-repeat center center;
}
.ar-container input:checked + label:after{
background-image: url(../images/arrow_up.png);
.accordion .accordion-head.collapsed:after{
background-image: url(../images/arrow_down_y.png);
}
.ar-container input{
/*.accordion input{
display: none;
}
.ar-container article{
}*/
.accordion .accordion-content {
background: rgba(255, 255, 255, 0.5);
margin-top: -1px;
overflow: hidden;
height: 0px;
position: relative;
z-index: 10;
-webkit-transition: height 0.3s ease-in-out, box-shadow 0.6s linear;
-moz-transition: height 0.3s ease-in-out, box-shadow 0.6s linear;
-o-transition: height 0.3s ease-in-out, box-shadow 0.6s linear;
-ms-transition: height 0.3s ease-in-out, box-shadow 0.6s linear;
transition: height 0.3s ease-in-out, box-shadow 0.6s linear;
}
.ar-container article p{
font-style: italic;
}
.accordion .accordion-content {
color: #777;
line-height: 23px;
font-size: 14px;
padding: 20px;
text-shadow: 1px 1px 1px rgba(255,255,255,0.8);
}
.ar-container input:checked ~ article{
-webkit-transition: height 0.5s ease-in-out, box-shadow 0.1s linear;
-moz-transition: height 0.5s ease-in-out, box-shadow 0.1s linear;
-o-transition: height 0.5s ease-in-out, box-shadow 0.1s linear;
-ms-transition: height 0.5s ease-in-out, box-shadow 0.1s linear;
transition: height 0.5s ease-in-out, box-shadow 0.1s linear;
.accordion .accordion-content {
box-shadow: 0px 0px 0px 1px rgba(155,155,155,0.3);
}
.ar-container input:checked ~ article.ar-small{
.accordion .accordion-content.ac-small{
height: 140px;
}
.ar-container input:checked ~ article.ar-medium{
.accordion .accordion-content.ac-medium{
height: 180px;
}
.ar-container input:checked ~ article.ar-large{
height: 230px;
}
/*Slider*/
.slider {
width: 100%;
}
.slider > .dragger {
background: #63BEC4;
background: -webkit-linear-gradient(top, #63BEC4, #63BEC4);
background: -moz-linear-gradient(top, #63BEC4, #63BEC4);
background: linear-gradient(top, #63BEC4, #63BEC4);
-webkit-box-shadow: inset 0 2px 2px rgba(255,255,255,0.5), 0 2px 8px rgba(0,0,0,0.2);
-moz-box-shadow: inset 0 2px 2px rgba(255,255,255,0.5), 0 2px 8px rgba(0,0,0,0.2);
box-shadow: inset 0 2px 2px rgba(255,255,255,0.5), 0 2px 8px rgba(0,0,0,0.2);
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
border: 1px solid #3d7489;
width: 16px;
height: 16px;
}
.slider > .dragger:hover {
background: -webkit-linear-gradient(top, #3d7489, #3d7489);
.accordion .accordion-content.ac-extra-medium{
height: auto;
}
.slider > .track, .slider > .highlight-track {
background: #ccc;
background: -webkit-linear-gradient(top, #bbb, #ddd);
background: -moz-linear-gradient(top, #bbb, #ddd);
background: linear-gradient(top, #bbb, #ddd);
-webkit-box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
-moz-box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
border-radius: 8px;
border: 1px solid #aaa;
height: 4px;
.accordion .accordion-content.ac-large{
height: 620px;
}
.slider > .highlight-track {
background-color: #63BEC4;
background: -webkit-linear-gradient(top, #63BEC4, #63BEC4);
background: -moz-linear-gradient(top, #63BEC4, #63BEC4);
background: linear-gradient(top, #63BEC4, #63BEC4);
border-color: #63BEC4;
.accordion .accordion-content.ac-large-input{
height: 291px;
}
/**subtables*/
#sub_table{
margin-left:22px;
......
<?php
require_once("config.php");
//$dbConn = mysql_connect($data[0],$data[1],$ps[$i])or die("Could not connect");
$dbConn = mysql_connect(
$config["db"]["host"],
$config["db"]["user"],
$config["db"]["password"]
)or die("Could not connect");
$db = mysql_select_db("plaza_complex", $dbConn) or die("Could not select DB");
try {
$db = new PDO('mysql:dbname='.$config['db']['database'].';host='.$config['db']['host'],
$config['db']['user'],
$config['db']['password']);
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (PDOException $e) {
echo 'Connection failed: '.$e->getMessage();
}
function build_in_array($key_prefix, $a) {
return array_combine(
array_map(
function ($v) use (&$key_prefix) {
return ":{$key_prefix}_{$v}";
},
array_keys($a)
), $a);
}
function prepare_in($key_prefix, $a) {
return implode(',', array_keys(build_in_array($key_prefix, $a)));
}
function bind_in_params($stmt, $type, $values) {
$args = build_in_array($type, $values);
call_user_func_array(array($stmt, "bind_param"), ref_array($args));
}
$spNames = array("pt" => "P. tremula", "at" => "A. thaliana", "os" => "Z. mays");
if (isset($_POST['op'])) $tmp_op=trim($_POST['op']);
if (isset($_GET['op'])) $tmp_op=trim($_GET['op']);
$spNames = array("pt" => "P. tremula", "at" => "A. thaliana", "os" => "Z. mays");
if (isset($_POST['selG'])) $tmp_selG=trim($_POST['selG']);
if (isset($_POST['allG']))$tmp_allG=trim($_POST['allG']);
if (isset($_POST['thexp']))$tmp_thexp=trim($_POST['thexp']);
$tmp_op = isset($_POST['op']) ? $_POST['op'] : null;
$tmp_op = isset($_GET['op']) ? $_GET['op'] : $tmp_op;
if (isset($_POST['sp'])) $tmp_sp=trim($_POST['sp']);
$tmp_selG = isset($_POST['selG']) ? trim($_POST['selG']) : null;
$tmp_allG = isset($_POST['allG']) ? trim($_POST['allG']) : null;
$tmp_thexp = isset($_POST['thexp']) ? trim($_POST['thexp']) : null;
if (isset($_POST['sp1'])) $tmp_sp1=trim($_POST['sp1']);
if (isset($_POST['th1']))$tmp_th1=(float)($_POST['th1']);
if (isset($_POST['consth1'])) $tmp_consth1=(float)($_POST['consth1']);
$sink1 = isset($_POST['sink1']) ? $_POST['sink1'] : null;
$sink2 = isset($_POST['sink2']) ? $_POST['sink2'] : null;
if (isset($_POST['sp2'])) $tmp_sp2=trim($_POST['sp2']);
if (isset($_POST['th2'])) $tmp_th2=(float)($_POST['th2']);
if (isset($_POST['consth2'])) $tmp_consth2=(float)($_POST['consth2']);
$tmp_sp = isset($_POST['sp']) ? trim($_POST['sp']) : null;
//if (!isset($_SESSION['showN'])) $_SESSION['showN']='align';
if($_POST['view_state']=="compare"){ $tmp_showN='compare';}else{ $tmp_showN='align';}
$tmp_sp1 = isset($_POST['sp1']) ? trim($_POST['sp1']) : null;
$tmp_th1 = isset($_POST['th1']) ? trim($_POST['th1']) : null;
$tmp_consth1 = isset($_POST['consth1']) ? (float)($_POST['consth1']) : null;
if($_GET['view_state']=="compare"){ $tmp_showN='compare';}else{ $tmp_showN='align';}
if($_GET['debug']=="true"){ $debug=true;}else{ $debug=false;}
$tmp_sp2 = isset($_POST['sp2']) ? trim($_POST['sp2']) : null;
$tmp_th2 = isset($_POST['th2']) ? trim($_POST['th2']) : null;
$tmp_consth2 = isset($_POST['consth2']) ? (float)($_POST['consth2']) : null;
$tmp_showN = isset($_POST['view_state']) ? $_POST['view_state'] : 'align';
$tmp_showN = isset($_GET['view_state']) ? $_GET['view_state'] : 'align';
if($debug==true){
if($_GET['selG']==""){
//$_POST['selG']="At4g18780,At5g16910";
$debug = isset($_GET['debug']) && $_GET['debug'] === 'true';
$_POST['selG']="Potri.001G266400,Potri.004G059600,Potri.005G027600,Potri.005G194200,Potri.006G052600,Potri.006G181900,Potri.006G251900,Potri.009G060800,Potri.013G082200,Potri.016G054900,Potri.018G029400,Potri.019G049700,Potri.001G120000,Potri.001G448400,Potri.002G178700,Potri.003G113000,Potri.005G116800,Potri.007G014400,Potri.008G080000,Potri.010G176600,Potri.011G153300,Potri.012G126500,Potri.013G092400,Potri.013G113100,Potri.014G104800,Potri.015G127400,Potri.019G066000,Potri.019G083600";
}else{$_POST['selG']=$_GET['selG'] ;}
}
$vowelss = array(",", ";", "\t", "\n", "\r", "s+", " ",",,");
$post_inputs=preg_replace("/\s+/", ",", trim(htmlentities($_POST['selG'])));
$post_inputs=preg_replace("/\s+/", ",", trim(htmlentities($tmp_selG)));
$onlyconsonantss = strtolower(str_replace($vowelss, ",", $post_inputs));
$geneids_arrays = explode(",", $onlyconsonantss);
//print_r($geneids_array);
$geneids_array_strs=implode('","',$geneids_arrays);
$gsel1='"'.$geneids_array_strs.'"';
//$_POST['sink1']="Potri.001G308100,Potri.002G230400,Potri.T073100";
if($debug==true){
if($_GET['n1']==""){
// $_POST['sink1']= "At4g18780,At5g16910,At5g64740,At1g02730,At5g09870,At2g33100,At1g32180,At5g44030,At2g25540,At4g39350,At5g05170,At4g32410,At5g17420,At3g03050,At4g38190,At2g21770";
//$_POST['sink1'] ="MA_10426189g0020,MA_10431579g0010,MA_10432389g0010,MA_10435716g0010,MA_10436590g0010,MA_10437155g0020,MA_109735g0020,MA_15346g0010,MA_158791g0170,MA_159139g0090,MA_161668g0010,MA_164660g0010,MA_183690g0010,MA_19157g0020,MA_31132g0010";
$_POST['sink1']="Potri.001G266400,Potri.004G059600,Potri.005G027600,Potri.005G194200,Potri.006G052600,Potri.006G181900,Potri.006G251900,Potri.009G060800,Potri.013G082200,Potri.016G054900,Potri.018G029400,Potri.019G049700";
}else{$_POST['sink1']=$_GET['n1'] ;}
}
$vowels = array(",", ";", "\t", "\n", "\r", "s+", " ",",,");
$post_input=preg_replace("/\s+/", ",", trim(htmlentities($_POST['sink1'])));
$geneids_array_strs = implode('","', $geneids_arrays);
$gsel1 = $geneids_arrays;
$vowels = array(",", ";", "\t", "\n", "\r", "s+", " ", ",,");
$post_input = preg_replace("/\s+/", ",", trim(htmlentities($sink1)));
$onlyconsonants = strtolower(str_replace($vowels, ",", $post_input));
$geneids_array = explode(",", $onlyconsonants);
//print_r($geneids_array);
$geneids_array_str=implode('","',$geneids_array);
$geneids_array_str = implode('","', $geneids_array);
$gstr1='"'.$geneids_array_str.'"';
//echo $gstr1;
if($debug==true){
if($_GET['n2']==""){
$_POST['sink2']="At5g64740,At2g33100,At4g39350,At5g05170,At4g32410,At4g38190";
}else{$_POST['sink2']=$_GET['n2'] ;}
}
$vowels = array(",", ";", "\t", "\n", "\r", "s+", " ",",,");
$post_input_2=preg_replace("/\s+/", ",", trim(htmlentities($_POST['sink2'])));
$vowels = array(",", ";", "\t", "\n", "\r", "s+", " ", ",,");
$post_input_2 = preg_replace("/\s+/", ",", trim(htmlentities($sink2)));
$onlyconsonants_2 = strtolower(str_replace($vowels, ",", $post_input_2));
$geneids_array_2 = explode(",", $onlyconsonants_2);
////print_r($geneids_array_2);
$geneids_array_2_str=implode('","',$geneids_array_2);
$gstr2='"'.$geneids_array_2_str.'"';
//echo $gstr2;
if($debug==true){
if($_GET['sp1']==""){$tmp_sp1="pt";}else{$tmp_sp1=$_GET['sp1'];}
if($_GET['sp2']==""){$tmp_sp2="at";}else{$tmp_sp2=$_GET['sp2'];}
$tmp_th1=4;
$tmp_th2=4;
$tmp_consth1=3;
$tmp_consth2=3;
}
$tmp_th2=$tmp_th1;
$geneids_array_2_str = implode('","',$geneids_array_2);
$gstr2 = '"'.$geneids_array_2_str.'"';
$tmp_consth2=$tmp_consth1;
$tmp_th2 = $tmp_th1;
$tmp_consth2 = $tmp_consth1;
if (($tmp_sp1=='pt') and ($tmp_sp2=='at')) $tabln = 'ptat';
if (($tmp_sp1=='at') and ($tmp_sp2=='pt')) $tabln = 'ptat';
if (($tmp_sp1=='pt') and ($tmp_sp2=='os')) $tabln = 'ptos';
if (($tmp_sp1=='os') and ($tmp_sp2=='pt')) $tabln = 'ptos';
if (($tmp_sp1=='at') and ($tmp_sp2=='os')) $tabln = 'atos';
if (($tmp_sp1=='os') and ($tmp_sp2=='at')) $tabln = 'atos';
if (($tmp_sp1 == 'pt') and ($tmp_sp2 == 'at')) $tabln = 'ptat';
if (($tmp_sp1 == 'at') and ($tmp_sp2 == 'pt')) $tabln = 'ptat';
if (($tmp_sp1 == 'pt') and ($tmp_sp2 == 'os')) $tabln = 'ptos';
if (($tmp_sp1 == 'os') and ($tmp_sp2 == 'pt')) $tabln = 'ptos';
if (($tmp_sp1 == 'at') and ($tmp_sp2 == 'os')) $tabln = 'atos';
if (($tmp_sp1 == 'os') and ($tmp_sp2 == 'at')) $tabln = 'atos';
?>
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
This diff is collapsed.
comp_net_add_export.js
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
var __slice=[].slice,__indexOf=[].indexOf||function(e){for(var t=0,n=this.length;t<n;t++){if(t in this&&this[t]===e)return t}return-1};(function(e,t){var n;n=function(){function t(t,n){var r,i=this;this.input=t;this.defaultOptions={animate:true,snapMid:false,classPrefix:null,classSuffix:null,theme:null,highlight:false};this.settings=e.extend({},this.defaultOptions,n);if(this.settings.theme){this.settings.classSuffix="-"+this.settings.theme}this.input.hide();this.slider=e("<div>").addClass("slider"+(this.settings.classSuffix||"")).css({position:"relative",userSelect:"none",boxSizing:"border-box"}).insertBefore(this.input);if(this.input.attr("id")){this.slider.attr("id",this.input.attr("id")+"-slider")}this.track=this.createDivElement("track").css({width:"100%"});if(this.settings.highlight){this.highlightTrack=this.createDivElement("highlight-track").css({width:"0"})}this.dragger=this.createDivElement("dragger");this.slider.css({minHeight:this.dragger.outerHeight(),marginLeft:this.dragger.outerWidth()/2,marginRight:this.dragger.outerWidth()/2});this.track.css({marginTop:this.track.outerHeight()/-2});if(this.settings.highlight){this.highlightTrack.css({marginTop:this.track.outerHeight()/-2})}this.dragger.css({marginTop:this.dragger.outerHeight()/-2,marginLeft:this.dragger.outerWidth()/-2});this.track.mousedown(function(e){return i.trackEvent(e)});if(this.settings.highlight){this.highlightTrack.mousedown(function(e){return i.trackEvent(e)})}this.dragger.mousedown(function(e){if(e.which!==1){return}i.dragging=true;i.dragger.addClass("dragging");i.domDrag(e.pageX,e.pageY);return false});e("body").mousemove(function(t){if(i.dragging){i.domDrag(t.pageX,t.pageY);return e("body").css({cursor:"pointer"})}}).mouseup(function(t){if(i.dragging){i.dragging=false;i.dragger.removeClass("dragging");return e("body").css({cursor:"auto"})}});this.pagePos=0;if(this.input.val()===""){this.value=this.getRange().min;this.input.val(this.value)}else{this.value=this.nearestValidValue(this.input.val())}this.setSliderPositionFromValue(this.value);r=this.valueToRatio(this.value);this.input.trigger("slider:ready",{value:this.value,ratio:r,position:r*this.slider.outerWidth(),el:this.slider})}t.prototype.createDivElement=function(t){var n;n=e("<div>").addClass(t).css({position:"absolute",top:"50%",userSelect:"none",cursor:"pointer"}).appendTo(this.slider);return n};t.prototype.setRatio=function(e){var t;e=Math.min(1,e);e=Math.max(0,e);t=this.ratioToValue(e);this.setSliderPositionFromValue(t);return this.valueChanged(t,e,"setRatio")};t.prototype.setValue=function(e){var t;e=this.nearestValidValue(e);t=this.valueToRatio(e);this.setSliderPositionFromValue(e);return this.valueChanged(e,t,"setValue")};t.prototype.trackEvent=function(e){if(e.which!==1){return}this.domDrag(e.pageX,e.pageY,true);this.dragging=true;return false};t.prototype.domDrag=function(e,t,n){var r,i,s;if(n==null){n=false}r=e-this.slider.offset().left;r=Math.min(this.slider.outerWidth(),r);r=Math.max(0,r);if(this.pagePos!==r){this.pagePos=r;i=r/this.slider.outerWidth();s=this.ratioToValue(i);this.valueChanged(s,i,"domDrag");if(this.settings.snap){return this.setSliderPositionFromValue(s,n)}else{return this.setSliderPosition(r,n)}}};t.prototype.setSliderPosition=function(e,t){if(t==null){t=false}if(t&&this.settings.animate){this.dragger.animate({left:e},200);if(this.settings.highlight){return this.highlightTrack.animate({width:e},200)}}else{this.dragger.css({left:e});if(this.settings.highlight){return this.highlightTrack.css({width:e})}}};t.prototype.setSliderPositionFromValue=function(e,t){var n;if(t==null){t=false}n=this.valueToRatio(e);return this.setSliderPosition(n*this.slider.outerWidth(),t)};t.prototype.getRange=function(){if(this.settings.allowedValues){return{min:Math.min.apply(Math,this.settings.allowedValues),max:Math.max.apply(Math,this.settings.allowedValues)}}else if(this.settings.range){return{min:parseFloat(this.settings.range[0]),max:parseFloat(this.settings.range[1])}}else{return{min:0,max:1}}};t.prototype.nearestValidValue=function(t){var n,r,i,s;i=this.getRange();t=Math.min(i.max,t);t=Math.max(i.min,t);if(this.settings.allowedValues){n=null;e.each(this.settings.allowedValues,function(){if(n===null||Math.abs(this-t)<Math.abs(n-t)){return n=this}});return n}else if(this.settings.step){r=(i.max-i.min)/this.settings.step;s=Math.floor((t-i.min)/this.settings.step);if((t-i.min)%this.settings.step>this.settings.step/2&&s<r){s+=1}return s*this.settings.step+i.min}else{return t}};t.prototype.valueToRatio=function(e){var t,n,r,i,s,o,u,a;if(this.settings.equalSteps){a=this.settings.allowedValues;for(i=o=0,u=a.length;o<u;i=++o){t=a[i];if(!(typeof n!=="undefined"&&n!==null)||Math.abs(t-e)<Math.abs(n-e)){n=t;r=i}}if(this.settings.snapMid){return(r+.5)/this.settings.allowedValues.length}else{return r/(this.settings.allowedValues.length-1)}}else{s=this.getRange();return(e-s.min)/(s.max-s.min)}};t.prototype.ratioToValue=function(e){var t,n,r,i,s;if(this.settings.equalSteps){s=this.settings.allowedValues.length;i=Math.round(e*s-.5);t=Math.min(i,this.settings.allowedValues.length-1);return this.settings.allowedValues[t]}else{n=this.getRange();r=e*(n.max-n.min)+n.min;return this.nearestValidValue(r)}};t.prototype.valueChanged=function(t,n,r){var i;if(t.toString()===this.value.toString()){return}this.value=t;i={value:t,ratio:n,position:n*this.slider.outerWidth(),trigger:r,el:this.slider};return this.input.val(t).trigger(e.Event("change",i)).trigger("slider:changed",i)};return t}();e.extend(e.fn,{simpleSlider:function(){var t,r,i;i=arguments[0],t=2<=arguments.length?__slice.call(arguments,1):[];r=["setRatio","setValue"];return e(this).each(function(){var s,o;if(i&&__indexOf.call(r,i)>=0){s=e(this).data("slider-object");return s[i].apply(s,t)}else{o=i;return e(this).data("slider-object",new n(e(this),o))}})}});return e(function(){return e("[data-slider]").each(function(){var t,n,r,i;t=e(this);r={};n=t.data("slider-values");if(n){r.allowedValues=function(){var e,t,r,s;r=n.split(",");s=[];for(e=0,t=r.length;e<t;e++){i=r[e];s.push(parseFloat(i))}return s}()}if(t.data("slider-range")){r.range=t.data("slider-range").split(",")}if(t.data("slider-step")){r.step=t.data("slider-step")}r.snap=t.data("slider-snap");r.equalSteps=t.data("slider-equal-steps");if(t.data("slider-theme")){r.theme=t.data("slider-theme")}if(t.attr("data-slider-highlight")){r.highlight=t.data("slider-highlight")}if(t.data("slider-animate")!=null){r.animate=t.data("slider-animate")}return t.simpleSlider(r)})})})(this.jQuery||this.Zepto,this)
\ No newline at end of file
var layoutOptions = {
name: 'cose-bilkent',
tile: true,
animate: 'during',
refresh: 60
};
function TableNetwork(active_table_element, other_table_element, network_element) {
this.activeTable = $(active_table_element).DataTable({
searching: false,
columnDefs: [{
orderable: false,
className: 'select-checkbox',
targets: 0,
data: null,
defaultContent: ""
}, {
data: 'gene',
targets: 1
}],
select: {
style: "multi",
},
rowId: "id",
order: [[1, 'asc']]
});
this.otherTable = $(other_table_element).DataTable({
searching: false,
columnDefs: [{
orderable: false,
className: 'select-checkbox',
targets: 0,
data: null,
defaultContent: ""
}, {
data: 'gene',
targets: 1
}, {
data: 'network',
targets: 2
}],
select: {
style: "multi",
},
rowId: "id",
order: [[1, 'asc']]
});
$(`${active_table_element} thead th, ${other_table_element} thead th`).each(function() {
if ($(this).index() != 0) {
var title = $(this).text();
$(this).html(title + '</br><input id="' + title.toLowerCase() +
'_index" type="text" placeholder="Search ' + title.toLowerCase() + '">');
}
});
this.cy = cytoscape({
container: $(network_element),
style: [
{
selector: 'node.active',
style: {
'background-color': '#eafff5'
}
}, {
selector: 'node',
style: {
content: 'data(label)'
}
}, {
selector: 'node.network',
style: {
'font-size': '3em'
}
}, {
selector: 'edge.orthology',
style: {
'line-style': 'dashed',
'label': 'data(conservation_pvalue)',
'display': 'none',
'curve-style': 'bezier',
'target-arrow-shape': 'triangle',
'arrow-scale': 2
}
}, {
selector: 'edge.orthology[support = "ORTHO"]',
style: {
'line-color': '#45ADFF',
'target-arrow-color': '#45ADFF'
}
}, {
selector: 'edge.orthology[support = "BHIF"]',
style: {
'line-color': '#FC784C',
'target-arrow-color': '#FC784C'
}
}, {
selector: 'edge.orthology[support = "TROG"]',
style: {
'line-color': '#1AC620',
'target-arrow-color': '#1AC620'
}
}
],
userZoomingEnabled: false,
boxSelectionEnabled: true
});
this.cy.nodes().unselectify();
this.cy.panzoom({
});
this.networkLayout = this.cy.layout(layoutOptions);
var self = this;
var networkSelect = false;
var tableSelect = false;
var propagateSelection = true;
this.deselectAll = function() {
self.cy.nodes().selectify().deselect().unselectify();
self.cy.edges('.orthology').style('display', 'none');
self.activeTable.rows().deselect();
self.otherTable.rows().deselect();
}
/**
* Select a node
*
* Select a node in the network and show any orthology
* edges connected to it. Also select any orthologs that
* it is connected to.
*/
var selectNode = function(node, fromTable) {
// Display orthology edges
node.selectify().select().unselectify();
node.connectedEdges('.orthology').style('display', 'element');
// Select the orthologs in the connected networks
if (node.data('parent') === `network${self.activeNetworkID}`) {
var orthologs = node.connectedEdges('.orthology').targets();
orthologs.selectify().select().unselectify();
var orthologIDs = orthologs.map(function(x) {
return `#${x.id()}`;
});
if (!fromTable) {
// Only select in the table if the selection was done in the network
self.activeTable.row(`#${node.id()}`, {selected: false}).select();
}
self.otherTable.rows(orthologIDs, {selected: false}).select();
} else {
var orthologs = node.connectedEdges('.orthology').sources();
orthologs.selectify().select().unselectify();
var orthologIDs = orthologs.map(function(x) {
return `#${x.id()}`;
});
if (!fromTable) {
self.otherTable.row(`#${node.id()}`, {selected: false}).select();
}
self.activeTable.rows(orthologIDs, {selected: false}).select();
}
}
/**
* Deselect a node
*
* Deselect a node in the network and hide any orthology
* edges connected to it. Also deselect the orthologous
* nodes in any other networks that don't have other
* orthology edges connected to them.
*/
var deselectNode = function(node, fromTable) {
node.selectify().deselect().unselectify();
node.connectedEdges('.orthology').style('display', 'none');
if (node.data('parent') === `network${self.activeNetworkID}`) {
node.connectedEdges('.orthology')
.targets()
.selectify()
.deselect()
.unselectify();
var selectedOrthologs = self.getActiveSelected()
.connectedEdges('.orthology:visible')
.targets();
selectedOrthologs.selectify().select().unselectify();
if (!fromTable) {
self.activeTable.row(`#${node.id()}`, {selected: true}).deselect();
}
var selectedOrthologIDs = selectedOrthologs.map(function(x) {
return `#${x.id()}`;
});
self.otherTable.rows().deselect();
self.otherTable.rows(selectedOrthologIDs).select();
} else {
node.connectedEdges('.orthology')
.sources()
.selectify()
.deselect()
.unselectify();
var selectedOrthologs = self.getInactiveSelected()
.connectedEdges('.orthology:visible')
.sources();
selectedOrthologs.selectify().select().unselectify();
if (!fromTable) {
self.otherTable.row(`#${node.id()}`, {selected: true}).deselect();
}
var selectedOrthologIDs = selectedOrthologs.map(function(x) {
return `#${x.id()}`;
})
self.activeTable.rows().deselect();
self.activeTable.rows(selectedOrthologIDs).select();
}
}
this.getActiveSelected = function() {
return self.cy
.nodes(`#network${self.activeNetworkID}`)
.children(':selected');
}
this.getInactiveSelected = function() {
var inactiveNetworks = $.grep(self.networks, function(x) {
return x != self.activeNetworkID;
}).map(x => `#network${x}`)
.join(',');
return self.cy
.nodes(inactiveNetworks)
.children(':selected');
}
var tapNode = function(node, shiftDown, fromTable) {
if (node.hasClass('network')) {
return;
}
var activeTap = node.data('parent') === `network${self.activeNetworkID}`;
var nSelected = activeTap ? self.getActiveSelected().length :
self.getInactiveSelected().length;
var isSelected = node.selected();
if (isSelected & nSelected === 1) {
deselectNode(node, fromTable);
} else if (isSelected & nSelected > 1 & !shiftDown) {
self.deselectAll();
selectNode(node, fromTable);
} else if (isSelected & nSelected > 1 & shiftDown) {
deselectNode(node, fromTable);
} else if (!isSelected & shiftDown) {
selectNode(node, fromTable);
} else if (!isSelected & !shiftDown) {
self.deselectAll();
selectNode(node, fromTable);
}
}
this.cy.on('tap', function(e) {
var type = e.target.group === undefined ? 'background' : e.target.group();
switch (type) {
case 'nodes':
tapNode(e.target, e.originalEvent.shiftKey, false);
break;
case 'edges':
break;
case 'background':
self.deselectAll();
break;
default:
console.error(`unknown element type: ${type}`);
}
});
var networkSelectionFromTable = function(e, dt, type, cell, originalEvent) {
var selectedID = dt.row(cell.index().row).data().id;
if (type === 'row') {
tapNode(self.cy.nodes(`#${selectedID}`), true, true);
}
}
this.activeTable.on('user-select', networkSelectionFromTable);
this.otherTable.on('user-select', networkSelectionFromTable);
this.add_network = function(networkID) {
}
<