Many thanks to both Bernhard and Tim. The functions “map_parameters” and
“make_and_draw_map_with_reso_with_refmac_params” were exactly what I was
looking for. The function below does what I was after, allowing the user to
enter a new high-resolution limit for the active map, and closing the old map.
It is a little slow with large maps, but it works well enough.
Cheers,
Oliver.
def change_hires_limit():
if (scroll_wheel_map()==-1):
info_dialog("You need a map!")
else:
def change_hires_by_entry(new_res):
mol=scroll_wheel_map()
new_res=float(new_res)
mtz_file=map_parameters(mol)[0]
F_col=map_parameters(mol)[1]
PHI_col=map_parameters(mol)[2]
make_and_draw_map_with_reso_with_refmac_params(mtz_file,F_col,PHI_col,"",0,0,0,"Fobs:None-specified",
"SigF:None-specified","RFree:None-specified",0,0,1,1000.0,new_res)
close_molecule(mol)
generic_single_entry("New high-res limit for map?",
"5.0","Change high resolution limit for refinement
map",change_hires_by_entry)
#Add menu item
add_simple_coot_menu_menuitem(menu,
"Change hi-res limit for map",lambda func: change_hires_limit())
> On Mar 18, 2015, at 12:19 PM, Bernhard Lohkamp <[email protected]> wrote:
>
>
> I think what you want is:
>
> molecule_name
>
> and
>
> make_and_draw_map_with_reso_with_refmac_params
>
> B
>
> P.S. Changing mtz resolution on the fly is currently not supported...
>
> On 18/03/2015 16:16, Oliver Clarke wrote:
>> As an alternative solution to this query, is there any way to get the
>> filename of a loaded map (or model) using the scripting interface?
>>
>> Because if that is the case I could write an extension myself to do this
>> (just reloading another version of the mtz with different resolution
>> limits), but I can't quite seem to find the appropriate function to grab the
>> filename of an already loaded map.
>>
>> Best,
>> Oliver.
>>
>> On Mon, 16 Mar 2015 17:00:04 +0000, Oliver Clarke <[email protected]>
>> wrote:
>>
>>> Hi all,
>>>
>>> Would it be possible (or is it already possible) to set resolution limits
>>> for an mtz on the fly?
>>>
>>> I'm not sure whether this is feasible or not, but the fact that on the fly
>>> B-factor sharpening works makes me think it might be.
>>>
>>> This would be particularly handy when dealing with EM maps, where it is
>>> often desirable to look at the map filtered at say 8Å to reveal poorly
>>> ordered or very mobile domains, the position of which is lost in the noise
>>> when looking at the map with all the higher resolution terms present.
>>>
>>> Right now I just load the map several times with different resolution
>>> limits, but it would be nice to be able to do this on the fly, both for map
>>> interpretation and for fitting (One could fit domains several times using
>>> progressively higher resolution data, for example).
>>>
>>> I realize that using a positive B-factor in sharpening achieves a similar
>>> effect, but the map doesn't look nearly as good.
>>>
>>> Best,
>>> Oliver.
>
> --
> ***************************************************
>
> Dr. Bernhard Lohkamp
> Associate Professor/Docent
> Div. Molecular Structural Biology
> Dept. of Medical Biochemistry and Biophysics (MBB)
> Karolinska Institutet
> S-17177 Stockholm
> Sweden
>
> phone: (+46) 08-52487651
> fax: (+46) 08-327626
> email: [email protected]
>
> ---
> This email has been checked for viruses by Avast antivirus software.
> http://www.avast.com
>