Skip to content
Snippets Groups Projects
Commit 22417930 authored by Gareth Tribello's avatar Gareth Tribello
Browse files

Made landmarks selction inherit from AnalysisBase as it makes more sense

parent 961088f8
No related branches found
No related tags found
No related merge requests found
......@@ -3,7 +3,7 @@ d1: READ FILE=colv_in VALUES=data
ss1: EUCLIDEAN_DISSIMILARITIES STRIDE=1 USE_ALL_DATA ARG=d1
PRINT_DISSIMILARITY_MATRIX USE_OUTPUT_DATA_FROM=ss1 FILE=mymatrix.dat FMT=%8.4f
ll1: LANDMARK_SELECT_STRIDE ARG=d1 USE_OUTPUT_DATA_FROM=ss1 NLANDMARKS=5
ll1: LANDMARK_SELECT_STRIDE USE_OUTPUT_DATA_FROM=ss1 NLANDMARKS=5
ss2: EUCLIDEAN_DISSIMILARITIES USE_OUTPUT_DATA_FROM=ll1
OUTPUT_ANALYSIS_DATA_TO_PDB USE_OUTPUT_DATA_FROM=ll1 FILE=output-stride.pdb
PRINT_DISSIMILARITY_MATRIX USE_OUTPUT_DATA_FROM=ll1 FILE=mymatrix2.dat FMT=%8.4f
......
......@@ -4,8 +4,8 @@ ss1: OUTPUT_ANALYSIS_DATA_TO_COLVAR STRIDE=1 RUN=6 ARG=d1 FILE=output-half.pdb
ss2: OUTPUT_ANALYSIS_DATA_TO_COLVAR STRIDE=1 USE_ALL_DATA ARG=d1 FILE=output-all.pdb
ss3: OUTPUT_ANALYSIS_DATA_TO_COLVAR REUSE_INPUT_DATA_FROM=ss2 FILE=output-reuse.pdb
ll1: LANDMARK_SELECT_STRIDE ARG=d1 REUSE_INPUT_DATA_FROM=ss3 NLANDMARKS=5 NOVORONOI
ll1: LANDMARK_SELECT_STRIDE USE_OUTPUT_DATA_FROM=ss3 NLANDMARKS=5 NOVORONOI
OUTPUT_ANALYSIS_DATA_TO_COLVAR USE_OUTPUT_DATA_FROM=ll1 FILE=output-stride.pdb
ll2: LANDMARK_SELECT_STRIDE ARG=d1 REUSE_INPUT_DATA_FROM=ss1 NLANDMARKS=3 NOVORONOI
ll2: LANDMARK_SELECT_STRIDE USE_OUTPUT_DATA_FROM=ss1 NLANDMARKS=3 NOVORONOI
OUTPUT_ANALYSIS_DATA_TO_COLVAR USE_OUTPUT_DATA_FROM=ll2 FILE=output-stride2.pdb
......@@ -48,7 +48,6 @@ PLUMED_REGISTER_ACTION(FarthestPointSampling,"LANDMARK_SELECT_FPS")
void FarthestPointSampling::registerKeywords( Keywords& keys ){
LandmarkSelectionBase::registerKeywords(keys);
LandmarkSelectionBase::removeDataCollectionKeywords( keys );
keys.add("compulsory","SEED","1234","a random number seed");
}
......
......@@ -24,15 +24,8 @@
namespace PLMD {
namespace analysis {
void LandmarkSelectionBase::removeDataCollectionKeywords( Keywords& keys ){
keys.remove("ATOMS"); keys.remove("STRIDE"); keys.remove("RUN"); keys.remove("USE_ALL_DATA");
keys.remove("REWEIGHT_BIAS"); keys.remove("REWEIGHT_TEMP"); keys.remove("TEMP");
keys.remove("REUSE_INPUT_DATA_FROM"); keys.remove("WRITE_CHECKPOINT"); keys.remove("NOMEMORY");
keys.remove("RESTART"); keys.remove("UPDATE_FROM"); keys.remove("UPDATE_UNTIL"); keys.remove("ARG");
}
void LandmarkSelectionBase::registerKeywords( Keywords& keys ){
AnalysisWithDataCollection::registerKeywords( keys );
AnalysisBase::registerKeywords( keys );
keys.add("compulsory","NLANDMARKS","the number of landmarks that you would like to select");
keys.addFlag("NOVORONOI",false,"do not do a Voronoi analysis of the data to determine weights of final points");
keys.addFlag("IGNORE_WEIGHTS",false,"ignore the weights in the underlying analysis object");
......@@ -40,7 +33,7 @@ void LandmarkSelectionBase::registerKeywords( Keywords& keys ){
LandmarkSelectionBase::LandmarkSelectionBase( const ActionOptions& ao ):
Action(ao),
AnalysisWithDataCollection(ao)
AnalysisBase(ao)
{
if( keywords.exists("NLANDMARKS") ) parse("NLANDMARKS",nlandmarks);
log.printf(" selecting %d landmark points \n",nlandmarks);
......
......@@ -22,12 +22,12 @@
#ifndef __PLUMED_analysis_LandmarkSelectionBase_h
#define __PLUMED_analysis_LandmarkSelectionBase_h
#include "AnalysisWithDataCollection.h"
#include "AnalysisBase.h"
namespace PLMD {
namespace analysis {
class LandmarkSelectionBase : public AnalysisWithDataCollection {
class LandmarkSelectionBase : public AnalysisBase {
friend class ReselectLandmarks;
private:
/// The number of landmarks we are selecting
......@@ -43,7 +43,6 @@ protected:
void selectFrame( const unsigned& );
public:
static void registerKeywords( Keywords& keys );
static void removeDataCollectionKeywords( Keywords& keys );
LandmarkSelectionBase( const ActionOptions& ao );
/// Return the number of data points
unsigned getNumberOfDataPoints() const ;
......@@ -71,7 +70,7 @@ unsigned LandmarkSelectionBase::getNumberOfDataPoints() const {
inline
unsigned LandmarkSelectionBase::getDataPointIndexInBase( const unsigned& idata ) const {
return AnalysisWithDataCollection::getDataPointIndexInBase( landmark_indices[idata] );
return AnalysisBase::getDataPointIndexInBase( landmark_indices[idata] );
}
inline
......@@ -81,12 +80,12 @@ double LandmarkSelectionBase::getWeight( const unsigned& idata ) const {
inline
void LandmarkSelectionBase::getDataPoint( const unsigned& idata, std::vector<double>& point, double& weight ) const {
AnalysisWithDataCollection::getDataPoint( landmark_indices[idata], point, weight );
AnalysisBase::getDataPoint( landmark_indices[idata], point, weight );
}
inline
ReferenceConfiguration* LandmarkSelectionBase::getReferenceConfiguration( const unsigned& idat ){
return AnalysisWithDataCollection::getReferenceConfiguration( landmark_indices[idat] );
return AnalysisBase::getReferenceConfiguration( landmark_indices[idat] );
}
inline
......
......@@ -50,7 +50,6 @@ PLUMED_REGISTER_ACTION(ReselectLandmarks,"RESELECT_LANDMARKS")
void ReselectLandmarks::registerKeywords( Keywords& keys ){
LandmarkSelectionBase::registerKeywords(keys);
LandmarkSelectionBase::removeDataCollectionKeywords( keys );
keys.remove("NLANDMARKS");
keys.add("compulsory","LANDMARKS","the action that selects the landmarks that you want to reselect using this action");
}
......
......@@ -120,13 +120,12 @@ external file
<table align=center frame=void width=95%% cellpadding=5%%>
<tr> <td width=5%> \subpage READ_DISSIMILARITY_MATRIX </td> <td> Read a matrix of dissimilarities between a trajectory of atomic configurations from a file. </td> </tr>
<tr> <td width=5%> \subpage READ_ANALYSIS_FRAMES </td> <td> Store the frames in trajectory to use in tandem with a dissimilarity matrix read using \ref READ_DISSIMILARITY_MATRIX </td> </tr>
</table>
N.B. You can only use the \ref READ_DISSIMILARITY_MATRIX command when you are doing post-processing. If you have a
trajectory that contains the configurations you read in the configurations from the trajectory using
\ref READ_ANALYSIS_FRAMES
N.B. You can only use the two commands above when you are doing post-processing.
\ref landmarks Landmark Selection
\section landmarks Landmark Selection
Many of the techniques described in the following sections are very computationally expensive to run on large trajectories.
A common strategy is thus to use a landmark selection algorithm to pick a particularly-reprentative subset of trajectory
......@@ -135,8 +134,7 @@ that are available in PLUMED are as follows
@LANDMARKS@
Some of these algorithms (e.g. \ref LANDMARK_SELECT_STRIDE) can collect data from the trajectory themselves. Others such as
\ref LANDMARK_SELECT_FPS must take a dissimilarity matrix action as input. That is to say they must be used as follows:
In general most of these landmark selection algorithms must be used in tandem with a \ref dissimilaritym "dissimilarity matrix" object as as follows:
\verbatim
ss1: EUCLIDEAN_DISSIMILARITIES STRIDE=1 USE_ALL_DATA ARG=d1
......@@ -196,7 +194,7 @@ a number of different algorithms. The various algorithms that can be used to op
@DIMRED@
\ref output Outputting the results from analysis algorithms
\section output Outputting the results from analysis algorithms
The following methods are available for printing the result output by the various analysis algorithms:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment