Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
bayesianem
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Riccardo PELLARIN
bayesianem
Commits
db4977a4
Commit
db4977a4
authored
5 years ago
by
Ben Webb
Browse files
Options
Downloads
Patches
Plain Diff
Add metadata to RMF output
parent
3b13b009
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
include/GaussianEMRestraint.h
+18
-0
18 additions, 0 deletions
include/GaussianEMRestraint.h
pyext/src/restraint.py
+2
-0
2 additions, 0 deletions
pyext/src/restraint.py
src/GaussianEMRestraint.cpp
+22
-1
22 additions, 1 deletion
src/GaussianEMRestraint.cpp
with
42 additions
and
1 deletion
include/GaussianEMRestraint.h
+
18
−
0
View file @
db4977a4
...
...
@@ -104,6 +104,15 @@ class IMPBAYESIANEMEXPORT GaussianEMRestraint : public Restraint
return
exp
(
-
unprotected_evaluate
(
NULL
));
}
//! Set the filename corresponding to the density GMM particles
/** If the density GMM particles were read from a file, this method
can be used to tell the restraint so that it can track this
information back to the original EM density file, which is useful
for deposition. */
void
set_density_filename
(
std
::
string
density_fn
)
{
density_fn_
=
get_absolute_path
(
density_fn
);
}
//! Pre-calculate the density-density and model-model scores
/** This is automatically called by the constructor.
You only need to call it manually if you change Gaussian variances
...
...
@@ -129,9 +138,17 @@ class IMPBAYESIANEMEXPORT GaussianEMRestraint : public Restraint
const
IMP_OVERRIDE
;
virtual
IMP
::
ModelObjectsTemp
do_get_inputs
()
const
IMP_OVERRIDE
;
void
show
(
std
::
ostream
&
out
)
const
{
out
<<
"GEM restraint"
;
}
//! \return Information for writing to RMF files
RestraintInfo
*
get_static_info
()
const
IMP_OVERRIDE
;
//! \return Information for writing to RMF files
RestraintInfo
*
get_dynamic_info
()
const
IMP_OVERRIDE
;
IMP_OBJECT_METHODS
(
GaussianEMRestraint
);
private
:
double
model_cutoff_dist_
,
density_cutoff_dist_
;
ParticleIndexes
model_ps_
;
ParticleIndexes
density_ps_
;
ParticleIndex
global_sigma_
;
...
...
@@ -148,6 +165,7 @@ class IMPBAYESIANEMEXPORT GaussianEMRestraint : public Restraint
ParticleIndexes
slope_ps_
;
//experiment
std
::
map
<
ParticleIndex
,
Float
>
map_score_dd_
;
Float
cached_score_term_
;
std
::
string
density_fn_
;
//variables needed to tabulate the exponential
Floats
exp_grid_
;
...
...
This diff is collapsed.
Click to expand it.
pyext/src/restraint.py
+
2
−
0
View file @
db4977a4
...
...
@@ -181,6 +181,8 @@ class GaussianEMRestraintWrapper(object):
cutoff_dist_model_data
,
slope
,
update_model
,
backbone_slope
)
if
target_fn
!=
''
:
self
.
gaussianEM_restraint
.
set_density_filename
(
target_fn
)
print
(
'
done EM setup
'
)
self
.
rs
=
IMP
.
RestraintSet
(
self
.
m
,
'
GaussianEMRestraint
'
)
...
...
This diff is collapsed.
Click to expand it.
src/GaussianEMRestraint.cpp
+
22
−
1
View file @
db4977a4
...
...
@@ -26,7 +26,9 @@ GaussianEMRestraint::GaussianEMRestraint(Model *mdl, ParticleIndexes model_ps,
Float
density_cutoff_dist
,
Float
slope
,
bool
update_model
,
bool
backbone_slope
,
std
::
string
name
)
:
Restraint
(
mdl
,
name
),
model_ps_
(
model_ps
),
density_ps_
(
density_ps
),
:
Restraint
(
mdl
,
name
),
model_cutoff_dist_
(
model_cutoff_dist
),
density_cutoff_dist_
(
density_cutoff_dist
),
model_ps_
(
model_ps
),
density_ps_
(
density_ps
),
global_sigma_
(
global_sigma
),
slope_
(
slope
),
update_model_
(
update_model
)
{
msize_
=
model_ps
.
size
();
...
...
@@ -281,4 +283,23 @@ ModelObjectsTemp GaussianEMRestraint::do_get_inputs() const {
return
ret
;
}
RestraintInfo
*
GaussianEMRestraint
::
get_static_info
()
const
{
IMP_NEW
(
RestraintInfo
,
ri
,
());
ri
->
add_string
(
"type"
,
"IMP.bayesianem.GaussianEMRestraint"
);
if
(
!
density_fn_
.
empty
())
{
ri
->
add_filename
(
"filename"
,
density_fn_
);
}
ri
->
add_float
(
"model cutoff"
,
model_cutoff_dist_
);
ri
->
add_float
(
"density cutoff"
,
density_cutoff_dist_
);
return
ri
.
release
();
}
RestraintInfo
*
GaussianEMRestraint
::
get_dynamic_info
()
const
{
IMP_NEW
(
RestraintInfo
,
ri
,
());
Float
scale
=
IMP
::
isd
::
Scale
(
get_model
(),
global_sigma_
).
get_scale
();
ri
->
add_float
(
"global sigma"
,
scale
);
ri
->
add_float
(
"score"
,
get_last_score
());
return
ri
.
release
();
}
IMPBAYESIANEM_END_NAMESPACE
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