Update of /cvsroot/basedb/basedb/www In directory usw-pr-cvs1:/tmp/cvs-serv23080 Modified Files: bioassay.inc.php bioassayset.inc.php job.inc.php mysql.inc.php pgsql.inc.php program.inc.php raw.inc.php trans_create.phtml Log Message: More PostgreSQL stuff Index: bioassay.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/bioassay.inc.php,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** bioassay.inc.php 9 Sep 2002 10:56:08 -0000 1.34 --- bioassay.inc.php 10 Sep 2002 10:57:41 -0000 1.35 *************** *** 433,438 **** "m.species, m.`clusterId`, bad.molecule, bad.position AS position, ". "$dia $ecol ". ! "FROM $config[dbDynamic]BioAssayData$this->experiment bad ". ! $search->getExtraTables()." $ljoin ". "WHERE ".db_true()." ". $search->getWhere()." ".$search->getExtraWhere(). --- 433,438 ---- "m.species, m.`clusterId`, bad.molecule, bad.position AS position, ". "$dia $ecol ". ! "FROM $config[dbDynamic]BioAssayData$this->experiment bad $ljoin ". ! $search->getExtraTables()." ". "WHERE ".db_true()." ". $search->getWhere()." ".$search->getExtraWhere(). *************** *** 475,480 **** $query = "SELECT DISTINCT bad.molecule ". ! "FROM $config[dbDynamic]BioAssayData$this->experiment bad ". ! $search->getExtraTables()." $ljoin ". "WHERE ".db_true()." ".$search->getWhere()." ". $search->getExtraWhere()." $ob"; --- 475,480 ---- $query = "SELECT DISTINCT bad.molecule ". ! "FROM $config[dbDynamic]BioAssayData$this->experiment bad $ljoin ". ! $search->getExtraTables()." ". "WHERE ".db_true()." ".$search->getWhere()." ". $search->getExtraWhere()." $ob"; *************** *** 591,597 **** $query = "SELECT ba.id, $sel $xf ". ! "FROM $config[dbDynamic]BioAssayData$expid bad ". $search->getExtraTables()." ". - "$ljoin ". "WHERE bad.molecule = $molecule ". $search->getWhere()." ".$search->getExtraWhere()." "; --- 591,596 ---- $query = "SELECT ba.id, $sel $xf ". ! "FROM $config[dbDynamic]BioAssayData$expid bad $ljoin ". $search->getExtraTables()." ". "WHERE bad.molecule = $molecule ". $search->getWhere()." ".$search->getExtraWhere()." "; *************** *** 881,889 **** $ob = $search->makeOrderBy($sortfields); ! $query = "SELECT rba.name as rawname, ba.* ". "FROM BioAssay ba ". "LEFT JOIN RawBioAssay rba ON rba.id = ba.`rawBioAssay` ". "WHERE ba.`bioAssaySet` = $setid ".$search->getWhere()." ". ! "GROUP BY ba.id $ob ".$search->makeLimit(); $arr = array(); --- 880,888 ---- $ob = $search->makeOrderBy($sortfields); ! $query = "SELECT ba.*, rba.name as rawname ". "FROM BioAssay ba ". "LEFT JOIN RawBioAssay rba ON rba.id = ba.`rawBioAssay` ". "WHERE ba.`bioAssaySet` = $setid ".$search->getWhere()." ". ! "$ob ".$search->makeLimit(); $arr = array(); *************** *** 944,948 **** $query = "INSERT INTO $config[dbDynamic]BioAssayData$this->experiment ". "(`bioAssay`, position, molecule, intensity1, intensity2, ratio) ". ! "SELECT $this->id, position, molecule, $i1, $i2, ($i1) / ($i2) ". "FROM RawBioAssayData WHERE `rawBioAssay` = $this->rawBioAssay"; if(!query($query)) return false; --- 943,948 ---- $query = "INSERT INTO $config[dbDynamic]BioAssayData$this->experiment ". "(`bioAssay`, position, molecule, intensity1, intensity2, ratio) ". ! "SELECT $this->id, position, molecule, $i1, $i2, ". ! "CASE WHEN $i1 > 0 AND $i2 > 0 THEN ($i1)/($i2) ELSE -1 END ". "FROM RawBioAssayData WHERE `rawBioAssay` = $this->rawBioAssay"; if(!query($query)) return false; Index: bioassayset.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/bioassayset.inc.php,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** bioassayset.inc.php 9 Sep 2002 10:56:08 -0000 1.26 --- bioassayset.inc.php 10 Sep 2002 10:57:41 -0000 1.27 *************** *** 81,85 **** $expid = $this->experiment; ! $query = "SELECT id FROM BioAssay WHERE bioAssaySet = $id"; $rc = true; if(!($res = query($query))) --- 81,85 ---- $expid = $this->experiment; ! $query = "SELECT id FROM BioAssay WHERE `bioAssaySet` = $id"; $rc = true; if(!($res = query($query))) *************** *** 199,203 **** $id = (int)$id; $query = "SELECT 1 FROM BioAssaySet ". ! "WHERE id = $id && experiment = ".(int)$expid; $res = query($query); if(db_num_rows($res)) return true; --- 199,203 ---- $id = (int)$id; $query = "SELECT 1 FROM BioAssaySet ". ! "WHERE id = $id AND experiment = ".(int)$expid; $res = query($query); if(db_num_rows($res)) return true; *************** *** 631,635 **** "$config[dbDynamic]BioAssaySetGene$this->experiment ". "(`bioAssaySet`, molecule, cnt) ". ! "SELECT STRAIGHT_JOIN $this->id, bad.molecule, COUNT(DISTINCT ba.id) ". "FROM BioAssay ba, $datatable bad ". "WHERE ba.`bioAssaySet` = $this->id AND bad.`bioAssay` = ba.id ". --- 631,636 ---- "$config[dbDynamic]BioAssaySetGene$this->experiment ". "(`bioAssaySet`, molecule, cnt) ". ! "SELECT ".db_straight_join()." $this->id, ". ! "bad.molecule, COUNT(DISTINCT ba.id) ". "FROM BioAssay ba, $datatable bad ". "WHERE ba.`bioAssaySet` = $this->id AND bad.`bioAssay` = ba.id ". *************** *** 643,647 **** "$config[dbDynamic]BioAssaySetPosGene$this->experiment ". "(`bioAssaySet`, position, molecule, cnt) ". ! "SELECT STRAIGHT_JOIN $this->id, bad.position, bad.molecule, COUNT(*) ". "FROM BioAssay ba, $datatable bad ". "WHERE ba.`bioAssaySet` = $this->id AND bad.`bioAssay` = ba.id ". --- 644,649 ---- "$config[dbDynamic]BioAssaySetPosGene$this->experiment ". "(`bioAssaySet`, position, molecule, cnt) ". ! "SELECT ".db_straight_join()." $this->id, ". ! "bad.position, bad.molecule, COUNT(*) ". "FROM BioAssay ba, $datatable bad ". "WHERE ba.`bioAssaySet` = $this->id AND bad.`bioAssay` = ba.id ". Index: job.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/job.inc.php,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** job.inc.php 10 Sep 2002 09:29:44 -0000 1.37 --- job.inc.php 10 Sep 2002 10:57:41 -0000 1.38 *************** *** 38,43 **** $this->experiment = (int)$experiment; $this->transformation = (int)$transformation; ! $this->startTime = $startTime; ! $this->endTime = $endTime; $this->status = $status; $this->program = (int)$program; --- 38,43 ---- $this->experiment = (int)$experiment; $this->transformation = (int)$transformation; ! $this->startTime = strtodate($startTime); ! $this->endTime = strtodate($endTime); $this->status = $status; $this->program = (int)$program; *************** *** 229,238 **** function setStartTime($val) { ! $this->startTime = $val; $this->saveVar("startTime", $val); } function setEndTime($val) { ! $this->endTime = $val; $this->saveVar("endTime", $val); } --- 229,238 ---- function setStartTime($val) { ! $this->startTime = strtodate($val); $this->saveVar("startTime", $val); } function setEndTime($val) { ! $this->endTime = strtodate($val); $this->saveVar("endTime", $val); } Index: mysql.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/mysql.inc.php,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** mysql.inc.php 10 Sep 2002 09:29:44 -0000 1.15 --- mysql.inc.php 10 Sep 2002 10:57:41 -0000 1.16 *************** *** 307,313 **** { if($base) ! return "LOG($arg)/LOG($base)"; else return "LOG($arg)"; } --- 307,318 ---- { if($base) ! return "(LOG($arg)/LOG($base))"; else return "LOG($arg)"; + } + + function db_straight_join() + { + return "STRAIGHT_JOIN"; } Index: pgsql.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/pgsql.inc.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** pgsql.inc.php 10 Sep 2002 09:29:44 -0000 1.11 --- pgsql.inc.php 10 Sep 2002 10:57:41 -0000 1.12 *************** *** 394,401 **** { if($base) ! $e = "LOG(".(float)$base.", float8($arg))"; else $e = "LOG(float8($arg))"; return "CASE WHEN $arg > 0. THEN $e ELSE NULL END"; } --- 394,406 ---- { if($base) ! $e = "(LOG(float8($arg))/LOG($base.))"; else $e = "LOG(float8($arg))"; return "CASE WHEN $arg > 0. THEN $e ELSE NULL END"; + } + + function db_straight_join() + { + return ""; } Index: program.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/program.inc.php,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** program.inc.php 9 Sep 2002 06:29:34 -0000 1.22 --- program.inc.php 10 Sep 2002 10:57:41 -0000 1.23 *************** *** 167,171 **** { $query = "SELECT id, name FROM Program ". ! "WHERE `onServer` ORDER BY name"; $res = query($query); $arr = array(); --- 167,171 ---- { $query = "SELECT id, name FROM Program ". ! "WHERE `onServer` <> 0 ORDER BY name"; $res = query($query); $arr = array(); *************** *** 185,189 **** --- 185,193 ---- $arr = array(); while($row =& db_fetch_assoc($res)) + //temp. fix for my dev database + { + $row["valueType"]=trim($row["valueType"]); $arr[(int)$row["position"]] = $row; + } return $arr; } Index: raw.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/www/raw.inc.php,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** raw.inc.php 10 Sep 2002 09:29:44 -0000 1.36 --- raw.inc.php 10 Sep 2002 10:57:41 -0000 1.37 *************** *** 484,488 **** "FROM RawBioAssay r, LabeledExtract le, Extract e ". "WHERE r.id = ".(int)$rawid." ". ! "AND le.id = r.`labeledCh`".($pos+1)." ". "AND e.id = le.extract"; $res = query($query); --- 484,488 ---- "FROM RawBioAssay r, LabeledExtract le, Extract e ". "WHERE r.id = ".(int)$rawid." ". ! "AND le.id = r.`labeledCh".($pos+1)."` ". "AND e.id = le.extract"; $res = query($query); Index: trans_create.phtml =================================================================== RCS file: /cvsroot/basedb/basedb/www/trans_create.phtml,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** trans_create.phtml 29 Aug 2002 16:51:34 -0000 1.23 --- trans_create.phtml 10 Sep 2002 10:57:41 -0000 1.24 *************** *** 181,184 **** --- 181,186 ---- if(!$prog->read($i_prog)) $err = "No such plug-in"; + else if(!$prog->getOnServer()) + $err = "The selected plug-in has been disabled by the admin"; } if(!$prog->getId()) $step = 0; *************** *** 401,406 **** if(!isset($ptypes[$type])) { ! echo "<tr><td colspan=3>Unknown parameter ". ! "type '$type'</td></tr>\n"; continue; } --- 403,408 ---- if(!isset($ptypes[$type])) { ! echo "<tr><td colspan=3>Unknown parameter type ". ! "'$type'</td></tr>\n"; continue; } |