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

[IMP-users] Questions about example script local_fitting.py



hello list,

   I started my IMP apprenticeship by trying to run and understand the example script local_fitting.py script. I spent some time rewritting it and parsing the documentation, and I come to you now with remaining questions. I am pretty new to the CryoEM field, so I will probably ask naïve questions. If some of these questions can be answered by reading a manual, please tell me which manual and I will be glad to read it.

1.) As a first remark concerning this script, the module IMP.algebra is used throughout the script, though never imported. Funnily, it puzzles my PyDev plugin but does not appear to lead to execution problems.
 

2.) I have problems wit regard to the resolution parameter and its apparent absence in density maps :
at line 30 the header of a loaded density map is modified.
  dmap.get_header_writable().set_resolution(resolution)
I though, the idea was to fix a possibly distinct resolution value for the resampled map; so I commented the line and replaced it by
 sampled_input_density.get_header_writable().set_resolution(resolution)
at line 36… Which resulted in an error during the local fitting process.
I thus checked wether the map header contained a resolution or not :
>>> dmap.get_header().get_has_resolution()
False
>>> dmap.get_header().get_resolution()
nan
Does the resolution never appear it map files ?
What is the incidence/relevance of "arbitrarily" setting this parameter such as it is apparently done in this example ?


3.) I don't fully understand the way objects share elements, and what happens when these elements are moved.
For instance, the three objects :
line 19 :   mh=IMP.atom.read_pdb(IMP.em.get_example_path("input.pdb"),m,sel)
line 24 :   ps= IMP.Particles(IMP.core.get_leaves(mh))
line 58 :   prot_rb = IMP.atom.setup_as_rigid_body(mh)

seem to share atoms since when moving :
line 60 :   IMP.core.transform(prot_rb,local_trans)
it looks like every atoms in mh and in ps have also been moved. 

I thus have the feeling that all three objects share references on the same atoms. 

If this is true, I don't understand what happens when iteratively applying transformations to prot_rb at the end of the script : 
line 100 :  prot_rb.set_transformation(fitting_sols.get_transformation(i))
line 102 : rmsd=IMP.atom.get_rmsd(IMP.core.XYZs(ps),IMP.core.XYZs(IMP.core.get_leaves(mh_ref)))
line 103 : IMP.atom.write_pdb(mh,"temp_"+str(i)+".pdb")
Since the transformations are applied iteratively, I would expect them to be composed; hence, parsing from 1 to fitting_sols.get_number_of_solutions()
in this order or in reverse order would not lead to the same result. I checked this behavior, and the solutions are (happily) the same whatever the order in which they are parsed... and I can't guess why…

4.) Is there a difference between prot_rb.set_transformation and IMP.core.transform ? 

5.) The signature is not the same for function IMP::em::local_rigid_fitting in the documentation and in the script.
In the documentation, it has a ( FittingSolutions &  fr) argument whereas, according to the script, this in fact seems to be the return type

6.) I could not find the documentation for the class FittingSolutions

Thanks for any hint

      --Ben