Commit 6a245bf4 by Maarten L. Hekkelman

Update for new libcifpp

parent 32b28bf2
...@@ -4,3 +4,5 @@ version-info*.txt ...@@ -4,3 +4,5 @@ version-info*.txt
mkdssp mkdssp
.vs/ .vs/
build build
.gdb_history
**/*.dssp
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
cmake_minimum_required(VERSION 3.15) cmake_minimum_required(VERSION 3.15)
# set the project name # set the project name
project(mkdssp VERSION 4.0.4 LANGUAGES CXX) project(mkdssp VERSION 4.0.5 LANGUAGES CXX)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
...@@ -120,7 +120,7 @@ find_package(Threads) ...@@ -120,7 +120,7 @@ find_package(Threads)
# Note: use -DBoost_USE_STATIC_LIBS=ON to use boost static libraries # Note: use -DBoost_USE_STATIC_LIBS=ON to use boost static libraries
find_package(cifpp 2.0.0 REQUIRED) find_package(cifpp 4.0.1 REQUIRED)
find_package(Boost COMPONENTS date_time program_options) find_package(Boost COMPONENTS date_time program_options)
add_executable(mkdssp add_executable(mkdssp
......
Version 4.0.5
- The options for loading custom dictionary files and the like are now
visible in the help again.
Version 4.0.4 Version 4.0.4
- New version string logic - New version string logic
- Improved makefile - Improved makefile
......
.TH mkdssp 1 "2021-08-31" "version 4.0.2" "User Commands" .TH mkdssp 1 "2021-08-31" "version 4.0.5" "User Commands"
.if n .ad l .if n .ad l
.nh .nh
.SH NAME .SH NAME
...@@ -40,6 +40,20 @@ angles within the range required to assing a PP helix. ...@@ -40,6 +40,20 @@ angles within the range required to assing a PP helix.
\fB--write-other\fR \fB--write-other\fR
By default the new format does not write the structure information for OTHER. By default the new format does not write the structure information for OTHER.
Use this flag to change that. Use this flag to change that.
.TP
\fB--components\fR
The knowledge of compounds is loaded from the CCD file \fIcomponents.cif\fR
that should have been installed by \fIlibcifpp\fR. You can override that file
by using this option.
.TP
\fB--extra-compounds\fR
As an addition to the standard \fIcomponents.cif\fR file, you can add more
files using this option. Files should be either in CCD format or should be
CCP4 restraints files.
.TP
\fB--mmcif-dictionary\fR
The default mmCIF dictionary file is installed by the \fIlibcifpp\fR library
but you can override it using this option.
.SH DETAILS .SH DETAILS
The DSSP algorithm assings secondary structure based on the energy calculated The DSSP algorithm assings secondary structure based on the energy calculated
for H-bonds. for H-bonds.
......
...@@ -154,6 +154,8 @@ std::string ResidueToDSSPLine(const mmcif::DSSP::ResidueInfo& info) ...@@ -154,6 +154,8 @@ std::string ResidueToDSSPLine(const mmcif::DSSP::ResidueInfo& info)
void writeDSSP(const mmcif::Structure& structure, const mmcif::DSSP& dssp, std::ostream& os) void writeDSSP(const mmcif::Structure& structure, const mmcif::DSSP& dssp, std::ostream& os)
{ {
auto &db = structure.datablock();
const std::string kFirstLine("==== Secondary Structure Definition by the program DSSP, NKI version 4.0 ==== "); const std::string kFirstLine("==== Secondary Structure Definition by the program DSSP, NKI version 4.0 ==== ");
boost::format kHeaderLine("%1% %|127t|%2%"); boost::format kHeaderLine("%1% %|127t|%2%");
...@@ -163,14 +165,14 @@ void writeDSSP(const mmcif::Structure& structure, const mmcif::DSSP& dssp, std:: ...@@ -163,14 +165,14 @@ void writeDSSP(const mmcif::Structure& structure, const mmcif::DSSP& dssp, std::
date today = day_clock::local_day(); date today = day_clock::local_day();
auto& cf = structure.getFile().file(); // auto& cf = structure.file();
os << kHeaderLine % (kFirstLine + "DATE=" + to_iso_extended_string(today)) % '.' << std::endl os << kHeaderLine % (kFirstLine + "DATE=" + to_iso_extended_string(today)) % '.' << std::endl
<< kHeaderLine % "REFERENCE W. KABSCH AND C.SANDER, BIOPOLYMERS 22 (1983) 2577-2637" % '.' << std::endl << kHeaderLine % "REFERENCE W. KABSCH AND C.SANDER, BIOPOLYMERS 22 (1983) 2577-2637" % '.' << std::endl
<< GetPDBHEADERLine(cf, 127) << '.' << std::endl << GetPDBHEADERLine(db, 127) << '.' << std::endl
<< GetPDBCOMPNDLine(cf, 127) << '.' << std::endl << GetPDBCOMPNDLine(db, 127) << '.' << std::endl
<< GetPDBSOURCELine(cf, 127) << '.' << std::endl << GetPDBSOURCELine(db, 127) << '.' << std::endl
<< GetPDBAUTHORLine(cf, 127) << '.' << std::endl; << GetPDBAUTHORLine(db, 127) << '.' << std::endl;
os << boost::format("%5.5d%3.3d%3.3d%3.3d%3.3d TOTAL NUMBER OF RESIDUES, NUMBER OF CHAINS, NUMBER OF SS-BRIDGES(TOTAL,INTRACHAIN,INTERCHAIN) %|127t|%c") % os << boost::format("%5.5d%3.3d%3.3d%3.3d%3.3d TOTAL NUMBER OF RESIDUES, NUMBER OF CHAINS, NUMBER OF SS-BRIDGES(TOTAL,INTRACHAIN,INTERCHAIN) %|127t|%c") %
stats.nrOfResidues % stats.nrOfChains % stats.nrOfSSBridges % stats.nrOfIntraChainSSBridges % (stats.nrOfSSBridges - stats.nrOfIntraChainSSBridges) % '.' << std::endl; stats.nrOfResidues % stats.nrOfChains % stats.nrOfSSBridges % stats.nrOfIntraChainSSBridges % (stats.nrOfSSBridges - stats.nrOfIntraChainSSBridges) % '.' << std::endl;
...@@ -235,7 +237,7 @@ void writeDSSP(const mmcif::Structure& structure, const mmcif::DSSP& dssp, std:: ...@@ -235,7 +237,7 @@ void writeDSSP(const mmcif::Structure& structure, const mmcif::DSSP& dssp, std::
void annotateDSSP(mmcif::Structure& structure, const mmcif::DSSP& dssp, bool writeOther, std::ostream& os) void annotateDSSP(mmcif::Structure& structure, const mmcif::DSSP& dssp, bool writeOther, std::ostream& os)
{ {
auto& db = structure.getFile().data(); auto& db = structure.datablock();
if (dssp.empty()) if (dssp.empty())
{ {
......
...@@ -83,6 +83,10 @@ int d_main(int argc, const char* argv[]) ...@@ -83,6 +83,10 @@ int d_main(int argc, const char* argv[])
("min-pp-stretch", po::value<short>(), "Minimal number of residues having PSI/PHI in range for a PP helix, default is 3") ("min-pp-stretch", po::value<short>(), "Minimal number of residues having PSI/PHI in range for a PP helix, default is 3")
("write-other", "If set, write the type OTHER for loops, default is to leave this out") ("write-other", "If set, write the type OTHER for loops, default is to leave this out")
("components", po::value<std::string>(), "Location of the components.cif file from CCD")
("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")
("mmcif-dictionary", po::value<std::string>(), "Path to the mmcif_pdbx.dic file to use instead of default")
("help,h", "Display help message") ("help,h", "Display help message")
("version", "Print version") ("version", "Print version")
("verbose,v", "verbose output") ("verbose,v", "verbose output")
...@@ -94,10 +98,7 @@ int d_main(int argc, const char* argv[]) ...@@ -94,10 +98,7 @@ int d_main(int argc, const char* argv[])
("output,o", po::value<std::string>(), "Output to this file") ("output,o", po::value<std::string>(), "Output to this file")
("debug,d", po::value<int>(), "Debug level (for even more verbose output)") ("debug,d", po::value<int>(), "Debug level (for even more verbose output)")
("compounds", po::value<std::string>(), "Location of the components.cif file from CCD") ("compounds", po::value<std::string>(), "Location of the components.cif file from CCD, alias")
("components", po::value<std::string>(), "Location of the components.cif file from CCD, alias")
("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")
("mmcif-dictionary", po::value<std::string>(), "Path to the mmcif_pdbx.dic file to use instead of default")
; ;
po::options_description cmdline_options; po::options_description cmdline_options;
......
data_1CBS data_1CBS
# #
_entry.id 1CBS _entry.id 1CBS
#
_audit_conform.dict_name mmcif_pdbx.dic
_audit_conform.dict_version 5.279
_audit_conform.dict_location http://mmcif.pdb.org/dictionaries/ascii/mmcif_pdbx.dic
# #
loop_ loop_
_database_2.database_id _database_2.database_id
......
...@@ -92,7 +92,7 @@ BOOST_AUTO_TEST_CASE(ut_mmcif_2) ...@@ -92,7 +92,7 @@ BOOST_AUTO_TEST_CASE(ut_mmcif_2)
using namespace cif::literals; using namespace cif::literals;
mmcif::File f("1cbs.cif.gz"); mmcif::File f("1cbs.cif.gz");
f.file().loadDictionary("mmcif_pdbx_v50"); f.loadDictionary("mmcif_pdbx_v50");
mmcif::Structure structure(f, 1, mmcif::StructureOpenOptions::SkipHydrogen); mmcif::Structure structure(f, 1, mmcif::StructureOpenOptions::SkipHydrogen);
......
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