コード例 #1
0
ファイル: sswing_choose.php プロジェクト: smlewis/MolProbity
 /**
 * Documentation for this function.
 */
 function onMakeFinalPDB()
 {
     $context = getContext();
     $newModel = $_SESSION['models'][$context['newModel']];
     $oldModel = $_SESSION['models'][$newModel['parent']];
     $newPDB = $_SESSION['dataDir'] . '/' . MP_DIR_MODELS . '/' . $newModel['pdb'];
     $oldPDB = $_SESSION['dataDir'] . '/' . MP_DIR_MODELS . '/' . $oldModel['pdb'];
     $url = $_SESSION['dataURL'] . '/' . MP_DIR_MODELS . '/' . $newModel['pdb'];
     // Put our money where our mouth is and calculate that new PDB file
     $all_changes = $context['sswingChanges'];
     $usercnit = $_REQUEST['cnit'];
     // Remove changes for residues that weren't selected
     foreach ($all_changes as $k => $v) {
         $res = substr($k, 0, 9);
         if (!isset($usercnit[$res])) {
             unset($all_changes[$k]);
         } else {
             $changed_res[$res] = $res;
         }
         // used below for the lab notebook
     }
     // Make PDB file
     pdbSwapCoords($oldPDB, $newPDB, $all_changes);
     // Make up the lab notebook entry
     $text = "The following residues were automatically refit by SSWING, creating {$newModel['pdb']} from {$oldModel['pdb']}:\n<ul>\n";
     foreach ($changed_res as $res) {
         $text .= "<li>{$res}</li>\n";
     }
     $text .= "</ul>\n";
     $text .= "<p>You can now <a href='{$url}'>download the optimized and annotated PDB file</a> (" . formatFilesize(filesize($newPDB)) . ").</p>\n";
     $entryNum = addLabbookEntry("Refit sidechains with SSWING to get {$newModel['pdb']}", $text, "{$oldModel['id']}|{$newModel['id']}", 'auto');
     $ctx = array('labbookEntry' => $entryNum);
     pageGoto("generic_done.php", $ctx);
 }
