Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Plumed AlphaFold
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Martin Kurečka
Plumed AlphaFold
Commits
acdaa3b4
There was an error fetching the commit references. Please try again later.
Commit
acdaa3b4
authored
9 years ago
by
Michele Ceriotti
Browse files
Options
Downloads
Patches
Plain Diff
Fixed bug in outputting analysis colvar files in some cases
parent
32daf83a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/analysis/ReadDissimilarityMatrix.cpp
+14
-2
14 additions, 2 deletions
src/analysis/ReadDissimilarityMatrix.cpp
with
14 additions
and
2 deletions
src/analysis/ReadDissimilarityMatrix.cpp
+
14
−
2
View file @
acdaa3b4
...
@@ -21,6 +21,8 @@
...
@@ -21,6 +21,8 @@
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
#include
"AnalysisBase.h"
#include
"AnalysisBase.h"
#include
"ReadAnalysisFrames.h"
#include
"ReadAnalysisFrames.h"
#include
"reference/ReferenceConfiguration.h"
#include
"reference/MetricRegister.h"
#include
"core/PlumedMain.h"
#include
"core/PlumedMain.h"
#include
"core/ActionSet.h"
#include
"core/ActionSet.h"
#include
"core/ActionRegister.h"
#include
"core/ActionRegister.h"
...
@@ -41,12 +43,14 @@ namespace analysis {
...
@@ -41,12 +43,14 @@ namespace analysis {
class
ReadDissimilarityMatrix
:
public
AnalysisBase
{
class
ReadDissimilarityMatrix
:
public
AnalysisBase
{
private:
private:
unsigned
nnodes
;
unsigned
nnodes
;
ReferenceConfiguration
*
fake_data
;
std
::
string
fname
,
wfile
;
std
::
string
fname
,
wfile
;
Matrix
<
double
>
dissimilarities
;
Matrix
<
double
>
dissimilarities
;
std
::
vector
<
double
>
weights
;
std
::
vector
<
double
>
weights
;
public:
public:
static
void
registerKeywords
(
Keywords
&
keys
);
static
void
registerKeywords
(
Keywords
&
keys
);
ReadDissimilarityMatrix
(
const
ActionOptions
&
ao
);
ReadDissimilarityMatrix
(
const
ActionOptions
&
ao
);
~
ReadDissimilarityMatrix
();
unsigned
getNumberOfDataPoints
()
const
;
unsigned
getNumberOfDataPoints
()
const
;
/// This gives an error as if we read in the matrix we dont have the coordinates
/// This gives an error as if we read in the matrix we dont have the coordinates
ReferenceConfiguration
*
getReferenceConfiguration
(
const
unsigned
&
idata
,
const
bool
&
calcdist
);
ReferenceConfiguration
*
getReferenceConfiguration
(
const
unsigned
&
idata
,
const
bool
&
calcdist
);
...
@@ -80,13 +84,16 @@ void ReadDissimilarityMatrix::registerKeywords( Keywords& keys ){
...
@@ -80,13 +84,16 @@ void ReadDissimilarityMatrix::registerKeywords( Keywords& keys ){
ReadDissimilarityMatrix
::
ReadDissimilarityMatrix
(
const
ActionOptions
&
ao
)
:
ReadDissimilarityMatrix
::
ReadDissimilarityMatrix
(
const
ActionOptions
&
ao
)
:
Action
(
ao
),
Action
(
ao
),
AnalysisBase
(
ao
),
AnalysisBase
(
ao
),
nnodes
(
1
)
nnodes
(
1
),
fake_data
(
NULL
)
{
{
std
::
string
mytraj
;
parse
(
"FRAMES"
,
mytraj
);
std
::
string
mytraj
;
parse
(
"FRAMES"
,
mytraj
);
if
(
mytraj
.
length
()
>
0
){
if
(
mytraj
.
length
()
>
0
){
ReadAnalysisFrames
*
mtraj
=
plumed
.
getActionSet
().
selectWithLabel
<
ReadAnalysisFrames
*>
(
mytraj
);
ReadAnalysisFrames
*
mtraj
=
plumed
.
getActionSet
().
selectWithLabel
<
ReadAnalysisFrames
*>
(
mytraj
);
if
(
!
mtraj
)
error
(
mytraj
+
" is not the label of a READ_ANALYSIS_FRAMES object"
);
if
(
!
mtraj
)
error
(
mytraj
+
" is not the label of a READ_ANALYSIS_FRAMES object"
);
mydata
=
dynamic_cast
<
AnalysisBase
*>
(
mtraj
);
mydata
->
use_all_data
=
true
;
mydata
=
dynamic_cast
<
AnalysisBase
*>
(
mtraj
);
mydata
->
use_all_data
=
true
;
}
else
{
fake_data
=
metricRegister
().
create
<
ReferenceConfiguration
>
(
"OPTIMAL"
);
}
}
if
(
mytraj
.
length
()
>
0
&&
plumed
.
getActionSet
().
size
()
!=
1
)
error
(
"should only be this action and the READ_ANALYSIS_FRAMES command in the input file"
);
if
(
mytraj
.
length
()
>
0
&&
plumed
.
getActionSet
().
size
()
!=
1
)
error
(
"should only be this action and the READ_ANALYSIS_FRAMES command in the input file"
);
...
@@ -104,6 +111,10 @@ nnodes(1)
...
@@ -104,6 +111,10 @@ nnodes(1)
use_all_data
=
true
;
freq
=
1
;
setStride
(
1
);
use_all_data
=
true
;
freq
=
1
;
setStride
(
1
);
}
}
ReadDissimilarityMatrix
::~
ReadDissimilarityMatrix
(){
if
(
fake_data
)
delete
fake_data
;
}
void
ReadDissimilarityMatrix
::
update
(){
if
(
!
mydata
)
plumed
.
stop
();
}
void
ReadDissimilarityMatrix
::
update
(){
if
(
!
mydata
)
plumed
.
stop
();
}
void
ReadDissimilarityMatrix
::
performAnalysis
(){
void
ReadDissimilarityMatrix
::
performAnalysis
(){
...
@@ -147,8 +158,9 @@ double ReadDissimilarityMatrix::getDissimilarity( const unsigned& iframe, const
...
@@ -147,8 +158,9 @@ double ReadDissimilarityMatrix::getDissimilarity( const unsigned& iframe, const
}
}
ReferenceConfiguration
*
ReadDissimilarityMatrix
::
getReferenceConfiguration
(
const
unsigned
&
idata
,
const
bool
&
calcdist
){
ReferenceConfiguration
*
ReadDissimilarityMatrix
::
getReferenceConfiguration
(
const
unsigned
&
idata
,
const
bool
&
calcdist
){
plumed_massert
(
!
calcdist
,
"cannot calc dist as this data was read in from input"
);
if
(
mydata
)
return
AnalysisBase
::
getReferenceConfiguration
(
idata
,
calcdist
);
if
(
mydata
)
return
AnalysisBase
::
getReferenceConfiguration
(
idata
,
calcdist
);
plumed_merror
(
"cannot get reference configurations from read in dissimilarity matrix"
)
;
return
fake_data
;
return
NULL
;
return
NULL
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment