public static function newFromProlucidSearchInstance($table, $inst)
 {
     global $toprundir;
     $toprundir = "/tmp/";
     $jobclus = new ProlucidJobCluster();
     $jobclus->setEmail("*****@*****.**");
     $fh = new FileHandler();
     print "\nGenerating input files for [" . $inst->getName() . "]\n";
     $exname = $inst->getPropertyValue("Experiment");
     $ex = new TypeInstance("Experiment", $exname);
     $ex->fetch($table);
     $jobclus->setExperiment($ex);
     // Set the experiment
     $dbname = $inst->getPropertyValue("Protein_Database");
     $db = new TypeInstance("Protein_Database", $dbname);
     $db->fetch($table);
     $dbfile = preg_replace("#http://DUMMYHOST.ROOTDIR/misc/MiniFileView.php/#", "", $db->getPropertyValue("File"));
     $dbfile = $fh->getFilePath($dbfile);
     $jobclus->setDatabaseFile($dbfile);
     // Set the database
     $jobclus->setSourceInstance($inst);
     // Set the source instance
     $jobclus->setSourceType("Prolucid_Search");
     // Set the source type
     $count = 1;
     $jobname = $inst->getName() . "_LSF_Job_" . $count;
     $jobinst = new TypeInstance("LSF_Job", $jobname);
     while ($jobinst->exists($table)) {
         $count++;
         $jobname = $inst->getName() . "_LSF_Job_" . $count;
         $jobinst = new TypeInstance("LSF_Job", $jobname);
     }
     $jobdir = $toprundir . $jobname . "/";
     $outdir = $jobdir . "out";
     $jobclus->setJobName($jobname);
     // Set the job name
     $jobclus->setRunDir($jobdir);
     // Set the job directory
     $jobclus->setOutDir($outdir);
     // Set the output directory
     return $jobclus;
 }
<?php

$topdir = dirname(dirname(__FILE__));
error_reporting(E_ALL);
require_once "{$topdir}/GlobalConfig.php";
require_once "{$topdir}/plugins/HarvardSMLims/ProlucidJobCluster.php";
require_once "{$topdir}/datamodel/TestDB.php";
require_once "Test.php";
$tname = 'semantic_data';
$sqlfile = 'testdb_small.sql';
$sqlfile2 = getcwd() . '/prolucid.sql';
$test = new Test();
$testdb = new TestDB();
$test->result($testdb, "Created TestDB");
$testdb->load_sql($sqlfile2);
$test->result($testdb, "Loaded prolucid sql");
$table = $testdb->getTable();
$test->result($table, "Got Table");
$plinst = new TypeInstance("Prolucid_Search", "PRO00001");
$plinst->fetch($table);
print $plinst->printValues() . "\n";
$jobclus = ProlucidJobCluster::newFromProlucidSearchInstance($table, $plinst);
$jobclus->split();
$test->print_total("ProlucidJobCluster");