...
 
Commits (14)
......@@ -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");
......
......@@ -5,110 +5,69 @@ 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();
}
$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']);
$tmp_op = isset($_POST['op']) ? $_POST['op'] : null;
$tmp_op = isset($_GET['op']) ? $_GET['op'] : $tmp_op;
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_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['sp'])) $tmp_sp=trim($_POST['sp']);
$sink1 = isset($_POST['sink1']) ? $_POST['sink1'] : null;
$sink2 = isset($_POST['sink2']) ? $_POST['sink2'] : 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']);
$tmp_sp = isset($_POST['sp']) ? trim($_POST['sp']) : 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_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 (!isset($_SESSION['showN'])) $_SESSION['showN']='align';
if($_POST['view_state']=="compare"){ $tmp_showN='compare';}else{ $tmp_showN='align';}
$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;
if($_GET['view_state']=="compare"){ $tmp_showN='compare';}else{ $tmp_showN='align';}
if($_GET['debug']=="true"){ $debug=true;}else{ $debug=false;}
$tmp_showN = isset($_POST['view_state']) ? $_POST['view_state'] : 'align';
$tmp_showN = isset($_GET['view_state']) ? $_GET['view_state'] : 'align';
$debug = isset($_GET['debug']) && $_GET['debug'] === 'true';
if($debug==true){
if($_GET['selG']==""){
//$_POST['selG']="At4g18780,At5g16910";
$_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';
?>
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
var vis1;
var vis2;
function ComplexNetwork(element) {
this.cy = cytoscape({
container: $(element),
layout: {
name: 'cose',
animate: false
}
});
this.set_data = function(data) {
this.cy.elements().remove();
this.cy.add(data);
this.cy.layout({name: 'cose'}).run();
}
}
function init_networks() {
console.log('initialising networks');
vis1 = new ComplexNetwork('#cytoscapeweb1');
vis2 = new ComplexNetwork('#cytoscapeweb2');
}
var firsttable;
var secondtable;
var table_options = {
searching: false
};
function ComplexTable(element) {
this.datatable = $(element).dataTable(table_options);
$(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.set_data = function(data) {
return;
};
}
function init_tables() {
console.log('initialisting tables');
firsttable = new ComplexTable("#firsttable");
secondtable = new ComplexTable("#secondtable");
}
This diff is collapsed.
This diff is collapsed.
......@@ -45,10 +45,11 @@ DROP TABLE IF EXISTS `gene`;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `gene` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(50) NOT NULL DEFAULT '',
`name` varchar(50) NOT NULL,
`species_id` int(11) unsigned NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`,`species_id`)
UNIQUE KEY `name` (`name`),
KEY (`species_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
......@@ -79,8 +80,12 @@ CREATE TABLE `network_score` (
`gene_id1` int(11) unsigned NOT NULL,
`gene_id2` int(11) unsigned NOT NULL,
`network_id` int(11) unsigned NOT NULL,
`score` float DEFAULT NULL,
PRIMARY KEY (`gene_id1`,`gene_id2`,`network_id`)
`score` float NOT NULL,
PRIMARY KEY (`gene_id1`,`gene_id2`),
KEY (`gene_id1`),
KEY (`gene_id2`),
KEY (`network_id`),
KEY (`score`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
......
This diff is collapsed.
<?
global $at_uuid;
if ( isset($_SERVER["REMOTE_ADDR"]) ) {
$ip = '' . $_SERVER["REMOTE_ADDR"] . '';
} else if ( isset($_SERVER["HTTP_X_FORWARDED_FOR"]) ) {
$ip = '' . $_SERVER["HTTP_X_FORWARDED_FOR"] . '';
} else if ( isset($_SERVER["HTTP_CLIENT_IP"]) ) {
$ip = '' . $_SERVER["HTTP_CLIENT_IP"] . '';
}
$at_uuid =$_COOKIE['atgenie_uuid'];//.';;'.$ip;
?>
<?php
require_once("../config.php");
$basket_db=mysql_connect(
$config["basket_db"]["host"],
$config["basket_db"]["user"],
$config["basket_db"]["password"]
) or die("maaf, tidak berhasil konek ke database");
if ( $_GET['db']=="at") {
include('atgenie/koneksi.php');
mysql_select_db("arabidopsisbasket",$basket_db) or die("database tidak ada");
}
if ($_GET['db']=="pt") {
include('poplar/koneksi.php');
if(isset($_COOKIE['select_species'])){
mysql_select_db("v4genebasket_".$_COOKIE['select_species'],$basket_db) or die("database tidak adas");
}else{
mysql_select_db("v4genebasket_potri",$basket_db) or die("database tidak ada");
}
}
if ( $_GET['db']=="os" ) {
include('spruce/koneksi.php');
mysql_select_db("congeniebaskets_beta",$basket_db) or die("database tidak ada");
}
if (isset($_GET) && $_GET['id'] !="") {
$uuid = $_GET['id'];
$g= 0;
$ip = $uuid;//="536b9ed660d70;;85.226.188.54";
$getgenelistsql = "SELECT genebaskets.genelist,genebaskets.harga FROM genebaskets JOIN defaultgenebaskets ON genebaskets.gene_basket_id=defaultgenebaskets.gene_basket_id where defaultgenebaskets.ip='$ip'";
$genelistresults = mysql_query($getgenelistsql,$basket_db) or die("query gagal dijalankan");
if (mysql_num_rows($genelistresults) != 0) {
$genelistdata = mysql_fetch_assoc($genelistresults);
$genelistnumber = $genelistdata['genelist'];
$children[$g]->genelist=explode(',',$genelistnumber);
$children[$g]->harga=$genelistdata['harga'];
} else {
$children[$g]->genelist=array();
$children[$g]->harga="0";
}
$ret[] = $children[$g];;
$g++;
$arrs = array ('basket'=>$ret);
echo json_encode($arrs);
mysql_close($basket_db);
}else{
return;
}
?>
This diff is collapsed.
<?php
require_once("../config.php");
$sp1=trim($_POST['sp1']);
$sp1_genes=$_POST['sp1_genes'];
$sp2=trim($_POST['sp2']);
$sp2_genes=$_POST['sp2_genes'];
//$replace_basket=$_POST['replacev'];
$replace_basket = filter_var($_POST['replace'], FILTER_VALIDATE_BOOLEAN);
/*if(trim($_POST['replacev']) === "true")
{
$replace_basket=true;
}
else
{
$replace_basket=false;
}*/
$geta="";
$getp="";
$getc="";
if($sp1=="at"){
$sp1_genes_array = explode(",", $sp1_genes);
include('atgenie/getgenelist.php');
if($replace_basket==true){
updategenebasketall_at($sp1_genes_array);
}else{
updategenebasket_at($sp1_genes_array);
}
}
if($sp1=="pt"){
$sp1_genes_array2 = explode(",", $sp1_genes);
include('poplar/getgenelist.php');
if($replace_basket==true){
updategenebasketall_pt($sp1_genes_array2);
}else{
updategenebasket_pt($sp1_genes_array2);
}
}
if($sp1=="os"){
$sp1_genes_array3 = explode(",", $sp1_genes);
include('spruce/getgenelist.php');
if($replace_basket==true){
updategenebasketall($sp1_genes_array3);
}else{
updategenebasket($sp1_genes_array3);
}
}
if($sp2=="at"){
$sp2_genes_array2x = explode(",", $sp2_genes);
include('atgenie/getgenelist.php');
if($replace_basket==true){
updategenebasketall_at($sp2_genes_array2x);
}else{
updategenebasket_at($sp2_genes_array2x);
//echo json_encode($sp2_genes_array2x);
}
}
if($sp2=="pt"){
$sp2_genes_array2 = explode(",", $sp2_genes);
include('poplar/getgenelist.php');
if($replace_basket==true){
updategenebasketall_pt($sp2_genes_array2);
}else{
updategenebasket_pt($sp2_genes_array2);
}
}
if($sp2=="os"){
$sp2_genes_array3 = explode(",", $sp2_genes);
include('spruce/getgenelist.php');
if($replace_basket==true){
updategenebasketall($sp2_genes_array3);
}else{
updategenebasket($sp2_genes_array3);
}
}
//echo json_encode($geta);
?>
This diff is collapsed.
<?
global $pt_uuid;
if ( isset($_SERVER["REMOTE_ADDR"]) ) {
$ip = '' . $_SERVER["REMOTE_ADDR"] . '';
} else if ( isset($_SERVER["HTTP_X_FORWARDED_FOR"]) ) {
$ip = '' . $_SERVER["HTTP_X_FORWARDED_FOR"] . '';
} else if ( isset($_SERVER["HTTP_CLIENT_IP"]) ) {
$ip = '' . $_SERVER["HTTP_CLIENT_IP"] . '';
}
$pt_uuid =$_COOKIE['popgenie_uuid'];//.';;'.$ip;
?>
This diff is collapsed.
<?
global $sp_uuid;
if ( isset($_SERVER["REMOTE_ADDR"]) ) {
$ip = '' . $_SERVER["REMOTE_ADDR"] . '';
} else if ( isset($_SERVER["HTTP_X_FORWARDED_FOR"]) ) {
$ip = '' . $_SERVER["HTTP_X_FORWARDED_FOR"] . '';
} else if ( isset($_SERVER["HTTP_CLIENT_IP"]) ) {
$ip = '' . $_SERVER["HTTP_CLIENT_IP"] . '';
}
$sp_uuid =$_COOKIE['congenie_uuid'];//.';;'.$ip;
?>