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; }