Commit 05c339e9 by Maarten L. Hekkelman

Merge branch 'trunk' of github.com:PDB-REDO/dssp into trunk

parents 9258a8c3 56561e18
......@@ -8,3 +8,7 @@ build
**/*.dssp
src/revision.hpp
out/
node_modules
docroot/fonts
docroot/scripts
docroot/css
......@@ -25,7 +25,7 @@
cmake_minimum_required(VERSION 3.15)
# set the project name
project(mkdssp VERSION 4.2.2.1 LANGUAGES CXX)
project(mkdssp VERSION 4.3 LANGUAGES CXX)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
......@@ -52,6 +52,7 @@ endif()
# Optionally build a version to be installed inside CCP4
option(BUILD_FOR_CCP4 "Build a version to be installed in CCP4" OFF)
option(BUILD_WEBSERVER "Add code to run dssp as a web service" OFF)
if(BUILD_FOR_CCP4)
if("$ENV{CCP4}" STREQUAL "" OR NOT EXISTS $ENV{CCP4})
......@@ -105,6 +106,11 @@ find_package(Threads)
if(NOT PDB_REDO_META)
find_package(libmcfp REQUIRED)
find_package(cifpp 5.0.8 REQUIRED)
if(BUILD_WEBSERVER)
find_package(zeep REQUIRED)
find_package(gxrio REQUIRED)
endif()
endif()
# The DSSP code is in a separate library, optionally to be used by others
......@@ -124,12 +130,52 @@ add_executable(mkdssp
${PROJECT_SOURCE_DIR}/src/dssp-io.hpp
${PROJECT_SOURCE_DIR}/src/mkdssp.cpp)
target_include_directories(mkdssp PRIVATE ${PROJECT_BINARY_DIR})
target_link_libraries(mkdssp PRIVATE dssp cifpp::cifpp libmcfp::libmcfp dssp::dssp)
if(USE_RSRC)
message("Using resources compiled with ${MRC}")
mrc_target_resources(mkdssp ${CIFPP_SHARE_DIR}/mmcif_pdbx.dic ${CIFPP_SHARE_DIR}/mmcif_ddl.dic)
mrc_target_resources(mkdssp
${CIFPP_SHARE_DIR}/mmcif_pdbx.dic
${CIFPP_SHARE_DIR}/mmcif_ddl.dic)
endif()
if(BUILD_WEBSERVER)
find_program(YARN yarn REQUIRED)
add_executable(dsspd
${PROJECT_SOURCE_DIR}/src/dssp-io.cpp
${PROJECT_SOURCE_DIR}/src/dssp-server.cpp)
target_link_libraries(dsspd PRIVATE dssp cifpp::cifpp libmcfp::libmcfp dssp::dssp zeep::zeep gxrio::gxrio)
# yarn rules for javascripts
set(webpack_input
${CMAKE_CURRENT_SOURCE_DIR}/webapp/pdb-redo-style.scss
${CMAKE_CURRENT_SOURCE_DIR}/webapp/index.js
${CMAKE_CURRENT_SOURCE_DIR}/webpack.config.js
)
set(webpack_output ${CMAKE_CURRENT_SOURCE_DIR}/docroot/scripts/index.js)
add_custom_command(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/node_modules
COMMAND ${YARN}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
VERBATIM)
add_custom_command(OUTPUT ${webpack_output}
DEPENDS ${webpack_input} ${CMAKE_CURRENT_SOURCE_DIR}/node_modules
COMMAND ${YARN} run $<IF:$<CONFIG:Debug>,build,build-production>
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
VERBATIM)
add_custom_target(generate_webpack DEPENDS ${webpack_output})
add_dependencies(dsspd generate_webpack)
mrc_target_resources(dsspd
${CIFPP_SHARE_DIR}/mmcif_pdbx.dic
${CIFPP_SHARE_DIR}/mmcif_ddl.dic
${PROJECT_SOURCE_DIR}/docroot/)
endif()
# Install rules
......
DSSP 4.0
DSSP 4.3
========
This is a rewrite of DSSP, now offering full mmCIF support. The difference
with previous releases of DSSP is that it now writes out an annotated mmCIF
file by default, storing the secondary structure information in the
file by default, storing the secondary structure information in the
_struct_conf category.
Another new feature in this version of DSSP is that it now defines
......@@ -33,20 +33,15 @@ Make sure you install [libcif++](https://github.com/PDB-REDO/libcifpp) and [libm
After that, building should be as easy as typing:
```
```bash
git clone https://github.com/PDB-REDO/dssp.git
cd dssp
mkdir build
cd build
cmake ..
cmake --build . --config Release
ctest -C Release
cmake --install .
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build
cmake --install build
```
This will install the `mkdssp` program in `$HOME/.local/bin`. If you want to
install elsewhere, specify the prefix with the [CMAKE_INSTALL_PREFIX](https://cmake.org/cmake/help/v3.21/variable/CMAKE_INSTALL_PREFIX.html) variable.
Usage
-----
......
Version 4.3
- Write new output by default
- Fix some issues with this new output, typo e.g.
- Added web service implementation
- Added mmcif_pdbx dictionary extension
Version 4.2.2.1
- Fixed dependency on libcifpp
......
......@@ -33,6 +33,9 @@ choose to output format, but if it is unclear, mmcif is the default. Use
this option to force output in either the old fixed column DSSP format or
the new annotated mmCIF format.
.TP
\fB--no-dssp-categories\fR
When writing mmCIF files, suppress the output of all dssp_ categories.
.TP
\fB--min-pp-stretch\fR
This option can be used to define the minimal number of residues with PHI/PSI
angles within the range required to assing a PP helix.
......
<!DOCTYPE html SYSTEM "about:legacy-compat" [
<!ENTITY nbsp "&#160;">
]>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:z2="http://www.hekkelman.com/libzeep/m2" lang="nl">
<head z2:replace="~{head::head(~{::title},~{::head/script})}">
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<title>DSSP</title>
</head>
<body class="site">
<nav z2:replace="~{menu :: navbar('about')}" />
<div class="container site-content">
<article>
<h2>General</h2>
<!-- <p>This is the DSSP web server. Before using it, please read the <a z2:href="@{/privacy-policy}">privacy policy</a>.</p> -->
</article>
<article>
<h2>References</h2>
<!-- TODO: fill in -->
<p>bla bla.</p>
<div class="programListTable">
<table style="margin-left: 0;">
<tr>
<td><a href="https://doi.org/10.1107/S2052252514009324" target="_BLANK">Web&nbsp;server</a></td>
<td>Joosten RP, Long F, Murshudov GN, Perrakis A. The PDB_REDO server for macromolecular
structure model optimization. IUCrJ. 2014; 1(4):213-220.
</td>
</tr>
<tr>
<td><a href="https://doi.org/10.1002/pro.3353" target="_BLANK">Databank</a></td>
<td>van
Beusekom B, Touw WG, Tatineni M, Somani S, Rajagopal G, Luo J, Gilliland GL,
Perrakis A, Joosten RP Homology-based hydrogen bond information improves
crystallographic structures in the PDB. Protein Science. 2018; 27:798-808.
</td>
</tr>
</table>
</div>
</article>
<article>
<h2>The Science behind DSSP</h2>
<!-- TODO: fill in -->
<!-- <p>Below are other publications that describe different algorithms and concepts of PDB-REDO.</p>
<div class="programListTable">
<table style="margin-left: 0;">
<tr>
<td><a href="https://doi.org/10.1126/science.317.5835.195" target="_BLANK">No data, no
PDB&#8209;REDO</a></td>
<td>Joosten RP, Vriend G. PDB improvement starts with data deposition. Science 2007;
317:195-196.
</td>
</tr>
<tr>
<td><a href="https://dx.doi.org/10.1107/S0907444908037591" target="_BLANK">The value of
re&#8209;refinement </a>
</td>
<td>Joosten RP, Womack T, Vriend G, Bricogne G. Re-refinement from deposited X&#8209;ray
data can deliver improved models for most PDB entries. Acta Cryst. 2009;
D65:176-185.
</td>
</tr>
<tr>
<td><a href="https://doi.org/10.1107/S0021889809008784" target="_BLANK">The first PDB-REDO</a></td>
<td>Joosten RP, et al and Vriend G. PDB_REDO: automated re&#8209;refinement of
X&#8209;ray
structure models in the PDB. J. Appl. Cryst. 2009; 42:376-384.
</td>
</tr><tr>
<td><a href="https://doi.org/10.1107/S0907444911054515" target="_BLANK">Decision making</a></td>
<td>Joosten RP, Joosten K, Murshudov GN, Perrakis A. PDB_REDO: constructive validation,
more
than just looking for errors. Acta Cryst. 2012; D68:484-496.
</td>
</tr>
<tr>
<td><a href="https://doi.org/10.1093/bioinformatics/btr590" target="_BLANK">Model rebuilding
</a>
</td>
<td>Joosten RP, Joosten K, Cohen SX, Vriend G, Perrakis A. Automatic rebuilding and
optimization of crystallographic structures in the Protein Data Bank. Bioinformatics
2011; 27:3392-3398.
</td>
</tr>
<tr>
<td><a href="https://doi.org/10.1002/pro.3353" target="_blank">Homology restraints</a></td>
<td>van
Beusekom B, Touw WG, Tatineni M, Somani S, Rajagopal G, Luo J, Gilliland GL,
Perrakis A, Joosten RP. Homology-based hydrogen bond information improves
crystallographic structures in the PDB. Protein Science. 2018; 27:798-808.
</td>
</tr>
<tr>
<td><a href="https://doi.org/10.1107/S2052252518010552" target="_blank">Loop building</a></td>
<td>van
Beusekom B, Joosten K, Hekkelman ML, Joosten RP,
Perrakis A. Homology-based loop modeling yields more complete crystallographic protein structures.
IUCrJ 2018; 5:585-594.
</td>
</tr>
<tr>
<td><a href="https://doi.org/10.1107/S2059798319003875" target="_blank">N-glycan building</a></td>
<td>van
Beusekom B, Wezel N, Hekkelman ML, Perrakis A, Emsley E, Joosten RP.
Building and rebuilding N-glycans in protein structure models.
Acta Cryst. 2019; D75:416-425.
</td>
</tr>
<tr>
<td><a href="https://doi.org/10.1107/S2059798321007610" target="_blank">Nucleic acids</a></td>
<td>de Vries I, Kwakman T, Lu X-J, Hekkelman ML, Deshpande M, Velankar S, Perrakis A, Joosten RP.
New restraints and validation approaches for nucleic acid structures in PDB-REDO.
Acta Cryst. 2021; D77:1127-1141.
</td>
</tr>
<tr>
<td><a href="https://doi.org/10.1107/S2059798316013036" target="_blank">Zinc sites</a></td>
<td>Touw WG, van Beusekom B, Evers JMG, Vriend G, Joosten RP.
Validation and correction of Zn–CysxHisy complexes.
Acta Cryst. 2016; D72:1110-1118.
</td>
</tr>
</table>
</div> -->
</article>
</div>
<footer z2:replace="~{footer::content}"></footer>
</body>
</html>
<!DOCTYPE html SYSTEM "about:legacy-compat" [ <!ENTITY nbsp "&#160;">
]>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:z2="http://www.hekkelman.com/libzeep/m2" lang="nl">
<head z2:replace="~{head::head(~{::title},~{::head/script})}">
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<title>PDB-REDO</title>
</head>
<body class="site">
<nav z2:replace="~{menu :: navbar('download')}" />
<div class="container site-content">
<!-- TODO: fill in -->
<!-- <article>
<h2>Downloading the PDB-REDO software</h2>
<p>If you are working with sensistive data you can install PDB-REDO locally on <a
href="https://pdb-redo.eu/others/pdb-redo.tar.bz2">Linux and WSL</a>.
You can also use it to run large sets of custom PDB-REDO jobs. Alternatively, you can use the
<a z2:href="@{/api-doc}">PDB-REDO API</a> to commit batches of custom calculations.
</p>
</article>
<article>
<h2>Downloading PDB-REDO entries</h2>
<p>You can download PDB-REDO entries using you favorite molecular graphics program or manually. You can also
download the entire databank at once. Below are some basic examples, more data from the PDB-REDO
databank is described underneath.</p>
<h2>Molecular graphics:</h2>
<ul>
<li><a href="http://www.yasara.org" target="_blank">YASARA</a> has a native PDB-REDO <a
href="http://www.yasara.org/pdbredo.htm" target="_blank">interface to show models</a>.
</li>
<li><a href="http://www.ccp4.ac.uk/MG/" target="_blank">CCP4mg</a> can download PDB-REDO models and
maps.</li>
<li><a href="http://www2.mrc-lmb.cam.ac.uk/Personal/pemsley/coot/" target="_blank">(Win)COOT</a> also
has a native
PDB-REDO interface that shows models, maps, and a guided tour through the model changes.
</li>
</ul>
<h2>Manual download (single entries) via the website or using <code>wget</code>:</h2>
<ul>
<li><code>wget https://pdb-redo.eu/db/9xyz/9xyz_final.pdb</code> downloads the fully optimised
(re-refined and
rebuilt) PDB file.
</li>
<li><code>wget https://pdb-redo.eu/db/9xyz/9xyz_final.mtz</code> downloads the MTZ files to generate
electron
density maps.
</li>
<li><code>wget https://pdb-redo.eu/db/9xyz.zip</code> downloads all files of a PDB-REDO entry.</li>
</ul>
<h2>Download entire PDB-REDO databank using <code>rsync</code>:</h2>
<ul>
<li><code>rsync -av rsync://rsync.pdb-redo.eu/pdb-redo/ pdb-redo/</code> downloads the entire archive.
</li>
</ul>
<h2>License</h2>
<p><a href="license.txt" z2:href="@{/license}">Here</a> you can find the data usage license.</p>
</article>
<article>
<h2>PDB-REDO entry description</h2>
<p>Each PDB-REDO entry consists of a set of files that describe the structure model in different states
(original,
re-refined, and re-refined &amp; rebuilt). Some of the data is provided for easy data mining. The table
below shows
the typical URLs of the files for the fictitious entry <code>9xyz</code>.</p>
<br />
<table>
<thead>
<tr>
<th>Description</th>
<th>Typical URL (for fictitious entry 9xyz)</th>
</tr>
</thead>
<tbody>
<tr>
<td colspan="2" class="group">Atomic coordinates</td>
</tr>
<tr>
<td>Initial model</td>
<td><code>https://pdb-redo.eu/db/9xyz/9xyz_0cyc.pdb.gz</code></td>
</tr>
<tr>
<td>Re-refined (only) model</td>
<td><code>https://pdb-redo.eu/db/9xyz/9xyz_besttls.pdb.gz</code></td>
</tr>
<tr>
<td>Re-refined &amp; rebuilt structure model</td>
<td><code>https://pdb-redo.eu/db/9xyz/9xyz_final.pdb</code></td>
</tr>
<tr>
<td>Re-refined &amp; rebuilt structure model with total B-factors (PDB)</td>
<td><code>https://pdb-redo.eu/db/9xyz/9xyz_final_tot.pdb</code></td>
</tr>
<tr>
<td>Re-refined &amp; rebuilt structure model with total B-factors (mmCIF)</td>
<td><code>https://pdb-redo.eu/db/9xyz/9xyz_final.cif</code></td>
</tr>
<tr>
<td colspan="2" class="group">Electron density</td>
</tr>
<tr>
<td>Map coefficients for the original model</td>
<td><code>https://pdb-redo.eu/db/9xyz/9xyz_0cyc.mtz.gz</code></td>
</tr>
<tr>
<td>Map coefficients for re-refined (only) model</td>
<td><code>https://pdb-redo.eu/db/9xyz/9xyz_besttls.mtz.gz</code></td>
</tr>
<tr>
<td>Map coefficients for re-refined &amp; rebuilt structure model</td>
<td><code>https://pdb-redo.eu/db/9xyz/9xyz_final.mtz</code></td>
</tr>
<tr>
<td colspan="2" class="group">Validation data</td>
</tr>
<tr>
<td>WHAT_CHECK report for initial model</td>
<td><code>https://pdb-redo.eu/db/9xyz/wo/pdbout.txt</code></td>
</tr>
<tr>
<td>WHAT_CHECK report for re-refined (only) model</td>
<td><code>https://pdb-redo.eu/db/9xyz/wc/pdbout.txt</code></td>
</tr>
<tr>
<td>WHAT_CHECK report for re-refined &amp; rebuilt model</td>
<td><code>https://pdb-redo.eu/db/9xyz/wf/pdbout.txt</code></td>
</tr>
<tr>
<td>Ligand and ligand interaction data for the initial and re-refined &amp; rebuilt structure
model</td>
<td><code>https://pdb-redo.eu/db/9xyz/9xyz_ligval.json</code> (only for entries with ligands; <a
href="id_ligval.json.schema" z2:href="@{/schema/id_ligval.json.schema}">JSON Schema</a>)
</td>
</tr>
<tr>
<td>Map fitting scores for the initial model <br />(RSCC, RSR, EDIAm, OPIA)</td>
<td><code>https://pdb-redo.eu/db/9xyz/9xyz_0cyc.json.gz</code> (<a href="id_0cyc.json.schema"
z2:href="@{/schema/id_0cyc.json.schema}">JSON Schema</a>)</td>
</tr>
<tr>
<td>Map fitting scores for the re-refined &amp; rebuilt model</td>
<td><code>https://pdb-redo.eu/db/9xyz/9xyz_final.json</code> (<a href="id_final.json.schema"
z2:href="@{/schema/id_final.json.schema}">JSON Schema</a>)</td>
</tr>
<tr>
<td>Data for model improvement sliders</td>
<td><code>https://pdb-redo.eu/db/9xyz/pdbe.json</code> (<a href="pdbe.json.schema"
z2:href="@{/schema/pdbe.json.schema}">JSON Schema</a>)</td>
</tr>
<tr>
<td colspan="2" class="group">Visual tools</td>
</tr>
<tr>
<td>COOT script to show model changes</td>
<td><code>https://pdb-redo.eu/db/9xyz/9xyz_final.py</code> (Python) or
<code>https://pdb-redo.eu/db/9xyz/9xyz_final.scm</code>
(Scheme)
</td>
</tr>
<tr>
<td colspan="2" class="group">Descriptive data</td>
</tr>
<tr>
<td>PDB-REDO statistics for data mining (crystal parameters, R-factors, validation scores, etc.)
</td>
<td><code>https://pdb-redo.eu/db/9xyz/data.json</code> (<a href="data.json.schema"
z2:href="@{/schema/data.json.schema}">JSON Schema</a>)</td>
</tr>
<tr>
<td>List of homologous entries in PDB-REDO databank</td>
<td><code>https://pdb-redo.eu/db/9xyz/9xyz_available_homologs.json</code> (<a
href="id_available_homologs.json.schema"
z2:href="@{/schema/id_available_homologs.json.schema}">JSON Schema</a>)</td>
</tr>
<tr>
<td>DSSP analysis of the re-refined &amp; rebuilt model</td>
<td><code>https://pdb-redo.eu/db/9xyz/9xyz_final.dssp</code></td>
</tr>
<tr>
<td>Software versions of all programs used</td>
<td><code>https://pdb-redo.eu/db/9xyz/versions.json</code> (<a href="versions.json.schema"
z2:href="@{/schema/versions.json.schema}">JSON Schema</a>)</td>
</tr>
</tbody>
</table>
</article> -->
</div>
<footer z2:replace="~{footer::content}"></footer>
</body>
</html>
<!DOCTYPE html>
<html xmlns:z2="http://www.hekkelman.com/libzeep/m2">
<body>
<footer z2:fragment="content">Maarten L. Hekkelman, Anastassis Perrakis &amp; Robbie P. Joosten
Department of Biochemistry, B8
Plesmanlaan 121, 1066CX Amsterdam
Tel: +31 20 512 1951</footer>
</body>
</html>
<!DOCTYPE html SYSTEM "about:legacy-compat">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:z2="http://www.hekkelman.com/libzeep/m2"
lang="nl" >
<head z2:fragment="head(title,script)">
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0" />
<meta http-equiv="Content-Security-Policy" content="default-src 'self' 'unsafe-inline'; child-src 'none'; img-src 'self' data:;" />
<title z2:replace="${title}">DSSP - PDB-REDO version</title>
<script z2:src="@{/scripts/index.js}"></script>
<script z2:replace="${script}"></script>
<link z2:href="@{/css/index.css}" rel="stylesheet" />
<!-- favicon stuff -->
<link rel="apple-touch-icon" sizes="180x180" href="/images/favicon/apple-touch-icon.png"/>
<link rel="icon" type="image/png" href="/images/favicon/favicon-32x32.png" sizes="32x32"/>
<link rel="icon" type="image/png" href="/images/favicon/favicon-16x16.png" sizes="16x16"/>
<link rel="manifest" href="/images/favicon/manifest.json"/>
<link rel="mask-icon" href="/images/favicon/safari-pinned-tab.svg" color="#5bbad5"/>
<meta name="theme-color" content="#ffffff"/>
</head>
</html>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 16.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="160px" height="120px" viewBox="0 0 160 120" enable-background="new 0 0 160 120" xml:space="preserve">
<g>
<g>
<path fill="#3366CC" d="M47.144,92.745c0,0.372-0.335,0.559-1.005,0.559h-4.731c-0.5,0-1.049-0.119-1.646-0.357
c-0.599-0.238-1.055-0.526-1.37-0.864l-3.352-3.458c-1.38-1.421-3.049-2.132-5.007-2.132h-4.811v5.59
c0,0.338-0.181,0.626-0.542,0.864s-0.799,0.357-1.311,0.357h-3.707c-0.512,0-0.952-0.119-1.32-0.357s-0.552-0.526-0.552-0.864
V75.897c0-0.338,0.177-0.628,0.532-0.871c0.354-0.242,0.788-0.363,1.301-0.363h16.264c3.01,0,5.478,0.532,7.403,1.599
c1.925,1.065,2.888,2.505,2.888,4.315c0,2.522-2.478,4.104-7.433,4.745c0.789,0.19,1.519,0.518,2.188,0.981
c0.671,0.464,1.439,1.138,2.307,2.021l3.588,3.757C47.038,92.324,47.144,92.546,47.144,92.745z M25.222,82.813h8.398
c1.354,0,2.546-0.178,3.578-0.533c1.031-0.355,1.547-0.923,1.547-1.703c0-0.779-0.516-1.348-1.547-1.703
c-1.032-0.354-2.225-0.532-3.578-0.532h-8.398V82.813z"/>
<path fill="#3366CC" d="M50.416,92.056V75.871c0-0.338,0.184-0.623,0.552-0.857s0.809-0.351,1.32-0.351h22.73
c0.513,0,0.949,0.121,1.311,0.363c0.361,0.243,0.543,0.533,0.543,0.871v1.222c0,0.338-0.182,0.627-0.543,0.865
s-0.798,0.357-1.311,0.357H57.848v3.782h14.785c0.513,0,0.95,0.119,1.312,0.357s0.542,0.526,0.542,0.865v1.222
c0,0.338-0.181,0.626-0.542,0.864s-0.799,0.357-1.312,0.357H57.848v3.835h17.132c0.499,0,0.926,0.117,1.281,0.351
c0.354,0.234,0.532,0.521,0.532,0.858v1.248c0,0.338-0.185,0.626-0.552,0.864c-0.368,0.238-0.809,0.357-1.321,0.357H52.288
c-0.512,0-0.952-0.119-1.32-0.357S50.416,92.411,50.416,92.056z"/>
<path fill="#3366CC" d="M80.5,92.107V75.924c0-0.355,0.184-0.654,0.552-0.897c0.368-0.242,0.809-0.363,1.32-0.363h11.021
c5.704,0,9.854,0.752,12.449,2.255c2.596,1.504,3.894,3.861,3.894,7.071c0,3.211-1.298,5.566-3.894,7.065
c-2.596,1.5-6.745,2.249-12.449,2.249H82.372c-0.512,0-0.952-0.115-1.32-0.345S80.5,92.445,80.5,92.107z M87.932,89.625h5.244
c3.535,0,5.94-0.425,7.215-1.274c1.275-0.849,1.912-2.303,1.912-4.361c0-2.058-0.637-3.514-1.912-4.367
c-1.274-0.854-3.68-1.28-7.215-1.28h-5.244V89.625z"/>
<path fill="#3366CC" d="M139.867,91.373c-2.688,1.556-6.631,2.334-11.828,2.334c-5.198,0-9.145-0.778-11.838-2.334
c-2.694-1.556-4.042-4.019-4.042-7.39s1.348-5.832,4.042-7.384c2.693-1.551,6.64-2.327,11.838-2.327
c5.197,0,9.141,0.776,11.828,2.327c2.688,1.552,4.031,4.013,4.031,7.384S142.555,89.817,139.867,91.373z M134.476,79.343
c-1.327-1.04-3.473-1.561-6.437-1.561s-5.112,0.521-6.446,1.561s-2.001,2.589-2.001,4.646c0,2.059,0.667,3.605,2.001,4.642
c1.334,1.035,3.482,1.553,6.446,1.553s5.109-0.518,6.437-1.553c1.327-1.036,1.991-2.583,1.991-4.642
C136.467,81.932,135.803,80.383,134.476,79.343z"/>
</g>
</g>
<g>
<path fill="#FF9933" d="M23.095,52.253v19.542H18.2V24.766h20.604c6.278,0,11.138,1.254,14.578,3.764
c3.441,2.507,5.161,5.83,5.161,9.964c0,4.178-1.72,7.515-5.161,10.014c-3.44,2.499-8.3,3.746-14.578,3.746H23.095z M23.095,48.959
h15.709c4.936,0,8.643-0.985,11.124-2.956s3.723-4.452,3.723-7.445c0-3.015-1.235-5.519-3.702-7.51
c-2.468-1.993-6.184-2.988-11.145-2.988H23.095V48.959z"/>
<path fill="#FF9933" d="M60.034,71.795V24.766h17.396c7.319,0,13.363,1.916,18.136,5.749c4.771,3.833,7.154,8.753,7.154,14.761
v6.041c0,6.029-2.384,10.95-7.154,14.762c-4.772,3.813-10.816,5.717-18.136,5.717H60.034z M64.928,28.06V68.5h12.503
c5.921,0,10.794-1.622,14.618-4.873c3.825-3.249,5.737-7.358,5.737-12.329v-6.132c0-4.906-1.919-8.983-5.757-12.232
c-3.839-3.249-8.706-4.874-14.599-4.874H64.928z"/>
<path fill="#FF9933" d="M104.607,71.795V24.766h17.478c6.223,0,11.069,1.029,14.537,3.087c3.468,2.057,5.202,5.153,5.202,9.29
c0,2.414-0.87,4.514-2.61,6.304c-1.742,1.788-4.107,3.026-7.096,3.716c3.646,0.518,6.607,1.863,8.884,4.037
c2.274,2.172,3.413,4.681,3.413,7.521c0,4.198-1.733,7.426-5.201,9.687c-3.47,2.259-8.109,3.389-13.921,3.389H104.607z
M109.5,45.857h13.778c4.33,0,7.683-0.747,10.054-2.245c2.371-1.496,3.558-3.698,3.558-6.605c0-2.972-1.263-5.206-3.784-6.702
c-2.522-1.498-6.195-2.245-11.021-2.245H109.5V45.857z M109.5,49.151V68.5h15.793c4.414,0,7.882-0.852,10.403-2.56
c2.522-1.705,3.784-4.092,3.784-7.162c0-2.812-1.146-5.118-3.434-6.922c-2.29-1.803-5.614-2.705-9.973-2.705H109.5z"/>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
</svg>
<!DOCTYPE html SYSTEM "about:legacy-compat" [ <!ENTITY nbsp "&#160;">
]>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:z2="http://www.hekkelman.com/libzeep/m2" lang="nl">
<head z2:replace="~{head::head(~{::title},~{::head/script})}">
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<title>DSSP</title>
</head>
<body class="site">
<nav z2:replace="~{menu :: navbar('home')}"></nav>
<div class="container site-content">
<article>
<h2>DSSP: Assign secondary structure to proteins</h2>
<p>DSSP (Dictionary of Secondary Structure in Proteins) is an algorithm originally designed by Wolfgang Kabsch and Chris Sander to standardise secondary structure assigment based on atomic coordinates. DSSP does not predict secondary structure. You can run DSSP using the form below or you can <a z2:href="@{/download}">install</a> the program locally. Ready-made annotations of PDB entries are available below and you can also <a z2:href="@{/download}">download</a> the whole databank at once. More details about the DSSP output are <a z2:href="@{/about}">here</a>.
</p>
</article>
<article>
<h2>Submit your structure</h2>
<form z2:fragment="submit-form" name="job-form" method="post" enctype="multipart/form-data"
z2:action="@{/do}">
<div class="input-group mb-3">
<label class="input-group-text" for="input-group-pdb-file">Coordinates</label>
<input type="file" class="form-control" id="input-group-pdb-file" name="data" required="required" />
</div>
<div class="input-group mb-3">
<label class="input-group-text" for="format-select">Format</label>
<select class="form-select" id="format-select" name="format">
<option value="mmcif">Annotated mmCIF</option>
<option value="dssp">Historic DSSP format, may fail on larger structures</option>
</select>
</div>
<button type="submit" class="btn btn-sm btn-primary mt-3">Submit</button>
</form>
</article>
</div>
<footer z2:replace="~{footer::content}"></footer>
</body>
</html>
<!DOCTYPE html SYSTEM "about:legacy-compat">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:z2="http://www.hekkelman.com/libzeep/m2" lang="nl">
<body>
<header z2:fragment="navbar(page)" class="d-flex">
<a href="https://pdb-redo.eu/"><img z2:src="@{/images/PDB_logo_rect_medium.svg}" /></a>
<div>
<div class="my-overflow">
<nav class="first">
<a href="http://www.nki.nl" target="_BLANK">NKI Research</a> |
<!-- <a href="http://www.nki.nl/divisions/biochemistry/" title="BioChemistry Homepage"
target="_BLANK">Biochemistry</a>
|-->
<a href="https://www.nki.nl/research/research-groups/anastassis-tassos-perrakis/" target="_BLANK">Perrakis
group</a>
</nav>
</div>
<nav class="navbar navbar-expand-md bg-nav-secondary navbar-light second">
<button class="navbar-toggler" type="button" data-bs-toggle="collapse"
data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent"
aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link" z2:classappend="${page == 'home' ? 'active' : ''}"
href="https://pdb-redo.eu/dssp">Home</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown2" role="button"
data-bs-toggle="dropdown" aria-expanded="false">
Tools
</a>
<ul class="dropdown-menu m-0" aria-labelledby="navbarDropdown2">
<li><a class="dropdown-item" href="https://alphafill.eu">AlphaFill</a></li>
<li><a class="dropdown-item" href="https://pdb-redo.eu">PDB-REDO</a></li>
<li><a class="dropdown-item" href="https://pdb-redo.eu/tortoize">Tortoize</a></li>
<li><a class="dropdown-item" href="https://ccd.rhpc.nki.nl/">CCD</a></li>
<li><a class="dropdown-item" href="https://pdb-redo.eu/archive">Archive</a></li>
<li><a class="dropdown-item" href="https://lahma.pdb-redo.eu/">Lahma</a></li>
</ul>
</li>
<li class="nav-item">
<a class="nav-link" z2:classappend="${page == 'about' ? 'active' : ''}"
z2:href="@{/about}">About</a>
</li>
<li class="nav-item">
<a class="nav-link" z2:classappend="${page == 'download' ? 'active' : ''}"
z2:href="@{/download}">Download</a>
</li>
</ul>
</div>
</nav>
</div>
</header>
</body>
</html>
......@@ -135,15 +135,15 @@ class dssp
int pdb_seq_num() const;
std::string pdb_ins_code() const;
float alpha() const;
float kappa() const;
float phi() const;
float psi() const;
float tco() const;
float omega() const;
std::optional<float> alpha() const;
std::optional<float> kappa() const;
std::optional<float> phi() const;
std::optional<float> psi() const;
std::optional<float> tco() const;
std::optional<float> omega() const;
bool is_pre_pro() const;
bool is_cis() const { return std::abs(omega()) < 30.0f; }
bool is_cis() const { return std::abs(omega().value_or(360)) < 30.0f; }
float chiral_volume() const;
std::size_t nr_of_chis() const;
......
{
"name": "dsspd",
"version": "1.0.0",
"description": "A web service for DSSP",
"main": "index.js",
"author": "Maarten L. Hekkelman",
"license": "BSD-2-Clause",
"scripts": {
"build": "webpack --config webpack.config.js",
"build-production": "webpack --config webpack.config.js --env PRODUCTION"
},
"devDependencies": {
"@babel/core": "^7.16.0",
"@babel/preset-env": "^7.16.0",
"@babel/preset-typescript": "^7.16.0",
"@popperjs/core": "^2.10.2",
"@webcomponents/webcomponentsjs": "^2.7.0",
"babel-loader": "^9.1.2",
"bs-custom-file-input": "^1.3.4",
"clean-webpack-plugin": "^4.0.0",
"crypto-es": "^1.2.7",
"css-loader": "^6.5.0",
"file-loader": "^6.2.0",
"lit": "^2.6.1",
"mini-css-extract-plugin": "^2.4.3",
"postcss-loader": "^7.0.2",
"sass": "^1.58.1",
"sass-loader": "^13.2.0",
"style-loader": "^3.3.1",
"terser-webpack-plugin": "^5.2.5",
"ts-loader": "^9.2.6",
"uglifyjs-webpack-plugin": "^2.2.0",
"webpack": "^5.76.0",
"webpack-cli": "^5.0.1"
},
"dependencies": {
"@babel/runtime-corejs3": "^7.20.13",
"bootstrap": "^5.1.3",
"bootstrap-icons": "^1.10.3",
"core-js": "^3.28.0"
},
"babel": {
"presets": [
"@babel/typescript",
[
"@babel/env",
{
"modules": false
}
]
]
}
}
......@@ -91,7 +91,7 @@ std::string ResidueToDSSPLine(const dssp::residue_info &info)
if (info.bend())
bend = 'S';
double alpha = residue.alpha();
double alpha = residue.alpha().value_or(360);
char chirality = alpha == 360 ? ' ' : (alpha < 0 ? '-' : '+');
uint32_t bp[2] = {};
......@@ -139,7 +139,11 @@ std::string ResidueToDSSPLine(const dssp::residue_info &info)
ss, helix[3], helix[0], helix[1], helix[2], bend, chirality, bridgelabel[0], bridgelabel[1],
bp[0], bp[1], sheet, floor(info.accessibility() + 0.5),
NHO[0], ONH[0], NHO[1], ONH[1],
residue.tco(), residue.kappa(), alpha, residue.phi(), residue.psi(),
residue.tco().value_or(0),
residue.kappa().value_or(360),
residue.alpha().value_or(360),
residue.phi().value_or(360),
residue.psi().value_or(360),
cax, cay, caz)
.str();
}
......@@ -153,7 +157,7 @@ void writeDSSP(const dssp &dssp, std::ostream &os)
std::time_t today = system_clock::to_time_t(system_clock::now());
std::tm *tm = std::gmtime(&today);
os << "==== Secondary Structure Definition by the program DSSP, NKI version 4.0 ==== DATE=" << std::put_time(tm, "%F") << " ." << std::endl
os << "==== Secondary Structure Definition by the program DSSP, NKI version 4.3 ==== DATE=" << std::put_time(tm, "%F") << " ." << std::endl
<< "REFERENCE W. KABSCH AND C.SANDER, BIOPOLYMERS 22 (1983) 2577-2637 ." << std::endl
<< dssp.get_pdb_header_line(dssp::pdb_record_type::HEADER) << '.' << std::endl
<< dssp.get_pdb_header_line(dssp::pdb_record_type::COMPND) << '.' << std::endl
......@@ -882,7 +886,7 @@ void writeStatistics(cif::datablock &db, const dssp &dssp)
using histogram_data_type = std::tuple<const char *, const uint32_t *>;
for (const auto &[type, values] : std::vector<histogram_data_type>{
{ "parallel_bridges_per_ladder", stats.histogram.residues_per_alpha_helix },
{ "residues_per_alpha_helix", stats.histogram.residues_per_alpha_helix },
{ "parallel_bridges_per_ladder", stats.histogram.parallel_bridges_per_ladder },
{ "antiparallel_bridges_per_ladder", stats.histogram.antiparallel_bridges_per_ladder },
{ "ladders_per_sheet", stats.histogram.ladders_per_sheet } })
......@@ -930,6 +934,11 @@ void writeSummary(cif::datablock &db, const dssp &dssp)
auto &dssp_struct_summary = db["dssp_struct_summary"];
// prime the category with the field labels we need, this is to ensure proper order in writing out the data.
for (auto label : { "entry_id", "label_comp_id", "label_asym_id", "label_seq_id", "secondary_structure", "ss_bridge", "helix_3_10", "helix_alpha", "helix_pi", "helix_pp", "bend", "chirality", "ladder_1", "ladder_2", "sheet", "accessibility", "TCO", "kappa", "alpha", "phi", "psi", "x_ca", "y_ca", "z_ca"})
dssp_struct_summary.add_column(label);
for (auto res : dssp)
{
......@@ -979,10 +988,9 @@ void writeSummary(cif::datablock &db, const dssp &dssp)
if (res.bend())
bend = "S";
double alpha = res.alpha();
std::string chirality = ".";
if (alpha != 360)
chirality = alpha < 0 ? "-" : "+";
if (res.alpha().has_value())
chirality = *res.alpha() < 0 ? "-" : "+";
std::string ladders[2] = { ".", "." };
......@@ -997,7 +1005,7 @@ void writeSummary(cif::datablock &db, const dssp &dssp)
auto const &[cax, cay, caz] = res.ca_location();
dssp_struct_summary.emplace({
cif::row_initializer data{
{ "entry_id", db.name() },
{ "label_comp_id", res.compound_id() },
{ "label_asym_id", res.asym_id() },
......@@ -1020,18 +1028,39 @@ void writeSummary(cif::datablock &db, const dssp &dssp)
{ "sheet", res.sheet() ? cif::cif_id_for_number(res.sheet() - 1) : "." },
{ "accesssibility", res.accessibility(), 1 },
{ "TCO", res.tco(), 3 },
{ "kappa", res.kappa(), 1 },
{ "alpha", res.alpha(), 1 },
{ "phi", res.phi(), 1 },
{ "psi", res.psi(), 1 },
{ "accessibility", res.accessibility(), 1 },
{ "x_ca", cax, 1 },
{ "y_ca", cay, 1 },
{ "z_ca", caz, 1 },
});
};
if (res.tco().has_value())
data.emplace_back("TCO", *res.tco(), 3);
else
data.emplace_back("TCO", ".");
if (res.kappa().has_value())
data.emplace_back("kappa", *res.kappa(), 1);
else
data.emplace_back("kappa", ".");
if (res.alpha().has_value())
data.emplace_back("alpha", *res.alpha(), 1);
else
data.emplace_back("alpha", ".");
if (res.phi().has_value())
data.emplace_back("phi", *res.phi(), 1);
else
data.emplace_back("phi", ".");
if (res.psi().has_value())
data.emplace_back("psi", *res.psi(), 1);
else
data.emplace_back("psi", ".");
dssp_struct_summary.emplace(std::move(data));
}
}
......
......@@ -31,3 +31,6 @@
void writeDSSP(const dssp& dssp, std::ostream& os);
void annotateDSSP(cif::datablock &db, const dssp& dssp, bool writeOther, bool writeExperimental, std::ostream& os);
void writeDSSP(std::istream &is, std::ostream& os);
void annotateDSSP(cif::datablock &db, const dssp& dssp, bool writeOther, bool writeExperimental, std::ostream& os);
/*-
* SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2023 NKI/AVL, Netherlands Cancer Institute
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "dssp-io.hpp"
#include "revision.hpp"
#include <cif++.hpp>
#include <gxrio.hpp>
#include <mcfp.hpp>
#include <zeep/http/daemon.hpp>
#include <zeep/http/html-controller.hpp>
#include <zeep/http/rest-controller.hpp>
#include <zeep/streambuf.hpp>
// --------------------------------------------------------------------
class dssp_html_controller : public zeep::http::html_controller
{
public:
dssp_html_controller()
: zeep::http::html_controller()
{
mount("{css,scripts,fonts,images,favicon}/", &dssp_html_controller::handle_file);
mount("{favicon.ico,browserconfig.xml,manifest.json}", &dssp_html_controller::handle_file);
map_get("", "index");
map_get("about", "about");
map_get("download", "download");
}
};
// --------------------------------------------------------------------
class dssp_rest_controller : public zeep::http::rest_controller
{
public:
dssp_rest_controller()
: zeep::http::rest_controller("")
{
map_post_request("do", &dssp_rest_controller::work, "data", "format");
}
zeep::http::reply work(const zeep::http::file_param &coordinates, std::optional<std::string> format);
};
zeep::http::reply dssp_rest_controller::work(const zeep::http::file_param &coordinates, std::optional<std::string> format)
{
zeep::char_streambuf sb(coordinates.data, coordinates.length);
gxrio::istream in(&sb);
cif::file f = cif::pdb::read(in);
if (f.empty())
throw std::runtime_error("Invalid input file, is it empty?");
// --------------------------------------------------------------------
short pp_stretch = 3; //minPPStretch.value_or(3);
std::string fmt = format.value_or("mmcif");
dssp dssp(f.front(), 1, pp_stretch, true);
std::ostringstream os;
if (fmt == "dssp")
writeDSSP(dssp, os);
else
annotateDSSP(f.front(), dssp, true, true, os);
// --------------------------------------------------------------------
std::string name = f.front().name();
if (fmt == "dssp")
name += ".dssp";
else
name += ".cif";
zeep::http::reply rep{ zeep::http::ok };
rep.set_content(os.str(), "text/plain");
rep.set_header("content-disposition", "attachement; filename = \"" + name + '"');
return rep;
}
// --------------------------------------------------------------------
int main(int argc, char *argv[])
{
using namespace std::literals;
namespace zh = zeep::http;
cif::compound_factory::init(true);
int result = 0;
auto &config = mcfp::config::instance();
config.init("dsspd [options] start|stop|status|reload",
mcfp::make_option("help,h", "Display help message"),
mcfp::make_option("version", "Print version"),
mcfp::make_option("verbose,v", "verbose output"),
mcfp::make_option<std::string>("address", "0.0.0.0", "External address"),
mcfp::make_option<uint16_t>("port", 10351, "Port to listen to"),
mcfp::make_option<std::string>("user,u", "www-data", "User to run the daemon"),
mcfp::make_option<std::string>("context", "", "Root context for web server"),
mcfp::make_option("no-daemon,F", "Do not fork into background"),
mcfp::make_option<std::string>("config", "Config file to use"));
std::error_code ec;
config.parse(argc, argv, ec);
if (ec)
{
std::cerr << "Error parsing command line arguments: " << ec.message() << std::endl
<< std::endl
<< config << std::endl;
exit(1);
}
config.parse_config_file("config", "dsspd.conf", { ".", "/etc" }, ec);
if (ec)
{
std::cerr << "Error parsing config file: " << ec.message() << std::endl;
exit(1);
}
// --------------------------------------------------------------------
if (config.has("version"))
{
write_version_string(std::cout, config.has("verbose"));
exit(0);
}
if (config.has("help"))
{
std::cout << config << std::endl;
exit(0);
}
if (config.operands().empty())
{
std::cerr << "Missing command, should be one of start, stop, status or reload" << std::endl;
exit(1);
}
cif::VERBOSE = config.count("verbose");
std::string user = config.get<std::string>("user");
std::string address = config.get<std::string>("address");
uint16_t port = config.get<uint16_t>("port");
zeep::http::daemon server([&, context = config.get("context")]()
{
auto s = new zeep::http::server();
#ifndef NDEBUG
s->set_template_processor(new zeep::http::file_based_html_template_processor("docroot"));
#else
s->set_template_processor(new zeep::http::rsrc_based_html_template_processor());
#endif
s->add_controller(new dssp_rest_controller());
s->add_controller(new dssp_html_controller());
s->set_context_name(context);
return s; },
kProjectName);
std::string command = config.operands().front();
if (command == "start")
{
std::cout << "starting server at http://" << address << ':' << port << '/' << std::endl;
if (config.has("no-daemon"))
result = server.run_foreground(address, port);
else
result = server.start(address, port, 2, 2, user);
}
else if (command == "stop")
result = server.stop();
else if (command == "status")
result = server.status();
else if (command == "reload")
result = server.reload();
else
{
std::cerr << "Invalid command" << std::endl;
result = 1;
}
return result;
}
\ No newline at end of file
......@@ -531,7 +531,8 @@ struct dssp::residue
float mAccessibility = 0;
float mChiralVolume = 0;
float mAlpha = 360, mKappa = 360, mPhi = 360, mPsi = 360, mTCO = 0, mOmega = 360;
// float mAlpha = 360, mKappa = 360, mPhi = 360, mPsi = 360, mTCO = 0, mOmega = 360;
std::optional<float> mAlpha, mKappa, mPhi, mPsi, mTCO, mOmega;
residue_type mType;
uint8_t mSSBridgeNr = 0;
......@@ -1114,8 +1115,8 @@ void CalculateAlphaHelices(std::vector<residue> &inResidues, statistics &stats,
for (auto &r : inResidues)
{
double kappa = r.mKappa;
r.SetBend(kappa != 360 and kappa > 70);
if (r.mKappa.has_value())
r.SetBend(*r.mKappa > 70);
}
for (uint32_t i = 1; i + 4 < inResidues.size(); ++i)
......@@ -1216,8 +1217,8 @@ void CalculatePPHelices(std::vector<residue> &inResidues, statistics &stats, int
for (uint32_t i = 1; i + 1 < inResidues.size(); ++i)
{
phi[i] = static_cast<float>(inResidues[i].mPhi);
psi[i] = static_cast<float>(inResidues[i].mPsi);
phi[i] = static_cast<float>(inResidues[i].mPhi.value_or(360));
psi[i] = static_cast<float>(inResidues[i].mPsi.value_or(360));
}
for (uint32_t i = 1; i + 3 < inResidues.size(); ++i)
......@@ -1888,32 +1889,32 @@ std::string dssp::residue_info::pdb_ins_code() const
return m_impl->mPDBInsCode;
}
float dssp::residue_info::alpha() const
std::optional<float> dssp::residue_info::alpha() const
{
return m_impl->mAlpha;
}
float dssp::residue_info::kappa() const
std::optional<float> dssp::residue_info::kappa() const
{
return m_impl->mKappa;
}
float dssp::residue_info::omega() const
std::optional<float> dssp::residue_info::omega() const
{
return m_impl->mOmega;
}
float dssp::residue_info::phi() const
std::optional<float> dssp::residue_info::phi() const
{
return m_impl->mPhi;
}
float dssp::residue_info::psi() const
std::optional<float> dssp::residue_info::psi() const
{
return m_impl->mPsi;
}
float dssp::residue_info::tco() const
std::optional<float> dssp::residue_info::tco() const
{
return m_impl->mTCO;
}
......
......@@ -72,10 +72,8 @@ int d_main(int argc, const char *argv[])
mcfp::make_option<std::string>("output-format", "Output format, can be either 'dssp' for classic DSSP or 'mmcif' for annotated mmCIF. The default is chosen based on the extension of the output file, if any."),
mcfp::make_option<short>("min-pp-stretch", 3, "Minimal number of residues having PSI/PHI in range for a PP helix, default is 3"),
mcfp::make_option("write-other", "If set, write the type OTHER for loops, default is to leave this out"),
mcfp::make_option("write-experimental", "If set, write the new, experimental DSSP output in mmCIF format, default is to leave this out"),
mcfp::make_option("no-dssp-categories", "If set, will suppress output of new DSSP output in mmCIF format"),
// mcfp::make_option("components", po::value<std::string, "Location of the components.cif file from CCD")
// mcfp::make_option("extra-compounds", po::value<std::string, "File containing residue information for extra compounds in this specific target, should be either in CCD format or a CCP4 restraints file")
mcfp::make_option<std::string>("mmcif-dictionary", "Path to the mmcif_pdbx.dic file to use instead of default"),
mcfp::make_option("help,h", "Display help message"),
......@@ -120,17 +118,7 @@ int d_main(int argc, const char *argv[])
// --------------------------------------------------------------------
// Load extra CCD definitions, if any
// if (config.has("compounds"))
// cif::add_file_resource("components.cif", config.get<std::string>("compounds"));
// else if (config.has("components"))
// cif::add_file_resource("components.cif", config.get<std::string>("components"));
// if (config.has("extra-compounds"))
// mmcif::CompoundFactory::instance().pushDictionary(config.get<std::string>("extra-compounds"));
// And perhaps a private mmcif_pdbx dictionary
// private mmcif_pdbx dictionary?
if (config.has("mmcif-dictionary"))
cif::add_file_resource("mmcif_pdbx.dic", config.get<std::string>("mmcif-dictionary"));
......@@ -164,9 +152,13 @@ int d_main(int argc, const char *argv[])
if (fmt.empty() and not output.empty())
{
if (output.extension() == ".gz" or output.extension() == ".xz")
output = output.stem();
if (output.extension() == ".dssp")
{
if (output.stem().extension() == ".dssp")
fmt = "dssp";
else
fmt = "cif";
}
else if (output.extension() == ".dssp")
fmt = "dssp";
else
fmt = "cif";
......@@ -187,14 +179,14 @@ int d_main(int argc, const char *argv[])
if (fmt == "dssp")
writeDSSP(dssp, out);
else
annotateDSSP(f.front(), dssp, writeOther, config.has("write-experimental"), out);
annotateDSSP(f.front(), dssp, writeOther, not config.has("no-dssp-categories"), out);
}
else
{
if (fmt == "dssp")
writeDSSP(dssp, std::cout);
else
annotateDSSP(f.front(), dssp, writeOther, config.has("write-experimental"), std::cout);
annotateDSSP(f.front(), dssp, writeOther, not config.has("no-dssp-categories"), std::cout);
}
return 0;
......
......@@ -97,9 +97,9 @@ BOOST_AUTO_TEST_CASE(ut_dssp)
std::string line_t, line_r;
BOOST_CHECK(std::getline(test, line_t) and std::getline(reference, line_r));
const char *kHeaderLineStart = "==== Secondary Structure Definition by the program DSSP, NKI version 4.0 ====";
const char *kHeaderLineStart = "==== Secondary Structure Definition by the program DSSP, NKI version 4.3 ====";
BOOST_CHECK(line_t.compare(0, std::strlen(kHeaderLineStart), kHeaderLineStart) == 0);
BOOST_CHECK(line_r.compare(0, std::strlen(kHeaderLineStart), kHeaderLineStart) == 0);
// BOOST_CHECK(line_r.compare(0, std::strlen(kHeaderLineStart), kHeaderLineStart) == 0);
for (int line_nr = 2;; ++line_nr)
{
......@@ -115,7 +115,11 @@ BOOST_AUTO_TEST_CASE(ut_dssp)
<< line_t << std::endl
<< line_r << std::endl;
BOOST_CHECK(line_t == line_r);
if (line_t != line_r)
{
BOOST_CHECK(line_t == line_r);
break;
}
}
BOOST_CHECK(test.eof());
......@@ -164,7 +168,7 @@ BOOST_AUTO_TEST_CASE(dssp_1)
std::string line;
getline(t, line);
std::cout << line << std::endl;
// std::cout << line << std::endl;
auto fld = cif::split(line, "\t");
......
import "core-js/stable";
import "regenerator-runtime/runtime";
import '@popperjs/core';
import 'bootstrap';
import './pdb-redo-style.scss';
@use "sass:math";
// (Required) Import Bootstrap
@import "bootstrap/scss/_functions";
@import "bootstrap/scss/_variables";
@import "bootstrap/scss/_mixins";
@import "~bootstrap-icons/font/bootstrap-icons.css";
.alert {
border: 1px solid;
}
@import "bootstrap/scss/_alert";
$font-family-sans-serif: "Verdana", "Arial", "Helvetica", "sans-serif";
$primary: rgb(100, 100, 100);
$primary-rgb: 100, 100, 100;
$nav-primary: #FF9933;
$nav-secondary: #ffecbf;
$nav-link: #3366cc;
$nav-primary-hover: #d8c7a5;
$dropdown-bg: $nav-secondary;
$dropdown-link-color: $nav-link;
$dropdown-link-hover-color: $nav-link;
$dropdown-link-hover-bg: $nav-primary-hover;
$dropdown-border-radius: 0;
$pdb-redo-colors: (
"primary": $primary,
"nav-primary": $nav-primary,
"nav-secondary": $nav-secondary,
);
$navbar-padding-y: 0;
$nav-link-padding-y: math.div($spacer, 2);
// (Required) Import Bootstrap
@import "bootstrap/scss/bootstrap";
$theme-colors: map-merge($pdb-redo-colors, $theme-colors);
@mixin hover-focus() {
&:hover,
&:focus {
@content;
}
}
.site {
display: flex;
min-height: 100vh;
height: 100%;
flex-direction: column;
header,
footer {
flex: none;
}
footer {
clear: both;
border-top: 1px solid #888;
padding: 0.5em;
margin-top: 2em;
font-size: small;
color: #555;
white-space: pre;
}
.site-content {
flex: 1 0 auto;
padding: var(--space) var(--space) 0;
width: 100%;
&::after {
content: '\00a0';
/* &nbsp; */
display: block;
margin-top: var(--space);
height: 0px;
visibility: hidden;
}
}
}
// for the pdb-redo header
header {
min-height: 6em;
padding-bottom: 1em;
img {
min-height: calc(6em + 30px);
margin: -15px 0;
width: auto;
}
div {
flex: 1 0 0%;
}
div.my-overflow {
overflow: hidden;
white-space: nowrap;
}
nav.first {
padding: 0.8em !important;
}
.navbar {
.navbar-nav {
.nav-link {
color: $nav-link;
@include hover-focus() {
background-color: $nav-primary-hover;
}
&.active {
background-color: lighten($nav-link, 5%);
color: white;
}
&.disabled {
color: mix($nav-link, $nav-secondary, 50%);
}
}
}
.navbar-toggler {
border-color: rgba($black, .1);
}
.navbar-toggler-icon {
background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'><path stroke='#{$navbar-light-color}' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/></svg>");
}
}
.first {
background-color: $nav-primary;
color: white;
a {
color: white;
text-decoration: none;
}
}
.second {
background-color: $nav-secondary;
}
a {
text-decoration: none;
&:hover {
text-decoration: underline;
}
}
}
@media all and (max-width: 1024px) {
header {
min-height: 4em;
img {
min-height: calc(4em + 30px);
}
nav.first {
padding: 0.4em !important;
}
.second {
padding: 0.2em;
}
}
}
article {
margin-top: 1em;
margin-bottom: 2em;
}
article h2 {
margin-bottom: 0.5em;
font-size: x-large;
}
a {
color: #3366cc;
text-decoration: none;
&:hover {
text-decoration: underline;
}
}
.error-info {
list-style: none;
}
.nummer {
text-align: right;
}
.error-head-text {
font-size: large;
}
.logo img {
margin: -15px 0;
height: 2em;
background-color: white;
}
ul.error-info {
margin: 0;
list-style: none;
}
a.action {
color: #888;
}
a.action:hover {
color: #555;
}
.no-list {
list-style: none;
margin: 0;
padding: 1px;
}
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const webpack = require('webpack');
const TerserPlugin = require('terser-webpack-plugin');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
const path = require('path');
const SCRIPTS = __dirname + "/webapp/";
const DEST = __dirname + "/docroot/scripts";
module.exports = (env) => {
const PRODUCTION = env != null && env.PRODUCTION;
const webpackConf = {
entry: {
index: SCRIPTS + "index.js"
},
output: {
path: DEST,
crossOriginLoading: 'anonymous'
},
module: {
rules: [
{
test: /\.js/,
exclude: /node_modules/,
use: {
loader: "babel-loader",
options: {
presets: ['@babel/preset-env']
}
}
},
{
test: /\.(sa|sc|c)ss$/i,
use: [
MiniCssExtractPlugin.loader,
"css-loader",
"postcss-loader",
"sass-loader"
]
},
{
test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/,
include: path.resolve(__dirname, './node_modules/bootstrap-icons/font/fonts'),
type: 'asset/resource',
generator: {
filename: '../fonts/[name][ext]'
}
}
]
},
resolve: {
extensions: ['.js', '.scss'],
},
plugins: [
new MiniCssExtractPlugin({
filename: "../css/[name].css"
})
],
optimization: { minimizer: [] },
target: 'web'
};
if (PRODUCTION) {
webpackConf.mode = "production";
webpackConf.plugins.push(
new CleanWebpackPlugin({
verbose: true
}));
webpackConf.optimization.minimizer.push(
new TerserPlugin({ /* additional options here */ }),
new UglifyJsPlugin({ parallel: 4 })
);
} else {
webpackConf.mode = "development";
webpackConf.devtool = 'source-map';
webpackConf.plugins.push(new webpack.optimize.AggressiveMergingPlugin())
}
return webpackConf;
};
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment