Skip to content

Commit

Permalink
Add the 'evalplateau' command. Other misc. fixes. (#821)
Browse files Browse the repository at this point in the history
* DRR - Initial incarnation of evalequilibration

* DRR - Enable evalequil

* DRR - Start to determine direction of relaxation

* DRR - Use forward declares.

* DRR - Fix up includes for forward declares in Array1D.h

* DRR - use Array1D

* DRR - Add non linear curve fitting and final curve output

* DRR - Add nonlinear fit stats printout

* DRR - Ensure A1 parameter guess starts out < 0 (improves convergence)

* DRR - Try adding an offset to X. I think the incoming X values will need to be shifted as well.

* DRR - Use an offset so that when fitting, the first X value is always 1. With the addition of the A2 parameter, we're saying we dont know exactly where on the exponential curve the data starts.

* DRR - Allow stats to be redirected to a file.

* DRR - Add some documentation

* DRR - More docs

* DRR - Start adding results

* DRR - Make blocks respect noexitonerror

* DRR - Add calculation of difference of last half of data from long-time estimate

* DRR - New forms of exponentials that are more consistent with each other and with first order decay. Bounded by A0 OP A2 (where OP is + for decay and - for inverse) and A2 at times 0 and infinity

* DRR - Remove obsolete code

* DRR - Make it easier to add more results data sets

* DRR - Add final fit parameters to results

* DRR - Add determination of equilibrated via cutoffs

* DRR - Add slope calculation

* DRR - Fix equation forms in output

* DRR - Add 1st half avg calc. Make sure printing to statsout

* DRR - Add equil. time

* DRR - Get F value from regression

* DRR - Save regression F value

* DRR - Use offset so X values start at 0. This gives proper weight to the t=0 case where the first value should be close to A0+A2 or A2-A0

* DRR - Try out new equation

* DRR - Use average of first 10% of data as a guess for A0

* DRR - Remove old functions

* DRR - Add comment

* DRR - Add slope criterion in final determination. Add more output when criteria not satisfied.

* DRR - In for loops with files, warn if an expression with wildcards does not expand to a file, dont add it.

* DRR - Revision bump for evalquil. May need to be updated in the future since the command is not fully ready yet.

* DRR - When output from actions/analyses is directed to stdout, ensure it is properly directed to output file if one has been specified.

* DRR - Ensure residue IsTerminal info is preserved on strip so things like 'pdbter' still work properly

* DRR - Use not isdigit so single wildcard is properly handled

* DRR - Add gamma function code. Use cmath version if c++11 support available, otherwise use an approximation

* DRR - Add C11_SUPPORT define when c++11 support available

* DRR - Add GammaFn to build

* DRR - Add file for calculating chi squared PDF

* DRR - Create default cut

* DRR - Improve strip warning message

* DRR - Add topresnum keyword for pdb output to use topology residue numbering instead of original

* DRR - Update pdb trajout documentation

* DRR - Fix missing include from forward declare

* DRR - Analysis_EvalEquilibration -> EvalPlateau; better name for what it actually does.

* DRR - Ignore mkl.h (helpme_standalone.h)

* DRR - Update for EvalPlateau

* DRR - Recast everything as plateau

* Add evalplateau test

* Add to list of tests.

* DRR - Ended up not needing the chi^2 function yet. Remove for now.

* Revision bump for evalplateau

* Hide evalplateau, not quite ready for prime time. Add onboard help.

* Revamp how hidden commands are defined. Instead of making a separate category, add a flag that marks the command as hidden. This allows the command to retain its underlying category and so things like 'runanalysis' work as intended with hidden commands.

Co-authored-by: Daniel R. Roe <daniel.roe@nih.gov>
  • Loading branch information
drroe and Daniel R. Roe committed Jun 14, 2020
1 parent 064f4d9 commit 88b9dd7
Show file tree
Hide file tree
Showing 58 changed files with 3,613 additions and 102 deletions.
1 change: 1 addition & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,7 @@ SetupFinalFlags() {
if [ $USE_SINGLEENSEMBLE -ne 0 ] ; then DIRECTIVES="$DIRECTIVES -DENABLE_SINGLE_ENSEMBLE" ; fi
if [ ! -z "$LFS" ] ; then DIRECTIVES="$DIRECTIVES $LFS" ; fi
if [ "$C11_SUPPORT" = 'yes' ] ; then
DIRECTIVES="$DIRECTIVES -DC11_SUPPORT"
if [ "${LIB_STAT[$LFFTW3]}" != 'off' ] ; then
DIRECTIVES="$DIRECTIVES -DLIBPME -DHAVE_FFTWD=1"
fi
Expand Down
21 changes: 12 additions & 9 deletions doc/cpptraj.lyx
Original file line number Diff line number Diff line change
Expand Up @@ -15170,35 +15170,38 @@ vdw PQR format; write charges and vdW radii to occupancy/B-factor columns.
\end_layout

\begin_layout Description
pdbres: Use PDB V3 residue names.
pdbres Use PDB V3 residue names.
Will write a default chain ID ('Z') for each residue if the corresponding
topology does not have chain ID information.
\end_layout

\begin_layout Description
pdbatom: Use PDB V3 atom names.
pdbatom Use PDB V3 atom names.
\end_layout

\begin_layout Description
pdbv3: Use PDB V3 residue/atom names.
pdbv3 Use PDB V3 residue/atom names.
Same as specifying 'pdbres' and 'pdbatom'.
\end_layout

\begin_layout Description
teradvance: Increment record (atom) number for TER records (not done by
default).
topresnum Use topology residue numbers; otherwise use original residue numbers.
\end_layout

\begin_layout Description
terbyres: Print TER cards based on residue sequence instead of molecules.
teradvance Increment record (atom) number for TER records (not done by default).
\end_layout

\begin_layout Description
pdbter: Print TER cards according to original PDB TER (if available).
terbyres Print TER cards based on residue sequence instead of molecules.
\end_layout

\begin_layout Description
noter: Do not write TER cards.
pdbter Print TER cards according to original PDB TER (if available).
\end_layout

\begin_layout Description
noter Do not write TER cards.
\end_layout

\begin_layout Description
Expand Down Expand Up @@ -15363,7 +15366,7 @@ cpptraj
\end_layout

\begin_layout Description
highprecision: (EXPERT USE ONLY) Write with 8.6 precision instead of 8.3.
highprecision (EXPERT USE ONLY) Write with 8.6 precision instead of 8.3.
Note that since the width does not change, the precision of large coords
may be lower than 6.
\end_layout
Expand Down
2 changes: 0 additions & 2 deletions src/Action.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ class Action : public DispatchObject {
public:
/// Constructor
Action() : DispatchObject(ACTION) {}
/// Constructor - override ACTION (e.g. HIDDEN)
Action(DispatchObject::Otype o) : DispatchObject(o) {}
/// Enumerate potential return states from Init, Setup, and DoAction.
enum RetType { OK=0, ///< Everything OK, normal return.
ERR, ///< Problem occurred.
Expand Down
8 changes: 6 additions & 2 deletions src/Action_Channel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@
#include "DataSet_GridFlt.h"

// CONSTRUCTOR
Action_Channel::Action_Channel() : Action(HIDDEN),
grid_(0), dxyz_(-1.0) {}
Action_Channel::Action_Channel() :
grid_(0),
dxyz_(-1.0)
{
SetHidden(true);
}

void Action_Channel::Help() const {
mprintf("\t<solute mask> [<solvent mask>] [out <file>] [dx <dx> [dy <dy>] [dz <dz>]]\n");
Expand Down
6 changes: 4 additions & 2 deletions src/Action_DNAionTracker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@
#include "CpptrajStdio.h"

// CONSTRUCTOR
Action_DNAionTracker::Action_DNAionTracker() : Action(HIDDEN),
Action_DNAionTracker::Action_DNAionTracker() :
distance_(0),
bintype_(COUNT),
poffset_(0),
useMass_(true)
{ }
{
SetHidden(true);
}

void Action_DNAionTracker::Help() const {
mprintf("\tname mask_p1 mask_p2 mask_base mask_ions\n"
Expand Down
3 changes: 2 additions & 1 deletion src/Action_Diffusion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,8 @@ void Action_Diffusion::CalcDiffusionConst(unsigned int& set, DataSet* ds, int Nd
double Factor = 10.0 / ((double)Ndim * 2.0);
double slope, intercept, corr;
double Dval = 0.0;
if (data.LinearRegression( slope, intercept, corr, 0 ) == 0)
double Fval = 0;
if (data.LinearRegression( slope, intercept, corr, Fval, 0 ) == 0)
Dval = slope * Factor;
if (diffout_ == 0)
mprintf("\t'%s' D= %g Slope= %g Int= %g Corr= %g\n", data.legend(), Dval,
Expand Down
1 change: 1 addition & 0 deletions src/Action_FilterByData.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "Action_FilterByData.h"
#include "CpptrajStdio.h"
#include "DataSet_1D.h"

void Action_FilterByData::Help() const {
mprintf("\t{<dataset arg> min <min> max <max> ...} [out <file>] [name <setname>]\n"
Expand Down
6 changes: 4 additions & 2 deletions src/Action_GridFreeEnergy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@
#include "Constants.h" // GASK_KCAL, SMALL

// CONSTRUCTOR
Action_GridFreeEnergy::Action_GridFreeEnergy() : Action(HIDDEN),
Action_GridFreeEnergy::Action_GridFreeEnergy() :
maxVoxelOccupancyCount_(600), // NOTE: See header for comments.
tempInKevin_(293.0),
grid_(0)
{}
{
SetHidden(true);
}

void Action_GridFreeEnergy::Help() const {
mprintf("\t<filename>\n%s\n\t<mask>\n", GridAction::HelpText);
Expand Down
6 changes: 4 additions & 2 deletions src/Action_InfraredSpectrum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,17 @@
# include <omp.h>
#endif

Action_InfraredSpectrum::Action_InfraredSpectrum() : Action(HIDDEN),
Action_InfraredSpectrum::Action_InfraredSpectrum() :
Vel_(0),
VAC_(0),
currentTop_(0),
tstep_(0.0),
maxLag_(-1),
previousNselected_(-1),
useFFT_(true)
{}
{
SetHidden(true);
}

// Action_InfraredSpectrum::Help()
void Action_InfraredSpectrum::Help() const {
Expand Down
1 change: 1 addition & 0 deletions src/Action_Matrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "CpptrajStdio.h"
#include "DistRoutines.h"
#include "Constants.h" // DEGRAD
#include "DataSet_1D.h"

// CONSTRUCTOR
Action_Matrix::Action_Matrix() :
Expand Down
24 changes: 18 additions & 6 deletions src/Action_NMRrst.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,25 @@
#include "BufferedLine.h"

// CONSTRUCTOR
Action_NMRrst::Action_NMRrst() : Action(HIDDEN),
findOutput_(0), specOutput_(0), masterDSL_(0), numNoePairs_(0), max_cut_(6.0),
strong_cut_(2.9), medium_cut_(3.5), weak_cut_(5.0),
resOffset_(0), debug_(0), nframes_(0), useMass_(false),
findNOEs_(false), series_(false),
Action_NMRrst::Action_NMRrst() :
findOutput_(0),
specOutput_(0),
masterDSL_(0),
numNoePairs_(0),
max_cut_(6.0),
strong_cut_(2.9),
medium_cut_(3.5),
weak_cut_(5.0),
resOffset_(0),
debug_(0),
nframes_(0),
useMass_(false),
findNOEs_(false),
series_(false),
rsttop_(0)
{}
{
SetHidden(true);
}

void Action_NMRrst::Help() const {
mprintf("\t[file <rstfile>] [name <dataname>] [geom] [noimage] [resoffset <r>]\n"
Expand Down
1 change: 1 addition & 0 deletions src/Action_Projection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "CpptrajStdio.h"
#include "StringRoutines.h" // integerToString
#include "Constants.h" // DEGRAD
#include "DataSet_1D.h"

// CONSTRUCTOR
Action_Projection::Action_Projection() :
Expand Down
2 changes: 1 addition & 1 deletion src/Action_Spam.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include "DataSet_Mesh.h"

// CONSTRUCTOR
Action_Spam::Action_Spam() : Action(HIDDEN),
Action_Spam::Action_Spam() :
debug_(0),
DG_BULK_(-30.3), // Free energy of bulk SPCE water
DH_BULK_(-22.2), // Enthalpy of bulk SPCE water
Expand Down
8 changes: 4 additions & 4 deletions src/Action_Strip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ Action::RetType Action_Strip::Init(ArgList& actionArgs, ActionInit& init, int de
Action::RetType Action_Strip::Setup(ActionSetup& setup) {
if (setup.Top().SetupIntegerMask( M1_ )) return Action::ERR;
if (M1_.None()) {
mprintf("Warning: strip: Mask [%s] has no atoms.\n",M1_.MaskString());
// If no atoms will be kept, no need for this command. SKIP.
mprintf("Warning: Mask [%s] would strip all atoms. Skipping.\n", M1_.MaskString());
return Action::SKIP;
}
int numStripped = setup.Top().Natom() - M1_.Nselected();
mprintf("\tStripping %i atoms.\n", numStripped);
// If no atoms will be stripped, no need to use this command. SKIP
// SANITY CHECK: If no atoms will be stripped, no need to use this command. SKIP
if ( numStripped == 0 ) {
mprintf("Warning: No atoms to strip. Skipping 'strip' for topology '%s'\n",
setup.Top().c_str());
mprintf("Warning: No atoms to strip. Skipping.\n");
return Action::SKIP;
}

Expand Down
2 changes: 0 additions & 2 deletions src/Analysis.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ class Analysis : public DispatchObject {
public:
/// Constructor
Analysis() : DispatchObject(ANALYSIS) {}
/// Constructor - override ANALYSIS (e.g. HIDDEN)
Analysis(DispatchObject::Otype o) : DispatchObject(o) {}
/// Enumerate potential return stats from Setup and Analyze.
enum RetType { OK = 0, ERR };
/// Destructor - virtual since this class is inherited
Expand Down
6 changes: 4 additions & 2 deletions src/Analysis_AmdBias.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
#include "CpptrajStdio.h"
#include "DataSet_double.h"

Analysis_AmdBias::Analysis_AmdBias() : Analysis(HIDDEN),
Analysis_AmdBias::Analysis_AmdBias() :
ds1_(0),
Ethresh_(0.0),
alpha_(0.0),
bias_(0)
{}
{
SetHidden(true);
}

void Analysis_AmdBias::Help() const {
mprintf("\tds <Edata> ethresh <Ethresh> alpha <alpha> out <filename>\n");
Expand Down
1 change: 1 addition & 0 deletions src/Analysis_Average.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include <cmath>
#include "Analysis_Average.h"
#include "CpptrajStdio.h"
#include "DataSet_1D.h"

Analysis_Average::Analysis_Average() :
avgOfSets_(0),
Expand Down

0 comments on commit 88b9dd7

Please sign in to comment.