Пример #1
0
 /**
 * Documentation for this function.
 */
 function onTryAgain()
 {
     if ($_REQUEST['cmd'] == '< Try again') {
         pageGoto("upload_setup.php");
     } else {
         pageReturn();
     }
 }
Пример #2
0
 /**
 * Launches Prekin when the user submits the form.
 */
 function onChooseOptions()
 {
     $req = $_REQUEST;
     if ($req['cmd'] == 'Cancel') {
         pageReturn();
         return;
     }
     // Otherwise, moving forward:
     if (isset($req['modelID'])) {
         $ctx = array();
         $ctx['modelID'] = $req['modelID'];
         pageGoto("editpdb_setup2.php", $ctx);
     }
 }
Пример #3
0
 /**
 * If the user requested to save changes, make sure we do that before returning.
 */
 function onSaveEntry()
 {
     $req = $_REQUEST;
     // Did we get an edit request?
     if ($req['labbookEditCmd'] == "Save") {
         $labbook = openLabbook();
         if (isset($req['entryNumber'])) {
             $entryNum = $req['entryNumber'];
             $labbook[$entryNum] = $req['labbookEntry'];
             mpLog("notebook-edit:User modified existing lab notebook entry");
         } else {
             $entryNum = count($labbook);
             $labbook[$entryNum] = $req['labbookEntry'];
             mpLog("notebook-add:User added a new entry to the lab notebook");
         }
         saveLabbook($labbook);
     }
     pageReturn();
 }
Пример #4
0
 /**
 * Documentation for this function.
 */
 function onAddH()
 {
     $req = $_REQUEST;
     if ($req['cmd'] == 'Cancel') {
         pageReturn();
         return;
     }
     // Otherwise, moving forward:
     if (isset($req['modelID']) && isset($req['method']) && isset($req['blength'])) {
         unset($_SESSION['bgjob']);
         // Clean up any old data
         $_SESSION['bgjob']['modelID'] = $req['modelID'];
         $_SESSION['bgjob']['makeFlipkin'] = $req['makeFlipkin'];
         $_SESSION['bgjob']['nqh_regularize'] = $req['nqh_regularize'];
         $_SESSION['bgjob']['reduce_blength'] = $req['blength'];
         $_SESSION['reduce_blength'] = $_SESSION['bgjob']['reduce_blength'];
         if ($req['method'] == 'build') {
             if ($_SESSION['bgjob']['reduce_blength'] == 'ecloud') {
                 mpLog("reduce-build:User ran default Reduce -build job; flipkins=" . $_REQUEST['makeFlipkin']);
             } else {
                 mpLog("reduce-build:User ran default Reduce -build -nuclear job; flipkins=" . $_REQUEST['makeFlipkin']);
             }
             // launch background job
             pageGoto("job_progress.php");
             launchBackground(MP_BASE_DIR . "/jobs/reduce-build.php", "reduce_choose.php", 5);
         } elseif ($req['method'] == 'nobuild') {
             if ($_SESSION['bgjob']['reduce_blength'] == 'ecloud') {
                 mpLog("reduce-nobuild:User ran Reduce with -nobuild9999 flag");
             } else {
                 mpLog("reduce-nobuild:User ran Reduce with -nobuild9999 -nuclear flag");
             }
             // launch background job
             pageGoto("job_progress.php");
             launchBackground(MP_BASE_DIR . "/jobs/reduce-nobuild.php", "generic_done.php", 5);
         }
     } else {
         $context = getContext();
         if (isset($req['modelID'])) {
             $context['modelID'] = $req['modelID'];
         }
         if (isset($req['method'])) {
             $context['method'] = $req['method'];
         }
         if (isset($req['blength'])) {
             $context['blength'] = $req['blength'];
         }
         setContext($context);
     }
 }
Пример #5
0
 /**
 * Launches Prekin when the user submits the form.
 */
 function onRunPrekin()
 {
     $req = $_REQUEST;
     if ($req['cmd'] == 'Cancel') {
         pageReturn();
         return;
     }
     // Otherwise, moving forward:
     if (isset($req['modelID']) && isset($req['scriptName'])) {
         $_SESSION['lastUsedModelID'] = $req['modelID'];
         // this is now the current model
         unset($_SESSION['bgjob']);
         // Clean up any old data
         $_SESSION['bgjob'] = $req;
         mpLog("makekin:Creating simple kinemages from built-in Prekin script '{$req['scriptName']}'");
         // launch background job
         pageGoto("job_progress.php");
         launchBackground(MP_BASE_DIR . "/jobs/makekin.php", "generic_done.php", 3);
     } else {
         $context = getContext();
         if (isset($req['modelID'])) {
             $context['modelID'] = $req['modelID'];
         }
         if (isset($req['scriptName'])) {
             $context['scriptName'] = $req['scriptName'];
         }
         setContext($context);
     }
 }
Пример #6
0
 /**
 * Documentation for this function.
 */
 function onRunAnalysis()
 {
     $req = $_REQUEST;
     if ($req['cmd'] == 'Cancel') {
         pageReturn();
         return;
     }
     // Otherwise, moving forward:
     if (isset($req['ensID'])) {
         $_SESSION['lastUsedModelID'] = $req['ensID'];
         // this is now the current "model"
         unset($_SESSION['bgjob']);
         // Clean up any old data
         $_SESSION['bgjob'] = $req;
         mpLog("aacgeom:Running all-atom contact and geometric analyses");
         // The chartXXX vars aren't defined in this interface (yet), but they don't hurt anything...
         if ($req['kinClashes'] || $req['kinHbonds'] || $req['kinContacts'] || $req['chartClashlist']) {
             mpLog("aacgeom-aac:Generataing all-atom contact data of some type");
         }
         if ($req['kinRama'] || $req['chartRama']) {
             mpLog("aacgeom-rama:Doing Ramachandran analysis");
         }
         if ($req['kinRota'] || $req['chartRota']) {
             mpLog("aacgeom-rota:Doing rotamer analysis");
         }
         if ($req['kinCBdev'] || $req['chartCBdev']) {
             mpLog("aacgeom-cbdev:Doing C-beta deviation analysis");
         }
         if ($req['kinBaseP'] || $req['chartBaseP']) {
             mpLog("aacgeom-basep:Validating base-phosphate distances vs sugar puckers");
         }
         // doMultiGraph hasn't been renamed to doCharts yet...
         if ($req['doKinemage']) {
             mpLog("aacgeom-mkin:Multi-criterion validation kinemage");
         }
         //if($req['doCharts'])        mpLog("aacgeom-mchart:Multi-criterion validation chart");
         if ($req['doMultiGraph']) {
             mpLog("aacgeom-mchart:Multi-criterion validation chart");
         }
         // launch background job
         pageGoto("job_progress.php");
         launchBackground(MP_BASE_DIR . "/jobs/ens_aacgeom.php", "generic_done.php", 5);
     }
 }
Пример #7
0
 /**
 * This function calls the notebook editor so the user can modify the notebook
 * entry. Control is transfered to another page, namely, notebook_edit.php.
 * When that page is done, it will call pageReturn(), and control will return
 * to this class--display() will be called again to show the entry.
 *
 * This function gets called when the user clicks the link made by display()
 *
 * $arg contains the entry number of the notebook entry to edit. It was specified
 * by the call to makeEventURL() that occurs in display(), above.
 * $req is filled in with the usually info from the form submission, but
 * we don't need to use it for anything here.
 */
 function onPdbConvert()
 {
     $req = $_REQUEST;
     if ($req['cmd'] == 'Cancel') {
         pageReturn();
         return;
     }
     if (isset($req['modelID'])) {
         $_SESSION['lastUsedModelID'] = $req['modelID'];
         // this is now the current model
         unset($_SESSION['bgjob']);
         // Clean up any old data
         $_SESSION['bgjob'] = $req;
         mpLog("convertPdb:Converted '{$req['modelID']}' to PDBv2.3");
         // launch background job
         pageGoto("job_progress.php");
         launchBackground(MP_BASE_DIR . "/jobs/pdb_convert.php", "generic_done.php", 3);
     } else {
         $context = getContext();
         if (isset($req['modelID'])) {
             $context['modelID'] = $req['modelID'];
         }
         //if(isset($req['scriptName']))   $context['scriptName']  = $req['scriptName'];
         setContext($context);
     }
 }
