[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [IMP-users] how to integrate RMF with IMP.restrainer?



Should be fixed in dev.


On Tue, Jun 25, 2013 at 10:02 AM, Jan Kosinski <" target="_blank">> wrote:
Thanks!

To answer your question about IMP version:

I use dev versions pulled from git repo on last Friday or so.

For imp:
$ git describe develop
2.0.0-518-gd3125ab


git rev-list HEAD --pretty | head
commit d3125ab77d22949e1b83b2f100d2936c7d70b088
Author: Daniel Russel " target="_blank"><>
Date:ÂÂ Thu Jun 20 17:05:56 2013 -0700


For RMF:
$ git rev-list HEAD --pretty | head
commit c444224ffb262a86b33edb2eaa4432971f7b0ba7
Author: Daniel Russel " target="_blank"><>
Date:ÂÂ Tue Jun 4 22:19:33 2013 -0700

Thanks,
Jan



On 06/25/2013 06:59 PM, Daniel Russel wrote:
BTW, I added a bug for this to the bug tracker: <https://github.com/salilab/imp/issues/414>


Dear all,

What are the methods to log the simulation frames to RMF format instead of old Chimera style?

I have managed to integrate RMF with IMP.restrainer but not everything works. It seems to work with restraints like ExcludedVolume, Distance or EM but not Y2H or PullDown - virtually all that internally are translated to connectivity restraint make a script crashing. For example if I modify the restrainer/nup84_complex_in_bead_representation.py to:
import IMP
import IMP.restrainer

IMP.base.set_log_level(IMP.base.VERBOSE)

# Create restrainer object
restrainer = IMP.restrainer.Main()

# Add representation, restraint, optimization and display to restrainer
rep = restrainer.add_representation(IMP.restrainer.get_example_path('input/nup84_representation.xml'))
rsr = restrainer.add_restraint(IMP.restrainer.get_example_path('input/nup84_restraint.xml'))

#BEGIN ADDED PART
import IMP.rmf
import RMF

rmf= RMF.create_rmf_file('nup84_simulation.rmf')
rmf.set_description("Simulate nup84.\n")

model = restrainer.get_model()
root_hierarchy = rep.get_root_imp_hierarchy()

IMP.rmf.add_hierarchy(rmf, root_hierarchy)
IMP.rmf.add_restraints(rmf, model.get_restraints())
IMP.rmf.save_frame(rmf, 0)

os= IMP.rmf.SaveOptimizerState(rmf)
os.update_always("initial conformation")
restrainer.log = os
#END ADDED PART

opt = restrainer.add_optimization(IMP.restrainer.get_example_path('input/nup84_optimization.xml'))
disp = restrainer.add_display(IMP.restrainer.get_example_path('input/nup84_display.xml'), 'some_log_name')

###=======================================================================###
#Â At this point all data from XML files have been placed into the model.
#Â Now it is possible to perform various operations on the IMP model.
###=======================================================================###

# Save the initial state in Chimera format
# restrainer.log.write('initial.py')

# Perform optimization
restrainer.optimize()

# Save the optimized state in Chimera format
# restrainer.log.write('optimized.py')


(note added lines and old-style Chimera stuff commented out)

I get the following error:
Traceback (most recent call last):
 File "nup84_complex_in_bead_representation.py", line 50, in <module>
ÂÂÂ IMP.rmf.save_frame(rmf, 0)
 File "/home/user/software/imp_dev/lib/IMP/rmf/__init__.py", line 875, in save_frame
ÂÂÂ return _IMP_rmf.save_frame(*args)
_IMP_base.IOException: UsageError: "Cannot write sentry value to an RMF file." processing decorator of type Score

WARNINGÂ No frames were saved to file "RestraintSaveLink0" even though objects were added.


If however I change <Y2H> node to <Distance> in input/nup84_restraint.xml everything runs correctly and I can enjoy a working RMF file.

Would you have any suggestions how to make RMF logging working properly?

BTW. I am using the current dev version of IMP and RMF.

Thank you in advance for help,
Jan

_______________________________________________
IMP-users mailing list
" target="_blank">
https://salilab.org/mailman/listinfo/imp-users



_______________________________________________
IMP-users mailing list
" target="_blank">
https://salilab.org/mailman/listinfo/imp-users


-- 
Jan Kosinski, PhD
Structural and Computational Biology Unit
European Molecular Biology Laboratory (EMBL)
Meyerhofstrasse 1
69117 Heidelberg
Germany

_______________________________________________
IMP-users mailing list
">
https://salilab.org/mailman/listinfo/imp-users