コード例 #2
0
ファイル: aacgeom.php プロジェクト: smlewis/MolProbity
mpSaveSession();
#{{{ a_function_definition - sumary_statement_goes_here
############################################################################
/**
* Documentation for this function.
*/
//function someFunctionName() {}
#}}}########################################################################
# MAIN - the beginning of execution for this page
############################################################################
$modelID = $_SESSION['bgjob']['modelID'];
$model = $_SESSION['models'][$modelID];
$opts = $_SESSION['bgjob'];
$doAAC = $opts['doKinemage'] && ($opts['kinClashes'] || $opts['kinHbonds'] || $opts['kinContacts']) || $opts['doCharts'] && $opts['chartClashlist'];
$labbookEntry = runAnalysis($modelID, $_SESSION['bgjob']);
$_SESSION['bgjob']['labbookEntry'] = addLabbookEntry("Analysis output: " . ($doAAC ? "all-atom contacts and " : "") . "geometry for {$model['pdb']}", $labbookEntry, $modelID, "auto", $doAAC ? "clash_rama.png" : "ramaplot.png");
/*********************
To compare:

    array_diff( array_keys($worst1), array_keys($worst2) ); // things fixed 1->2
    array_diff( array_keys($worst2), array_keys($worst1) ); // things broken 1->2

to find residues that are bad in one structure but not the other.
A detailed comparison can then be done between residues in:

    array_intersect( array_keys($worst1), array_keys($worst2) ); // things changed but not fixed

**********************
Alternately, you might do

    array_unique( array_merge(...keys...) )
コード例 #3
0
ファイル: editpdb_setup2.php プロジェクト: smlewis/MolProbity
 function onEditPDB()
 {
     $req = $_REQUEST;
     //if($req['cmd'] == 'Cancel')
     if ($req['cmd'] == 'Go back') {
         pageGoto("editpdb_setup1.php");
         return;
     }
     // Otherwise, moving forward:
     $oldID = $req['modelID'];
     $oldModel = $_SESSION['models'][$oldID];
     $inpath = $_SESSION['dataDir'] . '/' . MP_DIR_MODELS . '/' . $oldModel['pdb'];
     $newModel = createModel($oldID . "_edit");
     $newID = $newModel['id'];
     $outpath = $_SESSION['dataDir'] . '/' . MP_DIR_MODELS . '/' . $newModel['pdb'];
     $s = "";
     if (is_array($req['removechain']) && count($req['removechain']) > 0) {
         removeChains($inpath, $outpath, $req['removechain']);
         $s .= "<p>You created {$newModel['pdb']} by removing chain(s) " . implode(', ', $req['removechain']) . " from {$oldModel['pdb']}.\n";
         mpLog("editpdb:Removed chains from a PDB file");
     } else {
         copy($inpath, $outpath);
     }
     $resolu = $req['resolution'] + 0;
     $oldRes = $oldModel['stats']['resolution'] + 0;
     if ($resolu && ($oldRes == 0 || $oldRes != $resolu)) {
         $remark2 = sprintf("REMARK   2                                                                      \nREMARK   2 RESOLUTION. %.2f ANGSTROMS.                                          \n", $resolu);
         replacePdbRemark($outpath, $remark2, 2);
         $s .= "<p>You manually set the resolution for {$newModel['pdb']}.\n";
         mpLog("editpdb:Changed/set resolution for a PDB file");
     }
     if ($req['removeHs']) {
         $newModel = createModel($oldID . "_trimmed");
         $newID = $newModel['id'];
         $outpath = $_SESSION['dataDir'] . '/' . MP_DIR_MODELS . '/' . $newModel['pdb'];
         reduceTrim($inpath, $outpath);
         $s .= "<p>You created {$newModel['pdb']} by removing hydrogens from {$oldModel['pdb']}.\n";
         mpLog("editpdb:Removed hydrogens from a PDB file");
     }
     $newModel['stats'] = pdbstat($outpath);
     $newModel['history'] = "Edited {$oldModel['pdb']}";
     $newModel['isUserSupplied'] = $oldModel['isUserSupplied'];
     $_SESSION['models'][$newID] = $newModel;
     $_SESSION['lastUsedModelID'] = $newID;
     // this is now the current model
     $details = describePdbStats($newModel['stats'], true);
     $s .= "<ul>\n";
     foreach ($details as $detail) {
         $s .= "<li>{$detail}</li>\n";
     }
     $s .= "</ul>\n";
     $entrynum = addLabbookEntry("Created PDB file {$newModel['pdb']}", $s, "{$oldID}|{$newID}", "auto", "scissors.png");
     pageGoto("generic_done.php", array('labbookEntry' => $entrynum));
 }
コード例 #4
0
ファイル: pdb_convert.php プロジェクト: smlewis/MolProbity
# MAIN - the beginning of execution for this page
############################################################################
$modelID = $_SESSION['bgjob']['modelID'];
$model = $_SESSION['models'][$modelID];
$pdbDir = $_SESSION['dataDir'] . '/' . MP_DIR_MODELS;
$pdb = $pdbDir . '/' . $model['pdb'];
// Set up progress message
$tasks['convert'] = "Convert pdb with <code>remediator -oldout</code>";
$tasks['notebook'] = "Add entry to lab notebook";
setProgress($tasks, 'convert');
// updates the progress display if running as a background job
if (!file_exists($pdbDir)) {
    mkdir($pdbDir, 0777);
}
// shouldn't ever happen, but might...
$outpdb = $pdbDir . '/' . $modelID . "v23.pdb";
downgradePDB($pdb, $outpdb);
setProgress($tasks, 'notebook');
$outpdburl = $_SESSION['dataURL'] . '/' . MP_DIR_MODELS . '/' . $modelID . "v23.pdb";
$entry = "remediator was run on {$model['pdb']} to convert its atoms to PDB v2.3 format.\n";
$entry .= "<p>You can now <a href='{$outpdburl}'>download the converted PDB file with hydrogens</a> ";
$entry .= "or <a href='download_trimmed.php?{$_SESSION['sessTag']}&file={$outpdb}'>without hydrogens</a>.</p>\n";
$entry .= $pdbEntries;
//$entry .= "<p>A kinemage of all of the fragments is ready for viewing in KiNG: ".linkKinemage($modelID.'.kin')."</p>\n";
$_SESSION['bgjob']['labbookEntry'] = addLabbookEntry("Converted {$model['pdb']} to {$modelID}" . "v23.pdb.", $entry, "{$modelID}|{$newModel['id']}", "auto", "downgrade.gif");
setProgress($tasks, null);
############################################################################
// Clean up and go home
unset($_SESSION['bgjob']['processID']);
$_SESSION['bgjob']['endTime'] = time();
$_SESSION['bgjob']['isRunning'] = false;
コード例 #5
0
ファイル: interface-vis.php プロジェクト: smlewis/MolProbity
    // updates the progress display if running as a background job
    exec($prekin_cmd1);
    setProgress($tasks, 'dots');
    // updates the progress display if running as a background job
    exec($probe_cmd1);
    $entry .= "<p>Your kinemage is ready for viewing in KiNG: " . linkKinemage($outname) . "</p>\n";
    $entry .= "<p>The actual commands used were as follows:\n<ul>\n";
    $entry .= "<li><code>prekin -lots {$model['pdb']} > {$outname}</code></li>\n";
    $entry .= "<li><code>probe {$flags} {$model['pdb']} >> {$outname}</code></li>\n";
    $entry .= "</ul>\n";
}
if ($doList) {
    setProgress($tasks, 'list');
    // updates the progress display if running as a background job
    exec($probe_cmd2);
    $entry .= "Types of contacts include the following:";
    $entry .= "<p><code>hb</code> = hydrogen bond; <code>wc</code> = wide contact; <code>cc</code> = close contact; <code>so</code> = small overlap; <code>bo</code> = big overlap";
    $entry .= "<p>The list of contacts is as follows:</p>\n";
    $entry .= "<p><pre>\n";
    $entry .= @file_get_contents($list_out);
    $entry .= "</pre></p>\n";
}
setProgress($tasks, 'notebook');
// updates the progress display if running as a background job
$_SESSION['bgjob']['labbookEntry'] = addLabbookEntry("Visualized interface contacts for {$model['pdb']}", $entry, $modelID, "auto", "barnase_barstar.png");
setProgress($tasks, null);
############################################################################
// Clean up and go home
unset($_SESSION['bgjob']['processID']);
$_SESSION['bgjob']['endTime'] = time();
$_SESSION['bgjob']['isRunning'] = false;
コード例 #6
0
ファイル: fillfragments.php プロジェクト: smlewis/MolProbity
    //echo "For $pdbName\n";
    if (preg_match("/" . $modelID . ".*\\.[0-9]*-[0-9]*\\.pdb/", $pdbName)) {
        //echo "Found $pdbName\n";
        $filledPdbFile = $_SESSION['dataDir'] . '/' . MP_DIR_MODELS . '/' . $pdbName;
        $pdburl = $_SESSION['dataURL'] . '/' . MP_DIR_MODELS . '/' . $pdbName;
        $pdbEntries .= "<p>File <a href='{$pdburl}'>{$pdbName}</a> (" . formatFilesize(filesize($filledPdbFile)) . ").</p>\n";
        $gapCount += 1;
    } else {
        if (preg_match("/.kin/", $pdbName)) {
            // because JiffiLoop puts all output files in one directory, this moves the output kin to the kin directory.
            //echo "kin file name: ".$pdbName."\n";
            $origKinFile = $_SESSION['dataDir'] . '/' . MP_DIR_MODELS . '/' . $pdbName;
            $newKinFile = $kinDir . '/' . $pdbName;
            rename($origKinFile, $newKinFile);
            $jiffiKin = $pdbName;
        }
    }
}
//$pdbout = $_SESSION['dataDir'].'/'.MP_DIR_MODELS.'/'.$pdbpath;
//$pdburl = $_SESSION['dataURL'].'/'.MP_DIR_MODELS.'/'.$pdbpath;
$entry = "Jiffiloop was run on {$model['pdb']}; {$gapCount} JiffiLoop PDB files were found. If there are no files shown here, JiffiLoop likely crashed; please contact the developers.\n";
//$entry .= "<p>You can now <a href='$pdburl'>download the annotated PDB file</a> (".formatFilesize(filesize($pdb)).").</p>\n";
$entry .= $pdbEntries;
$entry .= "<p>A kinemage of the fragments from this run is ready for viewing in KiNG: " . linkKinemage($jiffiKin) . "</p>\n";
$_SESSION['bgjob']['labbookEntry'] = addLabbookEntry("Filled gaps in {$modelID}.", $entry, "{$modelID}|{$newModel['id']}", "auto", "add_h.png");
setProgress($tasks, null);
############################################################################
// Clean up and go home
unset($_SESSION['bgjob']['processID']);
$_SESSION['bgjob']['endTime'] = time();
$_SESSION['bgjob']['isRunning'] = false;
コード例 #7
0
ファイル: reduce-nobuild.php プロジェクト: smlewis/MolProbity
    $newModel['history'] = "Derived from {$model['pdb']} by Reduce -nobuild9999 -nuclear";
}
$newModel['isUserSupplied'] = $model['isUserSupplied'];
$newModel['isReduced'] = true;
$_SESSION['models'][$newModel['id']] = $newModel;
$_SESSION['bgjob']['modelID'] = $newModel['id'];
$_SESSION['lastUsedModelID'] = $newModel['id'];
// this is now the current model
$hcount = countReduceChanges($outpath);
setProgress($tasks, 'notebook');
$pdb = $_SESSION['dataDir'] . '/' . MP_DIR_MODELS . '/' . $outname;
$url = $_SESSION['dataURL'] . '/' . MP_DIR_MODELS . '/' . $outname;
$entry = "Reduce was run on {$model['pdb']} to add and optimize missing hydrogens, resulting in {$newModel['pdb']}.\n";
if ($hcount) {
    $entry .= "{$hcount['found']} hydrogens were found in the original model, and {$hcount['add']} hydrogens were added.\n";
    if ($hcount['std']) {
        $entry .= "{$hcount['std']} H were repositioned to standardize bond lengths.\n";
    }
    if ($hcount['adj']) {
        $entry .= "The positions of {$hcount['adj']} hydrogens were adjusted to optimize H-bonding.\n";
    }
}
$entry .= "Asn/Gln/His flips were not optimized.\n";
$entry .= "<p>You can now <a href='{$url}'>download the annotated PDB file</a> (" . formatFilesize(filesize($pdb)) . ").</p>\n";
$_SESSION['bgjob']['labbookEntry'] = addLabbookEntry("Added H with -nobuild9999 to get {$newModel['pdb']}", $entry, "{$modelID}|{$newModel['id']}", "auto", "add_h.png");
setProgress($tasks, null);
############################################################################
// Clean up and go home
unset($_SESSION['bgjob']['processID']);
$_SESSION['bgjob']['endTime'] = time();
$_SESSION['bgjob']['isRunning'] = false;
コード例 #8
0
ファイル: fetch-edsmap.php プロジェクト: smlewis/MolProbity
    if ($_SESSION['bgjob']['eds_fofc']) {
        setProgress($prog, 'fofc');
        $mapName = "{$code}-diff.omap.gz";
        $mapPath = "{$mapDir}/{$mapName}";
        if (!file_exists($mapPame)) {
            $tmpMap = getEdsMap($code, 'omap', 'fofc');
            if ($tmpMap && copy($tmpMap, $mapPath)) {
                unlink($tmpMap);
                $_SESSION['edmaps'][$mapName] = $mapName;
                mpLog("edmap-eds:User requested Fo-Fc map for {$code} from the EDS");
                $s .= "<p>The Fo-Fc map for {$code} was successfully retrieved from the EDS.</p>\n";
            } else {
                $s .= "<p><div class='alert'>The Fo-Fc map for {$code} could not be retrieved from the EDS.</div></p>\n";
            }
        } else {
            $s .= "<p><div class='alert'>The Fo-Fc map for {$code} could not be retrieved, because a file of the same name already exists.</div></p>\n";
        }
    }
} else {
    $title = "Failed to retrieve electron density from the EDS";
    $s .= "Unable to retrieve maps from the EDS because '{$code}' is not a valid PDB ID.";
}
// I'm too lazy to put it all the hyperlinks by hand  :)
$s = preg_replace('/EDS/', "<a href='http://eds.bmc.uu.se/' target='_blank'>EDS</a>", $s);
$_SESSION['bgjob']['labbookEntry'] = addLabbookEntry($title, $s, "", "auto", "phe_ed.png");
setProgress($tasks, null);
############################################################################
// Clean up and go home
unset($_SESSION['bgjob']['processID']);
$_SESSION['bgjob']['endTime'] = time();
$_SESSION['bgjob']['isRunning'] = false;
コード例 #9
0
ファイル: addmodel.php プロジェクト: smlewis/MolProbity
        $cur = $_SESSION['lastUsedModelID'];
        if (isset($_SESSION['ensembles'][$cur])) {
            $orig = "the original ensemble (or individual model)";
        } else {
            foreach ($_SESSION['models'] as $id_m => $model_m) {
                if ($_SESSION['lastUsedModelID'] != $id_m) {
                    $orig = $model_m['pdb'];
                }
            }
        }
        $s .= "<p><div class='alert'>The hydrogen atoms from your input model have been removed.<br>\n";
        $s .= "You will be able to add hydrogens at either electron cloud positions" . (count($idList) > 1 ? "" : " (default)") . ", which are best for X-ray crystallographic models, <br>";
        $s .= "or at nuclear positions, which are best for NMR models, neutron diffraction models, etc.<br>";
        $s .= "<br>If you prefer to use the input hydrogen positions, please select {$orig} from the 'Currently working on' list on the next page.</div></p>";
    }
    if ($model['segmap']) {
        $s .= "<p><div class='alert'>Because this model had more segment IDs than chainIDs,\n";
        $s .= "the segment IDs were automagically turned into new chain IDs for this model.\n";
        $s .= "If you would prefer the original chain IDs, please check the <b>Ignore segID field</b>\n";
        $s .= "on the file upload page.</div></p>";
    }
    $idList[] = $id;
    // make sure ensemble ID also appears in notebook
    $_SESSION['bgjob']['labbookEntry'] = addLabbookEntry($title, $s, implode('|', $idList), "auto", "pdb_icon.png");
    setProgress($tasks, null);
}
############################################################################
// Clean up and go home
unset($_SESSION['bgjob']['processID']);
$_SESSION['bgjob']['endTime'] = time();
$_SESSION['bgjob']['isRunning'] = false;
コード例 #10
0
ファイル: reduce_choose.php プロジェクト: smlewis/MolProbity
 /**
 * Documentation for this function.
 */
 function onRerunReduce()
 {
     $req = $_REQUEST;
     $doflip = $req['doflip'];
     $modelID = $req['modelID'];
     $model = $_SESSION['models'][$modelID];
     $pdb = $_SESSION['dataDir'] . '/' . MP_DIR_MODELS . '/' . $model['pdb'];
     $url = $_SESSION['dataURL'] . '/' . MP_DIR_MODELS . '/' . $model['pdb'];
     // If all changes were accepted, we will not need to re-run Reduce.
     // We're going to construct a lab notebook entry at the same time.
     $changes = decodeReduceUsermods($pdb);
     $rerun = false;
     $flags = '';
     $n = count($changes[0]);
     // How many changes are in the table?
     $autoflip = "<p>The following residues were flipped automatically by Reduce:\n<ul>\n";
     $userflip = "<p>The following residues were flipped manually by the user:\n<ul>\n";
     $userkeep = "<p>The following residues were NOT flipped, though Reduce recommended doing so:\n<ul>\n";
     for ($c = 0; $c < $n; $c++) {
         // Expect checks for ones flipped originally; expect no check for ones not flipped.
         $expected = $changes[4][$c] == "FLIP" || $changes[4][$c] == "CLS-FL";
         if ($expected) {
             if ($doflip[$c]) {
                 $autoflip .= "<li>{$changes[1][$c]} {$changes[2][$c]} {$changes[3][$c]} {$changes[13][$c]}</li>\n";
             } else {
                 $userkeep .= "<li>{$changes[1][$c]} {$changes[2][$c]} {$changes[3][$c]} {$changes[13][$c]}</li>\n";
                 $rerun = true;
             }
         } elseif ($doflip[$c]) {
             $userflip .= "<li>{$changes[1][$c]} {$changes[2][$c]} {$changes[3][$c]} {$changes[13][$c]}</li>\n";
         }
     }
     $autoflip .= "</ul>\n</p>\n";
     $userflip .= "</ul>\n</p>\n";
     $userkeep .= "</ul>\n</p>\n";
     $hcount = countReduceChanges($pdb);
     $parent = $_SESSION['models'][$model['parent']];
     $entry = "Reduce was run on {$parent['pdb']} to add and optimize hydrogens, and optimize Asn, Gln, and His flips, yielding {$model['pdb']}.\n";
     if ($hcount) {
         $entry .= "{$hcount['found']} hydrogens were found in the original model, and {$hcount['add']} hydrogens were added.\n";
         if ($hcount['std']) {
             $entry .= "{$hcount['std']} H were repositioned to standardize bond lengths.\n";
         }
         if ($hcount['adj']) {
             $entry .= "The positions of {$hcount['adj']} hydrogens were adjusted to optimize H-bonding.\n";
         }
     }
     if ($_SESSION['reduce_blength'] == 'ecloud') {
         $flags = 'electron-cloud';
     } else {
         $flags = 'nuclear';
     }
     $entry .= "<p>Reduce placed hydrogens at {$flags} positions.\n";
     $entry .= "<p>Reduce used <a href=http://kinemage.biochem.duke.edu/software/reduce.php> reduce_wwPDB_het_dict.txt </a> as the het dictonary.\n";
     if ($doflip && $n > 0) {
         $entry .= "<p>You can now download this atom-shifted and annotated <a href='{$url}'>PDB file with hydrogens</a>";
         $entry .= " or <a href='download_trimmed.php?{$_SESSION['sessTag']}&file={$pdb}'>without hydrogens (flips only)</a> <b>which should be re-refined before deposition.</b></p>\n";
     } else {
         $entry .= "<p>You can now download the optimized and annotated <a href='{$url}'>PDB file with hydrogens</a>";
         $entry .= " or <a href='download_trimmed.php?{$_SESSION['sessTag']}&file={$pdb}'>without hydrogens (flips only)</a>.</p>\n";
     }
     $nqkin = $_SESSION['dataDir'] . '/' . MP_DIR_KINS . "/{$model['prefix']}flipnq.kin";
     $hiskin = $_SESSION['dataDir'] . '/' . MP_DIR_KINS . "/{$model['prefix']}fliphis.kin";
     if (file_exists($nqkin) && file_exists($hiskin)) {
         $entry .= "<p>These Flipkin kinemages illustrate both flip states for all Asn/Gln/His.\n";
         $entry .= "Residues that Reduce <i>suggested</i> flipping are marked with stars (*) in the Views menu.\n";
         $entry .= "<ul>\n";
         $entry .= "<li>" . linkKinemage("{$model['prefix']}flipnq.kin") . "</li>\n";
         $entry .= "<li>" . linkKinemage("{$model['prefix']}fliphis.kin") . "</li>\n";
         $entry .= "</ul></p>\n";
     }
     if (strpos($autoflip, "<li>") !== false) {
         $entry .= $autoflip;
     }
     if (strpos($userflip, "<li>") !== false) {
         $entry .= $userflip;
     }
     if (strpos($userkeep, "<li>") !== false) {
         $entry .= $userkeep;
     }
     // Go ahead and make the notebook entry inline -- this can't take more than 1-2 sec.
     if ($_SESSION['reduce_blength'] == 'ecloud') {
         $flags = '-build';
     } else {
         $flags = '-build -nuclear';
     }
     if ($rerun) {
         $title = "Added H with {$flags} and user overrides to get {$model['pdb']}";
     } else {
         $title = "Added H with {$flags} to get {$model['pdb']}";
     }
     unset($_SESSION['bgjob']);
     // Clean up any old data
     $_SESSION['bgjob']['labbookEntry'] = addLabbookEntry($title, $entry, "{$parent['id']}|{$modelID}", "auto", "add_h.png");
     $_SESSION['bgjob']['modelID'] = $_REQUEST['modelID'];
     $_SESSION['bgjob']['doflip'] = $_REQUEST['doflip'];
     // User requested changes; re-launch Reduce
     if ($rerun) {
         mpLog("reduce-custom:User made changes to flips suggested by Reduce -build");
         // launch background job
         pageGoto("job_progress.php");
         launchBackground(MP_BASE_DIR . "/jobs/reduce-fix.php", "reduce_done.php", 5);
     } else {
         mpLog("reduce-accept:User accepted all flips proposed by Reduce -build as-is");
         pageGoto("reduce_done.php", $_SESSION['bgjob']);
     }
 }
コード例 #11
0
ファイル: ens_reduce.php プロジェクト: smlewis/MolProbity
setProgress($tasks, 'notebook');
$pdb = $_SESSION['dataDir'] . '/' . MP_DIR_MODELS . '/' . $newEns['pdb'];
$url = $_SESSION['dataURL'] . '/' . MP_DIR_MODELS . '/' . $newEns['pdb'];
// This should find the line for the first model, at least.
// Some USER MOD records may be munged by the model-joining process.
$hcount = countReduceChanges($pdb);
$entry = "Reduce was run on all models of {$oldEns['pdb']} to add and optimize missing hydrogens, resulting in {$newEns['pdb']}.\n";
if ($hcount) {
    $entry .= "{$hcount['found']} hydrogens were found in the original model, and {$hcount['add']} hydrogens were added.\n";
    if ($hcount['std']) {
        $entry .= "{$hcount['std']} H were repositioned to standardize bond lengths.\n";
    }
    if ($hcount['adj']) {
        $entry .= "The positions of {$hcount['adj']} hydrogens were adjusted to optimize H-bonding.\n";
    }
}
$entry .= "Asn/Gln/His flips were " . ($method == 'build' ? "" : "not") . " optimized.\n";
if ($reduce_blength == 'ecloud') {
    $flags = 'electron-cloud';
} else {
    $flags = 'nuclear';
}
$entry .= "<p>Reduce placed hydrogens at {$flags} positions.\n";
$entry .= "<p>You can now <a href='{$url}'>download the annotated PDB file</a> (" . formatFilesize(filesize($pdb)) . ").</p>\n";
$_SESSION['bgjob']['labbookEntry'] = addLabbookEntry("Added H with -{$method} to get {$newEns['pdb']}", $entry, "{$oldEnsID}|{$newEnsID}", "auto", "add_h.png");
setProgress($tasks, null);
############################################################################
// Clean up and go home
unset($_SESSION['bgjob']['processID']);
$_SESSION['bgjob']['endTime'] = time();
$_SESSION['bgjob']['isRunning'] = false;
コード例 #12
0
ファイル: makekin.php プロジェクト: smlewis/MolProbity
        $flag = "-cass";
        break;
}
// Do this after file name or it'll get junked up!
if ($rainbow) {
    $flag .= " -colornc";
}
// Color ramp N --> C ?
if ($cpkballs) {
    $flag .= " -show 'mc,sc,ht,at'";
}
$tasks['kin'] = "Make kinemage using <code>Prekin {$flag}</code>";
setProgress($tasks, 'kin');
// updates the progress display if running as a background job
$outfile = "{$kinDir}/{$model['prefix']}{$scriptName}.kin";
if ($scriptName == "halfbonds") {
    $cmd = "prekin {$flag} {$infile} | php -f " . MP_BASE_DIR . "/lib/halfbonds.php > {$outfile}";
} else {
    $cmd = "prekin {$flag} {$infile} > {$outfile}";
}
exec($cmd);
// Lab notebook entry / results page
$entry = "";
$entry .= "<p>Your kinemage is ready for viewing in KiNG: " . linkKinemage("{$model['prefix']}{$scriptName}.kin") . "</p>\n";
$_SESSION['bgjob']['labbookEntry'] = addLabbookEntry("Made simple kinemage of {$model['pdb']}", $entry, $modelID, "auto", "porin_barrel.png");
setProgress($tasks, null);
############################################################################
// Clean up and go home
unset($_SESSION['bgjob']['processID']);
$_SESSION['bgjob']['endTime'] = time();
$_SESSION['bgjob']['isRunning'] = false;
コード例 #13
0
ファイル: ens_aacgeom.php プロジェクト: smlewis/MolProbity
    makeRamachandranPDF($infile, $outfile);
    $labbookEntry .= "<h3>Multi-model Ramachandran plot</h3>\n";
    $labbookEntry .= "<p>" . linkAnyFile("{$ensemble['prefix']}rama.pdf", "Ramachandran plot PDF") . "</p>\n";
}
if ($opts['doMultiGraph']) {
    setProgress($tasks, 'multigraph');
    // updates the progress display if running as a background job
    $outfile = "{$kinDir}/{$ensemble['prefix']}multigraph.kin";
    makeChartKin($infiles, $outfile);
    $labbookEntry .= "<div class='alert'>\n<center><h3>ALPHA TEST</h3></center>\n";
    $labbookEntry .= "Not suitable for use by the general public: " . linkKinemage("{$ensemble['prefix']}multigraph.kin", "Multi-criterion graph");
    $labbookEntry .= "</div>\n";
}
if ($opts['doMultiModelChart']) {
    setProgress($tasks, 'multichart');
    // updates the progress display if running as a background job
    $outfile = "{$kinDir}/{$ensemble['prefix']}mmmcc.kin";
    // Multi-Model Multi-Criterion Chart
    writeMultimodelChart($infiles, $outfile);
    $labbookEntry .= "<div class='alert'>\n<center><h3>ALPHA TEST</h3></center>\n";
    $labbookEntry .= "Not suitable for use by the general public: " . linkKinemage("{$ensemble['prefix']}mmmcc.kin", "Multi-chart mockup");
    $labbookEntry .= "</div>\n";
}
setProgress($tasks, null);
//-----------------------------------------------------------------
$_SESSION['bgjob']['labbookEntry'] = addLabbookEntry("Analysis output: all-atom contacts and geometry for {$ensemble['pdb']}", $labbookEntry, $ensID, "auto", "clash_rama.png");
############################################################################
// Clean up and go home
unset($_SESSION['bgjob']['processID']);
$_SESSION['bgjob']['endTime'] = time();
$_SESSION['bgjob']['isRunning'] = false;