modifications in base v.3 sigenae · sigenae - modifications february 2005 i - presentation we used...

39
Sigenae - Modifications February 2005 MODIFICATIONS IN BASE V.3 SIGENAE Christelle Dantec Sigenae 1/39

Upload: doandien

Post on 21-Aug-2019

214 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: MODIFICATIONS IN BASE V.3 SIGENAE · Sigenae - Modifications February 2005 I - Presentation We used BASE since two years and we appreciated really it. We would like to thank the BASE's

Sigenae - Modifications February 2005

MODIFICATIONS IN BASE V.3 SIGENAE

Christelle Dantec

Sigenae 1/39

Page 2: MODIFICATIONS IN BASE V.3 SIGENAE · Sigenae - Modifications February 2005 I - Presentation We used BASE since two years and we appreciated really it. We would like to thank the BASE's

Sigenae - Modifications February 2005

ContentsI ­ Presentation...........................................................................................................................3II ­ Modify functionalities..........................................................................................................4

a ­ Generate spots image.........................................................................................................4b ­ Modify index on SI_bioassaysdataXX............................................................................11

III ­ Add functionalities...........................................................................................................12a ­ Links toward differents databases....................................................................................12b ­ Result file formats for differents softwares......................................................................13

i ­ Step 1 : Add desired columns in the table  rawbioassaydata...................................................14ii ­ Step 2 : Modify the php file to present the added columns......................................................15iii ­ Step 3 : Modify the interface to present the results according to the analysis processorused.......................................................................................................................... ......................16

c ­ Add calculation method...................................................................................................21d ­ Experiment plotter............................................................................................................23e ­ Add method for filtering..................................................................................................25f ­ Export data........................................................................................................................28g ­ Settings ............................................................................................................................31h ­ Add field to filter uploaded files......................................................................................32

IV ­ Strategy..............................................................................................................................38

Sigenae 2/39

Page 3: MODIFICATIONS IN BASE V.3 SIGENAE · Sigenae - Modifications February 2005 I - Presentation We used BASE since two years and we appreciated really it. We would like to thank the BASE's

Sigenae - Modifications February 2005

I - Presentation

We used BASE since two years and we appreciated really it.We would like to thank the BASE's developers for the design and the development ofthe software, and the provided documentation.

The purpose of this document is to present the stages of modifications made to thesoftware BASE to add one channel's spot intensities and others functionalities.This document is divided into 4 parts, describing the modifications in each chapter:

– Code modifying the functionalities– Code changing only the interface– Code to add functionalities– The strategy used for creating radioactivity membranes in BASE

Conventions :The red color in each part shows the modifications added.Be careful ' ....' represents a part of unchanged code of the initial document.

Note : These modifications have been tested on the base 1.2.15 (on Solaris usingPostgresql).

Sigenae 3/39

Page 4: MODIFICATIONS IN BASE V.3 SIGENAE · Sigenae - Modifications February 2005 I - Presentation We used BASE since two years and we appreciated really it. We would like to thank the BASE's

Sigenae - Modifications February 2005

II - Modify functionalities

a - Generate spots imageIn BASE: You can generate spots image for the 2-channels images, but not for the1-channel image. Here the modifications:

(Libraries used: tiffsplit, tifftopnm, pnmtojpeg)

In include/classes/image.inc.php

define("IMAGE_CHANNEL_NONE", 0);define("IMAGE_CHANNEL_ALL", ­1);define("IMAGE_CHANNEL_OTHER", ­2);define("IMAGE_CHANNEL_P33", ­3);define("IMAGE_CHANNEL_BOTH", ­4);define("IMAGE_CHANNEL_MAX", 8);

....

function takeOverUseForJpeg(){   if($this­>channels == IMAGE_CHANNEL_BOTH || $this­>channels ==

IMAGE_CHANNEL_P33)        $andchan = "";    else if($this­>channels == 1 || $this­>channels == 2)        $andchan = "AND channels <> ".(3 ­ $this­>channels);    else        return false;    $query = "UPDATE Image SET `useForJpeg` = ".              db_cast_boolean_int("(id = $this­>id)")." ".             "WHERE `imageAcquisition` = $this­>imageAcquisition ".             "$andchan";    if(!query($query))         return false;    $this­>useForJpeg = 1;         return true;}

function getChannelNames(){    $names = array(IMAGE_CHANNEL_ALL => "All",                   IMAGE_CHANNEL_BOTH => "Ch1 and 2 ",                   IMAGE_CHANNEL_P33 => "P32 or P33",                   IMAGE_CHANNEL_NONE => "None");    for($i = 1; $i <= IMAGE_CHANNEL_MAX; $i++)        $names[$i] = "Ch $i";        $names[IMAGE_CHANNEL_OTHER] = "Other";        return $names;}

Sigenae 4/39

Page 5: MODIFICATIONS IN BASE V.3 SIGENAE · Sigenae - Modifications February 2005 I - Presentation We used BASE since two years and we appreciated really it. We would like to thank the BASE's

Sigenae - Modifications February 2005

In include/classes/acquisition.inc.php

function canCreateJpegImage(){    $query = "SELECT i.channels FROM Image i ".             "WHERE i.`imageAcquisition` = $this­>id ".             "AND i.`useForJpeg` = 1 ".Item::whereRemovedAnd("i", 0)." ".             "ORDER BY channels";    $res = query($query);    $arr = array();    while($row =& db_fetch_row($res))          $arr[] = $row[0];    if(count($arr) == 1 && ($arr[0] == IMAGE_CHANNEL_BOTH || $arr[0] ==

IMAGE_CHANNEL_P33))          return 2;    if(count($arr) == 2 && $arr[0] == 1 && $arr[1] == 2)          return 1;    return false;}

function autoAssignJpegImages(){   $query = "SELECT i.channels, i.id FROM Image i ".            "WHERE i.`imageAcquisition` = $this­>id ".

"AND i.channels IN (1, 2,".IMAGE_CHANNEL_BOTH.",".IMAGE_CHANNEL_P33.") ".Item::whereRemovedAnd("i", 0)." ".

      "ORDER BY channels";   $res = query($query);   $arr = array();   $imgs = array(1 => 0, 2 => 0, IMAGE_CHANNEL_BOTH => 0,IMAGE_CHANNEL_P33

=> 0);   while($row =& db_fetch_row($res))   {       $arr[] = $row;       $imgs[$row[0]]++;   }   $found = 0;   if($imgs[1] >= 1 && $imgs[2] >= 1)       $found++;   if($imgs[IMAGE_CHANNEL_BOTH] >= 1)       $found++;   if($imgs[IMAGE_CHANNEL_P33] >= 1)       $found++;   if(!$found)       return 1;   if($found > 1 || $imgs[1] > 1 || $imgs[2] > 1 || $imgs

[IMAGE_CHANNEL_BOTH] > 1 || $imgs[IMAGE_CHANNEL_P33] > 1){       return 2;   }

   $acnt = count($arr);   for($i = 0; $i < $acnt; $i++)   {       $img = new Image();

Sigenae 5/39

Page 6: MODIFICATIONS IN BASE V.3 SIGENAE · Sigenae - Modifications February 2005 I - Presentation We used BASE since two years and we appreciated really it. We would like to thank the BASE's

Sigenae - Modifications February 2005

       if(!$img­>read($arr[$i][1]))           return 3;       if(!$img­>takeOverUseForJpeg())           return 3;   }   return 0;}

in include/classes/spotimage.inc.php

function runSpotImageChopper($dir, $imgs,$tiffch1 = 0, $tiffch2 = 0){      global $config;      $pwd = getcwd();      if(!chdir($dir))            return "Unable to chdir to spot image directory";      $fname = $this­>makeSpotInfoFile();

      if($fname === false)      {            chdir($pwd);            return "Unable to create spot info file";      }

      $fileS = escapeshellarg($fname);                    $ss = $this­>raw­>getSpotImagePixels();      $xoff = $this­>raw­>getSpotImageOffsetX();      $yoff = $this­>raw­>getSpotImageOffsetY();      $scale = $this­>raw­>getSpotImageScale();      $qual = 90;     // The admin might want to change this.

        $rc = 0;        if(count($imgs) == 2)        {            $imgG = $imgs[1];            $imgR = $imgs[2];            $fileG = escapeshellarg(Image::getRepositoryFilenameById

($imgG));            $fileR = escapeshellarg(Image::getRepositoryFilenameById

($imgR));                  }        else if(count($imgs) == 1)        {            @ob_flush();

  if(isset($imgs[IMAGE_CHANNEL_P33]))            {

      $imgP33 = $imgs[IMAGE_CHANNEL_P33];                $fileP33 = escapeshellarg(                           Image::getRepositoryFilenameById($imgP33));            }

  if(isset($imgs[IMAGE_CHANNEL_BOTH]))            {

Sigenae 6/39

Page 7: MODIFICATIONS IN BASE V.3 SIGENAE · Sigenae - Modifications February 2005 I - Presentation We used BASE since two years and we appreciated really it. We would like to thank the BASE's

Sigenae - Modifications February 2005

            echo "Splitting two­channel TIFF image\n";

                $fileBoth = escapeshellarg(                            Image::getRepositoryFilenameById($imgBoth));                $tiffsplit = "tiffsplit";                passthru("$tiffsplit 2>&1 $fileBoth", $rc);                $aa = Well::letterToInt("aa");                $fileR = "x".strtolower(Well::intToLetter($aa +                         (int)$skiptiffs)).".tif";                $fileG = "x".strtolower(Well::intToLetter($aa + 1 +                         (int)$skiptiffs)).".tif";            }                    }        else        {            $rc = 1;            $array[] = "Internal channel­related error";        }

        if((count($imgs) == 2)  && (!$rc))        {            echo "Converting to PNM and running image ".                                "chopper/enhancer/compressor\n";            @ob_flush();

  //A tricky way to get bash to pass the PNM files on FDs 4 and5            system("{ $tifftopnm $fileR |".                  " { $tifftopnm $fileG |".                  " { $chopper <$fileS $ss $xoff $yoff $scale $qual;".                  " } 4<&0; } 5<&0; } 2>&1", $rc);         }         if(count($imgs) == 1)         {

    if ((!$rc) && ($imgP33 != ''))    {        $lastmsg = time();        $nextbr = 0;

                  echo "Splitting P33 TIFF image\n";                  exec($tifftopnm." $fileP33 > $fileP33.pnm");                  $fd = fopen($fname, "r");                  if(!$fd)                          echo "<br>Not able to open the file";                 while(!feof($fd))             {                 $buffer = fgets($fd, 4096);                 list( $id, $x, $y ) = explode("\t",$buffer);                 $x = intval($x/$scale);                 $y = intval($y/$scale);                 $left1 = $x ­ $ss;                 $right1 = $x + $ss;                 $top1 = $y ­ $ss;                 $bottom1 = $y + $ss;                 $id = substr("0000".$id,strlen("0000".$id) ­ 4,4);                 $command = $pamcut." ­left $left1 ­right $right1

­top $top1 ­bottom $bottom1 $fileP33.pnm |

Sigenae 7/39

Page 8: MODIFICATIONS IN BASE V.3 SIGENAE · Sigenae - Modifications February 2005 I - Presentation We used BASE since two years and we appreciated really it. We would like to thank the BASE's

Sigenae - Modifications February 2005

".$pnmtojpeg." > $id.jpeg";if(time() ­ $lastmsg > 0)     

                     {                         echo "[$id]";                         if(++$nextbr == 10)                         {                         echo "<br>";                              $nextbr = 0;                        }                         $lastmsg = time();                         @ob_flush();                     }                                exec("$command");                $rc = 0;            } 

fclose($fd);          exec("/bin/rm $fileP33.pnm");        }                if((!$rc) && ($imgBoth != ''))        {

  echo "Running image splitter/enhancer/compressor\n";            @ob_flush();          //A tricky way to get bash to pass the PNM files on FDs 4 and 5.            system("{ $tifftopnm $fileR |".                   " { $tifftopnm $fileG |".                   " { $chopper <$fileS $ss $xoff $yoff $scale $qual;".                   " } 4<&0; } 5<&0; } 2>&1",                   $rc);            // Clean up after tiffsplit            exec("rm ­f x??.tif ".                   "2>>".escapeshellarg("$config[logDir]/spotimage.log"));        }     }             unlink($fname);        chdir($pwd);

        if(!$rc)            return "";        return "Failed to process images (rc=$rc).\n";}

In include/web/hyb_common.php

function imageInputHandle(&$user){... if(isset($i_imgjpeg) && $i_imgjpeg) {      $img = new Image();      if(!$img­>readShared($i_imgjpeg, $user))         return "Unable to use image for spot images: image not found";

Sigenae 8/39

Page 9: MODIFICATIONS IN BASE V.3 SIGENAE · Sigenae - Modifications February 2005 I - Presentation We used BASE since two years and we appreciated really it. We would like to thank the BASE's

Sigenae - Modifications February 2005

      $ch = $img­>getChannels();      if($ch != 1 && $ch != 2 && $ch != IMAGE_CHANNEL_BOTH  && $ch !=

IMAGE_CHANNEL_P33)      {          return "Unable to use image for spot images: can't handle its ".                 "channel(s)";       }       else if(!$img­>takeOverUseForJpeg())          return "Unable to use image for spot images: internal error";  }  return "";}

...

l.290

if($acq­>isShared($user, 1)){    if($ch == 1 || $ch == 2 || $ch == IMAGE_CHANNEL_BOTH || $ch ==

IMAGE_CHANNEL_P33)    {        $func[] = "[<a href='javascript:useForJpeg($a[id])'>".                  "Use for spot images</a>]";    }}

In raw_spot.phtml

if($err == ""){    $dir = $raw­>getSpotImageDirectoryById($raw­>getId(), false);    if($dir === false)         $err = "Spot image directory error";

        else if(!extension_loaded("gd"))    {         error_log("Unable to generate PNG image: PHP was compiled ".                  "without the gd extension. You ought to read the ".                  "installation instructions for BASE.");         $err = "Unable to generate PNG image: PHP was compiled ".                  "without the gd extension. The administrator, ".                  "$config[adminName] &lt;<a href='mailto:$config[adminEmail]'>".                  "$config[adminEmail]</a>&gt; should be able to fixthis.";    }    else    {         $pos = max(0, (int)$i_pos);         $size = max(1, min(200, (int)$i_size));         $imgw = 16;         //$fname = $dir.sprintf("/%04d.jpeg", $pos / ($imgw * $imgw));         $fname = $dir.sprintf("/%04d.jpeg", $pos);

Sigenae 9/39

Page 10: MODIFICATIONS IN BASE V.3 SIGENAE · Sigenae - Modifications February 2005 I - Presentation We used BASE since two years and we appreciated really it. We would like to thank the BASE's

Sigenae - Modifications February 2005

          $x = $pos % $imgw;         $y = (int)($pos / $imgw) % $imgw;         $pix = $raw­>getSpotImagePixels();         //$x *= $pix;         //$y *= $pix;         $x = 0;         $y = 0;         $pix = 20;

         header("Content­type: image/png");

         //$imgreq = IMG_JPG | IMG_PNG;         //if((imagetypes() & $imgreq) == $imgreq)         if (1 == 0)         {             $img = @imagecreatefromjpeg($fname);             if(!$img)                 $err = "Error loading JPEG spot image";             else if(!($img2 = imagecreatetruecolor($size, $size)))                 $err = "Unable to create image resource";             else if(!imagecopyresampled($img2, $img, 0, 0,                     $x, $y, $size, $size, $pix, $pix))             {                 $err = "Unable to cut from JPEG";             }             else if(!imagepng($img2))                 $err = "Unable to create PNG spot image";         }         else         {             error_log("Warning: Using external programs (instead of gd)".                       " to cut spot image");             if($size != $pix)                 $rescale = "| pnmscale ­xsize=$size ­ys ize=$size";             else                 $rescale = "";             $fname = escapeshellarg($fname);             //error_log("file = $fname");             passthru("djpeg $fname  |pn mcut $x $y $pix $pix ".                     "$rescale | pnmtopng ".                     "2>>".escapeshellarg("$config[logDir]/spotimage.log"),                     $rc);                          if($rc)                  $err = "Image cutter returned $rc";         }         if($err != "")             header("Content­type: text/html");}

Note : The parameters have to be adjusted according to the software used.

Sigenae 10/39

Page 11: MODIFICATIONS IN BASE V.3 SIGENAE · Sigenae - Modifications February 2005 I - Presentation We used BASE since two years and we appreciated really it. We would like to thank the BASE's

Sigenae - Modifications February 2005

b - Modify index on SI_bioassaysdataXXIn BASE: Request for the creation of the stdin.txt where very long. We have addedindex.

In Include/drivers/pgsql.inc.php

if($ok && ($from == "TemplateBioAssayData")){       //$query = "CREATE INDEX {$to}_index ON $to ".       //      "USING btree (\"bioAssay\", reporter)";       //$ok = (bool)query($query);       $query = "CREATE INDEX {$to}_index ON $to ".        "USING btree (position)";        $ok1 = (bool)query($query);        $query = "CREATE INDEX {$to}_index2 ON $to ".        "USING btree (reporter)";           $ok2 = (bool)query($query);        $ok = $ok1 * $ok2;}

Sigenae 11/39

Page 12: MODIFICATIONS IN BASE V.3 SIGENAE · Sigenae - Modifications February 2005 I - Presentation We used BASE since two years and we appreciated really it. We would like to thank the BASE's

Sigenae - Modifications February 2005

III - Add functionalities

a - Links toward differents databases

In BASE: The reporterId is linked in BASE to ncbi, but the clones used by biologistshave not necessary an identifiant in this database.

To make the link with ours own databases (and others), the function reporterlink()were modified.If the reporterId is a numeric, the link is toward ncbi.If the reporterId begins with ag:: (Id) -> link towards our Sigenae database.If the reporterId begins with em:: (Id) -> link towards http://www.ebi.ac.uk If the reporterId begins with dw:: (Id) -> link towards http://www.chickest.udel.edu ...

Sigenae 12/39

Page 13: MODIFICATIONS IN BASE V.3 SIGENAE · Sigenae - Modifications February 2005 I - Presentation We used BASE since two years and we appreciated really it. We would like to thank the BASE's

Sigenae - Modifications February 2005

In include/local/reporter_columns.inc.php

 function reporterLink(&$rid){

if(!$rid)          return html($rid);     else     {     if (is_numeric($rid))     {         // IMAGE CloneID         return "<a class=ext target=_blank href=\"".         "http://www.ncbi.nlm.nih.gov:80/entrez/query.fcgi?cmd=search".         "&doptcmdl=DocSum&db=nucleotide&term=".                    urlencode("\"image[$rid]\"")."\">".html($rid)."</a>";     }     else     {         $rid_head = substr($rid,0,4);         $rid_tail = substr($rid,4,strlen($rid) ­ 3);         switch($rid_head)         {             case 'em::':             {                return "<a class=ext target=_blank href=\"".                       "http://www.ebi.ac.uk/cgi­bin/dbfetch?".rawurlencode($rid_tail).                       "\">".html($rid)."</a>";                break;             }

   // case 'ag::' : ...   // case 'dw::' : ... 

             default :             {                 return html($rid);                 break;             }         }}

b - Result file formats for differents softwaresImages are quantified with BZScan in our laboratories but fields present in BASEnot correspond to the intensities calculated by BZScan (No field 'Q(Image,Constante)', 'Q(Image,Variable)', 'Fit Correction' ...)..

Sigenae 13/39

Page 14: MODIFICATIONS IN BASE V.3 SIGENAE · Sigenae - Modifications February 2005 I - Presentation We used BASE since two years and we appreciated really it. We would like to thank the BASE's

Sigenae - Modifications February 2005

i - Step 1 : Add desired columns in the table rawbioassaydata. SIGENA_base=> \d rawbioassaydata      Table "rawbioassaydata"   Column    |   Type   | Modifiers ­­­­­­­­­­­­­+­­­­­­­­­­+­­­­­­­­­­­ rawBioAssay | integer  |  position    | integer  |  element     | integer  |  reporter    | integer  |  block       | smallint |  numCol      | smallint |  numRow      | smallint |  x           | real     |  y           | real     |  dia         | real     |  FCh1Total   | real     |  FCh1Median  | real     |  FCh1Mean    | real     |  FCh1SD      | real     |  BCh1Total   | real     |  BCh1Median  | real     |  BCh1Mean    | real     |  BCh1SD      | real     |  percCh1SD1  | smallint |  percCh1SD2  | smallint |  percCh1Sat  | smallint |  FCh2Total   | real     |  FCh2Median  | real     |  FCh2Mean    | real     |  FCh2SD      | real     |  BCh2Total   | real     |  BCh2Median  | real     |  BCh2Mean    | real     |  BCh2SD      | real     |  percCh2SD1  | smallint |  percCh2SD2  | smallint | 

Sigenae 14/39

Page 15: MODIFICATIONS IN BASE V.3 SIGENAE · Sigenae - Modifications February 2005 I - Presentation We used BASE since two years and we appreciated really it. We would like to thank the BASE's

Sigenae - Modifications February 2005

 percCh2Sat  | smallint |  ratiosSD    | real     |  rgnRatio    | real     |  rgnR2       | real     |  FPixels     | smallint |  BPixels     | smallint |  flags       | smallint |  MValue      | real     |  CV          | real     |  QImCst      | real     |  QImVar      | real     |   ...

ii - Step 2 : Modify the php file to present the added columns

In include/local/raw_columns.inc.php

Note that for PostgreSQL the order of the columns must be the exact same as in thephp file, and all columns must be present. (The underlined red columns represent theadded columns in our database).

function getColumns(){  return array(  array("dia", XCOL_FLOAT, "Spot size", 4),  array("FCh1Total", XCOL_FLOAT, "Ch1 FG total", 2),   array("FCh1Median", XCOL_FLOAT, "Ch1 FG median", 2),  array("FCh1Mean", XCOL_FLOAT, "Ch1 FG mean", 2),  array("FCh1SD", XCOL_FLOAT, "Ch1 FG stddev", 1),  array("BCh1Total" , XCOL_FLOAT, "Ch1 BG Total", 2),  array("BCh1Median", XCOL_FLOAT, "Ch1 BG median", 2),  array("BCh1Mean", XCOL_FLOAT, "Ch1 BG mean", 2),  array("BCh1SD", XCOL_FLOAT, "Ch1 BG stddev", 1),  array("percCh1SD1", XCOL_TINYINT, "Ch1 %pix w/ FG > BG+1SD", 1),  array("percCh1SD2", XCOL_TINYINT, "Ch1 %pix w/ FG > BG+2SD", 1),  array("percCh1Sat", XCOL_TINYINT, "Ch1 %pix saturated", 1),  array("FCh2Total", XCOL_FLOAT, "Ch2 FG total", 2),  array("FCh2Median", XCOL_FLOAT, "Ch2 FG median", 2),  array("FCh2Mean", XCOL_FLOAT, "Ch2 FG mean", 2),  array("FCh2SD", XCOL_FLOAT, "Ch2 FG stddev", 1),  array("BCh2Total" , XCOL_FLOAT, "Ch2 BG Total", 2),  array("BCh2Median", XCOL_FLOAT, "Ch2 BG median", 2),  array("BCh2Mean", XCOL_FLOAT, "Ch2 BG mean", 2),  array("BCh2SD", XCOL_FLOAT, "Ch2 BG stddev", 1),  array("percCh2SD1", XCOL_TINYINT, "Ch2 %pix w/ FG > BG+1SD", 1),  array("percCh2SD2", XCOL_TINYINT, "Ch2 %pix w/ FG > BG+2SD", 1),  array("percCh2Sat", XCOL_TINYINT, "Ch2 %pix saturated", 1),  array("ratiosSD", XCOL_FLOAT, "Ratios SD", 1),  array("rgnRatio", XCOL_FLOATRATIO, "Rgn. ratio", 3),  array("rgnR2", XCOL_FLOAT, "Rgn. r^2", 1),  array("FPixels", XCOL_SMALLINT, "FG pixels", 1),  array("BPixels", XCOL_SMALLINT, "BG pixels", 1),  array("flags", XCOL_TINYINTNOAVG, "Flags", 4),

Sigenae 15/39

Page 16: MODIFICATIONS IN BASE V.3 SIGENAE · Sigenae - Modifications February 2005 I - Presentation We used BASE since two years and we appreciated really it. We would like to thank the BASE's

Sigenae - Modifications February 2005

  array("MValue", XCOL_FLOAT, "M­value", 1),  array("CV", XCOL_FLOAT, "CV", 1),  array("QImCst", XCOL_FLOAT, "Q(image,const)", 2),  array("QImVar", XCOL_FLOAT, "Q(Im,var)", 2),   ...}

iii - Step 3 : Modify the interface to present the results according to the analysis processor used.

You can add many different columns of quantification if your lab works with differentanalysis processor. To ameliorate the visibility, a function to filter the columnaccording to the analysis processor is described below (Modifications for the rawdata set and filters).

In raw_table.phtml         require_once("getconfig.inc.php");        require_once("init.inc.php");        require_once("bioassay.inc.php");        require_once("reporterlist.inc.php");        require_once("reporter.inc.php");        require_once("search.inc.php");        require_once("searchhtml.inc.php");        require_once("htmlinit.inc.php");        require_once("experiment.inc.php");        require_once("reporterlist_common.inc.php");        require_once("gene_common.inc.php");        require_once("raw.inc.php");        require_once("ware.inc.php");        require_once("ware_common.inc.php");...

line 82<form name=ff action="raw_table.php?i_r=<?= $rawid ?>" method=post><input type=hidden name=location value="<?= html($location, 0) ?>"></table><?        $soft = Software::getNameFromId($raw­>getFeatureSoftware());

// for us, if soft==BZScan => radiactivity, else fluo        if (strtolower($soft) == 'bzscan')                $channels = 1;        else if (strtolower($soft) != 'bzscan')                $channels = 2;        $searchfields = RawBioAssay::dataSearchFields($channels);        $searchtypes = RawBioAssay::dataSearchTypes($channels);        $userid = $curUser­>getId();        $search = makeSearchTable($curUser, "rawdata", "User", $userid,                "rawdata", $searchfields, $searchtypes, 0, "", true, 0);

?>

line 127<?    RawBioAssay::prepareDataSearch($search, $rawid,

Sigenae 16/39

Page 17: MODIFICATIONS IN BASE V.3 SIGENAE · Sigenae - Modifications February 2005 I - Presentation We used BASE since two years and we appreciated really it. We would like to thank the BASE's

Sigenae - Modifications February 2005

           $curDisplay­>getHitsPerPage(),$channels);

    $process = $raw­>getFeatureSoftware();        $columns = makeDataSearchColumns(1, $lims, $rawLevel, $repLevel,                $raw­>getHasSpotImages(), $soft);    $raw­>addDataSearchColumns($search, $columns,$channels);

....

function makeDataSearchColumns($show = 1, $lims, $rawLevel, $repLevel,$spots, $soft){     $gshow = $show && $repLevel < 5 ? 1 : 0;     $cols = array(             array("rawPosition", false, "Pos", 1,                   "renderExplorePositionRaw", $show),             array("reporterId", false, "Reporter", 1, 3, $show));     if($gshow)     {           $cols[] = array("clusterId", false, "Cluster", 1, 4, $show,                           "s" => array("species", "clusterId"));           $cols[] = array("species", false, false, 0, 0, $show);           $cols[] = array("geneSymbol", false, "Gene", 1, 1, $show);     }          if (strtolower($soft) != 'bzscan' )        {                $rawcols = RawBioAssayData::getAllShownFluoColumns();        }        else if (strtolower($soft) == 'bzscan')        {                $rawcols = RawBioAssayData::getAllShownBZScanColumns();        }

     $rawcols = xcolFilterColumns($rawcols, $rawLevel);     for($i = 0; $i < count($rawcols); $i++)     {           $rc =& $rawcols[$i];           $cols[] = array($rc[0], false, $rc[2],                     xcolDefaultOrder($rc[1]), 1, $show);     }     unset($rc);

     if($lims)     {        $cols[] = array("element", false,                  array("SeqVer", 3, array(1, "Bands", 1, "BactGrowth",                        1)), 0, "renderExploreBackend$lims", $show);     }     if($spots)     {         $cols[] = array("spots", false, array("Sp", $spots),0,                         "renderSpots", 0, "w" => 1);

Sigenae 17/39

Page 18: MODIFICATIONS IN BASE V.3 SIGENAE · Sigenae - Modifications February 2005 I - Presentation We used BASE since two years and we appreciated really it. We would like to thank the BASE's

Sigenae - Modifications February 2005

     }     if($gshow)     {         $cols[] = array("geneName", false, "Reporter name", 1,                         "renderGeneName", $show);     }

     $rep = ReporterColumn::getColumns();     $rep = xcolFilterColumns($rep, $repLevel);     for($i = 0; $i < count($rep); $i++)     {         $rc =& $rep[$i];         $cols[] = array($rc[0], false, $rc[2],                   xcolDefaultOrder($rc[1]), 2, $show);         unset($rc);     }

     return $cols;}

In include/local/raw_columns.inc.php

// add this functionfunction getFluoColumns(){   return array(   array("dia", XCOL_FLOAT, "Spot size", 4),   array("FCh1Total", XCOL_FLOAT, "Ch1 FG total", 2),    array("FCh1Median", XCOL_FLOAT, "Ch1 FG median", 2),   array("FCh1Mean", XCOL_FLOAT, "Ch1 FG mean", 2),   array("FCh1SD", XCOL_FLOAT, "Ch1 FG stddev", 1),   array("BCh1Total", XCOL_FLOAT, "Ch1 BG total", 2),    array("BCh1Median", XCOL_FLOAT, "Ch1 BG median", 2),   array("BCh1Mean", XCOL_FLOAT, "Ch1 BG mean", 2),   array("BCh1SD", XCOL_FLOAT, "Ch1 BG stddev", 1),   array("percCh1SD1", XCOL_TINYINT, "Ch1 %pix w/ FG > BG+1SD", 1),   array("percCh1SD2", XCOL_TINYINT, "Ch1 %pix w/ FG > BG+2SD", 1),   array("percCh1Sat", XCOL_TINYINT, "Ch1 %pix saturated", 1),   array("FCh2Total", XCOL_FLOAT, "Ch2 FG total", 2),    array("FCh2Median", XCOL_FLOAT, "Ch2 FG median", 2),   array("FCh2Mean", XCOL_FLOAT, "Ch2 FG mean", 2),   array("FCh2SD", XCOL_FLOAT, "Ch2 FG stddev", 1),   array("BCh2total", XCOL_FLOAT, "Ch2 BG total", 2),   array("BCh2Median", XCOL_FLOAT, "Ch2 BG median", 2),   array("BCh2Mean", XCOL_FLOAT, "Ch2 BG mean", 2),   array("BCh2SD", XCOL_FLOAT, "Ch2 BG stddev", 1),   array("percCh2SD1", XCOL_TINYINT, "Ch2 %pix w/ FG > BG+1SD", 1),   array("percCh2SD2", XCOL_TINYINT, "Ch2 %pix w/ FG > BG+2SD", 1),   array("percCh2Sat", XCOL_TINYINT, "Ch2 %pix saturated", 1),   array("ratiosSD", XCOL_FLOAT, "Ratios SD", 1),   array("rgnRatio", XCOL_FLOATRATIO, "Rgn. ratio", 3),   array("rgnR2", XCOL_FLOAT, "Rgn. r^2", 1),   array("FPixels", XCOL_SMALLINT, "FG pixels", 1),   array("BPixels", XCOL_SMALLINT, "BG pixels", 1),   array("flags", XCOL_TINYINTNOAVG, "Flags", 4),   array("MValue", XCOL_FLOAT, "M­value", 3)

Sigenae 18/39

Page 19: MODIFICATIONS IN BASE V.3 SIGENAE · Sigenae - Modifications February 2005 I - Presentation We used BASE since two years and we appreciated really it. We would like to thank the BASE's

Sigenae - Modifications February 2005

   );}

function getAllShownFluoColumns(){         static $a = false;         if(!$a)         {           $a = array_merge(RawBioAssayData::getBasicShownColumns(),                            RawBioAssayData::getFluoColumns());         }         return $a;}

// function for another software : BZScanfunction getBZScanColumns(){   return array(          array("dia", XCOL_FLOAT, "Spot size", 4),          array("CV", XCOL_FLOAT, "CV", 1),          array("QImCst", XCOL_FLOAT, "Q(image,const)", 3),          array("QFitVar", XCOL_FLOAT, "Q(fit,var)", 2),          array("FitCorr1", XCOL_FLOAT, "Fit correction", 2),          array("FitCorr2", XCOL_FLOAT, "Fit correction2", 1),          array("OverCorr", XCOL_FLOAT, "Overshining correction", 2),          array("QM", XCOL_FLOAT, "QM", 1),          array("SpotQual", XCOL_FLOAT, "Spot Quality", 2),          array("QImVar", XCOL_FLOAT, "Q(image,var)", 2),          array("QFitCst", XCOL_FLOAT, "Q(fit,const)", 2)       );}

function getAllShownBZScanColumns() {         static $a = false;         if(!$a)         {           $a = array_merge(RawBioAssayData::getBasicShownColumns(),                            RawBioAssayData::getBZScanColumns());         }         return $a;}

...function getExpressions($channels){    static $a = false;    if($a)        return $a;    if (($channels == 2) || !(isset($channels)))        $a = array(    array("flags", SEARCH_INTNOAVG, "%%.flags", "Flags"),                array("dia", SEARCH_FLOAT, "%%.dia","Spot diameter"),         array("CCh1Median", SEARCH_FLOAT, 

Sigenae 19/39

Page 20: MODIFICATIONS IN BASE V.3 SIGENAE · Sigenae - Modifications February 2005 I - Presentation We used BASE since two years and we appreciated really it. We would like to thank the BASE's

Sigenae - Modifications February 2005

"%%.`FCh1Median`­%%.`BCh1Median`","Ch1 bgcorr median"),         array("CCh2Median", SEARCH_FLOAT, 

"%%.`FCh2Median`­%%.`BCh2Median`","Ch2 bgcorr median"),                    array("MedianRatio",    SEARCH_FLOATRATIO,                     db_func_div("(%%.`FCh1Median`­%%.`BCh1Median`)",                                "(%%.`FCh2Median`­%%.`BCh2Median`)"),                                "Ratio, bgcorr median"),

                    array("CCh1Mean", SEARCH_FLOAT,   "%%.`FCh1Mean`­%%.`BCh1Mean`","Ch1 bgcorr mean"),

                    array("CCh2Mean", SEARCH_FLOAT, "%%.`FCh2Mean`­%%.`BCh2Mean`", "Ch2 bgcorr mean"),

                    array("CCh1Total", SEARCH_FLOAT,    "%%.`FCh1Total`­%%.`BCh1Total`", "Ch1 bgcorr total"),             array("CCh2Total", SEARCH_FLOAT,   

"%%.`FCh2Total`­%%.`BCh2Total`",Ch2 bgcorr total"),array("MeanRatio",      SEARCH_FLOATRATIO,

                db_func_div("(%%.`FCh1Mean`­%%.`BCh1Mean`)",                                "(%%.`FCh2Mean`­%%.`BCh2Mean`)"),                                "Ratio, bgcorr mean"),

                    array("SNRCh1Median", SEARCH_FLOAT,                    db_func_div("(%%.`FCh1Median`­%%.`BCh1Median`)",

 "%%.`BCh1SD`"),                                "SNR ch1 median"),                    array("SNRCh2Median", SEARCH_FLOAT,                    db_func_div("(%%.`FCh2Median`­%%.`BCh2Median`)",

 "%%.`BCh2SD`"),                                "SNR ch2 median"),                    array("SNRCh1Mean", SEARCH_FLOAT,                    db_func_div("(%%.`FCh1Mean`­%%.`BCh1Mean`)",   "%%.`BCh1SD`"),                                "SNR ch1 mean"),                    array("SNRCh2Mean", SEARCH_FLOAT,                    db_func_div("(%%.`FCh2Mean`­%%.`BCh2Mean`)", 

  "%%.`BCh2SD`"),                                "SNR ch2 mean"),                array("x", SEARCH_FLOAT, "%%.`x`", "X coordinate"),         array("y", SEARCH_FLOAT,   "%%.`y`", "Y coordinate"),                         array("rawPosition", SEARCH_INTNOAVG, "%%.`position`",

"Position")      );

if ($channels==1 )         $a = array(          array("flags", SEARCH_INTNOAVG, "%%.flags", "Flags"),          array("dia",SEARCH_FLOAT,"%%.dia", "Spot diameter"),

array("x", SEARCH_FLOAT, "%%.`x`", "X coordinate"),        array("y", SEARCH_FLOAT, "%%.`y`", "Y coordinate"),        array("rawPosition",   SEARCH_INTNOAVG,   "%%.`position`","Position")       );

 // Add all raw columns (except utterly unimportant ones), sorted by // importance, but don't repeat previously included ones.      if (!isset($channels))         $cols =& RawBioAssayData::getAllShownColumns();

Sigenae 20/39

Page 21: MODIFICATIONS IN BASE V.3 SIGENAE · Sigenae - Modifications February 2005 I - Presentation We used BASE since two years and we appreciated really it. We would like to thank the BASE's

Sigenae - Modifications February 2005

      else         {    if ($channels ==2)       $cols =& RawBioAssayData::getAllShownFluoColumns();       if ($channels == 1 )                                                 $cols =& RawBioAssayData::getAllShownBZScanColumns();     }

$used = array_flip(array("dia", "flags", "x", "y"));     for($imp = 3; $imp > 0; $imp­­)     {        for($i = 0; $i < count($cols); $i++)        {           $c =& $cols[$i];           if($c[3] != $imp || isset($used[$c[0]]))               continue;           $a[] = array($c[0], xcolToSearchType($c[1]),               "%%.`$c[0]`", $c[2]);        }    }    return $a;}

// Attempts to weed out trivial expressions.function getComplexExpressions(){   static $a = false;   if($a)      return $a;  $b = RawBioAssayData::getExpressions($channels);  $a = array();  for($i = 0; $i < count($b); $i++)  {     if(substr_count($b[$i][2], "%%") > 1)       $a[] = $b[$i];  }   return $a;}

c - Add calculation method

As we add fields for the raw results files, we add some new calculation methods forcreating a BioAssaySet.

Sigenae 21/39

Page 22: MODIFICATIONS IN BASE V.3 SIGENAE · Sigenae - Modifications February 2005 I - Presentation We used BASE since two years and we appreciated really it. We would like to thank the BASE's

Sigenae - Modifications February 2005

In include/local/raw_columns.inc.php

function getIntensityMeasures(){    // Calculation method for one channel experiment    return array(       array(1, "P33­1", "Median FG",                 "`FCh1Median`", ""),       array(1, "P33­2", "Mean FG",                 "`FCh1Mean`", ""),       array(1, "P33­3", "Standard Deviation FG",                "`FCh1SD`", ""),       array(1, "P33­4", "Total FG",                 "`FCh1Total`", ""),       array(1, "P33­5", "Median FG ­ Median BG",                 "`FCh1Median`­`BCh1Median`", ""),       array(1, "P33­6","Mean FG ­ Mean BG",                "`FCh1Mean`­`BCh1Mean`", ""),       array(1, "P33­7", "Total FG ­ Total BG",                "`FCh1Total`­`BCh1Total`", ""),       array(1, "P33­8", "Fit Correction 1",                 " `FitCorr1`",""),       array(1, "P33­9", "Fit Correction 2",                 " `FitCorr2`",""),       array(1, "P33­10", "Q(Fit,Const)",                " `QFitCst`",""),       array(1, "P33­11", "Q(Fit,Var)",                 " `QFitVar`",""),       array(1, "P33­12", "Q(Im,Cst)",                 " `QImCst`",""),       array(1, "P33­13", "Q(Im,Var)",                 " `QImVar`",""),        // Calculation method for two channels experiment       array(2, "CTotal", "Total FG ­ Total BG",                 "`FCh1Total`­`BCh1Total`", "",                 "`FCh2Total`­`BCh2Total`", ""),       array(2, "CMedian", "Median FG ­ Median BG",                "`FCh1Median`­`BCh1Median`", "",                "`FCh2Median`­`BCh2Median`", ""),       array(2, "CMean", "Mean FG ­ Mean BG",                "`FCh1Mean`­`BCh1Mean`", "",                "`FCh2Mean`­`BCh2Mean`", ""),       array(2, "FMedianBMean", "Median FG ­ Mean BG",                "`FCh1Median`­`BCh1Mean`", "",                "`FCh2Median`­`BCh2Mean`", ""),       array(2, "FMeanBMedian", "Mean FG ­ Median BG",                "`FCh1Mean`­`BCh1Median`", "",                "`FCh2Mean`­`BCh2Median`", ""),

       array(2, "FTotal", "Total FG",                "`FCh1Total`", "",                "`FCh2Total`", ""),       array(2, "FMedian", "Median FG",                "`FCh1Median`", "",                "`FCh2Median`", ""),

Sigenae 22/39

Page 23: MODIFICATIONS IN BASE V.3 SIGENAE · Sigenae - Modifications February 2005 I - Presentation We used BASE since two years and we appreciated really it. We would like to thank the BASE's

Sigenae - Modifications February 2005

       array(2, "FMean", "Mean FG",                "`FCh1Mean`", "",                "`FCh2Mean`", ""),

....    );}

d - Experiment plotter

As we add fields for the raw results files, we have to add some new calculationmethods for creating plots.

In include/local/raw_columns.inc.php

// For the experiment plotter. Returns an array of// array(descr, avg­expr, stddev­expr) with things that can be plotted.function getExperimentAverages(){  return array(

array("Mean(Total ch1 FG)", "AVG(%%.`FCh1Total`)",                   "STDDEV(%%.`FCh1Total`)"),   array("Mean(Total ch2 FG)", "AVG(%%.`FCh2Total`)",             "STDDEV(%%.`FCh2Mean`)"),

Sigenae 23/39

Page 24: MODIFICATIONS IN BASE V.3 SIGENAE · Sigenae - Modifications February 2005 I - Presentation We used BASE since two years and we appreciated really it. We would like to thank the BASE's

Sigenae - Modifications February 2005

     array("Mean(Total ch1 BG)", "AVG(%%.`BCh1Total`)",             "STDDEV(%%.`BCh1total`)"),   array("Mean(Total ch2 BG)", "AVG(%%.`BCh2total`)",             "STDDEV(%%.`BCh2Total`)"),     array("Mean(Total FG)", ".5*AVG(%%.`FCh1Total`+%%.`FCh2Total`)",             ".5*STDDEV(%%.`FCh1Total`+%%.`FCh2Total`)"),    array("Mean(Total BG)", ".5*AVG(%%.`BCh1Total`+%%.`BCh2Total`)",             ".5*STDDEV(%%.`BCh1Total`+%%.`BCh2Total`)"),       array("Mean(Mean ch1 FG)", "AVG(%%.`FCh1Mean`)",             "STDDEV(%%.`FCh1Mean`)"),       array("Mean(Mean ch2 FG)", "AVG(%%.`FCh2Mean`)",             "STDDEV(%%.`FCh2Mean`)"),       array("Mean(Mean ch1 BG)", "AVG(%%.`BCh1Mean`)",             "STDDEV(%%.`BCh1Mean`)"),       array("Mean(Mean ch2 BG)", "AVG(%%.`BCh2Mean`)",             "STDDEV(%%.`BCh2Mean`)"),       array("Mean(Mean FG)", ".5*AVG(%%.`FCh1Mean`+%%.`FCh2Mean`)",             ".5*STDDEV(%%.`FCh1Mean`+%%.`FCh2Mean`)"),       array("Mean(Mean BG)", ".5*AVG(%%.`BCh1Mean`+%%.`BCh2Mean`)",             ".5*STDDEV(%%.`BCh1Mean`+%%.`BCh2Mean`)"),

       array("Mean(Median ch1 FG)", "AVG(%%.`FCh1Median`)",             "STDDEV(%%.`FCh1Median`)"),       array("Mean(Median ch2 FG)", "AVG(%%.`FCh2Median`)",             "STDDEV(%%.`FCh2Median`)"),       array("Mean(Median ch1 BG)", "AVG(%%.`BCh1Median`)",             "STDDEV(%%.`BCh1Median`)"),       array("Mean(Median ch2 BG)", "AVG(%%.`BCh2Median`)",             "STDDEV(%%.`BCh2Median`)"),      array("Mean(Median FG)", ".5*AVG(%%.`FCh1Median`+%%.`FCh2Median`)",            ".5*STDDEV(%%.`FCh1Median`+%%.`FCh2Median`)"),      array("Mean(Median BG)", ".5*AVG(%%.`BCh1Median`+%%.`BCh2Median`)",            ".5*STDDEV(%%.`BCh1Median`+%%.`BCh2Median`)"),       array("Mean(Q(fit,Cst))", "AVG(%%.`QFitCst`)",             "STDDEV(%%.`QFitCst`)"),       array("Mean(Q(fit,Var))", "AVG(%%.`QFitVar`)",             "STDDEV(%%.`QFitVar`)"),       array("Mean(Q(Image,const))", "AVG(%%.`QImCst`)",             "STDDEV(%%.`QImCst`)"),       array("Mean(Q(Image,var))", "AVG(%%.`QImVar`)",             "STDDEV(%%.`QImVar`)"),       array("Mean(Fit correction)", "AVG(%%.`FitCorr1`)",             "STDDEV(%%.`FitCorr1`)"),       array("Mean(Fit correction2)", "AVG(%%.`FitCorr2`)",             "STDDEV(%%.`FitCorr2`)"),       array("Mean(Overshining correction)", "AVG(%%.`OverCorr`)",             "STDDEV(%%.`OverCorr`)"),       array("Per cent flagged", "100.0*SUM(".db_cast_boolean_int("rbad.flags<> 0").")/COUNT(rbad.flags)",            "0")   );}

Sigenae 24/39

Page 25: MODIFICATIONS IN BASE V.3 SIGENAE · Sigenae - Modifications February 2005 I - Presentation We used BASE since two years and we appreciated really it. We would like to thank the BASE's

Sigenae - Modifications February 2005

in include/classes/bioassay.inc.php

function boundDataExpressions($channels, $average, $setid,$forExport =false){

$channels = (int)$channels;if($channels == 1){

$arr = array(array("intensity1", SEARCH_FLOAT, "%%.intensity1", "Intensity"),array("l2intensity1", SEARCH_FLOATEXP, "%%.intensity1",

"log2(Intensity)"),array("l10intensity1", SEARCH_FLOATEXP, "%%.intensity1",

"log10(Intensity)"));}else if($channels == 2){

$arr = array(array("ratio1_2", SEARCH_FLOATRATIO,db_func_div("%%.intensity1", "%%.intensity2"), "Ratio"),array("intensity1", SEARCH_FLOAT, "%%.intensity1", "Int ch1"),array("intensity2", SEARCH_FLOAT, "%%.intensity2", "Int ch2"),

array("l2ratio1_2", SEARCH_FLOATEXP,db_func_div("%%.intensity1", "%%.intensity2"),"M, log2(Ratio)"),

array("l10intgmean1_2", SEARCH_FLOAT,".5*".db_func_log("%%.intensity1*%%.intensity2", 10),"A, log10(sqrt(Ch1*Ch2))"),

array("l2intsum1_2", SEARCH_FLOATEXP,"%%.intensity1+%%.intensity2", "log2(Ch1+Ch2)"),

array("maxint1_2", SEARCH_FLOAT,"(CASE WHEN %%.intensity1 > %%.intensity2 "."THEN %%.intensity1 ELSE %%.intensity2 END)","max(int ch1,int ch2)")

);}

e - Add method for filtering

As we work with different image processor, some filters are specific to software.

In include/local/raw_columns.inc.php

function getExpressions($channels){

static $a = false;if($a)

return $a;if (($channels == 2) || !(isset($channels)))

$a = array(array("flags", SEARCH_INTNOAVG, "%%.flags", "Flags"),array("dia",   SEARCH_FLOAT,   "%%.dia",       "Spot diameter"),

Sigenae 25/39

Page 26: MODIFICATIONS IN BASE V.3 SIGENAE · Sigenae - Modifications February 2005 I - Presentation We used BASE since two years and we appreciated really it. We would like to thank the BASE's

Sigenae - Modifications February 2005

array("CCh1Median", SEARCH_FLOAT, "%%.`FCh1Median`­%%.`BCh1Median`","Ch1 bgcorr median"),

array("CCh2Median", SEARCH_FLOAT, "%%.`FCh2Median`­%%.`BCh2Median`","Ch2 bgcorr median"),

array("MedianRatio", SEARCH_FLOATRATIO,db_func_div("(%%.`FCh1Median`­%%.`BCh1Median`)","(%%.`FCh2Median`­%%.`BCh2Median`)"),"Ratio, bgcorr median"),

array("CCh1Mean", SEARCH_FLOAT,   "%%.`FCh1Mean`­%%.`BCh1Mean`","Ch1 bgcorr mean"),

array("CCh2Mean", SEARCH_FLOAT,   "%%.`FCh2Mean`­%%.`BCh2Mean`","Ch2 bgcorr mean"),

array("CCh1Total", SEARCH_FLOAT,   "%%.`FCh1Total`­%%.`BCh1Total`","Ch1 bgcorr total"),

array("CCh2Total", SEARCH_FLOAT,   "%%.`FCh2Total`­%%.`BCh2Total`","Ch2 bgcorr total"),

array("MeanRatio", SEARCH_FLOATRATIO,db_func_div("(%%.`FCh1Mean`­%%.`BCh1Mean`)","(%%.`FCh2Mean`­%%.`BCh2Mean`)"),"Ratio, bgcorr mean"),

array("SNRCh1Median", SEARCH_FLOAT,db_func_div("(%%.`FCh1Median`­%%.`BCh1Median`)", "%%.`BCh1SD`"),"SNR ch1 median"),

array("SNRCh2Median", SEARCH_FLOAT,db_func_div("(%%.`FCh2Median`­%%.`BCh2Median`)", "%%.`BCh2SD`"),"SNR ch2 median"),

array("SNRCh1Mean", SEARCH_FLOAT,db_func_div("(%%.`FCh1Mean`­%%.`BCh1Mean`)", "%%.`BCh1SD`"),"SNR ch1 mean"),

array("SNRCh2Mean", SEARCH_FLOAT,db_func_div("(%%.`FCh2Mean`­%%.`BCh2Mean`)", "%%.`BCh2SD`"),"SNR ch2 mean"),

array("x", SEARCH_FLOAT,   "%%.`x`", "X coordinate"),array("y", SEARCH_FLOAT,   "%%.`y`", "Y coordinate"),array("rawPosition", SEARCH_INTNOAVG, "%%.`position`", "Position"));

if ($channels==1 )$a = array(

array("flags", SEARCH_INTNOAVG, "%%.flags", "Flags"),array("dia", SEARCH_FLOAT,   "%%.dia",       "Spot diameter"),

array("x", SEARCH_FLOAT,   "%%.`x`", "X coordinate"),array("y", SEARCH_FLOAT,   "%%.`y`", "Y coordinate"),array("rawPosition", SEARCH_INTNOAVG, "%%.`position`", "Position"));

// Add all raw columns (except utterly unimportant ones), sorted by// importance, but don't repeat previously included ones.if (!isset($channels))

$cols =& RawBioAssayData::getAllShownColumns();else{

Sigenae 26/39

Page 27: MODIFICATIONS IN BASE V.3 SIGENAE · Sigenae - Modifications February 2005 I - Presentation We used BASE since two years and we appreciated really it. We would like to thank the BASE's

Sigenae - Modifications February 2005

if ($channels ==2)                                              $cols =& RawBioAssayData::getAllShownFluoColumns();

if ($channels == 1 )$cols =& RawBioAssayData::getAllShownBZScanColumns();

}$used = array_flip(array("dia", "flags", "x", "y"));for($imp = 3; $imp > 0; $imp­­){

for($i = 0; $i < count($cols); $i++){

$c =& $cols[$i];if($c[3] != $imp || isset($used[$c[0]]))

continue;$a[] = array($c[0], xcolToSearchType($c[1]),"%%.`$c[0]`", $c[2]);

}}

return $a;}

// Attempts to weed out trivial expressions.function getComplexExpressions(){

static $a = false;if($a)

return $a;$b = RawBioAssayData::getExpressions($channels);$a = array();for($i = 0; $i < count($b); $i++){

if(substr_count($b[$i][2], "%%") > 1)$a[] = $b[$i];

}return $a;

}

Sigenae 27/39

Page 28: MODIFICATIONS IN BASE V.3 SIGENAE · Sigenae - Modifications February 2005 I - Presentation We used BASE since two years and we appreciated really it. We would like to thank the BASE's

Sigenae - Modifications February 2005

f - Export data

eisen export data was available only for two channels in BASE.

In www/gene_export.phtml

To export one channel data, modify the gene_export.phtml file.Line 185 ://else if($exp­>getChannels() >= 2)else if($exp­>getChannels() >= 1){    // Non­BASEfile formats    $columns = array("reporterId");    if($exp­>getChannels() >= 2){       $fields = array("ratio1_2");}    if($exp­>getChannels() == 1){       $fields = array("intensity1");}     if($format == 1)    {

$columns[] = "geneName";if ($exp­>getChannels() >= 2){$callback = "eisenCB";}else if ($exp­>getChannels() == 1){$callback = "eisenCB1";}

    }    else if($format == 2)    {         if ($exp­>getChannels() >= 2){         $callback = "eisenCB2";}

Sigenae 28/39

Page 29: MODIFICATIONS IN BASE V.3 SIGENAE · Sigenae - Modifications February 2005 I - Presentation We used BASE since two years and we appreciated really it. We would like to thank the BASE's

Sigenae - Modifications February 2005

         else if ($exp­>getChannels() == 1){         $callback = "eisenCB21";}    }    else if($format == 3)    {        $columns[] = "geneName";        if ($exp­>getChannels() >= 2){           $callback = "tmevCB";}        else if ($exp­>getChannels() == 1){           $callback = "tmevCB1";}    }    else  // $format == 4    {

if ($exp­>getChannels() >= 2){$callback = "geneclustCB";}else if ($exp­>getChannels() == 1){$callback = "geneclustCB1";}

    }

    .....}

