diff --git a/.travis.yml b/.travis.yml index d68bd4af4d94eb668b9931e35b68a65bcfc0761a..37307f5f6812fb58256ebd00f2e0659d7f3fa201 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,12 +3,12 @@ env: # list of configurations to be attempted: # MPI + doc # this is the "master" one, it is going to update the manual if log contains [makedoc] - - PLUMED_CC=mpicc PLUMED_CXX=mpic++ MAKEDOC=yes ALMOST=yes + - PLUMED_CC=mpicc PLUMED_CXX=mpic++ MAKEDOC=yes # the following are with debug flags # I think clang does not support debug-glibcxx, so I skip it here - - PLUMED_CC=gcc PLUMED_CXX=g++ ALMOST=yes CONFIG_FLAGS="--enable-debug --enable-debug-glibcxx" + - PLUMED_CC=gcc PLUMED_CXX=g++ CONFIG_FLAGS="--enable-debug --enable-debug-glibcxx" # with debug flags there are issues with openmp+mpi on travis - I disable openmp here - - PLUMED_CC=mpicc PLUMED_CXX=mpic++ ALMOST=yes CONFIG_FLAGS="--enable-debug --enable-debug-glibcxx --disable-openmp" + - PLUMED_CC=mpicc PLUMED_CXX=mpic++ CONFIG_FLAGS="--enable-debug --enable-debug-glibcxx --disable-openmp" # then I try serial compilers - PLUMED_CC=clang PLUMED_CXX=clang++ - PLUMED_CC=gcc PLUMED_CXX=g++ @@ -38,7 +38,6 @@ install: - export PLUMED_NUM_THREADS=2 - ./.travis/check.log makedoc || MAKEDOC=no - ./.travis/check.log valgrind || VALGRIND=no - - ./.travis/check.log almost || ALMOST=no # install some package - these are fast, we install them anyway - sudo apt-get update -qq - sudo apt-get install -y libmatheval-dev @@ -57,10 +56,6 @@ install: - if test "$MAKEDOC" == yes ; then sudo apt-get install -y doxygen doxygen-latex ; fi - if test "$VALGRIND" == yes ; then sudo apt-get install -y valgrind ; fi - if test "$LAPACK" == yes ; then sudo apt-get install libatlas-base-dev ; fi - - if test "$ALMOST" == yes ; then sudo apt-get install libatlas-base-dev ; fi - - if test "$ALMOST" == yes ; then ./.travis/install.almost ; fi - - if test "$ALMOST" == yes ; then ENALMOST="--enable-almost" ; fi - - if test "$ALMOST" == yes ; then PLUMED_CPPFLAGS="-I$HOME/opt/include -I$HOME/opt/include/almost" ; fi # moreover, we hardcode path to dynamic library, required for xdrfile to link properly # I do it only when LD_LIBRARY_PATH is non blank, since otherwise clang gives problems - if test -n "$LD_LIBRARY_PATH" ; then PLUMED_LDFLAGS="-Wl,-rpath,$LD_LIBRARY_PATH" ; fi @@ -71,7 +66,7 @@ script: # BUILD: # this is done only if PLUMED_CXX is defined # we have to pass the full path since on travis machines sudo does not have compilers in the path - - if test "$PLUMED_CXX" ; then ./configure CXX=$(which $PLUMED_CXX) CC=$(which $PLUMED_CC) CXXFLAGS="$PLUMED_CXXFLAGS" LDFLAGS="$PLUMED_LDFLAGS" CPPFLAGS="$PLUMED_CPPFLAGS" $ENALMOST $CONFIG_FLAGS ; fi + - if test "$PLUMED_CXX" ; then ./configure CXX=$(which $PLUMED_CXX) CC=$(which $PLUMED_CC) CXXFLAGS="$PLUMED_CXXFLAGS" LDFLAGS="$PLUMED_LDFLAGS" CPPFLAGS="$PLUMED_CPPFLAGS" $CONFIG_FLAGS ; fi - if test "$PLUMED_CXX" ; then make -j 2 ; fi # we install plumed so that it is in the path - if test "$PLUMED_CXX" ; then make install prefix="$HOME/opt" ; fi diff --git a/.travis/install.almost b/.travis/install.almost deleted file mode 100755 index 0e7854a857504069bb743f64b5b8ee5d19db553e..0000000000000000000000000000000000000000 --- a/.travis/install.almost +++ /dev/null @@ -1,15 +0,0 @@ -#! /bin/bash - -set -e -set -x - -svn checkout svn://svn.code.sf.net/p/almost/code/branches/almost-2.2-plumed almost-2.2 - -cd almost-2.2 - -autoreconf -fi -./configure --prefix="$HOME/opt" CFLAGS="-fPIC" CXXFLAGS="-fPIC" LIBS="-llapack" -make -j2 -s -make install -cd ../ - diff --git a/configure b/configure index af1ab6be388762da3b927a52a84cf804339a9520..701073ece2699d4a8f7bcc298cfce97d98c358a2 100755 --- a/configure +++ b/configure @@ -711,7 +711,6 @@ enable_readdir_r enable_cregex enable_dlopen enable_execinfo -enable_almost enable_gsl enable_xdrfile enable_boost_graph @@ -1375,7 +1374,6 @@ Optional Features: --enable-cregex enable search for C regular expression, default: yes --enable-dlopen enable search for dlopen, default: yes --enable-execinfo enable search for execinfo, default: yes - --enable-almost enable search for almost, default: no --enable-gsl enable search for gsl, default: no --enable-xdrfile enable search for xdrfile, default: yes --enable-boost_graph enable search for boost graph, default: no @@ -2754,24 +2752,6 @@ fi -almost= -# Check whether --enable-almost was given. -if test "${enable_almost+set}" = set; then : - enableval=$enable_almost; case "${enableval}" in - (yes) almost=true ;; - (no) almost=false ;; - (*) as_fn_error $? "wrong argument to --enable-almost" "$LINENO" 5 ;; - esac -else - case "no" in - (yes) almost=true ;; - (no) almost=false ;; - esac - -fi - - - gsl= # Check whether --enable-gsl was given. if test "${enable_gsl+set}" = set; then : @@ -6115,213 +6095,6 @@ $as_echo "$as_me: WARNING: cannot enable __PLUMED_HAS_ZLIB" >&2;} fi fi -if test $almost == true ; then - bz2=ko - ac_fn_cxx_check_header_mongrel "$LINENO" "bzlib.h" "ac_cv_header_bzlib_h" "$ac_includes_default" -if test "x$ac_cv_header_bzlib_h" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing BZ2_bzReadOpen" >&5 -$as_echo_n "checking for library containing BZ2_bzReadOpen... " >&6; } -if ${ac_cv_search_BZ2_bzReadOpen+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char BZ2_bzReadOpen (); -int -main () -{ -return BZ2_bzReadOpen (); - ; - return 0; -} -_ACEOF -for ac_lib in '' bz2; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - if ac_fn_cxx_try_link "$LINENO"; then : - ac_cv_search_BZ2_bzReadOpen=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_BZ2_bzReadOpen+:} false; then : - break -fi -done -if ${ac_cv_search_BZ2_bzReadOpen+:} false; then : - -else - ac_cv_search_BZ2_bzReadOpen=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_BZ2_bzReadOpen" >&5 -$as_echo "$ac_cv_search_BZ2_bzReadOpen" >&6; } -ac_res=$ac_cv_search_BZ2_bzReadOpen -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - bz2=ok -fi - -fi - - - found=ko - if test $bz2 == ok; then - ac_fn_cxx_check_header_mongrel "$LINENO" "almost.h" "ac_cv_header_almost_h" "$ac_includes_default" -if test "x$ac_cv_header_almost_h" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing init_camshift" >&5 -$as_echo_n "checking for library containing init_camshift... " >&6; } -if ${ac_cv_search_init_camshift+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char init_camshift (); -int -main () -{ -return init_camshift (); - ; - return 0; -} -_ACEOF -for ac_lib in '' Alm; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib -lsqlite3 -lz -lbz2 -lnbimpl -lshx $ac_func_search_save_LIBS" - fi - if ac_fn_cxx_try_link "$LINENO"; then : - ac_cv_search_init_camshift=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_init_camshift+:} false; then : - break -fi -done -if ${ac_cv_search_init_camshift+:} false; then : - -else - ac_cv_search_init_camshift=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_init_camshift" >&5 -$as_echo "$ac_cv_search_init_camshift" >&6; } -ac_res=$ac_cv_search_init_camshift -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - found=ok -else - { $as_echo "$as_me:${as_lineno-$LINENO}: \"Almost not found\"" >&5 -$as_echo "$as_me: \"Almost not found\"" >&6;} -fi - -fi - - - else - ac_fn_cxx_check_header_mongrel "$LINENO" "almost.h" "ac_cv_header_almost_h" "$ac_includes_default" -if test "x$ac_cv_header_almost_h" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing init_camshift" >&5 -$as_echo_n "checking for library containing init_camshift... " >&6; } -if ${ac_cv_search_init_camshift+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char init_camshift (); -int -main () -{ -return init_camshift (); - ; - return 0; -} -_ACEOF -for ac_lib in '' Alm; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib -lsqlite3 -lz -lnbimpl -lshx $ac_func_search_save_LIBS" - fi - if ac_fn_cxx_try_link "$LINENO"; then : - ac_cv_search_init_camshift=$ac_res -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext - if ${ac_cv_search_init_camshift+:} false; then : - break -fi -done -if ${ac_cv_search_init_camshift+:} false; then : - -else - ac_cv_search_init_camshift=no -fi -rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_init_camshift" >&5 -$as_echo "$ac_cv_search_init_camshift" >&6; } -ac_res=$ac_cv_search_init_camshift -if test "$ac_res" != no; then : - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - found=ok -else - { $as_echo "$as_me:${as_lineno-$LINENO}: \"Almost not found\"" >&5 -$as_echo "$as_me: \"Almost not found\"" >&6;} -fi - -fi - - - fi - if test $found == ok; then - $as_echo "#define __PLUMED_HAS_ALMOST 1" >>confdefs.h - - if test $bz2 == ok; then - LIBS="$LIBS -lsqlite3 -lz -lbz2 -lnbimpl -lshx" - else - LIBS="$LIBS -lsqlite3 -lz -lnbimpl -lshx" - fi - else - as_fn_error $? "--enable-almost: cannot find almost" "$LINENO" 5 - fi -fi if test $gsl == true ; then found=ko { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lgsl" >&5 diff --git a/configure.ac b/configure.ac index 043fc9c748221913d47591ae395d0c4e2839f0f1..391e85f2f1e07cae7fa881ff6e01df0cab60c4c4 100644 --- a/configure.ac +++ b/configure.ac @@ -176,7 +176,6 @@ PLUMED_CONFIG_ENABLE([readdir_r],[readdir-r],[search for readdir_r (threadsafe)] PLUMED_CONFIG_ENABLE([cregex],[cregex],[search for C regular expression],[yes]) PLUMED_CONFIG_ENABLE([dlopen],[dlopen],[search for dlopen],[yes]) PLUMED_CONFIG_ENABLE([execinfo],[execinfo],[search for execinfo],[yes]) -PLUMED_CONFIG_ENABLE([almost],[almost],[search for almost],[no]) PLUMED_CONFIG_ENABLE([gsl],[gsl],[search for gsl],[no]) PLUMED_CONFIG_ENABLE([xdrfile],[xdrfile],[search for xdrfile],[yes]) PLUMED_CONFIG_ENABLE([boost_graph],[boost_graph],[search for boost graph],[no]) @@ -429,26 +428,6 @@ fi if test $zlib == true ; then PLUMED_CHECK_PACKAGE([zlib.h],[gzopen],[__PLUMED_HAS_ZLIB],[z]) fi -if test $almost == true ; then - bz2=ko - AC_CHECK_HEADER([bzlib.h], AC_SEARCH_LIBS([BZ2_bzReadOpen], [bz2], [bz2=ok])) - found=ko - if test $bz2 == ok; then - AC_CHECK_HEADER([almost.h], AC_SEARCH_LIBS([init_camshift], [Alm], [found=ok] , AC_MSG_NOTICE(["Almost not found"]), [-lsqlite3 -lz -lbz2 -lnbimpl -lshx])) - else - AC_CHECK_HEADER([almost.h], AC_SEARCH_LIBS([init_camshift], [Alm], [found=ok] , AC_MSG_NOTICE(["Almost not found"]), [-lsqlite3 -lz -lnbimpl -lshx])) - fi - if test $found == ok; then - AC_DEFINE([__PLUMED_HAS_ALMOST]) - if test $bz2 == ok; then - LIBS="$LIBS -lsqlite3 -lz -lbz2 -lnbimpl -lshx" - else - LIBS="$LIBS -lsqlite3 -lz -lnbimpl -lshx" - fi - else - AC_MSG_ERROR([--enable-almost: cannot find almost]) - fi -fi if test $gsl == true ; then found=ko AC_CHECK_LIB([gsl],[main],[found=ok],[found=ko],[-lgslcblas]) diff --git a/src/colvar/CH3Shifts.cpp b/src/colvar/CH3Shifts.cpp deleted file mode 100644 index 7abcaf9c928cd1aefc3b0bd73fd9976301f91e1a..0000000000000000000000000000000000000000 --- a/src/colvar/CH3Shifts.cpp +++ /dev/null @@ -1,375 +0,0 @@ -/* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - Copyright (c) 2013-2016 The plumed team - (see the PEOPLE file at the root of the distribution for a list of names) - - See http://www.plumed.org for more information. - - This file is part of plumed, version 2. - - plumed is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - plumed is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with plumed. If not, see <http://www.gnu.org/licenses/>. -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */ -#ifdef __PLUMED_HAS_ALMOST - -#include "Colvar.h" -#include "ActionRegister.h" -#include "core/PlumedMain.h" -#include "core/Atoms.h" - -#include <almost/mdb.h> -#include <almost/pdb.h> -#include <almost/camshift3/meth/methcs.h> -#include <almost/io/formostream.h> - -using namespace std; -using namespace Almost; - -namespace PLMD{ - -//+PLUMEDOC COLVAR CH3SHIFTS -/* -This collective variable calculates a scoring function based on the comparison of calculated and -experimental methyl chemical shifts. - - -CH3Shift \cite Sahakyan:2011bn is employed to back calculate the chemical shifts of methyl groups -(ALA:HB; ILE:HD,HG2; LEU:HD1,HD2; THR:HG2; VAL:HG1,HG2) that are then compared with a set of experimental -values to generate a score \cite Robustelli:2010dn \cite Granata:2013dk. - -It is also possible to backcalculate the chemical shifts from multiple replicas and then average them -to perform Replica-Averaged Restrained MD simulations \cite Camilloni:2012je \cite Camilloni:2013hs. - -In general the system for which chemical shifts are to be calculated must be completly included in -ATOMS. It should also be made whole \ref WHOLEMOLECULES before the the back-calculation. - -HOW TO COMPILE IT - -\ref installingalmost on how to compile PLUMED with ALMOST. - -HOW TO USE IT - -CH3Shift reads from a text file the experimental chemical shifts: - -\verbatim -CH3shifts.dat: -1.596 28 -0.956 46 -0.576 3 HG2 -0.536 3 HD1 -0.836 13 HG2 -0.666 13 HD1 -0.716 23 HG2 -0.506 23 HD1 -\endverbatim - -A template.pdb file is needed to the generate a topology of the protein within ALMOST. For histidines in protonation -states different from D the HIE/HIP name should be used in the template.pdb. GLH and ASH can be used for the alternative -protonation of GLU and ASP. Non-standard amino acids and other molecules are not yet supported! If multiple chains are -present the chain identifier must be in the standard PDB format, together with the TER keyword at the end of each chain. -Residues numbering should always go from 1 to N in both the chemical shifts files as well as in the template.pdb file. -Two more keywords can be used to setup the topology: CYS-DISU to tell ALMOST to look for disulphide bridges and TERMINI -to define the protonation state of the the chain's termini (currently only DEFAULT (NH3+, CO2-) and NONE (NH, CO)). - -One more standard file is also needed, that is an ALMOST force-field file, corresponding to the force-field family used in -the MD code, (a03_cs2_gromacs.mdb for the amber family or all22_gromacs.mdb for the charmm family). - -All the above files must be in a single folder that must be specified with the keyword DATA (multiple definition of the -CV can point to different folders). - -\par Examples - -case 1: - -\verbatim -WHOLEMOLECULES ENTITY0=1-174 -cs: CH3SHIFTS ATOMS=1-174 DATA=data/ FF=a03_gromacs.mdb FLAT=0.0 NRES=13 ENSEMBLE -cse: RESTRAINT ARG=cs SLOPE=24 KAPPA=0 AT=0. -PRINT ARG=cs,cse.bias -\endverbatim - -case 2: - -\verbatim -WHOLEMOLECULES ENTITY0=1-174 -cs: CH3SHIFTS ATOMS=1-174 DATA=data/ FF=a03_gromacs.mdb FLAT=1.0 NRES=13 TERMINI=DEFAULT,NONE CYS-DISU WRITE_CS=1000 -PRINT ARG=cs -\endverbatim - -(See also \ref WHOLEMOLECULES, \ref RESTRAINT and \ref PRINT) - -*/ -//+ENDPLUMEDOC - -class CH3Shifts : public Colvar { - vector<MethCS*> meth_list; - Molecules molecules; - int numResidues; - unsigned pperiod; - unsigned ens_dim; - bool ensemble; - bool serial; - double **sh; - double ene_pl2alm; - double len_pl2alm; - double for_pl2alm; -public: - explicit CH3Shifts(const ActionOptions&); - ~CH3Shifts(); - static void registerKeywords( Keywords& keys ); - virtual void calculate(); -}; - -PLUMED_REGISTER_ACTION(CH3Shifts,"CH3SHIFTS") - -void CH3Shifts::registerKeywords( Keywords& keys ){ - Colvar::registerKeywords( keys ); - //keys.addFlag("SERIAL",false,"Perform the calculation in serial - for debug purpose."); - keys.add("atoms","ATOMS","The atoms to be included in the calculation, e.g. the whole protein."); - keys.add("compulsory","DATA","data/","The folder with the experimental chemical shifts."); - keys.add("compulsory","FF","a03_gromacs.mdb","The ALMOST force-field to map the atoms' names."); - keys.add("compulsory","FLAT","1.0","Flat region in the scoring function."); - keys.add("compulsory","NEIGH_FREQ","10","Period in step for neighbour list update."); - keys.add("compulsory","WRITE_CS","0","Write chemical shifts period."); - keys.add("compulsory","NRES","Number of residues, corresponding to the number of chemical shifts."); - keys.add("optional","TERMINI","Defines the protonation states of the chain-termini."); - keys.addFlag("CYS-DISU",false,"Set to TRUE if your system has disulphide bridges."); - keys.addFlag("ENSEMBLE",false,"Set to TRUE if you want to average over multiple replicas."); - keys.remove("NOPBC"); -} - -CH3Shifts::CH3Shifts(const ActionOptions&ao): -PLUMED_COLVAR_INIT(ao) -{ - string stringadb; - string stringamdb; - string stringapdb; - - serial=false; - //parseFlag("SERIAL",serial); - - string stringa_data; - parse("DATA",stringa_data); - - string stringa_forcefield; - parse("FF",stringa_forcefield); - - bool disu=false; - parseFlag("CYS-DISU",disu); - - double grains=1.0; - parse("FLAT", grains); - - int neigh_f=10; - parse("NEIGH_FREQ", neigh_f); - - unsigned w_period=0; - parse("WRITE_CS", w_period); - pperiod=w_period; - - parse("NRES", numResidues); - - ensemble=false; - parseFlag("ENSEMBLE",ensemble); - if(ensemble){ - if(comm.Get_rank()==0) { - if(multi_sim_comm.Get_size()<2) error("You CANNOT run Replica-Averaged simulations without running multiple replicas!\n"); - ens_dim=multi_sim_comm.Get_size(); - } else ens_dim=0; - comm.Sum(&ens_dim, 1); - } else ens_dim=1; - - stringadb = stringa_data + string("/CH3shifts.dat"); - stringamdb = stringa_data + string("/") + stringa_forcefield; - stringapdb = stringa_data + string("/template.pdb"); - - log.printf(" loading force-field %s\n", stringamdb.c_str()); log.flush(); - Almost::MDB mdb((char*)stringamdb.c_str()); - log.printf(" loading template %s\n", stringapdb.c_str()); log.flush(); - Almost::PDB pdb((char*)stringapdb.c_str()); - - vector<string> termini; - string stringa_mol; - parse("TERMINI",stringa_mol); - if(stringa_mol.length()>0) { - unsigned num_chains = pdb[0].size(); - vector<string> data=Tools::getWords(stringa_mol,","); - if(data.size()!=2*num_chains) error("You have to define both the NTerm and the CTerm for each chain of your system!\n"); - for(unsigned i=0;i<data.size();i++) termini.push_back(data[i]); - } else { - unsigned num_chains = pdb[0].size(); - for(unsigned i=0;i<(2*num_chains);i++) termini.push_back("DEFAULT"); - } - - log.printf(" building molecule ..."); log.flush(); - for(unsigned i=0;i<pdb[0].size();i++){ - unsigned j=2*i; - string str; - str +='A'+i; - Protein p(str); - p.build_missing(pdb[0][i],mdb,termini[j],termini[j+1]); - if(disu) p.auto_disu_bonds(2.9,mdb); - molecules.add_protein(p); - } - log.printf(" done!\n"); log.flush(); - log.printf(" Writing converted template.pdb ...\n"); log.flush(); - mol2pdb(molecules,"converted-template.pdb"); - - log.printf(" Initialization of the predictor ...\n"); log.flush(); - MethCS* a = new MethCS(molecules); - - log.printf(" Reading experimental data ...\n"); log.flush(); - a->read_cs(stringadb); - log.printf(" Setting parameters ...\n"); log.flush(); - /*unsigned stride=comm.Get_size(); - unsigned rank=comm.Get_rank(); - if(serial) {stride=1; rank=0;} - if(stride>1) log.printf(" Parallelized over %d processors\n", stride); - a.set_mpi(stride, rank);*/ - - if(ensemble) { log.printf(" ENSEMBLE averaging over %u replicas\n", ens_dim); } - a->set_w_cs(1); - a->set_flat_bottom_const(grains); - a->set_box_nupdate(neigh_f); - a->set_box_cutnb(11.); // cut-off for neigh-list - meth_list.push_back(a); - - sh = new double*[numResidues]; - sh[0] = new double[numResidues*8]; - for (int i=1; i<numResidues; i++) sh[i]=sh[i-1]+8; - - /* Energy and Lenght conversion */ - ene_pl2alm = 4.186/plumed.getAtoms().getUnits().getEnergy(); - len_pl2alm = 10.00*plumed.getAtoms().getUnits().getLength(); - for_pl2alm = ene_pl2alm*len_pl2alm; - log.printf(" Conversion table from plumed to Almost:\n"); - log.printf(" Energy %f\n", ene_pl2alm); - log.printf(" Length %f\n", len_pl2alm); - - vector<AtomNumber> atoms; - parseAtomList("ATOMS",atoms); - checkRead(); - - log<<" Bibliography " - <<plumed.cite("Sahakyan AB, Vranken WF, Cavalli A, Vendruscolo M, J. Biomol. NMR 50, 331 (2011)") - <<plumed.cite("Camilloni C, Robustelli P, De Simone A, Cavalli A, Vendruscolo M, J. Am. Chem. Soc. 134, 3968 (2012)") <<"\n"; - - addValueWithDerivatives(); - setNotPeriodic(); - - requestAtoms(atoms); - log.printf(" DONE!\n"); log.flush(); -} - -CH3Shifts::~CH3Shifts() -{ - delete[] sh[0]; - delete[] sh; -} - -void CH3Shifts::calculate() -{ - double energy=0.; - Tensor virial; - virial.zero(); - vector<Vector> deriv(getNumberOfAtoms()); - int N = getNumberOfAtoms(); - Coor<double> coor(N); - Coor<double> forces(N); - - forces.clear(); - for(int i=0; i<numResidues; i++) for(unsigned j=0; j<6; j++) sh[i][j]=0.; - - for (int i = 0; i < N; i++) { - int ipos = 4 * i; - Vector Pos = getPosition(i); - coor.coor[ipos] = len_pl2alm*Pos[0]; - coor.coor[ipos+1] = len_pl2alm*Pos[1]; - coor.coor[ipos+2] = len_pl2alm*Pos[2]; - } - - bool printout=false; - string csfile; - if(pperiod>0&&comm.Get_rank()==0) printout = (!(getStep()%pperiod)); - if(printout) {char tmp1[21]; sprintf(tmp1, "%ld", getStep()); csfile = string("cs")+getLabel()+"-"+tmp1+string(".dat");} - - double fact=1.0; - if(!ensemble) { - energy = meth_list[0]->calc_cs_force(coor, forces); - if(printout) meth_list[0]->write_cs(csfile.c_str()); - } else { - meth_list[0]->calc_cs(coor); - if(printout) meth_list[0]->write_cs(csfile.c_str()); - - unsigned size = meth_list[0]->ala_calc_hb.size(); - for(unsigned j=0;j<size;j++) sh[0][j] = meth_list[0]->ala_calc_hb[j]; - size = meth_list[0]->ile_calc_hd.size(); - for(unsigned j=0;j<size;j++) sh[1][j] = meth_list[0]->ile_calc_hd[j]; - size = meth_list[0]->ile_calc_hg2.size(); - for(unsigned j=0;j<size;j++) sh[2][j] = meth_list[0]->ile_calc_hg2[j]; - size = meth_list[0]->leu_calc_hd1.size(); - for(unsigned j=0;j<size;j++) sh[3][j] = meth_list[0]->leu_calc_hd1[j]; - size = meth_list[0]->leu_calc_hd2.size(); - for(unsigned j=0;j<size;j++) sh[4][j] = meth_list[0]->leu_calc_hd2[j]; - size = meth_list[0]->thr_calc_hg2.size(); - for(unsigned j=0;j<size;j++) sh[5][j] = meth_list[0]->thr_calc_hg2[j]; - size = meth_list[0]->val_calc_hg1.size(); - for(unsigned j=0;j<size;j++) sh[6][j] = meth_list[0]->val_calc_hg1[j]; - size = meth_list[0]->val_calc_hg2.size(); - for(unsigned j=0;j<size;j++) sh[7][j] = meth_list[0]->val_calc_hg2[j]; - fact = 1./((double) ens_dim); - if(comm.Get_rank()==0) { // I am the master of my replica - // among replicas - multi_sim_comm.Sum(&sh[0][0], numResidues*8); - for(unsigned i=0;i<8;i++) for(int j=0;j<numResidues;j++) sh[j][i] *= fact; - } else for(unsigned i=0;i<8;i++) for(int j=0;j<numResidues;j++) sh[j][i] = 0.; - // inside each replica - comm.Sum(&sh[0][0], numResidues*8); - // now send the averaged shifts back to almost - size = meth_list[0]->ala_calc_hb.size(); - for(unsigned j=0;j<size;j++) meth_list[0]->ala_calc_hb[j] = sh[0][j]; - size = meth_list[0]->ile_calc_hd.size(); - for(unsigned j=0;j<size;j++) meth_list[0]->ile_calc_hd[j] = sh[1][j]; - size = meth_list[0]->ile_calc_hg2.size(); - for(unsigned j=0;j<size;j++) meth_list[0]->ile_calc_hg2[j] = sh[2][j]; - size = meth_list[0]->leu_calc_hd1.size(); - for(unsigned j=0;j<size;j++) meth_list[0]->leu_calc_hd1[j] = sh[3][j]; - size = meth_list[0]->leu_calc_hd2.size(); - for(unsigned j=0;j<size;j++) meth_list[0]->leu_calc_hd2[j] = sh[4][j]; - size = meth_list[0]->thr_calc_hg2.size(); - for(unsigned j=0;j<size;j++) meth_list[0]->thr_calc_hg2[j] = sh[5][j]; - size = meth_list[0]->val_calc_hg1.size(); - for(unsigned j=0;j<size;j++) meth_list[0]->val_calc_hg1[j] = sh[6][j]; - size = meth_list[0]->val_calc_hg2.size(); - for(unsigned j=0;j<size;j++) meth_list[0]->val_calc_hg2[j] = sh[7][j]; - // calculate all the forces now - energy = meth_list[0]->ens_calc_cs_force(coor, forces); - } - - for (int i = 0; i < N; i++) - { - Vector For; - int ipos = 4 * i; - For[0] = forces.coor[ipos]; - For[1] = forces.coor[ipos+1]; - For[2] = forces.coor[ipos+2]; - deriv[i] = fact*for_pl2alm*For; - virial=virial+(-1.*Tensor(getPosition(i),deriv[i])); - } - - for(unsigned i=0;i<getNumberOfAtoms();++i) setAtomsDerivatives(i,deriv[i]); - setValue (ene_pl2alm*energy); - setBoxDerivatives (virial); -} - -} -#endif diff --git a/user-doc/Installation.txt b/user-doc/Installation.txt index df6b733c404cbebae87444d87c354cd6604328a3..fc3197751c78d84c7781f1d1413dcfa007be6cd5 100644 --- a/user-doc/Installation.txt +++ b/user-doc/Installation.txt @@ -198,7 +198,7 @@ just set this variable to a blank ("SOEXT="). \subsection BlasAndLapack BLAS and LAPACK We tried to keep PLUMED as independent as possible from external libraries and as such those features -that require external libraries (e.g. Almost and Matheval) are optional. However, to have a properly working version +that require external libraries (e.g. Matheval) are optional. However, to have a properly working version of plumed PLUMED you need BLAS and LAPACK libraries. We would strongly recommend you download these libraries and install them separately so as to have the most efficient possible implementations of the functions contained within them. However, if you cannot install blas and lapack, you can use the internal ones. @@ -460,37 +460,6 @@ default values this would be `/usr/local/lib/plumed/plumed-*`. These files are n to avoid clashes, but can be executed also when plumed is cross compiled and the main plumed executable cannot be launched. -\section installingalmost Installing PLUMED with ALMOST - -In order to used some of the NMR based collective variables (\ref CS2BACKBONE and \ref CH3SHIFTS) PLUMED needs to be linked with ALMOST. -To do this the free package ALMOST v.2.2 MUST be dowloaded via SVN (svn checkout svn://svn.code.sf.net/p/almost/code/branches/almost-2.2-plumed almost-2.2). -Compile it: - -\warning ALMOST needs SQLITE3 and GZIP installed on your computer. -\warning ALMOST cannot be installed in the same folder of the source code, use --prefix to install it in a different folder - -\verbatim -> ./configure --prefix="wherever you want it" CXXFLAGS="-O3 -fPIC" CFLAGS="-O3 -fPIC" LIBS=-llapack -> make -> make install -\endverbatim -Configure can complain about lapack and RDCs but it doesn't matter. -Sometimes ALMOST can give errors related to the automake tools. To fix them it is often enough to execute -\verbatim -> autoreconf -fi -> automake -\endverbatim -and then repeat the configuration and compilation instructions. - -Once ALMOST is installed, PLUMED 2 can then be configured with ALMOST enabled: - -\verbatim -> ./configure --enable-almost CPPFLAGS="-I/ALMOST_INSTALL_PATH/include \ - -I/ALMOST_INSTALL_PATH/include/almost" LDFLAGS="-L/ALMOST_INSTALL_PATH/lib" - -\endverbatim -with ALMOST_INSTALL_PATH set to the full path to the ALMOST installation folder. - \page CodeSpecificNotes Code specific notes Here you can find instructions that are specific for patching each of the supported MD codes.