/** * Context is not used. */ function display($context) { echo $this->pageHeader("Log out & end session", "logout"); ?> <p>We appreciate your help in freeing up disk space for other users. By clicking the button below, you will <b>permanently delete</b> all the files you generated during this session. Before logging out, you may wish to <a href='<?php echo makeEventURL('onGoto', 'file_browser.php'); ?> '>download</a> some of your files. It is also possible to <a href='<?php echo makeEventURL('onGoto', 'save_session.php'); ?> '>save this session</a> and return to do more work with these files later. <p><form method="post" action="logout_destroy.php"> <?php echo postSessionID(); ?> <input type="hidden" name="confirm" value="1"> <br>This action cannot be undone: <input type="submit" name="cmd" value="Destroy all my files and log me out >"> </form> <?php echo $this->pageFooter(); }
/** * Context is not used. */ function display($context) { echo $this->pageHeader("Work with kinemages", "helper_kinemage"); ?> This page explains how <b>teachers and students</b> can use MolProbity to look at 3-D pictures of proteins and nucleic acids. <ol> <li><b><?php echo "<a href='" . makeEventURL("onCall", "upload_setup.php") . "'>Choose a structure</a>"; ?> :</b> You will need to locate a model of the structure you're interested in. Publically available models are archived in the <a href='http://www.pdb.org/' target='blank'>Protein Data Bank</a>, where they are identified by a <b>four character code</b>. For instance, 2HHB is a structure of hemoglobin, a molecule that transports oxygen in the blood. Once you know the code for the molecule you're interested in, MolProbity can fetch it for you. </li> <li><b><?php echo "<a href='" . makeEventURL("onCall", "makekin_setup.php") . "'>Make a kinemage</a>"; ?> :</b> "Kinemages" (kinetic images) are three-dimensional illustrations of molcular structure. MolProbity will make a variety of different kinds of pictures -- ribbons are good for seeing the overall fold, but ball-and-stick is good for seeing details. <!-- to do: link to a Molikin tutorial for constructing more complex kins --> </li> <li><b>View your kinemage:</b> You can either view your kinemage directly in the web browser using KiNG (requires Java), or you can <a href='http://kinemage.biochem.duke.edu/software/mage.php' target='blank'>download Mage</a> or <a href='http://kinemage.biochem.duke.edu/software/king.php' target='blank'>KiNG</a> to your local machine and view the kinemage files there. If you're having trouble getting KiNG to work in the browser, see our <a href='help/java.html' target='_blank'>help page for Java</a>. </li> <li><b><?php echo "<a href='" . makeEventURL("onGoto", "file_browser.php") . "'>Download files</a>"; ?> :</b> Before you leave, you may want to download the files you've created. Click the triangle icons to open and close the different folders. </li> <li><b><?php echo "<a href='" . makeEventURL("onGoto", "logout.php") . "'>Log out</a>"; ?> :</b> This will permanenty remove your files from our server, freeing up space for other users. </li> </ol> <?php echo $this->pageFooter(); }
/** * Make sure you say what $context is here. For example: * * Context is an array containing: * modelID the model ID to add H to */ function display($context) { echo $this->pageHeader("Convert pdb format options"); if (count($_SESSION['models']) > 0) { // Choose a default model to select $lastUsedID = $context['modelID']; if (!$lastUsedID) { $lastUsedID = $_SESSION['lastUsedModelID']; } echo makeEventForm("onPdbConvert"); echo "<h3>Select a model to convert to PDBv2.3:</h3>"; echo "<p><table width='100%' border='0' cellspacing='0' cellpadding='2'>\n"; $c = MP_TABLE_ALT1; foreach ($_SESSION['models'] as $id => $model) { // Alternate row colors: $c == MP_TABLE_ALT1 ? $c = MP_TABLE_ALT2 : ($c = MP_TABLE_ALT1); echo " <tr bgcolor='{$c}'>\n"; echo " <td><input type='radio' name='modelID' value='{$id}'></td>\n"; echo " <td><b>{$model['pdb']}</b></td>\n"; echo " <td><small>{$model['history']}</small></td>\n"; } echo "</table></p>\n"; echo "<p><table width='100%' border='0'><tr>\n"; echo "<td><input type='submit' name='cmd' value='Convert >'></td>\n"; echo "<td align='right'><input type='submit' name='cmd' value='Cancel'></td>\n"; echo "</tr></table></p></form>\n"; ?> <hr> <div class='help_info'> <h4>Converting pdbs</h4> <i>TODO: Help text about converting pdbs goes here</i> </div> <?php } else { echo "No models are available. Please <a href='" . makeEventURL("onCall", "upload_setup.php") . "'>upload or fetch a PDB file</a> in order to continue.\n"; echo makeEventForm("onChooseOptions"); echo "<p><input type='submit' name='cmd' value='Cancel'></p></form>\n"; } // Here's a sample page that displays a notebook entry. // The notebook entry number was specified in $context['labbookEntry'] // This is a common way to display results of a background job. // Load and format the notebook entry: //$labbook = openLabbook(); //$num = $context['labbookEntry']; //echo formatLabbookEntry($labbook[$num]); // This line makes a URL that, when clicked, will cause the onEditNotebook() // function to be called. It's declared below... //echo "<p><a href='".makeEventURL('onEditNotebook', $num)."'>Edit notebook entry</a></p>\n"; // These lines create an HTML form that will call onReturn() to be called // when the user clicks the Continue > button. onReturn() is declared below. //echo "<p>" . makeEventForm("onReturn"); //echo "<input type='submit' name='cmd' value='Continue >'>\n</form></p>\n"; // Note the explicit </form> to end the form! echo $this->pageFooter(); }
function display($context) { echo $this->pageHeader("Edit PDB file"); if (count($_SESSION['models']) > 0) { // Choose a default model to select $lastUsedID = $context['modelID']; if (!$lastUsedID) { $lastUsedID = $_SESSION['lastUsedModelID']; } echo makeEventForm("onChooseOptions"); echo "<h3>Select a model to work with:</h3>"; echo "<p><table width='100%' border='0' cellspacing='0' cellpadding='2'>\n"; $c = MP_TABLE_ALT1; foreach ($_SESSION['models'] as $id => $model) { // Alternate row colors: $c == MP_TABLE_ALT1 ? $c = MP_TABLE_ALT2 : ($c = MP_TABLE_ALT1); echo " <tr bgcolor='{$c}'>\n"; $checked = $lastUsedID == $id ? "checked" : ""; echo " <td><input type='radio' name='modelID' value='{$id}' {$checked}></td>\n"; echo " <td><b>{$model['pdb']}</b></td>\n"; echo " <td><small>{$model['history']}</small></td>\n"; echo " </tr>\n"; } echo "</table></p>\n"; echo "<p><table width='100%' border='0'><tr>\n"; echo "<td><input type='submit' name='cmd' value='Choose editing options >'></td>\n"; echo "<td align='right'><input type='submit' name='cmd' value='Cancel'></td>\n"; echo "</tr></table></p></form>\n"; // Note the explicit </form> to end the form! ?> <hr> <div class='help_info'> <h4>Editing PDB files</h4> <i>TODO: Help text about editing goes here</i> </div> <?php } else { echo "No models are available. Please <a href='" . makeEventURL("onCall", "upload_setup.php") . "'>upload or fetch a PDB file</a> in order to continue.\n"; echo makeEventForm("onChooseOptions"); echo "<p><input type='submit' name='cmd' value='Cancel'></p></form>\n"; } echo $this->pageFooter(); }
/** * Make sure you say what $context is here. For example: * * Context is an array containing: * labbookEntry the labbook entry number for adding this new model */ function display($context) { echo $this->pageHeader("NAME OF YOUR PAGE GOES HERE"); // Here's a sample page that displays a notebook entry. // The notebook entry number was specified in $context['labbookEntry'] // This is a common way to display results of a background job. // Load and format the notebook entry: $labbook = openLabbook(); $num = $context['labbookEntry']; echo formatLabbookEntry($labbook[$num]); // This line makes a URL that, when clicked, will cause the onEditNotebook() // function to be called. It's declared below... echo "<p><a href='" . makeEventURL('onEditNotebook', $num) . "'>Edit notebook entry</a></p>\n"; // These lines create an HTML form that will call onReturn() to be called // when the user clicks the Continue > button. onReturn() is declared below. echo "<p>" . makeEventForm("onReturn"); echo "<input type='submit' name='cmd' value='Continue >'>\n</form></p>\n"; // Note the explicit </form> to end the form! echo $this->pageFooter(); }
/** * Context is an array containing: * labbookEntry the labbook entry number * modelID the ID of the new Reduced model */ function display($context) { $labbook = openLabbook(); $num = $context['labbookEntry']; echo $this->pageHeader($labbook[$num]['title']); //echo formatLabbookEntry($labbook[$num]); echo $labbook[$num]['entry']; // avoid date stamp, title clutter //echo "<p><a href='".makeEventURL('onEditNotebook', $num)."'>Edit notebook entry</a></p>\n"; echo "<p>" . makeEventForm("onReturn"); echo "<input type='submit' name='cmd' value='Continue >'>\n</form></p>\n"; $modelID = $context['modelID']; $model = $_SESSION['models'][$modelID]; if ($modelID && $model && $model['isReduced'] && $model['isUserSupplied']) { $url = makeEventURL('onDownload', $_SESSION['dataDir'] . '/' . MP_DIR_MODELS . '/' . $model['pdb']); ?> <script language='JavaScript'> function confirmPdbDownload() { if(window.confirm("Your PDB file has been changed. Would you like to download the new coordinates now?")) window.location.href = "<?php echo $url; ?> " } // This nifty function means we won't override other ONLOAD handlers function windowOnload(f) { var prev = window.onload; window.onload = function() { if(prev) prev(); f(); } } windowOnload(confirmPdbDownload) </script> <?php } echo $this->pageFooter(); }
/** * Context is not used. */ function display($context) { // FUNKY: this breaks the general rule of display() not modifying session data. // Set session lifetime to a longer value. // Will be overwritten each session restart (i.e. when we leave this page). mpSessSetTTL(session_id(), MP_SESSION_LIFETIME_EXT); echo $this->pageHeader("Save session", "savesession"); ?> <p>To make MolProbity more convenient, you can bookmark this page and return to it later. We will do our best to preserve all your files, but the unexpected does sometimes happen -- so we recommend that you <a href='<?php echo makeEventURL('onGoto', 'file_browser.php'); ?> '>download</a> anything really important. </p> <p>If you're not going to use these files anymore, please <a href='<?php echo makeEventURL('onGoto', 'logout.php'); ?> '>log out</a> instead. We appreciate your help in freeing up disk space for other users. </p> <center><p>Your data will be kept until: <br><b><?php echo formatDayTime(time() + mpSessTimeToLive(session_id())); ?> </b> </p></center> <?php echo $this->pageFooter(); }
function display($context) { echo $this->pageHeader("Make simple kinemages"); if (count($_SESSION['models']) > 0) { // Choose a default model to select $lastUsedID = $context['modelID']; if (!$lastUsedID) { $lastUsedID = $_SESSION['lastUsedModelID']; } // These lines create an HTML form that will call onRunPrekin() to be called // when the user clicks the submit button. onRunPrekin() is declared below. echo makeEventForm("onRunPrekin"); echo "<h3>Select a model to work with:</h3>"; echo "<p><table width='100%' border='0' cellspacing='0' cellpadding='2'>\n"; $c = MP_TABLE_ALT1; foreach ($_SESSION['models'] as $id => $model) { // Alternate row colors: $c == MP_TABLE_ALT1 ? $c = MP_TABLE_ALT2 : ($c = MP_TABLE_ALT1); echo " <tr bgcolor='{$c}'>\n"; $checked = $lastUsedID == $id ? "checked" : ""; echo " <td><input type='radio' name='modelID' value='{$id}' {$checked}></td>\n"; echo " <td><b>{$model['pdb']}</b></td>\n"; echo " <td><small>{$model['history']}</small></td>\n"; echo " </tr>\n"; } echo "</table></p>\n"; echo "<h3>Choose a type of kinemage to make:</h3>"; echo "<table width='100%' border='0' cellspacing='0' cellpadding='2'>\n"; // Rib 'n' Het echo "<tr bgcolor='" . MP_TABLE_ALT2 . "'><td><input type='radio' name='scriptName' value='ribnhet'></td>\n"; echo "<td>Ribbon representation, colored by secondary structure (if present in PDB file)</td></tr>\n"; // Lots echo "<tr bgcolor='" . MP_TABLE_ALT1 . "'><td><input type='radio' name='scriptName' value='lots'></td>\n"; echo "<td>Mainchain, sidechains, alpha carbon trace, hydrogens, hets, waters (color by sidechain/mainchain)</td></tr>\n"; // Lots -- half bonds echo "<tr bgcolor='" . MP_TABLE_ALT2 . "'><td><input type='radio' name='scriptName' value='halfbonds'></td>\n"; echo "<td>Mainchain, sidechains, alpha carbon trace, hydrogens, hets, waters (<b>half-bond coloring</b>)</td></tr>\n"; // CA -- SS echo "<tr bgcolor='" . MP_TABLE_ALT1 . "'><td><input type='radio' name='scriptName' value='cass'></td>\n"; echo "<td>Alpha carbon trace with disulfides and non-water hets</td></tr>\n"; // MC -- HB echo "<tr bgcolor='" . MP_TABLE_ALT2 . "'><td><input type='radio' name='scriptName' value='mchb'></td>\n"; echo "<td>Mainchain and its hydrogen bonds</td></tr>\n"; // AA/SC echo "<tr bgcolor='" . MP_TABLE_ALT1 . "'><td><input type='radio' name='scriptName' value='aasc'></td>\n"; echo "<td>Mainchain and sidechains, with amino acids grouped into sets</td></tr>\n"; // NABA echo "<tr bgcolor='" . MP_TABLE_ALT2 . "'><td><input type='radio' name='scriptName' value='naba'></td>\n"; echo "<td>Nucleic acid bases grouped into sets and more</td></tr>\n"; echo "</table>\n"; echo "<p><label><input type='checkbox' name='rainbow' value='1'> Rainbow colors N->C / 5'->3' on mainchain</label>\n"; echo "<br><label><input type='checkbox' name='cpkballs' value='1'> CPK-colored markers on non-carbons</label></p>\n"; //echo "</p>\n"; // can't make the above work... echo "<p><table width='100%' border='0'><tr>\n"; echo "<td><input type='submit' name='cmd' value='Make kinemage >'></td>\n"; echo "<td align='right'><input type='submit' name='cmd' value='Cancel'></td>\n"; echo "</tr></table></p></form>\n"; // Note the explicit </form> to end the form! ?> <hr> <div class='help_info'> <h4>Making simple kinemages</h4> <i>TODO: Help text about making kinemages goes here</i> </div> <?php } else { echo "No models are available. Please <a href='" . makeEventURL("onCall", "upload_setup.php") . "'>upload or fetch a PDB file</a> in order to continue.\n"; echo makeEventForm("onRunPrekin"); echo "<p><input type='submit' name='cmd' value='Cancel'></p></form>\n"; } echo $this->pageFooter(); }
/** * We use some clever JavaScript to show/hide the upload options in-line. * For users without JavaScript, the link will function normally and take * them to the upload/download page. * * That code is very clever and I'm quite fond of it, but I've also done * similar things in the past by setting/clearing a flag in $context and * simply reloading the page, as I do for e.g. file_browser.php. * If the current version proves too incompatible, I could fall back to that one. */ function displayUploadOld($context) { echo makeEventForm("onUploadOrFetch") . "\n"; //echo "<h5 class='welcome'>File Upload/Retrieval (<a href='".makeEventURL("onCall", "upload_setup.php")."'>more options</a>)</h5>"; echo "<h5 class='welcome'>File Upload/Retrieval (<a href='" . makeEventURL("onCall", "upload_setup.php") . "' onclick='toggleUploadOptions(); return false' id='upload_options_link'>more options</a>)</h5>"; ?> <script language='JavaScript'> <!-- function toggleUploadOptions() { var block = document.getElementById('upload_options_block') var link = document.getElementById('upload_options_link') if(block.style.display == 'none') { block.style.display = 'block' link.innerHTML = 'hide options' } else { block.style.display = 'none' link.innerHTML = 'more options' } } // --> </script> <div class='indent'><table border='0' width='100%'> <tr> <td align='center' width='50%'>PDB/NDB code: <input type="text" name="pdbCode" size="6" maxlength="10"></td> <td align='center' width='50%'><input type="file" name="uploadFile"></td> </tr><tr> <td align='center'> <select name='fetchType'> <option value='pdb'>PDB/NDB file</option> <option value='biolunit'>Biol. unit (PDB only)</option> <option value='eds_2fofc'>2Fo-Fc map (EDS)</option> <option value='eds_fofc'>Fo-Fc map (EDS)</option> </select> <input type="submit" name="cmd" value="Fetch >"> </td> <td align='center'> <select name='uploadType'> <option value='pdb'>PDB file</option> <option value='kin'>kinemage</option> <option value='map'>ED map</option> <option value='hetdict'>het dict</option> </select> <input type="submit" name="cmd" value="Upload >"> </td> </tr> </table> <div style='display:none' id='upload_options_block'> <!-- We have to start a new table because you can't show/hide <tr>'s, at least not in Safari --> <table border='0' width='100%'><tr valign='top'> <td width='50%'><!-- <div class='inline_options'> <label><input type="checkbox" name="biolunit" value="1"> Biol. unit (PDB only)</label> <br><label><input type="checkbox" name="eds_2fofc" value="1"> Get 2Fo-Fc map from EDS</label> <br><label><input type="checkbox" name="eds_fofc" value="1"> Get Fo-Fc map from EDS</label> </div> --></td> <td width='50%'><div class='inline_options'> <label><input type="checkbox" name="isCnsFormat" value="1"> File is from CNS refinement</label> <br><label><input type="checkbox" name="ignoreSegID" value="1"> Ignore segID field</label> </div></td> </tr></table> </div> </div></form> <?php }
/** * Context may contain the following keys: * ensID the ensemble ID to analyze */ function display($context) { echo $this->pageHeader("Analyze all-atom contacts and geometry"); //{{{ Script to set default choices based on model properties. ?> <script language='JavaScript'> <!-- var selectionHasH = true function hideKinOpts() { var block = document.getElementById('kin_opts') if(document.forms[0].doKinemage.checked) block.style.display = 'block' else block.style.display = 'none' } /*function hideChartOpts() { var block = document.getElementById('chart_opts') if(document.forms[0].doCharts.checked) block.style.display = 'block' else block.style.display = 'none' }*/ function setAnalyses(doAAC, hasProtein, hasNucAcid, isBig) { selectionHasH = doAAC document.forms[0].kinClashes.checked = doAAC document.forms[0].kinHbonds.checked = doAAC if(!doAAC) // turn these off only { document.forms[0].kinContacts.checked = doAAC && !isBig } //document.forms[0].chartClashlist.checked = doAAC document.forms[0].kinRama.checked = hasProtein document.forms[0].kinRota.checked = hasProtein document.forms[0].kinCBdev.checked = hasProtein //document.forms[0].chartRama.checked = hasProtein //document.forms[0].chartRota.checked = hasProtein //document.forms[0].chartCBdev.checked = hasProtein document.forms[0].kinBaseP.checked = hasNucAcid //document.forms[0].chartBaseP.checked = hasNucAcid } // Try to make sure we have H if we're doing AAC function checkSettingsBeforeSubmit() { var doAAC = (document.forms[0].kinClashes.checked || document.forms[0].kinHbonds.checked || document.forms[0].kinContacts.checked //|| document.forms[0].chartClashlist.checked ); if(!selectionHasH && doAAC) { return window.confirm("The file you choose may not have all its H atoms added." +" All-atom contacts requires all H atoms to function properly." +" Do you want to proceed anyway?") } else return true; // OK to submit } // --> </script> <?php //}}} Script to set default choices based on model properties. if (count($_SESSION['ensembles']) > 0) { // Choose a default model to select $lastUsedID = $context['ensID']; if (!$lastUsedID) { $lastUsedID = $_SESSION['lastUsedModelID']; } echo makeEventForm("onRunAnalysis"); echo "<h3>Select an ensemble to work with:</h3>"; echo "<p><table width='100%' border='0' cellspacing='0' cellpadding='2'>\n"; $c = MP_TABLE_ALT1; foreach ($_SESSION['ensembles'] as $id => $ensemble) { // Determine which tasks should be selected by default, // and use an ONCLICK handler to set them. // Use the first model of each ensemble as representative. $modelID = reset($ensemble['models']); $model = $_SESSION['models'][$modelID]; $stats = $model['stats']; $doAAC = $stats['has_most_H'] || $model['isReduced'] ? "true" : "false"; $hasProtein = $stats['sidechains'] > 0 ? "true" : "false"; $hasNucAcid = $stats['nucacids'] > 0 ? "true" : "false"; $pdbSize = filesize($_SESSION['dataDir'] . '/' . MP_DIR_MODELS . '/' . $ensemble['pdb']); $isBig = $pdbSize > 1 << 21 ? "true" : "false"; //isBig is set with some over-clever math // increased from 1<<20 during the CaBLAM/low-res update due to expanded computing power $isLowRes = $stats['resolution'] > 2.5 ? "true" : "false"; // Alternate row colors: $c == MP_TABLE_ALT1 ? $c = MP_TABLE_ALT2 : ($c = MP_TABLE_ALT1); echo " <tr bgcolor='{$c}'>\n"; $checked = $lastUsedID == $id ? "checked" : ""; echo " <td><input type='radio' name='ensID' value='{$id}' onclick='setAnalyses({$doAAC}, {$hasProtein}, {$hasNucAcid}, {$isBig})' {$checked}></td>\n"; echo " <td><b>{$ensemble['pdb']}</b></td>\n"; echo " <td><small>{$ensemble['history']}</small></td>\n"; echo " </tr>\n"; if ($checked) { $jsOnLoad = "setAnalyses({$doAAC}, {$hasProtein}, {$hasNucAcid}, {$isBig})"; } } echo "</table></p>\n"; ?> <hr> <h3>Choose which analyses to run:</h3> <div class='indent'> <h5 class='nospaceafter'><label><input type='checkbox' name='doKinemage' value='1' checked onclick='hideKinOpts()'> Multi-criterion kinemage</label></h5> <div class='indent' id='kin_opts'> <label><input type='checkbox' name='kinClashes' value='1'> Clashes</label> <br><label><input type='checkbox' name='kinHbonds' value='1'> Hydrogen bonds</label> <br><label><input type='checkbox' name='kinContacts' value='1'> van der Waals contacts</label> <p><label><input type='checkbox' name='kinRama' value='1'> Ramachandran plots</label> <br><label><input type='checkbox' name='kinRota' value='1'> Rotamer evaluation</label> <br><label><input type='checkbox' name='kinCBdev' value='1'> Cβ deviations</label> <br><label><input type='checkbox' name='kinBaseP' value='1'> RNA sugar pucker analysis</label> <p><label><input type='checkbox' name='kinAltConfs' value='1'> Alternate conformations</label> <br><label><input type='checkbox' name='kinBfactor' value='1'> Models colored by B-factors</label> <br><label><input type='checkbox' name='kinOccupancy' value='1'> Models colored by occupancy</label> <br><label><input type='checkbox' name='kinRibbons' value='1'> Ribbons</label> </div> <h5 class='nospaceafter'><label><input type='checkbox' name='doRamaPDF' value='1' checked> Multi-model Ramachandran plot (PDF)</label></h5> <!-- <h5 class='nospaceafter'><label><input type='checkbox' name='doMultiGraph' value='1'> Multi-criterion graph [ALPHA TEST]</label></h5> --> <h5 class='nospaceafter'><label><input type='checkbox' name='doMultiModelChart' value='1'> Multi-criterion kinemage chart [ALPHA TEST]</label></h5> </div> <?php echo "<p><table width='100%' border='0'><tr>\n"; echo "<td><input type='submit' name='cmd' value='Run programs to perform these analyses >' onclick='return checkSettingsBeforeSubmit()'></td>\n"; echo "<td align='right'><input type='submit' name='cmd' value='Cancel'></td>\n"; echo "</tr></table></p></form>\n"; // Rather than trying to put this in onload(), we'll do it after the form is defined. if ($jsOnLoad) { echo "<script language='JavaScript'>\n<!--\n{$jsOnLoad}\n// -->\n</script>\n"; } ?> <hr> <div class='help_info'> <h4>Analyze all-atom contacts and geometry</h4> <i>TODO: Help text about analysis goes here</i> </div> <?php } else { echo "No ensembles are available. Please <a href='" . makeEventURL("onCall", "upload_setup.php") . "'>upload or fetch a PDB file</a> in order to continue.\n"; echo makeEventForm("onReturn"); echo "<p><input type='submit' name='cmd' value='Cancel'></p></form>\n"; } echo $this->pageFooter(); }
/** * Context is not used. */ function display($context) { echo $this->pageHeader("Evaluate NMR structure", "helper_nmr"); ?> <div class='feature'> We currently have no tutorials for NMR structures, but many of the principles of analyzing crystal structures still apply. See our <a href='http://kinemage.biochem.duke.edu/teaching/workshop/CSHL2012/' target='_blank'>2012 Cold Spring Harbor tutorial on MolProbity</a> as well as our <a href='<?php echo makeEventURL("onGoto", "helper_xray.php"); ?> '>guide to analyzing X-ray structures</a>. </div> Use this guide to help you evaluate the reliablity of a structural model determined by Nuclear Magnetic Resonance (NMR) spectroscopy -- not all parts of all structures (published or not) are correct, and the errors could impact the biological conclusion you wish to draw. <ol> <li><b><?php echo "<a href='" . makeEventURL("onCall", "upload_setup.php") . "'>Choose a structure</a>"; ?> :</b> You need the coordinates for your model in PDB format. You can upload a file directly from your computer, or search for one at the <a href='http://www.pdb.org/' target='blank'>Protein Data Bank</a> or the <a href='http://ndbserver.rutgers.edu/' target='blank'>Nucleic Acid Data Bank</a>. </li> <li><b><?php echo "<a href='" . makeEventURL("onCall", "reduce_setup.php") . "'>Add hydrogens (usually unnecessary)</a>"; ?> :</b> Explicit hydrogens are needed for many of MolProbity's analyses to function correctly, but structures determined by NMR almost always include them. </li> <li><b><?php echo "<a href='" . makeEventURL("onCall", "aacgeom_setup.php") . "'>Analyze sterics & geometry for single models</a>"; ?> :</b> Most NMR structures are reported as ensembles of models. At the moment, MolProbity has limited tools for analyzing ensembles, but it can easily analyze each model individually. <p>Don't be daunted by the array of <b>options</b> here -- MolProbity automatically selects appropriate settings for your structure, so it's not necessary for you to change them unless you want to. Running all the various analyses may take a few minutes, so please be patient. <p>The <b>all-atom contact</b> analysis is concerned with steric interactions inside the model. Non-(H)bonded atoms with substantial (e.g. >0.4Å) van der Waals overlap are errors in the model; the energetic cost is enormous relative the stability of a macromolecule. The clashscore is the number of these overlaps per 1000 atoms; smaller numbers are better. You can see the individual clashes in the multi-criterion kinemage as hot pink spikes, which is useful for seeing if the errors affect your region(s) of interest. <p>The <b>geometric</b> analyses are also good indicators of potential errors in the model. Ramachandran and rotamer outliers flag very unusual conformations of the protein backbone or sidechains, respectively. A few of these may be genuine, but in most cases they are mistakes. Cβ deviations indicate net distortion of bond angles around the Cα, which can be diagnostic of a backwards sidechain. For nucleic acids, the perpendicular distance from the base to the phosphate is strongly correlated with the pucker of the ribose ring, making it a useful aid to fitting. <p>Don't be dismayed -- <b>all structures have a few problems!</b> These tools can help structural biologists reduce the number of problems in their structures, however, and can help other scientists know whether a particular model offers a believable view of a specific area. </li> <li><b><?php echo "<a href='" . makeEventURL("onCall", "ens_aacgeom_setup.php") . "'>Analyze sterics & geometry for the ensemble</a>"; ?> :</b> At the moment, MolProbity has limited tools for analyzing ensembles. It can produce multi-model multi-criterion kinemages, but not much else (yet). Feature requests to Jeremy Block (jeremy.block@duke.edu). </li> <li><b><?php echo "<a href='" . makeEventURL("onGoto", "file_browser.php") . "'>Download files</a>"; ?> :</b> Before you leave, you may want to download some of the files you've created, like the PDB file with hydrogens added, or the multi-criterion kinemage. You can also review the results you've obtained using the <?php echo "<a href='" . makeEventURL("onGoto", "notebook_main.php") . "'>lab notebook</a>"; ?> . </li> <li><b><?php echo "<a href='" . makeEventURL("onGoto", "logout.php") . "'>Log out</a>"; ?> :</b> This will permanenty remove your files from our server, freeing up space for other users. </li> </ol> <?php echo $this->pageFooter(); }
function mpNavBar_call($page, $title) { if ($page == '') { return "{$title}<br />\n"; } else { return "<a href='" . makeEventURL("onNavBarCall", $page) . "'>{$title}</a><br />\n"; } }
/** * Takes the output of listRecursive() * $isExpanded has absolute directory names as its keys and booleans as values. */ function makeFileList($list, $basePath, $baseURL, $isExpanded, $depth = 0, $hidden = false) { if ($depth === 0) { $this->fileListColor = MP_TABLE_ALT1; } $s = ''; foreach ($list as $dir => $file) { // With new JS toggles, the rows don't reliably alternate color in any given state //$s .= "<tr bgcolor='".$this->fileListColor."'"; $s .= "<tr bgcolor='" . MP_TABLE_ALT1 . "'"; $s .= " filetreedepth='{$depth}'"; if ($hidden) { $s .= " style='display:none;'"; } $s .= ">"; // end of the <TR> $s .= "<td><input type='checkbox' name='zipfiles[]' value='{$basePath}/" . (is_array($file) ? $dir : $file) . "'></td><td>"; $this->fileListColor == MP_TABLE_ALT1 ? $this->fileListColor = MP_TABLE_ALT2 : ($this->fileListColor = MP_TABLE_ALT1); if (is_array($file)) { // Using #filelist in here means we snap back to the table on page reload, // rather than having to scroll all the way back down... (matters more for welcome.php) $s .= "<img src='img/clear_1x1.gif' width='" . 16 * $depth . "' height='1'>"; if ($isExpanded["{$basePath}/{$dir}"]) { $s .= "<a class='file_browser' href='" . makeEventURL("onFolderClose", "{$basePath}/{$dir}") . "#filelist' onclick='expando(this); return false;'>"; $s .= "<img src='img/openfolder.gif'> "; $s .= "<b>{$dir}</b></a></td><td colspan='4'></td></tr>\n"; $s .= $this->makeFileList($file, "{$basePath}/{$dir}", "{$baseURL}/{$dir}", $isExpanded, $depth + 1, $hidden); } else { $s .= "<a class='file_browser' href='" . makeEventURL("onFolderOpen", "{$basePath}/{$dir}") . "#filelist' onclick='expando(this); return false;'>"; $s .= "<img src='img/closedfolder.gif'> "; $s .= "<b>{$dir}</b></a></td><td colspan='4'></td></tr>\n"; $s .= $this->makeFileList($file, "{$basePath}/{$dir}", "{$baseURL}/{$dir}", $isExpanded, $depth + 1, true); } } else { // 15 lines up file names with directories: 10px for dir icon + magic fudge factor $s .= "<img src='img/clear_1x1.gif' width='" . (16 * $depth + 15) . "' height='1'>"; $s .= "<small>{$file}</small></td>" . $this->makeFileCommands("{$basePath}/{$file}", "{$baseURL}/{$file}") . "</tr>\n"; } } return $s; }
/** * Context is not used. */ function display($context) { echo $this->pageHeader("Evaluate X-ray structure", "helper_xray"); ?> <div class='feature'> <b>For a more detailed tutorial</b>, including references, see our <a href='http://kinemage.biochem.duke.edu/teaching/workshop/CSHL2012/' target='_blank'>2012 Cold Spring Harbor tutorial on MolProbity</a>! </div> Use this guide to help you evaluate the reliablity of a structural model determined by X-ray crystallography -- not all parts of all structures (published or not) are correct, and the errors could impact the biological conclusion you wish to draw. <ol> <li><b><?php echo "<a href='" . makeEventURL("onCall", "upload_setup.php") . "'>Choose a structure</a>"; ?> :</b> You need the coordinates for your model in PDB format. You can upload a file directly from your computer, or search for one at the <a href='http://www.pdb.org/' target='blank'>Protein Data Bank</a> or the <a href='http://ndbserver.rutgers.edu/' target='blank'>Nucleic Acid Data Bank</a>. </li> <li><b><?php echo "<a href='" . makeEventURL("onCall", "reduce_setup.php") . "'>Add hydrogens (strongly recommended)</a>"; ?> :</b> Explicit hydrogens are needed for many of MolProbity's analyses to function correctly, and structures determined by crystallography almost never include them. In most cases, we also recommend letting MolProbity flip Asn, Gln, and His residues that are fit 180 degrees backwards; this will give the most reliable view of H-bonding and steric interactions. You'll have a chance to review and override those flips, of course. </li> <li><b><?php echo "<a href='" . makeEventURL("onCall", "aacgeom_setup.php") . "'>Analyze sterics & geometry</a>"; ?> :</b> Don't be daunted by the array of <b>options</b> here -- MolProbity automatically selects appropriate settings for your structure, so it's not necessary for you to change them unless you want to. Running all the various analyses may take a few minutes, so please be patient. <p>The <b>all-atom contact</b> analysis is concerned with steric interactions inside the model. Non-(H)bonded atoms with substantial (e.g. >0.4Å) van der Waals overlap are errors in the model; the energetic cost is enormous relative the stability of a macromolecule. The clashscore is the number of these overlaps per 1000 atoms; smaller numbers are better. You can see the individual clashes in the multi-criterion kinemage as hot pink spikes, which is useful for seeing if the errors affect your region(s) of interest. <p>The <b>geometric</b> analyses are also good indicators of potential errors in the model. Ramachandran and rotamer outliers flag very unusual conformations of the protein backbone or sidechains, respectively. A few of these may be genuine, but in most cases they are mistakes. Cβ deviations indicate net distortion of bond angles around the Cα, which can be diagnostic of a backwards sidechain. For nucleic acids, the perpendicular distance from the base to the phosphate is strongly correlated with the pucker of the ribose ring, making it a useful aid to fitting. <p>Don't be dismayed -- <b>all structures have a few problems!</b> These tools can help structural biologists reduce the number of problems in their structures, however, and can help other scientists know whether a particular model offers a believable view of a specific area. </li> <li><b><?php echo "<a href='" . makeEventURL("onGoto", "file_browser.php") . "'>Download files</a>"; ?> :</b> Before you leave, you may want to download some of the files you've created, like the PDB file with hydrogens added, or the multi-criterion kinemage. You can also review the results you've obtained using the <?php echo "<a href='" . makeEventURL("onGoto", "notebook_main.php") . "'>lab notebook</a>"; ?> . </li> <li><b><?php echo "<a href='" . makeEventURL("onGoto", "logout.php") . "'>Log out</a>"; ?> :</b> This will permanenty remove your files from our server, freeing up space for other users. </li> </ol> <p>Want to <?php echo "<a href='" . makeEventURL("onGoto", "helper_rebuild.php") . "'>fix some of the problems</a>"; ?> you've discovered here? <!-- <ul> <li>XXX-TODO: About coordinate files</li> <li>XXX-TODO: About adding H, flips, and flipkins (Reduce)</li> <li>XXX-TODO: About all-atom contacts</li> <li>XXX-TODO: About Ramachandran/rotamer</li> <li>XXX-TODO: About C-beta deviations</li> <li>XXX-TODO: About base-P measurement</li> <li>XXX-TODO: How to use multi-criterion kinemages</li> </ul> --> <?php echo $this->pageFooter(); }
/** * Context may contain the following keys: * modelID the model ID to add H to * method the means of adding H: nobuild or build * blength desired x-H length: ecloud or nuclear */ function display($context) { echo $this->pageHeader("Add hydrogens"); if (count($_SESSION['models']) > 0) { // Choose a default model to select $lastUsedID = $context['modelID']; if (!$lastUsedID) { $lastUsedID = $_SESSION['lastUsedModelID']; } echo makeEventForm("onAddH"); echo "<h3>Select a model to add H to:</h3>"; echo "<p><table width='100%' border='0' cellspacing='0' cellpadding='2'>\n"; $c = MP_TABLE_ALT1; foreach ($_SESSION['models'] as $id => $model) { // Alternate row colors: $c == MP_TABLE_ALT1 ? $c = MP_TABLE_ALT2 : ($c = MP_TABLE_ALT1); echo " <tr bgcolor='{$c}'>\n"; if ($model['isReduced']) { echo " <td></td>\n"; echo " <td><span class='inactive' title='Already has H added'><b>{$model['pdb']}</b></span></td>\n"; echo " <td><span class='inactive'><small>{$model['history']}</small></span></td>\n"; } else { $stats = $model['stats']; $hasProtein = $stats['sidechains'] > 0 ? "true" : "false"; $hasNucAcid = $stats['nucacids'] > 0 ? "true" : "false"; $checked = $lastUsedID == $id ? "checked" : ""; echo " <td><input type='radio' name='modelID' value='{$id}' {$checked} onclick='setFlipkins({$hasProtein})'></td>\n"; echo " <td><b>{$model['pdb']}</b></td>\n"; echo " <td><small>{$model['history']}</small></td>\n"; } echo " </tr>\n"; } echo "</table></p>\n"; echo "<h3>Select a method of adding H:</h3>"; echo "<p><table width='100%' border='0'>\n"; // Starts with no default method checked. This is well-intentioned but annoying. //$check1 = ($context['method'] == 'build' ? "checked" : ""); //$check2 = ($context['method'] == 'nobuild' ? "checked" : ""); // Selects -BUILD by default unless the user changes it. if ($context['method'] == 'nobuild') { $check1 = ""; $check2 = "checked"; } else { $check1 = "checked"; $check2 = ""; } echo "<tr valign='top'><td width='300'><input type='radio' name='method' value='build' {$check1}> <b>Asn/Gln/His flips</b><td>"; echo "<td><small>Add missing H, optimize H-bond networks, check for flipped Asn, Gln, His"; echo " (<code>Reduce -build</code>)\n"; echo "<div class='inline_options'><b>Advanced options:</b><br>\n"; echo "<label><input type='checkbox' name='makeFlipkin' id='makeFlipkin' value='1' checked>\n"; echo "Make Flipkin kinemages illustrating any Asn, Gln, or His flips</label>\n"; echo "<br><label><input type='checkbox' name='nqh_regularize' id='nqh_regularize' value='1' checked>\n"; echo "Regularize Asn, Gln, and His geometry following flip correction</div>\n"; echo "</small></td></tr>\n"; echo "<tr><td colspan='2'> </td></tr>\n"; // vertical spacer echo "<tr valign='top'><td width='300'><input type='radio' name='method' value='nobuild' {$check2}> <b>No flips</b><td>"; echo "<td><small>Add missing H, optimize H-bond networks, leave other atoms alone (<code>Reduce -nobuild9999</code>)</small></td></tr>\n"; echo "</table></p>\n"; echo "<h3>Select x-H bond-length:</h3>"; echo "<p><table width='100%' border='0'>\n"; if ($context['method'] == 'nuclear') { $check1 = ""; $check2 = "checked"; } else { $check1 = "checked"; $check2 = ""; } echo "<tr valign='top'><td width='300'><input type='radio' name='blength' value='ecloud' {$check1}> <b>Electron-cloud x-H</b><td>"; echo "<td><small>Use electron-cloud x-H bond lengths and vdW radii.\nIdeal for most cases, especially X-ray crystal structures."; echo "</small></td></tr>\n"; echo "<tr><td colspan='2'> </td></tr>\n"; // vertical spacer echo "<tr valign='top' align='left'><td width='300'><input type='radio' name='blength' value='nuclear' {$check2}> <b>Nuclear x-H</b><td>"; echo "<td><small>Use nuclear x-H bond lengths and vdW radii.\nIdeal for NMR, neutron diffraction, etc.</small></td></tr>\n"; echo "</table></p>\n"; echo "<p><table width='100%' border='0'><tr>\n"; echo "<td><input type='submit' name='cmd' value='Start adding H >'></td>\n"; echo "<td align='right'><input type='submit' name='cmd' value='Cancel'></td>\n"; echo "</tr></table></p></form>\n"; ?> <script type='text/javascript'> function setFlipkins(hasProtein) { flipkin = document.getElementById("makeFlipkin"); flipkin.checked = hasProtein; nqh_reg = document.getElementById("nqh_regularize"); nqh_reg.checked = hasProtein; } // This nifty function means we won't override other ONLOAD handlers function windowOnload(f) { var prev = window.onload; window.onload = function() { if(prev) prev(); f(); } } // On page load, find the selected model and sync us to its state windowOnload(function() { var models = document.getElementsByName('modelID'); for(var i = 0; i < models.length; i++) { if(models[i].checked) models[i].onclick(); } }); </script> <hr> <div class='help_info'> <h4>Adding hydrogens</h4> <i>TODO: Help text about Reduce and adding hydrogens goes here</i> </div> <?php } else { echo "No models are available. Please <a href='" . makeEventURL("onCall", "upload_setup.php") . "'>upload or fetch a PDB file</a> in order to continue.\n"; echo makeEventForm("onReturn"); echo "<p><input type='submit' name='cmd' value='Cancel'></p></form>\n"; } echo $this->pageFooter(); }
/** * Context may contain the following keys: * modelID the model ID to add H to * map the ED map to use */ function display($context) { echo $this->pageHeader("Refit sidechains"); // Script to discourage people from choosing models without H ?> <script language='JavaScript'> <!-- function warnNoH(obj) { if(!window.confirm("The file you chose may not have all its H atoms added."+ " All-atom contacts requires all H atoms to function properly.")) { obj.checked = false } } // --> </script> <div class='alert'> <center><h3>ALPHA TEST</h3></center> Not suitable for use by the general public. </div> <?php if (count($_SESSION['models']) > 0 && count($_SESSION['edmaps']) > 0) { // Choose a default model to select $lastUsedID = $context['modelID']; if (!$lastUsedID) { $lastUsedID = $_SESSION['lastUsedModelID']; } echo makeEventForm("onChooseResidues"); echo "<h3>Select a model to work with:</h3>"; echo "<p><table width='100%' border='0' cellspacing='0' cellpadding='2'>\n"; $c = MP_TABLE_ALT1; foreach ($_SESSION['models'] as $id => $model) { // Alternate row colors: $c == MP_TABLE_ALT1 ? $c = MP_TABLE_ALT2 : ($c = MP_TABLE_ALT1); $checked = $lastUsedID == $id ? "checked" : ""; echo " <tr bgcolor='{$c}'>\n"; if ($model['isReduced']) { echo " <td><input type='radio' name='modelID' value='{$id}' {$checked}></td>\n"; echo " <td><b>{$model['pdb']}</b></td>\n"; echo " <td><small>{$model['history']}</small></td>\n"; } else { echo " <td><input type='radio' name='modelID' value='{$id}' onclick='warnNoH(this)' {$checked}></td>\n"; echo " <td><span class='inactive' title='Doesn't have H added'><b>{$model['pdb']}</b></span></td>\n"; echo " <td><span class='inactive'><small>{$model['history']}</small></span></td>\n"; } echo " </tr>\n"; } echo "</table></p>\n"; echo "<h3>Select a CCP4-format electron density map:</h3>"; echo "<p><table width='100%' border='0' cellspacing='0' cellpadding='2'>\n"; $c = MP_TABLE_ALT1; foreach ($_SESSION['edmaps'] as $map) { // Alternate row colors: $c == MP_TABLE_ALT1 ? $c = MP_TABLE_ALT2 : ($c = MP_TABLE_ALT1); $checked = $context['map'] == $map ? "checked" : ""; echo " <tr bgcolor='{$c}'>\n"; echo " <td><input type='radio' name='map' value='{$map}' {$checked}>\n"; echo " <b>{$map}</b></td>\n"; echo " </tr>\n"; } echo "</table></p>\n"; echo "<p><table width='100%' border='0'><tr>\n"; echo "<td><input type='submit' name='cmd' value='Choose residues to refit >'></td>\n"; echo "<td align='right'><input type='submit' name='cmd' value='Cancel'></td>\n"; echo "</tr></table></p></form>\n"; ?> <hr> <div class='help_info'> <h4>Refitting sidechains</h4> <i>TODO: Help text about SSwing and refitting sidechains goes here</i> </div> <?php } elseif (count($_SESSION['models']) == 0) { echo "No models are available. Please <a href='" . makeEventURL("onCall", "upload_setup.php") . "'>upload or fetch a PDB file</a> in order to continue.\n"; echo makeEventForm("onReturn"); echo "<p><input type='submit' name='cmd' value='Cancel'></p></form>\n"; } else { echo "No electron density maps are available. Please <a href='" . makeEventURL("onCall", "upload_setup.php") . "'>upload a CCP4-format map</a> in order to continue.\n"; echo makeEventForm("onReturn"); echo "<p><input type='submit' name='cmd' value='Cancel'></p></form>\n"; } echo $this->pageFooter(); }
/** * Context may contain the following keys: * modelID the model ID to analyze */ function display($context) { echo $this->pageHeader("Analyze all-atom contacts and geometry"); //{{{ Script to set default choices based on model properties. ?> <script language='JavaScript'> <!-- var selectionHasH = true function hideKinOpts() { var block = document.getElementById('kin_opts') if(document.forms[0].doKinemage.checked) block.style.display = 'block' else block.style.display = 'none' } function hideChartOpts() { var block = document.getElementById('chart_opts') if(document.forms[0].doCharts.checked) block.style.display = 'block' else block.style.display = 'none' } function hideMultiOpts() { var block = document.getElementById('multi_opts') if(document.forms[0].chartMulti.checked) block.style.display = 'block' else block.style.display = 'none' } //function hideLowResOpts() //{ // var block = document.getElementById('lowres_opts') // if(document.forms[0].doLowRes.checked) block.style.display = 'block' // else block.style.display = 'none' //} function setAnalyses(doAAC, hasProtein, hasNucAcid, isBig, isLowRes) { selectionHasH = doAAC document.forms[0].kinClashes.checked = doAAC document.forms[0].kinHbonds.checked = doAAC document.forms[0].kinContacts.checked = doAAC && !isBig document.forms[0].chartClashlist.checked = doAAC document.forms[0].kinRama.checked = hasProtein document.forms[0].kinRota.checked = hasProtein document.forms[0].kinCBdev.checked = hasProtein document.forms[0].kinGeom.checked = (hasProtein || hasNucAcid) document.forms[0].kinOmega.checked = hasProtein document.forms[0].kinCablamLow.checked = (hasProtein && isLowRes) document.forms[0].chartRama.checked = hasProtein document.forms[0].chartRota.checked = hasProtein document.forms[0].chartCBdev.checked = hasProtein document.forms[0].chartGeom.checked = (hasProtein || hasNucAcid) document.forms[0].chartOmega.checked = hasProtein document.forms[0].chartCablamLow.checked = (hasProtein && isLowRes) document.forms[0].kinBaseP.checked = hasNucAcid document.forms[0].kinSuite.checked = hasNucAcid document.forms[0].chartBaseP.checked = hasNucAcid document.forms[0].chartSuite.checked = hasNucAcid //document.forms[0].chartCoot.checked = !isBig document.forms[0].chartImprove.checked = (hasProtein && doAAC) document.forms[0].chartMulti.checked = (hasProtein || hasNucAcid) document.forms[0].chartNotJustOut.checked = !isBig document.forms[0].chartAltloc.checked = (hasProtein || hasNucAcid) //Low-resolution analyses, all end with Low //document.forms[0].doLowRes.checked = (hasProtein && isLowRes) // Low-res kinemage options are expected to expand in the future // document.forms[0].kinClashesLow.checked = (doAAC && isLowRes) // document.forms[0].kinGeomLow.checked = ((hasProtein || hasNucAcid) && isLowRes) } // Try to make sure we have H if we're doing AAC function checkSettingsBeforeSubmit() { var doAAC = (document.forms[0].kinClashes.checked || document.forms[0].kinHbonds.checked || document.forms[0].kinContacts.checked || document.forms[0].chartClashlist.checked); if(!selectionHasH && doAAC) { return window.confirm("The file you choose may not have all its H atoms added." +" All-atom contacts requires all H atoms to function properly." +" Do you want to proceed anyway?") } else return true; // OK to submit } // --> </script><?php //}}} Script to set default choices based on model properties. if (count($_SESSION['models']) > 0) { // Choose a default model to select $lastUsedID = $context['modelID']; if (!$lastUsedID) { $lastUsedID = $_SESSION['lastUsedModelID']; } echo makeEventForm("onRunAnalysis"); echo "<h3>Select a model to work with:</h3>"; echo "<p><table width='100%' border='0' cellspacing='0' cellpadding='2'>\n"; $c = MP_TABLE_ALT1; foreach ($_SESSION['models'] as $id => $model) { // Determine which tasks should be selected by default, // and use an ONCLICK handler to set them. //$doAAC = ($model['isReduced'] ? "true" : "false"); $stats = $model['stats']; $doAAC = $stats['has_most_H'] || $model['isReduced'] ? "true" : "false"; $hasProtein = $stats['sidechains'] > 0 ? "true" : "false"; $hasNucAcid = $stats['nucacids'] > 0 ? "true" : "false"; $pdbSize = filesize($_SESSION['dataDir'] . '/' . MP_DIR_MODELS . '/' . $model['pdb']); $isBig = $pdbSize > 1 << 21 ? "true" : "false"; // 1<<20 = 2^20 $isLowRes = $stats['resolution'] > 2.5 ? "true" : "false"; // Alternate row colors: $c == MP_TABLE_ALT1 ? $c = MP_TABLE_ALT2 : ($c = MP_TABLE_ALT1); echo " <tr bgcolor='{$c}'>\n"; $checked = $lastUsedID == $id ? "checked" : ""; echo " <td><input type='radio' name='modelID' value='{$id}' onclick='setAnalyses({$doAAC}, {$hasProtein}, {$hasNucAcid}, {$isBig})' {$checked}></td>\n"; echo " <td><b>{$model['pdb']}</b></td>\n"; echo " <td><small>{$model['history']}</small></td>\n"; echo " </tr>\n"; if ($checked) { $jsOnLoad = "setAnalyses({$doAAC}, {$hasProtein}, {$hasNucAcid}, {$isBig}, {$isLowRes})"; } } echo "</table></p>\n"; ?> <hr> <h3 class='nospaceafter'>Choose the outputs you want:</h3> Default options have been selected based on the content of the submitted file. <br>Follow the <a target="_blank" href="help/validation_options/validation_options.html"> <img src="img/helplink.jpg" alt="" title="General help"></a> symbols for more information on the validation options. <div class='indent'> <h5 class='nospaceafter'><label><input type='checkbox' name='doKinemage' value='1' checked onclick='hideKinOpts()'> 3-D kinemage graphics</label></h5> <div class='indent' id='kin_opts'> <label><b>Universal</b></label> <br><label><input type='checkbox' name='kinClashes' value='1'> Clashes</label> <a target="_blank" href="help/validation_options/validation_options.html#clashes"> <img src="img/helplink.jpg" alt="" title="Clash help"></a> <br><label><input type='checkbox' name='kinHbonds' value='1'> Hydrogen bonds</label> <a target="_blank" href="help/validation_options/validation_options.html#hbonds"><img src="img/helplink.jpg" alt="" title="H-bond help"></a> <br><label><input type='checkbox' name='kinContacts' value='1'> van der Waals contacts</label> <a target="_blank" href="help/validation_options/validation_options.html#vdwcontacts"><img src="img/helplink.jpg" alt="" title="vdw contact help"></a> <br><label><input type='checkbox' name='kinGeom' value='1'> Geometry evaluation</label> <a target="_blank" href="help/validation_options/validation_options.html#bondgeometry"><img src="img/helplink.jpg" alt="" title="Geometry help"></a> <p><label><b>Protein</b></label> <br><label><input type='checkbox' name='kinRama' value='1'> Ramachandran plots</label> <a target="_blank" href="help/validation_options/validation_options.html#ramachandran"><img src="img/helplink.jpg" alt="" title="Ramachandran help"></a> <br><label><input type='checkbox' name='kinRota' value='1'> Rotamer evaluation</label> <a target="_blank" href="help/validation_options/validation_options.html#rotamers"><img src="img/helplink.jpg" alt="" title="Rotamer help"></a> <br><label><input type='checkbox' name='kinCBdev' value='1'> Cβ deviations</label> <a target="_blank" href="help/validation_options/validation_options.html#cbdev"><img src="img/helplink.jpg" alt="" title="CB deviation help"></a> <br><label><input type='checkbox' name='kinOmega' value='1'> Cis-Peptide evaluation</label> <a target="_blank" href="help/validation_options/validation_options.html#cispeptides"><img src="img/helplink.jpg" alt="" title="Cis-peptide help"></a> <br><label><input type='checkbox' name='kinCablamLow' value='1'> CaBLAM backbone markup</label> <a target="_blank" href="help/validation_options/validation_options.html#cablam"><img src="img/helplink.jpg" alt="" title="CaBLAM help"></a> <p><label><b>RNA</b></label> <br><label><input type='checkbox' name='kinBaseP' value='1'> RNA sugar pucker analysis</label> <a target="_blank" href="help/validation_options/validation_options.html#sugarpuckers"><img src="img/helplink.jpg" alt="" title="Sugar pucker help"></a> <br><label><input type='checkbox' name='kinSuite' value='1'> RNA backbone conformations</label> <a target="_blank" href="help/validation_options/validation_options.html#suites"><img src="img/helplink.jpg" alt="" title="Suite help"></a> <p><label><b>Other options</b></label> <br><label><input type='checkbox' name='kinForceViews' value='1'> Make views of trouble spots even if it takes longer</label> <br><label><input type='checkbox' name='kinAltConfs' value='1'> Alternate conformations</label> <br><label><input type='checkbox' name='kinBfactor' value='1'> Model colored by B-factors</label> <br><label><input type='checkbox' name='kinOccupancy' value='1'> Model colored by occupancy</label> <br><label><input type='checkbox' name='kinRibbons' value='1'> Ribbons</label> </div> <h5 class='nospaceafter'><label><input type='checkbox' name='doCharts' value='1' checked onclick='hideChartOpts()'> Charts, plots, and tables</label></h5> <div class='indent' id='chart_opts'> <label><b>Universal</b></label> <br><label><input type='checkbox' name='chartClashlist' value='1'> Clashes & clashscore</label> <a target="_blank" href="help/validation_options/validation_options.html#clashes"> <img src="img/helplink.jpg" alt="" title="Clash help"></a> <br><label><input type='checkbox' name='chartGeom' value='1'> Geometry evaluation</label> <a target="_blank" href="help/validation_options/validation_options.html#bondgeometry"> <img src="img/helplink.jpg" alt="" title="Geometry help"></a> <p><label><b>Protein</b></label> <br><label><input type='checkbox' name='chartRama' value='1'> Ramachandran plots</label> <a target="_blank" href="help/validation_options/validation_options.html#ramachandran"> <img src="img/helplink.jpg" alt="" title="Ramachandran help"></a> <br><label><input type='checkbox' name='chartRota' value='1'> Rotamer evaluation</label> <a target="_blank" href="help/validation_options/validation_options.html#rotamers"> <img src="img/helplink.jpg" alt="" title="Rotamer help"></a> <br><label><input type='checkbox' name='chartCBdev' value='1'> Cβ deviations</label> <a target="_blank" href="help/validation_options/validation_options.html#cbdev"> <img src="img/helplink.jpg" alt="" title="CB deviation help"></a> <br><label><input type='checkbox' name='chartOmega' value='1'> Cis-Peptide evaluation</label> <a target="_blank" href="help/validation_options/validation_options.html#cispeptides"> <img src="img/helplink.jpg" alt="" title="Cis-peptide help"></a> <br><label><input type='checkbox' name='chartCablamLow' value='1'> CaBLAM backbone evaluation</label> <a target="_blank" href="help/validation_options/validation_options.html#cablam"> <img src="img/helplink.jpg" alt="" title="CaBLAM help"></a> <p><label><b>RNA</b></label> <br><label><input type='checkbox' name='chartBaseP' value='1'> RNA sugar pucker analysis</label> <a target="_blank" href="help/validation_options/validation_options.html#sugarpuckers"> <img src="img/helplink.jpg" alt="" title="Sugar pucker help"></a> <br><label><input type='checkbox' name='chartSuite' value='1'> RNA backbone conformations</label> <a target="_blank" href="help/validation_options/validation_options.html#suites"> <img src="img/helplink.jpg" alt="" title="Suite help"></a> <p><label><b>Other options</b></label> <br><label><input type='checkbox' name='chartHoriz' value='1'> Horizontal chart with real-space correlation data</label> <br><label><input type='checkbox' name='chartCoot' value='1'> Chart for use with Coot (may take a long time, but should take less than 1 hour) </label> <br><label><input type='checkbox' name='chartImprove' value='1'> Suggest / report on automatic structure fix-ups</label> <br><label><input type='checkbox' name='chartMulti' value='1' onclick='hideMultiOpts()'> Create html version of multi-chart</label> <div class='indent' id='multi_opts'> <label><input type='checkbox' name='chartNotJustOut' value='1'> List all residues in multi-chart, not just outliers</label> <br><label><input type='checkbox' name='chartAltloc' value='1'> Remove residue rows with ' ' altloc when other alternate(s) present</label> </div> </div> </div> <?php echo "<p><table width='100%' border='0'><tr>\n"; echo "<td><input type='submit' name='cmd' value='Run programs to perform these analyses >' onclick='return checkSettingsBeforeSubmit()'></td>\n"; echo "<td align='right'><input type='submit' name='cmd' value='Cancel'></td>\n"; echo "</tr></table></p></form>\n"; // Rather than trying to put this in onload(), we'll do it after the form is defined. if ($jsOnLoad) { echo "<script language='JavaScript'>\n<!--\n{$jsOnLoad}\n// -->\n</script>\n"; } ?> <hr> <div class='help_info'> <h4>Analyze all-atom contacts and geometry</h4> <i>TODO: Help text about analysis goes here</i> </div> <?php } else { echo "No models are available. Please <a href='" . makeEventURL("onCall", "upload_setup.php") . "'>upload or fetch a PDB file</a> in order to continue.\n"; echo makeEventForm("onReturn"); echo "<p><input type='submit' name='cmd' value='Cancel'></p></form>\n"; } echo $this->pageFooter(); }
function display($context) { echo $this->pageHeader("Visualize interface contacts"); ?> <script language='JavaScript'> <!-- function warnNoH(obj) { if(!window.confirm("The file you chose may not have all its H atoms added."+ " All-atom contacts requires all H atoms to function properly.")) { obj.checked = false } } // --> </script><?php if (count($_SESSION['models']) > 0) { // Choose a default model to select $lastUsedID = $context['modelID']; if (!$lastUsedID) { $lastUsedID = $_SESSION['lastUsedModelID']; } // These lines create an HTML form that will call onChooseOptions() to be called // when the user clicks the submit button. onChooseOptions() is declared below. echo makeEventForm("onChooseOptions"); echo "<h3>Select a model to work with:</h3>"; echo "<p><table width='100%' border='0' cellspacing='0' cellpadding='2'>\n"; $c = MP_TABLE_ALT1; foreach ($_SESSION['models'] as $id => $model) { // Alternate row colors: $c == MP_TABLE_ALT1 ? $c = MP_TABLE_ALT2 : ($c = MP_TABLE_ALT1); echo " <tr bgcolor='{$c}'>\n"; $checked = $lastUsedID == $id ? "checked" : ""; if ($model['isReduced'] || $model['stats']['has_most_H']) { echo " <td><input type='radio' name='modelID' value='{$id}' {$checked}></td>\n"; echo " <td><b>{$model['pdb']}</b></td>\n"; echo " <td><small>{$model['history']}</small></td>\n"; } else { echo " <td><input type='radio' name='modelID' value='{$id}' onclick='warnNoH(this)'></td>\n"; echo " <td><span class='inactive' title='Already has H added'><b>{$model['pdb']}</b></span></td>\n"; echo " <td><span class='inactive'><small>{$model['history']}</small></span></td>\n"; } echo " </tr>\n"; } echo "</table></p>\n"; echo "<p><table width='100%' border='0'><tr>\n"; echo "<td><input type='submit' name='cmd' value='Choose Probe options >'></td>\n"; echo "<td align='right'><input type='submit' name='cmd' value='Cancel'></td>\n"; echo "</tr></table></p></form>\n"; // Note the explicit </form> to end the form! ?> <hr> <div class='help_info'> <h4>Visualizing interface contacts</h4> <i>TODO: Help text about interfaces and Probe goes here</i> </div> <?php } else { echo "No models are available. Please <a href='" . makeEventURL("onCall", "upload_setup.php") . "'>upload or fetch a PDB file</a> in order to continue.\n"; echo makeEventForm("onChooseOptions"); echo "<p><input type='submit' name='cmd' value='Cancel'></p></form>\n"; } echo $this->pageFooter(); }
/** * Make sure you say what $context is here. For example: * * Context is an array containing: * labbookEntry the labbook entry number for adding this new model */ function display($context) { echo $this->pageHeader("JiffiLoop options"); if (count($_SESSION['models']) > 0) { // Choose a default model to select $lastUsedID = $context['modelID']; if (!$lastUsedID) { $lastUsedID = $_SESSION['lastUsedModelID']; } echo makeEventForm("onFillGaps"); echo "<h3>Select a model to fill gaps:</h3>"; echo "<p><table width='100%' border='0' cellspacing='0' cellpadding='2'>\n"; $c = MP_TABLE_ALT1; foreach ($_SESSION['models'] as $id => $model) { // Alternate row colors: $c == MP_TABLE_ALT1 ? $c = MP_TABLE_ALT2 : ($c = MP_TABLE_ALT1); echo " <tr bgcolor='{$c}'>\n"; echo " <td><input type='radio' name='modelID' value='{$id}' checked></td>\n"; echo " <td><b>{$model['pdb']}</b></td>\n"; echo " <td><small>{$model['history']}</small></td>\n"; } echo "</table></p>\n"; ?> <p> <br> <p>Max number of fragments to return:<input type='text' name='num_fragments' size=5 maxlength=10 value='100'> <p>Simulate gap starting from residue number:<input type='text' name='gap_start' size=5 maxlength=10> to <input type='text' name='gap_end' size=5 maxlength=10> <p><input type="checkbox" name="tight_params" value="1" checked> Use narrow ranges around JiffiLoop parameters <p><input type="checkbox" name="keep_seq" value="1"> Keep original sequences of matching loops <p><input type="checkbox" name="nomatch" value="1" onclick="switchTextBox()"> Instead of matching gap size, return loops of length (<15):<input type='text' disabled name='nomatch_size' size=5 maxlength=5> <p><input type="checkbox" name="ranges" value="1" onclick="hideRangeOpts()"> Manually specify parameter ranges: <div class='indent' id='range_opts' style="display: none"> <p>Distance: <input type='text' name='distrange' size=5 maxlength=5> <p>Angles: <input type="text" name='nanglerange' size=5 maxlength=5> <input type="text" name='canglerange' size=5 maxlength=5> <p>Dihedrals: <input type="text" name='ndihedrange' size=5 maxlength=5> <input type="text" name='ddihedrange' size=5 maxlength=5> <input type="text" name='cdihedrange' size=5 maxlength=5> </div> <table width='100%' border='0'><tr> <p><td><input type='submit' name='cmd' value='Start filling gaps >'></td> <td align='right'><input type='submit' name='cmd' value='Cancel'></td> </tr></table></p></form> <hr> <div class='help_info'> <h4>Filling gaps in protein backbone using JiffiLoop</h4> JiffiLoop attempts to fill gaps in protein backbone using the relative geometry of the two peptides surrounding a gap, using a fragment library derived from the Top5200 set of PDB files. JiffiLoop fills gaps up to 15 peptides long, with best results from < 8 peptide gaps. . <ul> <li>"Max number of fragments to return" -- changes the maximum number of fragments to return. Be careful, setting this value too high may result in the job running for a long time!</li> <li>"Simulate gap starting from residue number___to___" -- enter start and end residues to have JiffiLoop simulate a gap between those residues. <li>"Use narrow ranges around JiffiLoop parameters" -- returns fragments which match the end peptide geometry fairly closely. Uncheck to get fragments with a wider geometry range.</li> <li>"Keep original sequences of matching loops" -- by default, all non-gly, pro residues are mutated to ala. Check to retain the original sequence from the source PDBs.</li> <li>"Instead of matching gap size, return loops of length (< 15)" -- by default, gaps are filled with the appropriate number of peptides, based on the residue numbers of the endpoint peptides. Check and fill in a desired size (< 15) to search for different length fragments.</li> </ul> </div> <!-- Simple javascript function to turn off or on the 'nomatch_size' text box when 'nomatch' is checked--> <SCRIPT type="text/javascript"> function switchTextBox() { if(document.forms[0].nomatch.checked) { document.forms[0].nomatch_size.disabled=false } else { document.forms[0].nomatch_size.disabled=true } //if(document.forms[0].ranges.checked) { // document.forms[0].distrange.disabled=false // document.forms[0].nanglerange.disabled=false // document.forms[0].canglerange.disabled=false // document.forms[0].ndihedrange.disabled=false // document.forms[0].ddihedrange.disabled=false // document.forms[0].cdihedrange.disabled=false //} else { // document.forms[0].distrange.disabled=true // document.forms[0].nanglerange.disabled=true // document.forms[0].canglerange.disabled=true // document.forms[0].ndihedrange.disabled=true // document.forms[0].ddihedrange.disabled=true // document.forms[0].cdihedrange.disabled=true //} } // hides range options function hideRangeOpts() { var block = document.getElementById('range_opts') if(document.forms[0].ranges.checked) { block.style.display = 'block' document.forms[0].tight_params.checked=false } else block.style.display = 'none' } </SCRIPT> <?php } else { echo "No models are available. Please <a href='" . makeEventURL("onCall", "upload_setup.php") . "'>upload or fetch a PDB file</a> in order to continue.\n"; echo makeEventForm("onChooseOptions"); echo "<p><input type='submit' name='cmd' value='Cancel'></p></form>\n"; } // Here's a sample page that displays a notebook entry. // The notebook entry number was specified in $context['labbookEntry'] // This is a common way to display results of a background job. // Load and format the notebook entry: //$labbook = openLabbook(); //$num = $context['labbookEntry']; //echo formatLabbookEntry($labbook[$num]); // This line makes a URL that, when clicked, will cause the onEditNotebook() // function to be called. It's declared below... //echo "<p><a href='".makeEventURL('onEditNotebook', $num)."'>Edit notebook entry</a></p>\n"; // These lines create an HTML form that will call onReturn() to be called // when the user clicks the Continue > button. onReturn() is declared below. //echo "<p>" . makeEventForm("onReturn"); //echo "<input type='submit' name='cmd' value='Continue >'>\n</form></p>\n"; // Note the explicit </form> to end the form! echo $this->pageFooter(); }
/** * Context is not used; $_SESSION[bgjob] is used instead. */ function display($context) { // Because we can't modify $_SESSION while a background job is running, // we have to "cheat" on our contract and use display() to take action. // This is not recommended for normal MolProbity pages!! if (isset($_REQUEST['abort']) && $_REQUEST['abort'] == $_SESSION['bgjob']['processID']) { // Sometimes jobs die due to seg fault or PHP syntax error. // Thus, the isRunning flag remains set forever, causing the UI to "hang". // However, posix_kill() will return failure, b/c the job no longer exists. // So, we try to kill the job and proceed, with the assumption that it worked. posix_kill($_SESSION['bgjob']['processID'], 9); // 9 --> KILL mpSessReadOnly(false); unset($_SESSION['bgjob']['processID']); $_SESSION['bgjob']['endTime'] = time(); $_SESSION['bgjob']['isRunning'] = false; // It no longer makes sense to continue -- needed vars may be undefined. // All we can do is return to the main page! //pageGoto("sitemap.php"); No, b/c we're already in display() $_SESSION['bgjob']['whereNext'] = "welcome.php"; mpSaveSession(); } $ellapsed = time() - $_SESSION['bgjob']['startTime']; if ($_SESSION['bgjob']['isRunning'] && !$_SESSION['bgjob']['processID'] && $ellapsed > 5) { $url = makeEventURL("onGoto", "welcome.php"); $refresh = "10; URL={$url}"; echo $this->pageHeader("Job failed to start"); //, "none", $refresh); echo "<p>It appears that your background job failed to start.\n"; echo "<br>This is probably due to a syntax error in one of the PHP scripts.\n"; echo "<br>See the session error log for hints.\n"; echo "<p><a href='{$url}'>Click here</a> to continue.\n"; echo $this->pageFooter(); } elseif ($_SESSION['bgjob']['isRunning']) { // We have to be very careful to not overwrite $_SESSION while the // background job is running, or data could be lost!!! mpSessReadOnly(true); // A simple counter to make sure browsers think each reload // is a "unique" page... $count = $_REQUEST['count'] + 1; // We use basename() to get "index.php" instead of the full path, // which is subject to corruption with URL forwarding thru kinemage. $url = basename($_SERVER['PHP_SELF']) . "?{$_SESSION['sessTag']}&count={$count}"; // Refresh once quickly to get list of tasks displayed, then at given rate $rate = $count == 1 ? 2 : $_SESSION['bgjob']['refreshRate']; // Slow down if this is a long job if ($ellapsed > 30 && $rate < 5) { $rate = 5; } elseif ($ellapsed > 120 && $rate < 10) { $rate = 10; } elseif ($ellapsed > 1200 && $rate < 30) { $rate = 30; } // after 20 min, refresh every 30 sec $refresh = "{$rate}; URL={$url}"; echo $this->pageHeader("Job is running...", "none", $refresh); echo "<p><center>\n"; echo "<table border='0'><tr><td>\n"; echo "<img src='img/2sod-anim.gif'></td><td>\n"; @readfile("{$_SESSION['dataDir']}/" . MP_DIR_SYSTEM . "/progress"); echo "</td></tr></table></center>\n"; echo "<p><small>Your job has been running for " . $this->fmtTime($ellapsed) . ".</small>\n"; echo "<br><small>If this page doesn't update after {$rate} seconds, <a href='{$url}'>click here</a>.</small>\n"; if (isset($_SESSION['bgjob']['processID'])) { echo "<br><small>If needed, you can <a href='{$url}&abort={$_SESSION[bgjob][processID]}'>abort this job</a>.\n"; } echo $this->pageFooter(); } elseif ($_SESSION['bgjob']['modelError']) { $url = makeEventURL("onGoto", "welcome.php"); $pdburlMODEL = "http://deposit.rcsb.org/adit/docs/pdb_atom_format.html#MODEL"; $pdburlENDMDL = "http://deposit.rcsb.org/adit/docs/pdb_atom_format.html#ENDMDL"; $refresh = "10; URL={$url}"; echo $this->pageHeader("CCTBX job failed"); //, "none", $refresh); echo "<p>It appears that the PDB you provided has a formatting error.\n"; echo "<br>MolProbity believes the formatting error has to do with mismatched MODEL and ENDMDL cards.\n\n"; echo "<p>Each MODEL card must be uniquely numbered and have a matching ENDMDL card.\n"; echo "<p>The most common error is 'MODEL 1' existing with no ENDMDL card.\n"; echo "<br>For further info please see the <a href='{$pdburlMODEL}' target=\"_blank\">PDB's MODEL</a> and <a href='{$pdburlENDMDL}' target=\"_blank\">ENDMDL</a> documentation.\n"; echo "<p><strong>To fix:</strong> please check your fomatting conforms to proper PDB"; echo "<br>conventions and try again. If you continue experiencing problems please"; echo "<br>contact us using the feedback page which you can access on the left-hand"; echo "<br>navigation bar from the main page.\n"; echo "<p><a href='{$url}'>Click here</a> to return to the main page. \n"; echo $this->pageFooter(); } elseif ($_SESSION['bgjob']['elementError']) { $url = makeEventURL("onGoto", "welcome.php"); $pdburl = "http://www.wwpdb.org/documentation/file-format/format33/sect9.html#ATOM"; $refresh = "10; URL={$url}"; echo $this->pageHeader("CCTBX job failed"); //, "none", $refresh); echo "<p>It appears that the PDB you provided has a formatting error.\n"; echo "<br>MolProbity believes the formatting error has to do with improper chemical names (a.k.a. element symbols)\n\n"; echo "<p>Here is an example of PDB format:"; echo "<pre>\n"; echo " 1 2 3 4 5 6 7 8\n"; echo "12345678901234567890123456789012345678901234567890123456789012345678901234567890\n"; echo "ATOM 32 N AARG A -3 11.281 86.699 94.383 0.50 35.88 N\n"; echo "ATOM 33 N BARG A -3 11.296 86.721 94.521 0.50 35.60 N\n"; echo "ATOM 34 CA AARG A -3 12.353 85.696 94.456 0.50 36.67 C\n"; echo "ATOM 35 CA BARG A -3 12.333 85.862 95.041 0.50 36.42 C\n"; echo "ATOM 36 C AARG A -3 13.559 86.257 95.222 0.50 37.37 C\n"; echo "ATOM 37 C BARG A -3 12.759 86.530 96.365 0.50 36.39 C\n"; echo "ATOM 38 O AARG A -3 13.753 87.471 95.270 0.50 37.74 O\n"; echo "ATOM 39 O BARG A -3 12.924 87.757 96.420 0.50 37.26 O\n"; echo "ATOM 40 CB AARG A -3 12.774 85.306 93.039 0.50 37.25 C\n"; echo "ATOM 41 CB BARG A -3 13.428 85.746 93.980 0.50 36.60 C\n"; echo "ATOM 42 CG AARG A -3 11.754 84.432 92.321 0.50 38.44 C\n"; echo "ATOM 43 CG BARG A -3 12.866 85.172 92.651 0.50 37.31 C\n"; echo "ATOM 44 CD AARG A -3 11.698 84.678 90.815 0.50 38.51 C\n"; echo "ATOM 45 CD BARG A -3 13.374 85.886 91.406 0.50 37.66 C\n"; echo "HETATM 46 MG MG B 101 44.444 55.555 66.666 1.00 42.42 MG\n"; echo "</pre><p>Chemical names must be in columns 77-78 of the PDB file, right justified (e.g. \" C\"). "; echo "<br>For further info please see the <a href='{$pdburl}' target=\"_blank\">PDB formatting</a> guide.\n"; echo "<p><strong>To fix:</strong> please check your fomatting conforms to proper PDB"; echo "<br>conventions and try again. If you continue experiencing problems please"; echo "<br>contact us using the feedback page which you can access on the left-hand"; echo "<br>navigation bar from the main page.\n"; echo "<p><a href='{$url}'>Click here</a> to return to the main page.\n"; echo $this->pageFooter(); } elseif ($_SESSION['bgjob']['cctbxError']) { $url = makeEventURL("onGoto", "feedback_setup.php"); $refresh = "10; URL={$url}"; echo $this->pageHeader("CCTBX job failed"); //, "none", $refresh); echo "<p>It appears that your CCTBX-powered job failed.\n"; echo "<br>This is probably due to a syntax error in one of the CCTBX scripts!\n"; echo "<br>See the session error log for hints, and please report the bug using the Feedback tool.\n"; echo "<p><a href='{$url}'>Click here</a> to continue.\n"; echo $this->pageFooter(); } else { $url = makeEventURL("onGoto", $_SESSION['bgjob']['whereNext'], $_SESSION['bgjob']); $refresh = "3; URL={$url}"; echo $this->pageHeader("Job is finished", "none", $refresh); echo "<p><center>\n"; echo "<p><table border='0'><tr><td>\n"; @readfile("{$_SESSION['dataDir']}/" . MP_DIR_SYSTEM . "/progress"); echo "</td></tr></table></center>\n"; echo "<p><small>Your job ran for " . $this->fmtTime($_SESSION['bgjob']['endTime'] - $_SESSION['bgjob']['startTime']) . ".</small>\n"; echo "<br><small>If nothing happens after 3 seconds, <a href='{$url}'>click here</a>.<small>\n"; echo $this->pageFooter(); } }
/** * Context may contain the following keys: * modelID the ID of the model just added * showAllNQH true if all Asn, Gln, and His residues should be listed * * OUTPUTS: * modelID ID code for model to process * doflip[] an array of booleans, where the keys match the second index * in the data structure from decodeReduceUsermods() */ function display($context) { echo $this->pageHeader("Review flips"); $id = $context['modelID']; $model = $_SESSION['models'][$id]; $pdb = $_SESSION['dataDir'] . '/' . MP_DIR_MODELS . '/' . $model['pdb']; $flags = ''; $changes = decodeReduceUsermods($pdb); // Check to see if any cliques couldn't be solved by looking for scores = -9.9e+99 // At the same time, check to see if anything at all was flipped... $didnt_solve = $did_flip = false; $n = count($changes[0]); // How many changes are in the table? for ($c = 0; $c < $n; $c++) { if ($changes[6][$c] == "-9.9e+99") { $didnt_solve = true; } if (!$did_flip && ($changes[4][$c] == "FLIP" || $changes[4][$c] == "CLS-FL")) { $did_flip = true; } } if ($didnt_solve) { echo '<p><center><div class="alert">Some H-bonding networks ("cliques") were too complex to optimize. If this is a problem, please download Reduce and run it with a higher <code>-limit</code> setting.</div></center> <p> '; } $nqkin = $_SESSION['dataDir'] . '/' . MP_DIR_KINS . "/{$model['prefix']}flipnq.kin"; $hiskin = $_SESSION['dataDir'] . '/' . MP_DIR_KINS . "/{$model['prefix']}fliphis.kin"; if ($_SESSION['reduce_blength'] == 'ecloud') { $flags = 'electron-cloud'; } else { $flags = 'nuclear'; } if (file_exists($nqkin) && file_exists($hiskin)) { echo "These Flipkin kinemages illustrate the changes Reduce made.\n"; echo "Residues that were flipped are marked with stars (*) in the Views menu.\n"; echo "<ul>\n"; echo "<li>" . linkKinemage("{$model['prefix']}flipnq.kin") . "</li>\n"; echo "<li>" . linkKinemage("{$model['prefix']}fliphis.kin") . "</li>\n"; echo "</ul>\n"; echo "Reduce placed hydrogens at {$flags} positions.\n"; echo "<hr>\n"; } echo makeEventForm("onRerunReduce"); echo "<input type='hidden' name='modelID' value='{$id}'>\n"; if (!$did_flip && !$context['showAllNQH']) { echo "Reduce didn't flip any groups while adding hydrogens to your file.\n"; echo "This <b>may</b> indicate that all of the Asn's, Gln's, and His's in your structure are oriented correctly.\n"; echo "(<a href='" . makeEventURL("onShowAllNQH", true) . "'>Show all Asn/Gln/His</a>)"; echo "<p><input type='submit' name='cmd' value='Continue >'>\n"; } else { echo "Below is a list of changes made while adding hydrogens.\n"; echo "Please leave selected the residues you would like to flip, and unselect those you wish not to flip.\n"; if ($context['showAllNQH']) { echo "(<a href='" . makeEventURL("onShowAllNQH", false) . "'>Show flipped Asn/Gln/His only</a>)"; } else { echo "(<a href='" . makeEventURL("onShowAllNQH", true) . "'>Show all Asn/Gln/His</a>)"; } echo "<p><table border='0' cellspacing='0' width='100%'>\n"; echo "<tr bgcolor='" . MP_TABLE_HIGHLIGHT . "'>"; echo "<td align='center'><b>Flip?</b></td>\n"; echo "<td align='center'><b>Chain</b></td>\n"; echo "<td align='right'><b>Res#</b></td>\n"; echo "<td align='center'><b>Alt</b></td>\n"; echo "<td align='center'><b>Res ID</b></td>\n"; echo "<td align='left'><b>Orig</b></td>\n"; echo "<td align='left'><b>Flip</b></td>\n"; echo "<td align='left'><b>Flip-Orig</b></td>\n"; echo "<td align='left'><b>Code</b></td>\n"; echo "<td align='left'><b>Explanation</b></td>\n"; echo "</tr>\n"; $color = MP_TABLE_ALT1; for ($c = 0; $c < $n; $c++) { if ($changes[4][$c] == "FLIP" || $changes[4][$c] == "CLS-FL" || $context['showAllNQH']) { if ($changes[4][$c] == "FLIP" or $changes[4][$c] == "CLS-FL") { $checked = "checked"; } else { $checked = ""; } echo "<tr bgcolor='{$color}'>\n"; echo "<td align='center'><input type='checkbox' {$checked} name='doflip[{$c}]' value='1'></td>\n"; echo "<td align='center'>" . $changes[1][$c] . "</td>\n"; echo "<td align='right'>" . $changes[2][$c] . "</td>\n"; echo "<td align='center'>" . $changes[13][$c] . "</td>\n"; echo "<td align='center'>" . $changes[3][$c] . "</td>\n"; echo "<td align='left'>" . $changes[8][$c] . "</td>\n"; echo "<td align='left'>" . $changes[10][$c] . "</td>\n"; echo "<td align='left'>" . ($changes[10][$c] - $changes[8][$c]) . "</td>\n"; echo "<td align='left'>" . $changes[4][$c] . "</td>\n"; echo "<td align='left'>" . $changes[5][$c] . "</td>\n"; echo "</tr>\n"; $color == MP_TABLE_ALT1 ? $color = MP_TABLE_ALT2 : ($color = MP_TABLE_ALT1); } } echo "</table>\n"; echo "<p><input type='submit' name='cmd' value='Regenerate H, applying only selected flips >'>\n"; echo "<br><small>(If you didn't make any changes, we won't recalculate.)</small>\n"; } echo "</form>\n"; echo $this->pageFooter(); }
/** * Context is not used. */ function display($context) { echo $this->pageHeader("Site map", "sitemap"); echo "<i>Features in italics have not yet been implemented.</i>\n"; echo "<h3><a href='" . makeEventURL("onCall", "upload_setup.php") . "'>Input files</a></h3>\n<ul>\n"; echo "<li>Upload PDB files from local disk.</li>\n"; echo "<li>Retrieve PDB files from the PDB or NDB.</li>\n"; echo "<li>Upload kinemages for viewing in KiNG.</li>\n"; echo "<li>Upload electron density maps.</li>\n"; echo "<li>Retrieve 2Fo-Fc and Fo-Fc (difference) maps from the EDS.</li>\n"; echo "<li>Upload custom heterogen dictionaries (for adding hydrogens).</li>\n"; echo "</ul>\n"; echo "<h3><a href='" . makeEventURL("onCall", "editpdb_setup1.php") . "'>Edit PDB files</a></h3>\n<ul>\n"; echo "<li>Remove unwanted chains.</li>\n"; echo "<li>Specify crystallographic resolution.</li>\n"; echo "</ul>\n"; echo "<h3><a href='" . makeEventURL("onCall", "pdb_convert_setup.php") . "'>Downgrade PDB to v2.3</a></h3>\n<ul>\n"; echo "<li>Downgrade an uploaded PDB to v2.3 (for download only)</li>\n"; echo "</ul>\n"; echo "<h3><a href='" . makeEventURL("onCall", "reduce_setup.php") . "'>Add hydrogens</a></h3>\n<ul>\n"; echo "<li>Add missing hydrogens.</li>\n"; echo "<li>Optimize H-bond networks.</li>\n"; echo "<li>Check for Asn, Gln, His flips.</li>\n"; echo "</ul>\n"; echo "<h3><a href='" . makeEventURL("onCall", "aacgeom_setup.php") . "'>Analyze all-atom contacts and geometry</a></h3>\n<ul>\n"; echo "<li>All-atom steric contacts (clashlist, clash score, contact dots)</li>\n"; echo "<li>Protein geometry evaluation (Ramachandran plot, rotamers, Cβ deviations)</li>\n"; echo "<li>Nucleic acid geometry (base-phosphate perpendiculars, suite names)</li>\n"; echo "<li>Evaulate protein and nucleic acid bond lengths and angles</li>\n"; echo "<li>Multi-criterion chart and kinemage displays</li>\n"; echo "</ul>\n"; echo "<h3><a href='" . makeEventURL("onCall", "interface_setup1.php") . "'>Visualize interface contacts</a></h3>\n<ul>\n"; echo "<li>Offers detailed control over running Probe to visualize steric interactions.</li>\n"; echo "<li>Displaying contacts between two subunits or chains is common, but other uses are possible.</li>\n"; echo "</ul>\n"; echo "<h3><a href='" . makeEventURL("onCall", "sswing_setup1.php") . "'>Refit sidechains</a></h3>\n<ul>\n"; echo "<li>ALPHA TEST - not for general public use.</li>\n"; echo "<li>Automatically refit sidechains based on electron density and all-atom contacts.</li>\n"; echo "</ul>\n"; echo "<h3><a href='" . makeEventURL("onCall", "makekin_setup.php") . "'>Make simple kinemages</a></h3>\n<ul>\n"; echo "<li>Make kinemages using basic Prekin scripts.</li>\n"; echo "<li>Kinemages can be combined and edited in KiNG with File | Append.</li>\n"; echo "<li>KiNG can save modified kinemages to the server with File | Save as.</li>\n"; echo "</ul>\n"; echo "<h3><a href='" . makeEventURL("onCall", "fragmentfill_setup.php") . "'>Fill protein gaps</a></h3>\n<ul>\n"; echo "<li>ALPHA TEST - not for general public use.</li>\n"; echo "<li>Fill gaps in protein structures automatically.</li>\n"; echo "</ul>\n"; echo "<hr>\n"; echo "<h3><a href='" . makeEventURL("onCall", "ens_aacgeom_setup.php") . "'>Analyze all-atom contacts and geometry for ensembles</a></h3>\n<ul>\n"; echo "<li>Multi-criterion kinemage for multi-model ensembles</li>\n"; echo "</ul>\n"; echo "<hr>\n"; echo "<h3><a href='" . makeEventURL("onGoto", "file_browser.php") . "'>View & download files</a></h3>\n<ul>\n"; echo "<li>View the original files you submitted or retrieved from the network.</li>\n"; echo "<li>View kinemages, charts, and other files created by MolProbity.</li>\n"; echo "<li>Download all files packaged as a ZIP, or individual files one at a time.</li>\n"; echo "</ul>\n"; echo "<h3><a href='" . makeEventURL("onGoto", "notebook_main.php") . "'>Lab notebook</a></h3>\n<ul>\n"; echo "<li>See notebook entries made automatically by MolProbity.</li>\n"; echo "<li>Annotate automatic entries with notes and comments.</li>\n"; echo "<li>Create your own new entries in the notebook.</li>\n"; echo "<li>Print the notebook or save it as an HTML page.</li>\n"; echo "</ul>\n"; echo "<h3><a href='" . makeEventURL("onGoto", "feedback_setup.php") . "'>Feedback & bugs</a></h3>\n<ul>\n"; echo "<li>Report problems with MolProbity or suggestions for improvement.</li>\n"; echo "</ul>\n"; echo "<h3><a href='" . makeEventURL("onGoto", "save_session.php") . "'>Save session</a></h3>\n<ul>\n"; echo "<li>Save your results from this session and come back later to keep working.</li>\n"; echo "<li>Creates a page that can be bookmarked in your web browser.</li>\n"; echo "</ul>\n"; echo "<h3><a href='" . makeEventURL("onGoto", "logout.php") . "'>Log out</a></h3>\n<ul>\n"; echo "<li>Destroy all the files created during this session.</li>\n"; echo "<li>Start over with a new session, if you want.</li>\n"; echo "<li>Free up disk space for other users. (Thanks!)</li>\n"; echo "</ul>\n"; //echo "<hr><pre>\$_SESSION = "; //print_r($_SESSION); //echo "</pre>"; echo $this->pageFooter(); }
/** * Context may contain the following keys: * ensID the ensemble ID to add H to * method the means of adding H: nobuild or build */ function display($context) { echo $this->pageHeader("Add hydrogens"); if (count($_SESSION['ensembles']) > 0) { // Choose a default model to select $lastUsedID = $context['ensID']; if (!$lastUsedID) { $lastUsedID = $_SESSION['lastUsedModelID']; } echo makeEventForm("onAddH"); echo "<h3>Select an ensemble to add H to:</h3>"; echo "<p><table width='100%' border='0' cellspacing='0' cellpadding='2'>\n"; $c = MP_TABLE_ALT1; foreach ($_SESSION['ensembles'] as $id => $ensemble) { // Use the first model of each ensemble as representative. $modelID = reset($ensemble['models']); $model = $_SESSION['models'][$modelID]; $stats = $model['stats']; // Alternate row colors: $c == MP_TABLE_ALT1 ? $c = MP_TABLE_ALT2 : ($c = MP_TABLE_ALT1); echo " <tr bgcolor='{$c}'>\n"; if ($ensemble['isReduced']) { echo " <td></td>\n"; echo " <td><span class='inactive' title='Already has H added'><b>{$ensemble['pdb']}</b></span></td>\n"; echo " <td><span class='inactive'><small>{$ensemble['history']}</small></span></td>\n"; } else { $stats = $model['stats']; $hasProtein = $stats['sidechains'] > 0 ? "true" : "false"; $hasNucAcid = $stats['nucacids'] > 0 ? "true" : "false"; $checked = $lastUsedID == $id ? "checked" : ""; echo " <td><input type='radio' name='ensID' value='{$id}' {$checked}></td>\n"; echo " <td><b>{$ensemble['pdb']}</b></td>\n"; echo " <td><small>{$ensemble['history']}</small></td>\n"; } echo " </tr>\n"; } echo "</table></p>\n"; echo "<h3>Select a method of adding H:</h3>"; echo "<p><table width='100%' border='0'>\n"; // Starts with no default method checked. This is well-intentioned but annoying. //$check1 = ($context['method'] == 'build' ? "checked" : ""); //$check2 = ($context['method'] == 'nobuild' ? "checked" : ""); // Selects -NOBUILD by default unless the user changes it. if ($context['method'] == 'build') { $check1 = "checked"; $check2 = ""; } else { $check1 = ""; $check2 = "checked"; } echo "<tr valign='top'><td><input type='radio' name='method' value='build' {$check1}> <b>Asn/Gln/His flips</b><td>"; echo "<td><small>Add missing H, optimize H-bond networks, check for flipped Asn, Gln, His"; echo " (<code>Reduce -build</code>)\n"; #echo "<div class='inline_options'><b>Advanced options:</b>\n"; #echo "<label><input type='checkbox' name='makeFlipkin' id='makeFlipkin' value='1' checked>\n"; #echo "Make Flipkin kinemages illustrating any Asn, Gln, or His flips</label></div>\n"; echo "</small></td></tr>\n"; echo "<tr><td colspan='2'> </td></tr>\n"; // vertical spacer echo "<tr valign='top'><td><input type='radio' name='method' value='nobuild' {$check2}> <b>No flips</b><td>"; echo "<td><small>Add missing H, optimize H-bond networks, leave other atoms alone (<code>Reduce -nobuild</code>)</small></td></tr>\n"; echo "</table></p>\n"; echo "<h3>Select x-H bond-length:</h3>"; echo "<p><table width='100%' border='0'>\n"; if ($context['method'] == 'ecloud') { $check1 = "checked"; $check2 = ""; } else { $check1 = ""; $check2 = "checked"; } echo "<tr valign='top'><td width='300'><input type='radio' name='blength' value='ecloud' {$check1}> <b>Electron-cloud x-H</b><td>"; echo "<td><small>Use electron-cloud x-H bond lengths and vdW radii.\nIdeal for most cases, especially X-ray crystal structures."; echo "</small></td></tr>\n"; echo "<tr><td colspan='2'> </td></tr>\n"; // vertical spacer echo "<tr valign='top' align='left'><td width='300'><input type='radio' name='blength' value='nuclear' {$check2}> <b>Nuclear x-H</b><td>"; echo "<td><small>Use nuclear x-H bond lengths and vdW radii.\nIdeal for NMR, neutron diffraction, etc.</small></td></tr>\n"; echo "</table></p>\n"; echo "<p><table width='100%' border='0'><tr>\n"; echo "<td><input type='submit' name='cmd' value='Start adding H >'></td>\n"; echo "<td align='right'><input type='submit' name='cmd' value='Cancel'></td>\n"; echo "</tr></table></p></form>\n"; ?> <hr> <div class='help_info'> <h4>Adding hydrogens</h4> <i>TODO: Help text about Reduce and adding hydrogens goes here</i> </div> <?php } else { echo "No ensembles are available. Please <a href='" . makeEventURL("onCall", "upload_setup.php") . "'>upload or fetch a PDB file</a> in order to continue.\n"; echo makeEventForm("onReturn"); echo "<p><input type='submit' name='cmd' value='Cancel'></p></form>\n"; } echo $this->pageFooter(); }