density-fitness-1.0.3/0000775000175000017500000000000014177153152014513 5ustar maartenmaartendensity-fitness-1.0.3/.gitignore0000664000175000017500000000003514177153152016501 0ustar maartenmaarten.vscode/ .gdb_history build/ density-fitness-1.0.3/CMakeLists.txt0000664000175000017500000001145414177153152017260 0ustar maartenmaarten# SPDX-License-Identifier: BSD-2-Clause # Copyright (c) 2021 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. cmake_minimum_required(VERSION 3.15) # set the project name project(density-fitness VERSION 1.0.3 LANGUAGES CXX) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") include(GNUInstallDirs) include(CheckFunctionExists) include(CheckIncludeFile) include(CheckIncludeFiles) include(CheckLibraryExists) include(CMakePackageConfigHelpers) include(Dart) include(GenerateExportHeader) set(CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers") elseif(MSVC) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4") endif() option(CCP4 "The location where ccp4 is installed" "") if(DEFINED CCP4 AND EXISTS ${CCP4}) set(CLIBD ${CCP4}/lib/data) elseif(EXISTS $ENV{CCP4}) set(CCP4 $ENV{CCP4}) set(CLIBD ${CCP4}/lib/data) endif() if(EXISTS "${CCP4}") set(BUILD_SHARED_LIBS ON) list(PREPEND CMAKE_MODULE_PATH "${CCP4}/Lib") list(APPEND CMAKE_PREFIX_PATH ${CCP4}) if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) set(CMAKE_INSTALL_PREFIX ${CCP4}) endif() endif() if(MSVC) # make msvc standards compliant... add_compile_options(/permissive-) macro(get_WIN32_WINNT version) if (WIN32 AND CMAKE_SYSTEM_VERSION) set(ver ${CMAKE_SYSTEM_VERSION}) string(REPLACE "." "" ver ${ver}) string(REGEX REPLACE "([0-9])" "0\\1" ver ${ver}) set(${version} "0x${ver}") endif() endmacro() get_WIN32_WINNT(ver) add_definitions(-D_WIN32_WINNT=${ver}) # On Windows, do not install in the system location if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT AND NOT BUILD_FOR_CCP4) message(STATUS "The library and auxiliary files will be installed in $ENV{LOCALAPPDATA}/${PROJECT_NAME}") set(CMAKE_INSTALL_PREFIX "$ENV{LOCALAPPDATA}/${PROJECT_NAME}" CACHE PATH "..." FORCE) endif() endif() if(UNIX AND NOT APPLE) # On Linux, install in the $HOME/.local folder by default if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) message(WARNING "The library and auxiliary files will be installed in $ENV{HOME}/.local") set(CMAKE_INSTALL_PREFIX "$ENV{HOME}/.local" CACHE PATH "..." FORCE) endif() endif() # Create a revision file, containing the current git version info include(VersionString) write_version_header() # Optionally use mrc to create resources find_package(Mrc) if(MRC_FOUND) option(USE_RSRC "Use mrc to create resources" ON) else() message(STATUS "Not using resources since mrc was not found") endif() if(USE_RSRC) set(USE_RSRC 1) message("Using resources compiled with ${MRC_EXECUTABLE}") add_compile_definitions(USE_RSRC) mrc_write_header(${CMAKE_BINARY_DIR}/mrsrc.hpp) endif() # libraries find_package(pdb-redo 2.0.2 REQUIRED) find_package(Boost COMPONENTS program_options REQUIRED) add_executable(density-fitness ${PROJECT_SOURCE_DIR}/src/density-fitness.cpp ${density-fitness_RESOURCE}) if(USE_RSRC) mrc_target_resources(density-fitness ${CIFPP_SHARE_DIR}/mmcif_pdbx_v50.dic) endif() target_include_directories(density-fitness PRIVATE pdb-redo::pdb-redo ${CMAKE_SOURCE_DIR}/include ${CMAKE_BINARY_DIR}) target_link_libraries(density-fitness PRIVATE pdb-redo::pdb-redo Boost::program_options) install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION ${BIN_INSTALL_DIR} ) # manual if(UNIX) install(FILES doc/density-fitness.1 DESTINATION ${CMAKE_INSTALL_DATADIR}/man/man1) endif() if(EXISTS "${CCP4}/html") install(FILES doc/density-fitness.html DESTINATION ${CCP4}/html) endif() density-fitness-1.0.3/LICENSE0000664000175000017500000000247214177153152015525 0ustar maartenmaartenSPDX-License-Identifier: BSD-2-Clause Copyright (c) 2020 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.density-fitness-1.0.3/README.md0000664000175000017500000001312014177153152015767 0ustar maartenmaartendensity-fitness =============== This is the repository for density-fitness, an application to calculate density statisctics. This program is part of the [PDB-REDO](https://pdb.redo.eu/) suite of programs. Installation ------------ See the documentation for [`libpdb-redo`](https://github.com/PDB-REDO/libpdb-redo) on installing all prerequisites. After that, density-fitness can be built as follows: ``` git clone https://github.com/PDB-REDO/density-fitness.git cd density-fitness mkdir build cd build cmake .. cmake --build . cmake --install . ``` When building on Windows you should replace `cmake --build .` with `cmake --build . --config Release`. This checks out the source code from github, creates a new directory where cmake stores its files. Run a configure, build the code and run tests. And then it installs the library and auxiliary files. The default is to install everything in `$HOME/.local` on Linux and `%LOCALAPPDATA%` on Windows (the AppData/Local folder in your home directory). You can change this by specifying the prefix with the [CMAKE_INSTALL_PREFIX](https://cmake.org/cmake/help/v3.21/variable/CMAKE_INSTALL_PREFIX.html) variable. Usage ----- # Name density-fitness - Calculates per-residue electron density scores real-space R, real-space correlation coefficient, EDIAm, and OPIA # Synopsis ``` density-fitness [OPTION] [output] density-fitness [OPTION] --hklin= --xyzin=] density-fitness [OPTION] --fomap= --dfmap= --reslo= --reshi= --xyzin=] ``` # Description The program density-fitness calculates electron density metrics, for main- (includes Cβ atom) and side-chain atoms of individual residues. For this calculation, the program uses the structure model in either PDB or mmCIF format and the electron density from the 2mFo-DFc and mFo-DFc maps. If these maps are not readily available, the MTZ file and model can be used to calculate maps clipper. Density-fitness support both X-ray and electron diffraction data. This program is essentially a reimplementation of _edstats_, a program available from the CCP4 suite. However, the output now contains only the RSR, SRSR and RSCC fields as in _edstats_ with the addition of EDIAm and OPIA and no longer requires pre-calculated map coefficients. * The real-space R factor (RSR) is defined (Brändén & Jones, 1990; Jones et al., 1991) as: RSR = Σ |ρobs - ρcalc| / Σ |ρobs + ρcalc| The SRSR is the estimated sigma for RSR. * The real-space correlation coefficient (RSCC) is defined as: RSCC = cov(ρobs,ρcalc) / sqrt(var(ρobs) var(ρcalc)) where cov(.,.) and var(.) are the sample covariance and variance (i.e. calculated with respect to the sample means of ρobs and ρcalc). * The EDIAm score is a per-residue score based on the atomic EDIA value and the OPIA score gives the percentage of atoms in the residue with EDIA score is above 0.8. # Options When using MTZ files, the input and output files do not need the option flag. If no output file is given, the result is printed to _stdout_. When using map files, the resolution **must** be specified using the _reshi_ and _reslo_ options. * **--xyzin** The coordinates file in either PDB or mmCIF format. This file may be compressed with gzip or bzip2. **--fomap** and **--dfmap** The _2mFo-DFc_ and _mFo-DFc_ map files respectively. Both are required and if these are specified, the resolution **must** also be specified. * **--reslo** and **--reshi** The low and high resolution for the specied map files. * **--hklin** The MTZ file. If this option is specified, the maps will be calculated using the information in this file. * **--sampling-rate** The sampling rate to use when creating maps. Default is 1.5. * **--recalc** By default the maps are read from the MTZ file, but you can also opt to recalculate the maps, e.g. when the structure no longer corresponds to the structure used to calculate the maps in the MTZ file. * **--aniso-scaling** Accepted values for this option are _observed_ and _calculated_ or _none_. Used when recalculating maps. * **--no-bulk** When specified, a bulk solvent mask is not used in recalculating the maps. * **--dict**=<file> Dictionary file containing restraints for residues in this specific target. * **--no-validate** Omit the validation of the input mmCIF file. This will force output even in case the input file contains errors. * **--electron-scattering** Use electron scattering factors instead of X-ray scattering factors. * **--use-auth-ids** By default, when reading mmCIF files, the label_xxx_id is used in the edstats output. Use this flag to force output with the auth_xxx_ids. * **--output-format** By default a JSON file is written, unless the filename ends with .eds. Use this option to force output in _edstats_ or _json_ format. * **--verbose**,**-V** Be more verbose, useful to diagnose validation errors. # References References: * Statistical quality indicators for electron-density maps Tickle, I. J. (2012). Acta Cryst. D68, 454-467. DOI: 10.1107/S0907444911035918 * Estimating Electron Density Support for Individual Atoms and Molecular Fragments in X-ray Structures Agnes Meyder, Eva Nittinger, Gudrun Lange, Robert Klein, and Matthias Rarey Journal of Chemical Information and Modeling 2017 57 (10), 2437-2447 DOI: 10.1021/acs.jcim.7b00391 # Author Written by Maarten L. Hekkelman <[maarten@hekkelman.com](mailto:maarten@hekkelman.com)> # Reporting Bugs Report bugs at https://github.com/PDB-REDO/density-fitness/issues density-fitness-1.0.3/changelog0000664000175000017500000000031514177153152016364 0ustar maartenmaartenVersion 1.0.3 - PDB-REDO dependency updated - Improved makefile Version 1.0.2 - New dependencies - Update build system Version 1.0.1 - Change from GNU configure to cmake Version 1.0.0 - Initial release density-fitness-1.0.3/cmake/0000775000175000017500000000000014177153152015573 5ustar maartenmaartendensity-fitness-1.0.3/cmake/GetGitRevisionDescription.cmake0000664000175000017500000002245714177153152023715 0ustar maartenmaarten# - Returns a version string from Git # # These functions force a re-configure on each git commit so that you can # trust the values of the variables in your build system. # # get_git_head_revision( [ALLOW_LOOKING_ABOVE_CMAKE_SOURCE_DIR]) # # Returns the refspec and sha hash of the current head revision # # git_describe( [ ...]) # # Returns the results of git describe on the source tree, and adjusting # the output so that it tests false if an error occurs. # # git_describe_working_tree( [ ...]) # # Returns the results of git describe on the working tree (--dirty option), # and adjusting the output so that it tests false if an error occurs. # # git_get_exact_tag( [ ...]) # # Returns the results of git describe --exact-match on the source tree, # and adjusting the output so that it tests false if there was no exact # matching tag. # # git_local_changes() # # Returns either "CLEAN" or "DIRTY" with respect to uncommitted changes. # Uses the return code of "git diff-index --quiet HEAD --". # Does not regard untracked files. # # Requires CMake 2.6 or newer (uses the 'function' command) # # Original Author: # 2009-2020 Ryan Pavlik # http://academic.cleardefinition.com # # Copyright 2009-2013, Iowa State University. # Copyright 2013-2020, Ryan Pavlik # Copyright 2013-2020, Contributors # SPDX-License-Identifier: BSL-1.0 # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) if(__get_git_revision_description) return() endif() set(__get_git_revision_description YES) # We must run the following at "include" time, not at function call time, # to find the path to this module rather than the path to a calling list file get_filename_component(_gitdescmoddir ${CMAKE_CURRENT_LIST_FILE} PATH) # Function _git_find_closest_git_dir finds the next closest .git directory # that is part of any directory in the path defined by _start_dir. # The result is returned in the parent scope variable whose name is passed # as variable _git_dir_var. If no .git directory can be found, the # function returns an empty string via _git_dir_var. # # Example: Given a path C:/bla/foo/bar and assuming C:/bla/.git exists and # neither foo nor bar contain a file/directory .git. This wil return # C:/bla/.git # function(_git_find_closest_git_dir _start_dir _git_dir_var) set(cur_dir "${_start_dir}") set(git_dir "${_start_dir}/.git") while(NOT EXISTS "${git_dir}") # .git dir not found, search parent directories set(git_previous_parent "${cur_dir}") get_filename_component(cur_dir "${cur_dir}" DIRECTORY) if(cur_dir STREQUAL git_previous_parent) # We have reached the root directory, we are not in git set(${_git_dir_var} "" PARENT_SCOPE) return() endif() set(git_dir "${cur_dir}/.git") endwhile() set(${_git_dir_var} "${git_dir}" PARENT_SCOPE) endfunction() function(get_git_head_revision _refspecvar _hashvar) _git_find_closest_git_dir("${CMAKE_CURRENT_SOURCE_DIR}" GIT_DIR) if("${ARGN}" STREQUAL "ALLOW_LOOKING_ABOVE_CMAKE_SOURCE_DIR") set(ALLOW_LOOKING_ABOVE_CMAKE_SOURCE_DIR TRUE) else() set(ALLOW_LOOKING_ABOVE_CMAKE_SOURCE_DIR FALSE) endif() if(NOT "${GIT_DIR}" STREQUAL "") file(RELATIVE_PATH _relative_to_source_dir "${CMAKE_SOURCE_DIR}" "${GIT_DIR}") if("${_relative_to_source_dir}" MATCHES "[.][.]" AND NOT ALLOW_LOOKING_ABOVE_CMAKE_SOURCE_DIR) # We've gone above the CMake root dir. set(GIT_DIR "") endif() endif() if("${GIT_DIR}" STREQUAL "") set(${_refspecvar} "GITDIR-NOTFOUND" PARENT_SCOPE) set(${_hashvar} "GITDIR-NOTFOUND" PARENT_SCOPE) return() endif() # Check if the current source dir is a git submodule or a worktree. # In both cases .git is a file instead of a directory. # if(NOT IS_DIRECTORY ${GIT_DIR}) # The following git command will return a non empty string that # points to the super project working tree if the current # source dir is inside a git submodule. # Otherwise the command will return an empty string. # execute_process( COMMAND "${GIT_EXECUTABLE}" rev-parse --show-superproject-working-tree WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" OUTPUT_VARIABLE out ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE) if(NOT "${out}" STREQUAL "") # If out is empty, GIT_DIR/CMAKE_CURRENT_SOURCE_DIR is in a submodule file(READ ${GIT_DIR} submodule) string(REGEX REPLACE "gitdir: (.*)$" "\\1" GIT_DIR_RELATIVE ${submodule}) string(STRIP ${GIT_DIR_RELATIVE} GIT_DIR_RELATIVE) get_filename_component(SUBMODULE_DIR ${GIT_DIR} PATH) get_filename_component(GIT_DIR ${SUBMODULE_DIR}/${GIT_DIR_RELATIVE} ABSOLUTE) set(HEAD_SOURCE_FILE "${GIT_DIR}/HEAD") else() # GIT_DIR/CMAKE_CURRENT_SOURCE_DIR is in a worktree file(READ ${GIT_DIR} worktree_ref) # The .git directory contains a path to the worktree information directory # inside the parent git repo of the worktree. # string(REGEX REPLACE "gitdir: (.*)$" "\\1" git_worktree_dir ${worktree_ref}) string(STRIP ${git_worktree_dir} git_worktree_dir) _git_find_closest_git_dir("${git_worktree_dir}" GIT_DIR) set(HEAD_SOURCE_FILE "${git_worktree_dir}/HEAD") endif() else() set(HEAD_SOURCE_FILE "${GIT_DIR}/HEAD") endif() set(GIT_DATA "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/git-data") if(NOT EXISTS "${GIT_DATA}") file(MAKE_DIRECTORY "${GIT_DATA}") endif() if(NOT EXISTS "${HEAD_SOURCE_FILE}") return() endif() set(HEAD_FILE "${GIT_DATA}/HEAD") configure_file("${HEAD_SOURCE_FILE}" "${HEAD_FILE}" COPYONLY) configure_file("${_gitdescmoddir}/GetGitRevisionDescription.cmake.in" "${GIT_DATA}/grabRef.cmake" @ONLY) include("${GIT_DATA}/grabRef.cmake") set(${_refspecvar} "${HEAD_REF}" PARENT_SCOPE) set(${_hashvar} "${HEAD_HASH}" PARENT_SCOPE) endfunction() function(git_describe _var) if(NOT GIT_FOUND) find_package(Git QUIET) endif() get_git_head_revision(refspec hash) if(NOT GIT_FOUND) set(${_var} "GIT-NOTFOUND" PARENT_SCOPE) return() endif() if(NOT hash) set(${_var} "HEAD-HASH-NOTFOUND" PARENT_SCOPE) return() endif() # TODO sanitize #if((${ARGN}" MATCHES "&&") OR # (ARGN MATCHES "||") OR # (ARGN MATCHES "\\;")) # message("Please report the following error to the project!") # message(FATAL_ERROR "Looks like someone's doing something nefarious with git_describe! Passed arguments ${ARGN}") #endif() #message(STATUS "Arguments to execute_process: ${ARGN}") execute_process( COMMAND "${GIT_EXECUTABLE}" describe --tags --always ${hash} ${ARGN} WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" RESULT_VARIABLE res OUTPUT_VARIABLE out ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE) if(NOT res EQUAL 0) set(out "${out}-${res}-NOTFOUND") endif() set(${_var} "${out}" PARENT_SCOPE) endfunction() function(git_describe_working_tree _var) if(NOT GIT_FOUND) find_package(Git QUIET) endif() if(NOT GIT_FOUND) set(${_var} "GIT-NOTFOUND" PARENT_SCOPE) return() endif() execute_process( COMMAND "${GIT_EXECUTABLE}" describe --dirty ${ARGN} WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" RESULT_VARIABLE res OUTPUT_VARIABLE out ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE) if(NOT res EQUAL 0) set(out "${out}-${res}-NOTFOUND") endif() set(${_var} "${out}" PARENT_SCOPE) endfunction() function(git_get_exact_tag _var) git_describe(out --exact-match ${ARGN}) set(${_var} "${out}" PARENT_SCOPE) endfunction() function(git_local_changes _var) if(NOT GIT_FOUND) find_package(Git QUIET) endif() get_git_head_revision(refspec hash) if(NOT GIT_FOUND) set(${_var} "GIT-NOTFOUND" PARENT_SCOPE) return() endif() if(NOT hash) set(${_var} "HEAD-HASH-NOTFOUND" PARENT_SCOPE) return() endif() execute_process( COMMAND "${GIT_EXECUTABLE}" diff-index --quiet HEAD -- WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" RESULT_VARIABLE res OUTPUT_VARIABLE out ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE) if(res EQUAL 0) set(${_var} "CLEAN" PARENT_SCOPE) else() set(${_var} "DIRTY" PARENT_SCOPE) endif() endfunction() density-fitness-1.0.3/cmake/GetGitRevisionDescription.cmake.in0000664000175000017500000000251214177153152024310 0ustar maartenmaarten# # Internal file for GetGitRevisionDescription.cmake # # Requires CMake 2.6 or newer (uses the 'function' command) # # Original Author: # 2009-2010 Ryan Pavlik # http://academic.cleardefinition.com # Iowa State University HCI Graduate Program/VRAC # # Copyright 2009-2012, Iowa State University # Copyright 2011-2015, Contributors # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) # SPDX-License-Identifier: BSL-1.0 set(HEAD_HASH) file(READ "@HEAD_FILE@" HEAD_CONTENTS LIMIT 1024) string(STRIP "${HEAD_CONTENTS}" HEAD_CONTENTS) if(HEAD_CONTENTS MATCHES "ref") # named branch string(REPLACE "ref: " "" HEAD_REF "${HEAD_CONTENTS}") if(EXISTS "@GIT_DIR@/${HEAD_REF}") configure_file("@GIT_DIR@/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY) else() configure_file("@GIT_DIR@/packed-refs" "@GIT_DATA@/packed-refs" COPYONLY) file(READ "@GIT_DATA@/packed-refs" PACKED_REFS) if(${PACKED_REFS} MATCHES "([0-9a-z]*) ${HEAD_REF}") set(HEAD_HASH "${CMAKE_MATCH_1}") endif() endif() else() # detached HEAD configure_file("@GIT_DIR@/HEAD" "@GIT_DATA@/head-ref" COPYONLY) endif() if(NOT HEAD_HASH) file(READ "@GIT_DATA@/head-ref" HEAD_HASH LIMIT 1024) string(STRIP "${HEAD_HASH}" HEAD_HASH) endif() density-fitness-1.0.3/cmake/VersionString.cmake0000664000175000017500000000603414177153152021414 0ustar maartenmaarten# SPDX-License-Identifier: BSD-2-Clause # Copyright (c) 2021 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. cmake_minimum_required(VERSION 3.15) # Create a revision file, containing the current git version info, if any function(write_version_header) include(GetGitRevisionDescription) if(NOT(GIT-NOTFOUND OR HEAD-HASH-NOTFOUND)) git_describe_working_tree(BUILD_VERSION_STRING --match=build --dirty) if(BUILD_VERSION_STRING MATCHES "build-([0-9]+)-g([0-9a-f]+)(-dirty)?") set(BUILD_GIT_TAGREF "${CMAKE_MATCH_2}") if(CMAKE_MATCH_3) set(BUILD_VERSION_STRING "${CMAKE_MATCH_1}*") else() set(BUILD_VERSION_STRING "${CMAKE_MATCH_1}") endif() endif() else() set(BUILD_VERSION_STRING "no git info available") endif() include_directories(${CMAKE_BINARY_DIR} PRIVATE) string(TIMESTAMP BUILD_DATE_TIME "%Y-%m-%dT%H:%M:%SZ" UTC) if(ARGC GREATER 0) set(VAR_PREFIX "${ARGV0}") endif() file(WRITE "${CMAKE_BINARY_DIR}/revision.hpp.in" [[// Generated revision file #pragma once #include const char k@VAR_PREFIX@ProjectName[] = "@PROJECT_NAME@"; const char k@VAR_PREFIX@VersionNumber[] = "@PROJECT_VERSION@"; const char k@VAR_PREFIX@VersionGitTag[] = "@BUILD_GIT_TAGREF@"; const char k@VAR_PREFIX@BuildInfo[] = "@BUILD_VERSION_STRING@"; const char k@VAR_PREFIX@BuildDate[] = "@BUILD_DATE_TIME@"; inline void write_version_string(std::ostream &os, bool verbose) { os << k@VAR_PREFIX@ProjectName << " version " << k@VAR_PREFIX@VersionNumber << std::endl; if (verbose) { os << "build: " << k@VAR_PREFIX@BuildInfo << ' ' << k@VAR_PREFIX@BuildDate << std::endl; if (k@VAR_PREFIX@VersionGitTag[0] != 0) os << "git tag: " << k@VAR_PREFIX@VersionGitTag << std::endl; } } ]]) configure_file("${CMAKE_BINARY_DIR}/revision.hpp.in" "${CMAKE_BINARY_DIR}/revision.hpp" @ONLY) endfunction() density-fitness-1.0.3/doc/0000775000175000017500000000000014177153152015260 5ustar maartenmaartendensity-fitness-1.0.3/doc/density-fitness.10000664000175000017500000001171314177153152020475 0ustar maartenmaarten.TH density-fitness 1 "2020-11-23" "version 1.0.1" "User Commands" .if n .ad l .nh .SH NAME density\-fitness \- Calculates per-residue electron density scores real-space R, real-space correlation coefficient, EDIAm, and OPIA .SH SYNOPSIS density\-fitness [OPTION] [output] .sp density\-fitness [OPTION] --hklin= --xyzin= [--output=] .sp density\-fitness [OPTION] --fomap= --dfmap= --reslo= --reshi= --xyzin=] .SH DESCRIPTION The program density-fitness calculates electron density metrics, for main- (includes Cβ atom) and side-chain atoms of individual residues. .sp For this calculation, the program uses the structure model in either PDB or mmCIF format and the electron density from the 2mFo-DFc and mFo-DFc maps. If these maps are not readily available, the MTZ file and model can be used to calculate maps clipper. Density-fitness support both X-ray and electron diffraction data. .sp This program is essentially a reimplementation of \fIedstats\fR, a program available from the CCP4 suite. However, the output now contains only the RSR, SRSR and RSCC fields as in \fIedstats\fR with the addition of EDIAm and OPIA and no longer requires pre-calculated map coefficients. .TP The real-space R factor (RSR) is defined (Brändén & Jones, 1990; Jones et al., 1991) as: .sp RSR = Σ |ρobs - ρcalc| / Σ |ρobs + ρcalc| .P The SRSR is the estimated sigma for RSR. .TP The real-space correlation coefficient (RSCC) is defined as: .sp RSCC = cov(ρobs,ρcalc) / sqrt(var(ρobs) var(ρcalc)) .sp where cov(.,.) and var(.) are the sample covariance and variance (i.e. calculated with respect to the sample means of ρobs and ρcalc). .P The EDIAm score is a per-residue score based on the atomic EDIA value and the OPIA score gives the percentage of atoms in the residue with EDIA score is above 0.8. .SH OPTIONS When using MTZ files, the input and output files do not need the option flag. If no output file is given, the result is printed to \fIstdout\fR. .sp When using map files, the resolution \fBmust\fR be specified using the \fIreshi\fR and \fIreslo\fR options. .TP \fB--xyzin\fR The coordinates file in either PDB or mmCIF format. This file may be compressed with gzip. \fB--fomap\fR and \fB--dfmap\fR The \fI2mFo-DFc\fR and \fImFo-DFc\fR map files respectively. Both are required and if these are specified, the resolution \fBmust\fR also be specified. .TP \fB--reslo\fR and \fB--reshi\fR The low and high resolution for the specified map files. .TP \fB--hklin\fR The MTZ file. If this option is specified, the maps will be calculated using the information in this file. .TP \fB--sampling-rate\fR The sampling rate to use when creating maps. Default is 1.5. .TP \fB--recalc\fR By default the maps are read from the MTZ file, but you can also opt to recalculate the maps, e.g. when the structure no longer corresponds to the structure used to calculate the maps in the MTZ file. .TP \fB--aniso-scaling\fR Accepted values for this option are \fIobserved\fR and \fIcalculated\fR or \fInone\fR. Used when recalculating maps. .TP \fB--no-bulk\fR When specified, a bulk solvent mask is not used in recalculating the maps. .TP \fB--components\fR (or \fB--compounds\fR) Specify the path of the CCD file components.cif. By default the one installed by libcifpp is used, use this option to override this default. .TP \fB--extra-compounds\fR A file containing information for residues in this specific target. This file may be in either CCD or CCP4 monomer library format. .TP \fB--mmcif-dictionary\fR Specify the path to the mmcif pdbx dictionary file. The default is to use the dictionary installed by libcifpp, use this option to override this default. .TP \fB--no-validate\fR Omit the validation of the input mmCIF file. This will force output even in case the input file contains errors. .TP \fB--electron-scattering\fR Use electron scattering factors instead of X-ray scattering factors. .TP \fB--use-auth-ids\fR By default, when reading mmCIF files, the label_xxx_id is used in the edstats output. Use this flag to force output with the auth_xxx_ids. .TP \fB--output-format\fR By default a JSON file is written, unless the filename ends with .eds. Use this option to force output in \fIedstats\fR or \fIjson\fR format. .TP \fB--verbose\fR,\fB-V\fR Be more verbose, useful to diagnose validation errors. .SH REFERENCES References: .TP Statistical quality indicators for electron-density maps Tickle, I. J. (2012). Acta Cryst. D68, 454-467. DOI: 10.1107/S0907444911035918 .TP Estimating Electron Density Support for Individual Atoms and Molecular Fragments in X-ray Structures Agnes Meyder, Eva Nittinger, Gudrun Lange, Robert Klein, and Matthias Rarey Journal of Chemical Information and Modeling 2017 57 (10), 2437-2447 DOI: 10.1021/acs.jcim.7b00391 .SH AUTHOR Written by Maarten L. Hekkelman .SH "REPORTING BUGS" Report bugs at https://github.com/PDB-REDO/density-fitness/issues density-fitness-1.0.3/doc/density-fitness.html0000664000175000017500000001440314177153152021300 0ustar maartenmaartenContent-type: text/html; charset=UTF-8 Man page of density-fitness

density-fitness

Section: User Commands (1)
Updated: 2020-11-23
Index Return to Main Contents
 

NAME

density-fitness - Calculates per-residue electron density scores real-space R, real-space correlation coefficient, EDIAm, and OPIA  

SYNOPSIS

density-fitness [OPTION] <mtz-file> <coordinates-file> [output]

density-fitness [OPTION] --hklin=<mtz-file> --xyzin=<coordinates-file> [--output=<output>]

density-fitness [OPTION] --fomap=<fo-map-file> --dfmap=<df-map-file> --reslo=<low-resolution> --reshi=<high-resolution> --xyzin=<input [--output=<output>]  

DESCRIPTION

The program density-fitness calculates electron density metrics, for main- (includes Cβ atom) and side-chain atoms of individual residues.

For this calculation, the program uses the structure model in either PDB or mmCIF format and the electron density from the 2mFo-DFc and mFo-DFc maps. If these maps are not readily available, the MTZ file and model can be used to calculate maps clipper. Density-fitness support both X-ray and electron diffraction data.

This program is essentially a reimplementation of edstats, a program available from the CCP4 suite. However, the output now contains only the RSR, SRSR and RSCC fields as in edstats with the addition of EDIAm and OPIA and no longer requires pre-calculated map coefficients.

The real-space R factor (RSR) is defined (Brändén & Jones, 1990; Jones et al., 1991) as:

RSR = Σ |ρobs - ρcalc| / Σ |ρobs + ρcalc|

The SRSR is the estimated sigma for RSR.

The real-space correlation coefficient (RSCC) is defined as:

RSCC = cov(ρobs,ρcalc) / sqrt(var(ρobs) var(ρcalc))

where cov(.,.) and var(.) are the sample covariance and variance (i.e. calculated with respect to the sample means of ρobs and ρcalc).

The EDIAm score is a per-residue score based on the atomic EDIA value and the OPIA score gives the percentage of atoms in the residue with EDIA score is above 0.8.  

OPTIONS

When using MTZ files, the input and output files do not need the option flag. If no output file is given, the result is printed to stdout.

When using map files, the resolution must be specified using the reshi and reslo options.

--xyzin
The coordinates file in either PDB or mmCIF format. This file may be compressed with gzip. --fomap and --dfmap The 2mFo-DFc and mFo-DFc map files respectively. Both are required and if these are specified, the resolution must also be specified.
--reslo and --reshi
The low and high resolution for the specified map files.
--hklin
The MTZ file. If this option is specified, the maps will be calculated using the information in this file.
--sampling-rate
The sampling rate to use when creating maps. Default is 1.5.
--recalc
By default the maps are read from the MTZ file, but you can also opt to recalculate the maps, e.g. when the structure no longer corresponds to the structure used to calculate the maps in the MTZ file.
--aniso-scaling
Accepted values for this option are observed and calculated or none. Used when recalculating maps.
--no-bulk
When specified, a bulk solvent mask is not used in recalculating the maps.
--components (or --compounds)
Specify the path of the CCD file components.cif. By default the one installed by libcifpp is used, use this option to override this default.
--extra-compounds
A file containing information for residues in this specific target. This file may be in either CCD or CCP4 monomer library format.
--mmcif-dictionary
Specify the path to the mmcif pdbx dictionary file. The default is to use the dictionary installed by libcifpp, use this option to override this default.
--no-validate
Omit the validation of the input mmCIF file. This will force output even in case the input file contains errors.
--electron-scattering
Use electron scattering factors instead of X-ray scattering factors.
--use-auth-ids
By default, when reading mmCIF files, the label_xxx_id is used in the edstats output. Use this flag to force output with the auth_xxx_ids.
--output-format
By default a JSON file is written, unless the filename ends with .eds. Use this option to force output in edstats or json format.
--verbose,-V
Be more verbose, useful to diagnose validation errors.
 

REFERENCES

References:
Statistical quality indicators for electron-density maps
Tickle, I. J. (2012). Acta Cryst. D68, 454-467. DOI: 10.1107/S0907444911035918
Estimating Electron Density Support for Individual Atoms and Molecular Fragments in X-ray Structures
Agnes Meyder, Eva Nittinger, Gudrun Lange, Robert Klein, and Matthias Rarey Journal of Chemical Information and Modeling 2017 57 (10), 2437-2447 DOI: 10.1021/acs.jcim.7b00391
 

AUTHOR

Written by Maarten L. Hekkelman <maarten@hekkelman.com>  

REPORTING BUGS

Report bugs at https://github.com/PDB-REDO/density-fitness/issues


 

Index

NAME
SYNOPSIS
DESCRIPTION
OPTIONS
REFERENCES
AUTHOR
REPORTING BUGS

This document was created by man2html, using the manual pages.
Time: 14:15:38 GMT, August 31, 2021 density-fitness-1.0.3/doc/density-fitness.pdf0000664000175000017500000006213214177153152021107 0ustar maartenmaarten%PDF-1.4 %쏢 %%Invocation: path/gs -P- -dSAFER -dCompatibilityLevel=1.4 -q -P- -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sstdout=? -sOutputFile=? -P- -dSAFER -dCompatibilityLevel=1.4 - 5 0 obj <> stream xXYrSԗ D UmR#R sB#b;h,-MZ9}| *lݤD)1l.Cix>da׋ ^2'-ً%D`^o % cG1[ !#ZeUw/mw#B.ˤZ쁣?.lKR }lza.YO/h*9!.\_X+;It[$]ֲ 1#Ƿ&k6cY]SW¬MkcMvIҌ? u "^w.҃OXiU!{yzCy껹6E#e߼}w~v>7ZQy>Euݬ,O.mvR)o?vm\xmgzm닏ݗd2k{1zZO" E}|TԸ }9I;zW[ sWXꊛ&~2WAkTgʪ%ko,o2i&)wJc%euMl]7LfV^v'FEbJ$B@ơG?CFHU\ aMO&]])QB(胖kW@ ?nQ~ILGS[(֒pyӑH86/`f|DY7A5۴6+UV@;xѰw/<9{E/NK_QVMdjg.g|E_D  ЎWs@>beؾpxٚk3%о;§U^|bɀʋҍx&b."yUi/Cё*:',HY}&ȧN=.- ..ry@"/0頓pe=vMǮnOUckj=b$i2sH?.X'Le"k$OvIAnrSd%B:#?QsnߑBV-ε$Ci a <׺ !uC"WbJf)tl<<9yyq_=S ].DFo3QANEVLfL,X#V: t^G^\*D{n} y~r|$iQ'ǘI.M ᘕw%%Y> } ;觺ՏfE]]c6'i2{7@7ɠ.2%(l}^ K .HD+{ihS[߰k!? WpH]A F\ƓOFcst]6[|sK><=JDhd}2%J.$@gFwbxOr,rdMi:L t |Eڶ_`Dr= {۵:v=leh%gZ79&:n[1}vda:ad+D᠅Ʈ^hpF{3۾v;LrՀD/ąB?J['RJ6:꒿q-GsT՜0؅5;B8F_r_BNfj~j9@SG3,x\MC?Pbݽ&߹ͦ hۡ*2A##%3%m'^SCm=YcKq{pӂkPUˋBH~hPW6 0_b۶{np]v@yFMnwTRe+-gƄc wv!_%0sGq"TNlBؠԂ\.endstream endobj 6 0 obj 2572 endobj 18 0 obj <> stream xXr8}Wm*&xgjkj}Q2$qVg&ޚHHf̋Bn()K2@7N>7PF1i99YDd#'LMzIGZ%`5D. Y4o'_LT2owRZvJnh8au^%2I1w1ǸBb2m:N["Ej-s֡^9ہ xW[Ix#H#xFM]u%#)/dM-,a : ފatCU@! `}mӥmNu Ir[#Y'EO#y;Ă)|p!@Wm ;f,lzq;MSm 0kE'$Y x%b)yf4A # MB`~#%.~@׋{O&.eप+>e:&uB}/7h $2iQY3j{Z,jz67H몶WS!}fu˼}˭H"؊uj"aKT-EVUNQqS(K)l*: >U41q٨@2f 'HLáC5Soy{G~~~%LRd~WPdˋYH`v!d3ނYC@@1)nLb5MtP*)`.p ۆbYX?dcǔHQAU< y^ru8,u<úWjڥZYh)Y[;BLFeHgƄ?k͎8^@,!Wv1,{Iڀ 1v"lHhb&$,\c1F5#?r⿏>AD<E5Fu^2 LeY_1EL̺-n =s*zI]J{la`-ܤDGqhMPC-CyID%Z"mV]am[Ѡ濄 fWJDK1m" !㟊4]{g:QDS,gRqڂD_y+d? Jkc&fT@N|ϱ a=n3^O]_M% be3 {`JW!2RAVT«ph1ϺyZغR?\xG=%0vJirr$EψFq7xhƜIŚs<zTrvaۺi.04m]5ِ ߔ8jhoZ2 1~:e@,f̆Ero?[Fendstream endobj 19 0 obj 1960 endobj 4 0 obj <> /Contents 5 0 R >> endobj 17 0 obj <> /Contents 18 0 R >> endobj 3 0 obj << /Type /Pages /Kids [ 4 0 R 17 0 R ] /Count 2 >> endobj 1 0 obj <> endobj 7 0 obj <>endobj 15 0 obj <> endobj 16 0 obj <> endobj 20 0 obj <> endobj 21 0 obj <> endobj 12 0 obj <> endobj 13 0 obj <> endobj 10 0 obj <> endobj 8 0 obj <> endobj 25 0 obj <> endobj 14 0 obj <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ǹ-ޗ.uKNӣ3yW](}mp-9z!b%D;_ض;(v>ykp 8iaF-fZW1`@.(x _|dfpxfv+Ce^W}rq7k{ˍW; іŖáwJz`wm':~+~vkomTxۊFo=Iw?-֐2zfpGuO߉F4 N[_vtaHtčh d]16_' "(WR ~ 4-44w}牁c GۄaΨ61ڢh/ER䆜J1 st}xu#@7] o=sd[\.y˚g3 wP_ 1Xqf3D1 1QƆƆzMLeu#u A.$.U~ x"uv<-d aT{Q摣1* ǨT'*wTzV80tCϳVf56A7d)͓XMt@PIe%H* TQ2ԊR],QeڨB/ɣQ6H?E`g Hi3@P J2+47"TQcS9/3G64 CF.TL ҄凱1EЧ|B~ħ'N , endstream endobj 26 0 obj <>stream 2021-08-31T16:15:58+02:00 2021-08-31T16:15:58+02:00 groff version 1.22.4 Untitled endstream endobj 2 0 obj <>endobj xref 0 27 0000000000 65535 f 0000005285 00000 n 0000024842 00000 n 0000005219 00000 n 0000004897 00000 n 0000000182 00000 n 0000002824 00000 n 0000005350 00000 n 0000006402 00000 n 0000015037 00000 n 0000005976 00000 n 0000010232 00000 n 0000005566 00000 n 0000005628 00000 n 0000007216 00000 n 0000005391 00000 n 0000005421 00000 n 0000005057 00000 n 0000002844 00000 n 0000004876 00000 n 0000005484 00000 n 0000005514 00000 n 0000007498 00000 n 0000010557 00000 n 0000015576 00000 n 0000007118 00000 n 0000023419 00000 n trailer << /Size 27 /Root 1 0 R /Info 2 0 R /ID [<48F69ADDF4397C860574AC8104F70656><48F69ADDF4397C860574AC8104F70656>] >> startxref 24996 %%EOF density-fitness-1.0.3/src/0000775000175000017500000000000014177153152015302 5ustar maartenmaartendensity-fitness-1.0.3/src/config.hpp.in0000664000175000017500000000510614177153152017667 0ustar maartenmaarten/* src/config.hpp.in. Generated from configure.ac by autoheader. */ /* define if the Boost library is available */ #undef HAVE_BOOST /* define if the Boost::Date_Time library is available */ #undef HAVE_BOOST_DATE_TIME /* define if the Boost::IOStreams library is available */ #undef HAVE_BOOST_IOSTREAMS /* define if the Boost::PROGRAM_OPTIONS library is available */ #undef HAVE_BOOST_PROGRAM_OPTIONS /* define if the Boost::Regex library is available */ #undef HAVE_BOOST_REGEX /* Define to 1 if CIFPP is found */ #undef HAVE_CIFPP /* Define to 1 if CLIPPER is found */ #undef HAVE_CLIPPER /* define if the compiler supports basic C++17 syntax */ #undef HAVE_CXX17 /* Define to 1 if DLIB is found */ #undef HAVE_DLIB /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if LIBBZ2 is found */ #undef HAVE_LIBBZ2 /* Define to 1 if LIBZ is found */ #undef HAVE_LIBZ /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if NEWUOA is found */ #undef HAVE_NEWUOA /* Define to 1 if PDB_REDO is found */ #undef HAVE_PDB_REDO /* Define if you have POSIX threads libraries and header files. */ #undef HAVE_PTHREAD /* Have PTHREAD_PRIO_INHERIT. */ #undef HAVE_PTHREAD_PRIO_INHERIT /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if ZEEP is found */ #undef HAVE_ZEEP /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to necessary symbol if this constant uses a non-standard name on your system. */ #undef PTHREAD_CREATE_JOINABLE /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Use mrc to store resources */ #undef USE_RSRC density-fitness-1.0.3/src/density-fitness.cpp0000664000175000017500000002442714177153152021147 0ustar maartenmaarten/*- * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 2020 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. */ /* Created by: Maarten L. Hekkelman Date: woensdag 27 december, 2017 */ #include #include #include #include #include #include #include "zeep/json/element.hpp" #include "cif++/BondMap.hpp" #include "pdb-redo/Statistics.hpp" #include "revision.hpp" namespace po = boost::program_options; namespace fs = std::filesystem; namespace c = mmcif; namespace io = boost::iostreams; // -------------------------------------------------------------------- int pr_main(int argc, char* argv[]) { po::options_description visible_options(fs::path(argv[0]).filename().string() + " [options] []"); visible_options.add_options() ("hklin", po::value(), "mtz file") ("recalc", "Recalculate Fc from FP/SIGFP in mtz file") ("aniso-scaling", po::value(), "Anisotropic scaling (none/observed/calculated)") ("no-bulk", "No bulk correction") ("xyzin", po::value(), "coordinates file") ("fomap", po::value(), "Fo map file -- 2mFo - DFc") ("dfmap", po::value(), "difference map file -- 2(mFo - DFc)") ("reshi", po::value(), "High resolution") ("reslo", po::value(), "Low resolution") ("sampling-rate", po::value()->default_value(1.5f), "Sampling rate") ("electron-scattering", "Use electron scattering factors") ("no-edia", "Skip EDIA score calculation") ("output,o", po::value(), "Write output to this file instead of stdout") ("output-format", po::value()->default_value("json"), "Output format, can be either 'edstats' or 'json'") ("use-auth-ids", "Write auth_ identities instead of label_") ("mmcif-dictionary", po::value(), "Path to the mmcif_pdbx.dic file to use instead of default") ("compounds", po::value(), "Location of the components.cif file from CCD") ("extra-compounds", po::value(), "File containing residue information for extra compounds in this specific target, should be either in CCD format or a CCP4 restraints file") ("help,h", "Display help message") ("version", "Print version") ("verbose,v", "Verbose output") ; po::options_description hidden_options("hidden options"); hidden_options.add_options() ("components", po::value(), "Location of the components.cif file from CCD, alias") ("debug,d", po::value(), "Debug level (for even more verbose output)"); po::options_description cmdline_options; cmdline_options.add(visible_options).add(hidden_options); po::positional_options_description p; p.add("hklin", 1); p.add("xyzin", 1); p.add("output", 1); po::variables_map vm; po::store(po::command_line_parser(argc, argv).options(cmdline_options).positional(p).run(), vm); po::notify(vm); // po::variables_map vm; // po::store(po::command_line_parser(argc, argv).options(cmdline_options).run(), vm); // po::notify(vm); // -------------------------------------------------------------------- if (vm.count("version")) { write_version_string(std::cout, vm.count("verbose")); exit(0); } if (vm.count("help")) { std::cerr << visible_options << std::endl; return 0; } if (vm.count("xyzin") == 0 or (vm.count("hklin") == 0 and (vm.count("fomap") == 0 or vm.count("dfmap") == 0))) { std::cerr << visible_options << std::endl; exit(1); } const std::set kAnisoOptions{ "none", "calculated", "observed" }; if (vm.count("aniso-scaling") and kAnisoOptions.count(vm["aniso-scaling"].as()) == 0) { std::cerr << "Invalid option for aniso-scaling, allowed values are none, observed and calculated" << std::endl; exit(1); } if (vm.count("fomap") and (vm.count("reshi") == 0 or vm.count("reslo") == 0)) { std::cerr << "The reshi and reslo parameters are required when using std::map files" << std::endl; exit(1); } cif::VERBOSE = vm.count("verbose") != 0; if (vm.count("debug")) cif::VERBOSE = vm["debug"].as(); // Load extra CCD definitions, if any if (vm.count("compounds")) cif::addFileResource("components.cif", vm["compounds"].as()); else if (vm.count("components")) cif::addFileResource("components.cif", vm["components"].as()); if (vm.count("extra-compounds")) c::CompoundFactory::instance().pushDictionary(vm["extra-compounds"].as()); // And perhaps a private mmcif_pdbx dictionary if (vm.count("mmcif-dictionary")) cif::addFileResource("mmcif_pdbx_v50.dic", vm["mmcif-dictionary"].as()); mmcif::File f(vm["xyzin"].as()); mmcif::Structure structure(f); bool electronScattering = vm.count("electron-scattering") > 0; if (not electronScattering) { auto& exptl = f.data()["exptl"]; electronScattering = not exptl.empty() and exptl.front()["method"] == "ELECTRON CRYSTALLOGRAPHY"; } pdb_redo::MapMaker mm; if (vm.count("hklin")) { float samplingRate = vm["sampling-rate"].as(); if (vm.count("recalc")) { auto aniso = pdb_redo::MapMaker::as_None; if (vm.count("aniso-scaling")) { if (vm["aniso-scaling"].as() == "observed") aniso = pdb_redo::MapMaker::as_Observed; else if (vm["aniso-scaling"].as() == "calculated") aniso = pdb_redo::MapMaker::as_Calculated; } mm.calculate( vm["hklin"].as(), structure, vm.count("no-bulk"), aniso, samplingRate, electronScattering); } else mm.loadMTZ(vm["hklin"].as(), samplingRate); } else { float reshi = vm["reshi"].as(); float reslo = vm["reslo"].as(); mm.loadMaps(vm["fomap"].as(), vm["dfmap"].as(), reshi, reslo); } std::vector r; if (vm.count("no-edia")) { pdb_redo::StatsCollector collector(mm, structure, electronScattering); r = collector.collect(); } else { mmcif::BondMap bm(structure); pdb_redo::EDIAStatsCollector collector(mm, structure, electronScattering, bm); r = collector.collect(); } bool formatAsJSON = vm["output-format"].as() == "json"; std::ofstream of; io::filtering_stream out; if (vm.count("output")) { fs::path output = vm["output"].as(); of.open(output); if (not of.is_open()) { std::cerr << "Could not open output file" << std::endl; exit(1); } if (output.extension() == ".gz") { out.push(io::gzip_compressor()); output = output.stem(); } if (vm["output-format"].defaulted() and output.extension() == ".eds") formatAsJSON = false; out.push(of); } else out.push(std::cout); if (formatAsJSON) { using object = zeep::json::element; object stats; for (auto i: r) { std::tuple pdbID = structure.MapLabelToPDB(i.asymID, i.seqID, i.compID, i.authSeqID); stats.emplace_back(object{ { "asymID", i.asymID }, { "seqID", i.seqID }, { "compID", i.compID }, { "pdb", { { "strandID", std::get<0>(pdbID) }, { "seqNum", std::get<1>(pdbID) }, { "compID", std::get<2>(pdbID) }, { "insCode", std::get<3>(pdbID) } } }, { "RSR", i.RSR }, { "SRSR", i.SRSR }, { "RSCCS", i.RSCCS }, { "NGRID", i.ngrid }, { "EDIAm", i.EDIAm }, { "OPIA", i.OPIA } }); } out << stats << std::endl; } else { out << "RESIDUE" << '\t' << "RSR" << '\t' << "SRSR" << '\t' << "RSCCS" << '\t' << "NGRID" << '\t' << "EDIAm" << '\t' << "OPIA" << std::endl; bool writeAuth = vm.count("use-auth-ids"); for (auto i: r) { std::string id; if (writeAuth) { std::tuple pdbID = structure.MapLabelToPDB(i.asymID, i.seqID, i.compID, i.authSeqID); id = std::get<2>(pdbID) + '_' + std::get<0>(pdbID) + '_' + std::to_string(std::get<1>(pdbID)) + std::get<3>(pdbID); } else if (i.compID == "HOH") id = i.compID + '_' + i.asymID + '_' + i.authSeqID; else id = i.compID + '_' + i.asymID + '_' + std::to_string(i.seqID); out << std::fixed << std::setprecision(3) << id << '\t' << i.RSR << '\t' << i.SRSR << '\t' << i.RSCCS << '\t' << i.ngrid << '\t' << i.EDIAm << '\t' << std::setprecision(1) << i.OPIA << std::endl; } } return 0; } // -------------------------------------------------------------------- // recursively print exception whats: void print_what (const std::exception& e) { std::cerr << e.what() << std::endl; try { std::rethrow_if_nested(e); } catch (const std::exception& nested) { std::cerr << " >> "; print_what(nested); } } int main(int argc, char* argv[]) { int result = -1; try { result = pr_main(argc, argv); } catch (std::exception& ex) { print_what(ex); exit(1); } return result; }