Пример #8
0
 /**
 * Documentation for this function.
 */
 function onRunAnalysis()
 {
     $req = $_REQUEST;
     if ($req['cmd'] == 'Cancel') {
         pageReturn();
         return;
     }
     // Otherwise, moving forward:
     if (isset($req['modelID'])) {
         $_SESSION['lastUsedModelID'] = $req['modelID'];
         // this is now the current model
         unset($_SESSION['bgjob']);
         // Clean up any old data
         $_SESSION['bgjob'] = $req;
         mpLog("aacgeom:Running all-atom contact and geometric analyses");
         if ($req['kinClashes'] || $req['kinHbonds'] || $req['kinContacts'] || $req['chartClashlist']) {
             mpLog("aacgeom-aac:Generataing all-atom contact data of some type");
         }
         if ($req['kinRama'] || $req['chartRama']) {
             mpLog("aacgeom-rama:Doing Ramachandran analysis");
         }
         if ($req['kinRota'] || $req['chartRota']) {
             mpLog("aacgeom-rota:Doing rotamer analysis");
         }
         if ($req['kinGeom'] || $req['chartGeom']) {
             mpLog("aacgeom-geom:Doing geometry analysis");
         }
         if ($req['kinCBdev'] || $req['chartCBdev']) {
             mpLog("aacgeom-cbdev:Doing C-beta deviation analysis");
         }
         if ($req['kinBaseP'] || $req['chartBaseP']) {
             mpLog("aacgeom-basep:Validating base-phosphate distances vs sugar puckers");
         }
         if ($req['kinSuite'] || $req['chartSuite']) {
             mpLog("aacgeom-suite:Validating RNA backbone conformations");
         }
         if ($req['doKinemage']) {
             mpLog("aacgeom-mkin:Multi-criterion validation kinemage");
         }
         if ($req['doCharts']) {
             mpLog("aacgeom-mchart:Multi-criterion validation chart");
         }
         $modelID = $_SESSION['bgjob']['modelID'];
         // $model   = $_SESSION['models'][$modelID];
         if ($req['chartHoriz'] and !isset($_SESSION['models'][$modelID]['mtz_file'])) {
             // check to see if there is one mtz. If so, then link it to the
             // model being analyzed automatically
             $xrayDir = $_SESSION['dataDir'] . '/' . MP_DIR_XRAYDATA;
             if (file_exists($xrayDir)) {
                 $mtzs = array();
                 $handle = opendir($xrayDir);
                 while (false !== ($entry = readdir($handle))) {
                     if (substr($entry, -4) != ".mtz") {
                         continue;
                     }
                     $mtzs[] = $entry;
                 }
                 if (count($mtzs) == 1) {
                     $_SESSION['models'][$modelID]['mtz_file'] = $xrayDir . '/' . $mtzs[0];
                     // launch background job
                     pageGoto("job_progress.php");
                     launchBackground(MP_BASE_DIR . "/jobs/aacgeom.php", "generic_done.php", 5);
                 } else {
                     pageCall("link_model_2_mtz.php", array('modelID' => $modelID));
                 }
             } else {
                 pageCall("link_model_2_mtz.php", array('modelID' => $modelID));
             }
         } else {
             // launch background job
             pageGoto("job_progress.php");
             launchBackground(MP_BASE_DIR . "/jobs/aacgeom.php", "generic_done.php", 5);
         }
     }
 }
Пример #9
0
 function onReturn()
 {
     pageReturn();
 }
Пример #10
0
 /**
 * Documentation for this function.
 */
 function onUploadHetDictFile()
 {
     if ($_REQUEST['cmd'] == "Cancel") {
         pageReturn();
     } else {
         // Remove the old het dictionary:
         if (isset($_SESSION['hetdict'])) {
             unlink($_SESSION['hetdict']);
             unset($_SESSION['hetdict']);
         }
         $dictName = "user_het_dict.txt";
         $dictPath = "{$_SESSION['dataDir']}/" . MP_DIR_TOPPAR;
         if (!file_exists($dictPath)) {
             mkdir($dictPath, 0777);
         }
         $dictPath .= "/{$dictName}";
         if (!$_FILES['uploadFile']['error'] && $_FILES['uploadFile']['size'] > 0 && move_uploaded_file($_FILES['uploadFile']['tmp_name'], $dictPath)) {
             // Uploaded file probably has restrictive permissions
             chmod($dictPath, 0666 & ~MP_UMASK);
             exec("echo >> {$dictPath}");
             // adds a blank line
             exec("cat " . MP_REDUCE_HET_DICT . " >> {$dictPath}");
             // appends the std dict
             $_SESSION['hetdict'] = $dictName;
             mpLog("hetdict-upload:User uploaded an custom het dictionary file");
             pageGoto("upload_other_done.php", array('type' => 'hetdict'));
         } else {
             $this->doUploadError('hetdict');
         }
     }
 }
Пример #11
0
 /**
 * This function calls the notebook editor so the user can modify the notebook
 * entry. Control is transfered to another page, namely, notebook_edit.php.
 * When that page is done, it will call pageReturn(), and control will return
 * to this class--display() will be called again to show the entry.
 *
 * This function gets called when the user clicks the link made by display()
 *
 * $arg contains the entry number of the notebook entry to edit. It was specified
 * by the call to makeEventURL() that occurs in display(), above.
 * $req is filled in with the usually info from the form submission, but
 * we don't need to use it for anything here.
 */
 function onFillGaps()
 {
     $req = $_REQUEST;
     if ($req['cmd'] == 'Cancel') {
         pageReturn();
         return;
     }
     if (isset($req['modelID'])) {
         $_SESSION['lastUsedModelID'] = $req['modelID'];
         // this is now the current model
         unset($_SESSION['bgjob']);
         // Clean up any old data
         $_SESSION['bgjob'] = $req;
         mpLog("makekin:Filling fragments in: '{$req['modelID']}'");
         // launch background job
         pageGoto("job_progress.php");
         launchBackground(MP_BASE_DIR . "/jobs/fillfragments.php", "generic_done.php", 3);
     } else {
         $context = getContext();
         if (isset($req['modelID'])) {
             $context['modelID'] = $req['modelID'];
         }
         //if(isset($req['scriptName']))   $context['scriptName']  = $req['scriptName'];
         setContext($context);
     }
 }
Пример #12
0
 /**
 * Documentation for this function.
 */
 function onChooseResidues()
 {
     $req = $_REQUEST;
     if ($req['cmd'] == 'Cancel') {
         pageReturn();
         return;
     }
     // Otherwise, moving forward:
     if (isset($req['modelID']) && isset($req['map'])) {
         $ctx['modelID'] = $req['modelID'];
         $ctx['map'] = $req['map'];
         pageGoto("sswing_setup2.php", $ctx);
     } else {
         $ctx = getContext();
         if (isset($req['modelID'])) {
             $ctx['modelID'] = $req['modelID'];
         }
         if (isset($req['map'])) {
             $ctx['map'] = $req['map'];
         }
         setContext($ctx);
     }
 }
Пример #13
0
 /**
 */
 function onContinueLinkMtz($modelID)
 {
     $modelID = $_REQUEST['modelID'];
     $xrayDir = $_SESSION['dataDir'] . '/' . MP_DIR_XRAYDATA;
     if (isset($_REQUEST['mtz'])) {
         $_SESSION['models'][$modelID]['mtz_file'] = $xrayDir . '/' . $_REQUEST['mtz'];
     }
     pageReturn();
     return;
     //pageCall("notebook_edit.php", array('entryNumber' => $arg));
 }
Пример #14
0
 /**
 * Documentation for this function.
 */
 function onAddH()
 {
     $req = $_REQUEST;
     if ($req['cmd'] == 'Cancel') {
         pageReturn();
         return;
     }
     // Otherwise, moving forward:
     if (isset($req['ensID']) && isset($req['method']) && isset($req['blength'])) {
         unset($_SESSION['bgjob']);
         // Clean up any old data
         $_SESSION['bgjob']['ensID'] = $req['ensID'];
         $_SESSION['bgjob']['method'] = $req['method'];
         $_SESSION['bgjob']['reduce_blength'] = $req['blength'];
         mpLog("reduce-ensemble:User ran default Reduce -{$req['method']} job on an ensemble");
         // launch background job
         pageGoto("job_progress.php");
         launchBackground(MP_BASE_DIR . "/jobs/ens_reduce.php", "generic_done.php", 5);
     } else {
         $context = getContext();
         if (isset($req['ensID'])) {
             $context['ensID'] = $req['ensID'];
         }
         if (isset($req['method'])) {
             $context['method'] = $req['method'];
         }
         if (isset($req['blength'])) {
             $context['blength'] = $req['blength'];
         }
         setContext($context);
     }
 }