.....    for($i = 0, $odd = 1; $i < count($formats); $i++, $odd ^= 1)    {    // Skip formats that require 2 channels if we don't have that    //if($i < 3  && $exp­>getChannels() < 2)     //      continue; cd    ...    }

function eisenCB1(&$arr){    static $i = 0;    global $genes, $assayids;    $m =& $arr[0][0];    $p =& $arr[0][1];    if(!isset($genes[$m][$p]))    {        error_log("Missing reporter for mol/pos $m/$p");        return;    }    $g =& $genes[$m][$p];    $i++;    echo $g["reporterId"]."\t".printable($g["geneName"])."\t1\t$i";    for(reset($assayids); list(, $e) = each($assayids); )    {        if(isset($arr[$e]))        {            echo "\t".$arr[$e]["intensity1"];        }        else        {            echo "\t";        }    }

Sigenae 29/39

Page 30: MODIFICATIONS IN BASE V.3 SIGENAE · Sigenae - Modifications February 2005 I - Presentation We used BASE since two years and we appreciated really it. We would like to thank the BASE's

Sigenae - Modifications February 2005

    echo "\n";}

function eisenCB21(&$arr){    static $i = 0;    global $genes, $assayids;    $m =& $arr[0][0];    $p =& $arr[0][1];    if(!isset($genes[$m][$p]))    {        error_log("Missing reporter for mol/pos $m/$p");        return;    }    $g =& $genes[$m][$p];    $i++;    echo $g["reporterId"]."\t"$g["reporterId"])."\t1\t$i";    for(reset($assayids); list(, $e) = each($assayids); )    {        if(isset($arr[$e]))        {            echo "\t".$arr[$e]["ratio1_2"];        }        else        {            echo "\t";        }    }    echo "\n";}

function geneclustCB1(&$arr){        global $genes, $assayids, $fCount;

        $m =& $arr[0][0];        $p =& $arr[0][1];        if(!isset($genes[$m][$p]))        {                error_log("Missing reporter for mol/pos $m/$p");                return;        }        $g =& $genes[$m][$p];        echo $g["reporterId"];        for(reset($assayids); list(, $e) = each($assayids); )        {                if(isset($arr[$e]))                        echo "\t".$arr[$e]["intensity1"];                else                        echo "\t";

Sigenae 30/39

Page 31: MODIFICATIONS IN BASE V.3 SIGENAE · Sigenae - Modifications February 2005 I - Presentation We used BASE since two years and we appreciated really it. We would like to thank the BASE's

Sigenae - Modifications February 2005

        }        echo "\n";}

g - Settings

When you're changing a color to your Web page, you'll need to use the hex code,which is something that the browser will be able to understand. It is not easy for auser to personalize its interface, so we have included the html code developped byHenri Ruch. ( http://www.henri-ruch.ch/Couleurs/couleurs.asp)

(File added with this document).

Sigenae 31/39

Page 32: MODIFICATIONS IN BASE V.3 SIGENAE · Sigenae - Modifications February 2005 I - Presentation We used BASE since two years and we appreciated really it. We would like to thank the BASE's

Sigenae - Modifications February 2005

h - Add field to filter uploaded files

All files present in your Upload section are displayed when you want to choose one ofthem and it is not easy to retreive the needed files. This part has been modified:

• Only the tif files will be automatically displayed in the 'Select an uploaded file' boxto upload images from a scan.

• You have the possibility to enter a substring for filtering filters in the Select anuploaded file' box.

In include/web/upload_common.inc.php

function uploadInput(&$user, $inputid = "", $removable = true,$filterFunc =false){

$ups = Upload::getBrief($user);    $ffilter = $filterFunc ? " ".html($filterFunc(false)) : "";

$inputbis=$inputid;    if ($inputid != 0 && $inputid!=1)

        $inputid="";...if($ups){

$selsize = (count($ups) > 40) ? 8 : 1;echo "<tr><th>Select an uploaded$ffilter file</th>".

"<td><select name='i_fileid$inputid' size=$selsize>".        "<option value=0>­ none ­\n";

$fid = isset($GLOBALS["i_fileid$inputid"]) ?$GLOBALS["i_fileid$inputid"] : 0;

for(reset($ups); list(, $arr) = each($ups); ){

if(!$arr)echo "<option value=0>­­­­­­­­­\n";

else{

$sel = $fid == $arr["id"] ? "selected" : "";$searchIn = $arr["name"];if   ((($inputbis   ==   0)   ||   ($inputbis   ==   1))   &&

($filterFunc== False))$inputbis = "\.tif";     

     if (isset($inputbis))                               $strg = ereg($inputbis, $searchIn );

 if ($strg == 1 || $inputbis == "")                     echo "<option $sel value=$arr[id]>".html($arr["name"],

0).    " (".readableBytes($arr["fileSize"]).")\n";

}}echo "</select></td></tr>\n";

$pick = "Or pick";

Sigenae 32/39

Page 33: MODIFICATIONS IN BASE V.3 SIGENAE · Sigenae - Modifications February 2005 I - Presentation We used BASE since two years and we appreciated really it. We would like to thank the BASE's

Sigenae - Modifications February 2005

}

...

In arraytype_repmap.php

l.74<form method=post enctype="multipart/form­data"        action="arraytype_repmap.php?i_at=<?= $atid ?>"><input type=hidden name=location value="<?= html($location, 0) ?>"><tr><td colspan=2><a class=large href="<?= html($location, 0) ?>"        >Return</a></td></tr><?                if($err != "")                        echo "<tr><td colspan=2 class=red>Error:$err</td></tr>\n";?><tr><th>Array design</th><td><?= html($at­>getName()) ?></td></tr><?        $filter = isset($i_filter) ? $i_filter : "";?><tr><th>Filter for uploaded file</th><td><input type=text name=i_filtervalue = "<?= $filter ?>" size=30>        <input type=submit value="Refresh"></td></tr><?

Sigenae 33/39

Page 34: MODIFICATIONS IN BASE V.3 SIGENAE · Sigenae - Modifications February 2005 I - Presentation We used BASE since two years and we appreciated really it. We would like to thank the BASE's

Sigenae - Modifications February 2005

                uploadInput($curUser,$filter);?><tr><td colspan=2><input type=submit value="Continue"></td></tr></form>

In arraytype_print.php... l.68<form method=post enctype="multipart/form­data"        action="arraytype_print.php?i_at=<?= $atid ?>"><input type=hidden name=location value="<?= html($location, 0) ?>"><tr><td colspan=2><a class=large href="<?= html($location, 0) ?>"        >Return</a></td></tr><?                if($err != "")                        echo "<tr><td colspan=2 class=red>Error:$err</td></tr>\n";?><tr><th>Array design</th><td><?= html($at­>getName()) ?></td></tr><?        $filter = isset($i_filter) ? $i_filter : "";?><tr><th>Filter for uploaded file</th><td><input type=text name=i_filtervalue = "<?= $filter ?>" size=30>        <input type=submit value="Refresh"></td></tr><?                uploadInput($curUser,$filter);?><tr><td colspan=2>&nbsp;</td></tr><tr><td colspan=2><input type=submit value="Continue"></td></tr></form>...

In plate_upload.php...l.66<form name=ff method=post action="plate_upload.php"        enctype="multipart/form­data"><input type=hidden name=location value="<?= html($location, 0) ?>"><?        $filter = isset($i_filter) ? $i_filter : "";?><tr><th>Filter for uploaded file</th><td><input type=text name=i_filtervalue = "<?= $filter ?>" size=30>        <input type=submit value="Refresh"></td></tr><?                if($err != "")                        echo "<tr><td colspan=2 class=red>Error:$err</td></tr>\n";                echo "<tr><td colspan=2>&nbsp;</td></tr>\n";                uploadInput($curUser,$filter);?><tr><td colspan=2><input type=submit value="Continue"></td></tr></form>...

Sigenae 34/39

Page 35: MODIFICATIONS IN BASE V.3 SIGENAE · Sigenae - Modifications February 2005 I - Presentation We used BASE since two years and we appreciated really it. We would like to thank the BASE's

Sigenae - Modifications February 2005

In hyb_result.php...l.474<form method=post action="hyb_result.php?i_acq=<?= $acq­>getId() ?>"        enctype="multipart/form­data"><input type=hidden name=i_popup value=<?= $ispopup ?>><input type=hidden name=location value="<?= html($location, 0) ?>"><?        $filter = isset($i_filter) ? $i_filter : "";?><tr><th>Filter for uploaded file</th><td><input type=text name=i_filtervalue = "<?= $filter ?>" size=30>        <input type=submit value="Refresh"></td></tr><?                uploadInput($curUser,$filter);?><tr><td colspan=2><input type=submit value='Continue'></td></tr><tr><td colspan=2>Or <a <?= href("imagene_join.php", 2)        ?>>merge two Imagene files</a></td></tr></table><?        }?><br><table <?= $cellpad ?>><tr><th colspan=2 class=subhead>Scan info</th></tr><?                acquisitionInfo($acq);                echo "<tr><th colspan=2 class=subhead>Hybridizationinfo</th></tr>\n";                hybInfo($hyb, false, true);?></form>...

In program_list.php...l.159<p><table <?= $cellpad ?>><tr><th class=subhead colspan=2>Import plug­in definition</th></tr><?        $filter = isset($i_filter) ? $i_filter : "";?><form method=post action="program_list.php" enctype="multipart/form­data"><tr><th>Filter for uploaded file</th><td><input type=text name=i_filtervalue = "<?= $filter ?>" size=30><input type=submit value='Refresh'></td></tr></form><form method=post action="program_edit.php"        enctype="multipart/form­data"><?                uploadInput($curUser,$filter);?><tr><td colspan=2><input type=submit value='Continue'></td></tr></table>

Sigenae 35/39

Page 36: MODIFICATIONS IN BASE V.3 SIGENAE · Sigenae - Modifications February 2005 I - Presentation We used BASE since two years and we appreciated really it. We would like to thank the BASE's

Sigenae - Modifications February 2005

...

In protocol_edit.php

...l.155<tr><th>Description</th><td><textarea name=i_descr rows=7 cols=60        ><?= html($proto­>getDescr(), 0) ?></textarea></td></tr><?                $fn = $proto­>getFilename();                if($fn === NULL)                {?><tr><th>Attached file</th><td><?= html(NULL) ?></td></tr><form name=ff method=post action="protocol_list.php"enctype="multipart/form­data"><?        $filter = isset($i_filter) ? $i_filter : "";?><tr><th>Filter for uploaded file</th><td><input type=text name=i_filtervalue = "<?= $filter ?>" size=30><input type=submit value="Refresh"></td></tr></form><?                        uploadInput($curUser,$filter);                }...

In reporter_update.php

...l.60<form method=post action="reporter_update.php"        enctype="multipart/form­data"><input type=hidden name=i_popup value=<?= $ispopup ?>><input type=hidden name=location value="<?= html($location, 0) ?>"><?        $filter = isset($i_filter) ? $i_filter : "";?><tr><th>Filter for uploaded file</th><td><input type=text name=i_filtervalue = "<?= $filter ?>" size=30><input type=submit value="Refresh"></td></tr><?                uploadInput($curUser,$filter);?><tr><td colspan=2><input type=submit value='Continue'></td></tr></table></form>

Sigenae 36/39

Page 37: MODIFICATIONS IN BASE V.3 SIGENAE · Sigenae - Modifications February 2005 I - Presentation We used BASE since two years and we appreciated really it. We would like to thank the BASE's

Sigenae - Modifications February 2005

In reporterlist_edit.php...l.209<tr><th>Mode of operation</th><td><select name=i_append>

$modes = array(Just modify attributes of existing list","Clone list, and append/update reporters");

$append = isset($i_append) ? (int)$i_append : 0;for(reset($modes); list($i, $n) = each($modes); ){

$sel = ($append == $i) ? "selected" : "";echo "<option value=$i $sel>".html($n, 0)."\n";

}echo "</select></td></tr>\n";*/

        $filter = isset($i_filter) ? $i_filter : "";?><tr><th>Filter for uploaded file</th><td><input type=text name=i_filtervalue = "<?= $filter ?>" size=30>        <input type=submit value="Refresh"></td></tr><?

uploadInput($curUser,$filter);

$rowf = isset($i_rowf) ? $i_rowf : 1;$rowt = isset($i_rowt) ? (int)$i_rowt : 0;if($rowt <= 0)

$rowt = "";?>...

In wizzzard_edit.php...l.405<table <?= $cellpad ?>><tr><th colspan=2 class=subhead>Test with an uploaded file</th></tr><?        $filter = isset($i_filter) ? $i_filter : "";?><tr><th>Filter for uploaded file</th><td><input type=text name=i_filtervalue = "<?= $filter ?>" size=30>        <input type=submit value="Refresh"></td></tr><?        uploadInput($curUser, $filter, false);                echo "</select> \n";?><tr><td colspan=2><input type=submit value='Test with file'name=i_filetest>        <?= webHelp(15, 1) ?></td></tr><tr><td colspan=2><input type=submit value=Accept name=i_ok></td></tr><?

        if($fileid && $fd)        {?></table><p>

Sigenae 37/39

Page 38: MODIFICATIONS IN BASE V.3 SIGENAE · Sigenae - Modifications February 2005 I - Presentation We used BASE since two years and we appreciated really it. We would like to thank the BASE's

Sigenae - Modifications February 2005

IV - Strategy

Reused arrays

The laboratories which work with macroarray (nylon membranes) use thesesmembranes four or five twice, but in BASE the arrays can be used only once.

When creating data, we have added the notion of version for an array.There is two strategies when creating array print:Array.x.y : (x -> version, y -> membrane) or Array.x.y : (y -> version, x -> membrane)Where y is generated automatically.

First solution :An array batch which generates automatically the number of hybridization for thearray.

Inconvenient : if you want to create 100 membranes in the same time, is verylong...

Example : Array.a-1 represents the first hybridization of the array a (Arraybatch : Array.a).

Array.version.membrane

Ver

sion Array.a Array.b Array.c Array.d Array.e

1 Array.a.1

2 Array.a.2

3 Array.a.3

The red number are generated automatically, and blue has to be defined by the user. Here you haveas many version as you want for 5 membranes: it is not the better solution.

Second solution :An array batch which generates automatically the number of arrays for the firsthybridization, the second, and so on...

Advantages : Very quick if you have many membranes to create. You have 5'array batches' to create if you re-used your membrane five twice.

Example : Array1-A represents the first hybridization of the array A (Arrayprint : Array1).

Sigenae 38/39

Page 39: MODIFICATIONS IN BASE V.3 SIGENAE · Sigenae - Modifications February 2005 I - Presentation We used BASE since two years and we appreciated really it. We would like to thank the BASE's

Sigenae - Modifications February 2005

Array.membrane.version

mem

bran

e Array.a Array.b Array.c Array.d Array.e

1 Array.a.1

2 Array.a.2

3 Array.a.3

4 Array.a.4

5 Array.a.5The red number are generated automatically, and blue has to be defined by the user. You have as

many membrane as you want for 5 version.

Sigenae 39/39