Hi Ahmad,
If you want to use the values from the accept refinement dialog, they are
available from the refine_residues function:
imol = 0
residue_list = [["A", 10, ""], ["A", 20, ""], ["A", 30, ""], ["A", 40, ""]]
# for example
set_undo_molecule(imol)
for rs in residue_list:
rnr = residues_near_residue(imol, rs, 4.2)
rset = rnr + [rs]
with AutoAccept():
stat_summary = refine_residues(imol, rset)
if stats_are_acceptable(stat_summary):
pass
else:
apply_undo()
You will still need to write the stats_are_acceptable function with your
own cutoff values.
Kind regards,
Paul
On Mon, 20 May 2019 at 02:30, Ahmad Khalifa <[email protected]> wrote:
> But that function should already be implemented in the green flags that I
> get in the accept refinement dialog, no?
>
> On Sun, May 19, 2019, 7:19 PM Paul Emsley <[email protected]>
> wrote:
>
>> On 19/05/2019 21:40, Ahmad Khalifa wrote:
>> > Hello,
>> >
>> > I want to write a script that does the following:
>> >
>> > for a bunch of chains and atom numbers:
>> > go to chain letter and atom number
>> > do sphere refinement
>>
>> This should get you started:
>>
>> imol = 0
>> residue_list = [["A", 10, ""], ["A", 20, ""], ["A", 30, ""], ["A", 40,
>> ""]] # for example
>>
>> set_undo_molecule(imol)
>> for rs in residue_list:
>> rnr = residues_near_residue(imol, rs, 4.2)
>> rset = rnr + rs
>> distortion_pre = residues_distortions_py(imol, rset)
>> with_auto_accept([refine_residues, imol, rset])
>> distortion_post = residues_distortions_py(imol, rset)
>> if post_model_is_better_model(distortion_pre, distortion_post):
>> pass
>> else:
>> apply_undo()
>>
>> Have fun writing the post_model_is_better_model() function
>>
>> Paul.
>>
>
> ------------------------------
>
> To unsubscribe from the COOT list, click the following link:
> https://www.jiscmail.ac.uk/cgi-bin/webadmin?SUBED1=COOT&A=1
>
########################################################################
To unsubscribe from the COOT list, click the following link:
https://www.jiscmail.ac.uk/cgi-bin/webadmin?SUBED1=COOT&A=1