From: <tr...@us...> - 2003-02-11 14:43:17
|
Update of /cvsroot/basedb/basedb/include/classes In directory sc8-pr-cvs1:/tmp/cvs-serv7133/classes Modified Files: bioassay.inc.php bioassayset.inc.php jobhandler.inc.php Log Message: Added import and display of extra bioassayset float columns Index: bioassay.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/include/classes/bioassay.inc.php,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** bioassay.inc.php 3 Feb 2003 20:13:17 -0000 1.31 --- bioassay.inc.php 11 Feb 2003 14:43:06 -0000 1.32 *************** *** 708,712 **** { $xct = $xctables[$arr["valueType"]]; ! $tn = "xc_$xid"; $tables[$tn] = array( "$config[dbDynamic]BioAssayExtra$xct$expid $tn", --- 708,712 ---- { $xct = $xctables[$arr["valueType"]]; ! $tn = "baef_$xid"; $tables[$tn] = array( "$config[dbDynamic]BioAssayExtra$xct$expid $tn", Index: bioassayset.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/include/classes/bioassayset.inc.php,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** bioassayset.inc.php 10 Feb 2003 08:40:42 -0000 1.21 --- bioassayset.inc.php 11 Feb 2003 14:43:08 -0000 1.22 *************** *** 154,158 **** if(!$this->extraColumns) $this->extraColumns = ExtraDataColumn::getBriefForSet($this->id); ! return $this->hasExtraColumns; } --- 154,158 ---- if(!$this->extraColumns) $this->extraColumns = ExtraDataColumn::getBriefForSet($this->id); ! return $this->extraColumns; } *************** *** 169,172 **** --- 169,176 ---- $this->intensityMeasure = $val; } + function setHasExtraColumns($val) + { + $this->hasExtraColumns = $val ? 1 : 0; + } // Adds another extra data column for this bioassayset. *************** *** 709,716 **** for($i = 1; $i <= $channels; $i++) $columns[] = "intensity$i"; ! if(!db_tabfile_load($fname, $table, $columns)) return false; return $this->updateGeneTable(false); } } --- 713,731 ---- for($i = 1; $i <= $channels; $i++) $columns[] = "intensity$i"; ! if(db_tabfile_load($fname, $table, $columns) < 1) return false; return $this->updateGeneTable(false); } + + function importExtraFloats($fname) + { + global $config; + $table = "$config[dbDynamic]BioAssayExtraFloat$this->experiment"; + $columns = array("bioAssay", "position", "extraDataColumn", + "extraValue"); + if(db_tabfile_load($fname, $table, $columns) < 1) + return false; + return true; + } } *************** *** 948,957 **** for(reset($arr), $i = 0; list($id, $a) = each($arr); $i++) { ! $expr[] = array("_xc_$id", $types[$a["valueType"]], ! "%%.extraValue", $a["name"]); ! Search::bindExpressionToTable($expr[$i], "xc_$id"); } return $expr; } } --- 963,976 ---- for(reset($arr), $i = 0; list($id, $a) = each($arr); $i++) { ! $name = $a["name"]; ! $expr[] = array("_xc_".printable($name), $types[$a["valueType"]], ! "%%.extraValue", $name); ! $tname = "baef_$id"; ! $comm = "[Extra]"; ! Search::bindExpressionToTable($expr[$i], $tname, $comm); } return $expr; } + } Index: jobhandler.inc.php =================================================================== RCS file: /cvsroot/basedb/basedb/include/classes/jobhandler.inc.php,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** jobhandler.inc.php 10 Feb 2003 08:40:45 -0000 1.9 --- jobhandler.inc.php 11 Feb 2003 14:43:10 -0000 1.10 *************** *** 358,361 **** --- 358,370 ---- unset($parents); } + + // Find the ids of the extra float columns + for(reset($extraFloats); list($ef) = each($extraFloats); ) + { + $efid = ExtraDataColumn::getIdFromNameAndType($ef, 0, true); + if(!$efid) + return "Can't create extra float column '$ef'\n"; [...117 lines suppressed...] + unlink($tempfileextra); return "assayImporter returned $rc: ".implode("\n", $res); } ! $ok = $set->importBASEfile($tempfile2, $channels); unlink($tempfile2); ! if(!$ok) ! { ! unlink($tempfileextra); return "Failed to import assay data into database"; + } + + if($extraFloats) + $ok = $set->importExtraFloats($tempfileextra); + else + $ok = true; + unlink($tempfileextra); + if(!$ok) + return "Failed to import extra float columns into database"; return ""; } |