In case it is useful to anyone else, this function seems to work fine:

def mutate_residue_range_by_click_a():
  def mutate_residue_range_by_click_b(res1,res2):
    if (res1[1]!=res2[1]) or (res1[2]!=res2[2]) or (res1[3]==res2[3]):
      info_dialog("Start and end points must be in the same mol and chain!")
    else:
      if (res1[3] > res2[3]):
        res_start=res2[3]
        res_end=res1[3]
        n=res_end-res_start+1
      else:
        res_start=res1[3]
        res_end=res2[3]
        n=res_end-res_start+1
      mol_id=res1[1]
      ch_id=res1[2]
      target_seq=n*"A"
      turn_off_backup(mol_id)
      mutate_residue_range(mol_id,ch_id,res_start,res_end,target_seq)
      for n in range(res_start,res_end+1):
        set_residue_name(mol_id,ch_id,n,"","UNK")
      turn_on_backup(mol_id)
  user_defined_click(2,mutate_residue_range_by_click_b)
add_simple_coot_menu_menuitem(menu,
"Mutate range to UNK (click start and end)", lambda func: 
mutate_residue_range_by_click_a())

> On Jun 27, 2015, at 12:39 PM, Clarke, Oliver <oc2...@cumc.columbia.edu> wrote:
> 
> That should work for the moment, thanks Bernhard! I can’t use it with 
> mutate_residue_range because there is no single letter code, but I can loop 
> through all residues in a range sequentially and mutate to ala and then set 
> the residue name, so that works fine. 
> 
> I would still ultimately favor making it a standard residue with three letter 
> code UNK and single letter code X - it allows for easy specification of 
> ambiguity, and it is the PDB-sanctioned way of representing an amino acid of 
> unknown identity. 
> 
> I would also suggest being able to set this as the default type for new 
> residues - it allows easy recognition of amino acids that are as yet 
> unassigned, and avoids confusion with alanine.
> 
> Cheers,
> Oliver.
>> On Jun 27, 2015, at 8:44 AM, Bernhard Lohkamp <bernhard.lohk...@ki.se> wrote:
>> 
>> 
>> How about using:
>> 
>> set_residue_name(int imol, const char *chain_id, int res_no, const char 
>> *ins_code, const char *new_residue_name)
>> 
>> B
>> 
>> On 26/06/2015 18:36, Oliver Clarke wrote:
>>> Hi all,
>>> 
>>> Would it be possible to add "UNK" to the list of standard residues one can 
>>> mutate to? Currently mutate doesn't seem to work using "UNK" as the target 
>>> res type, and I would like to add it to a function for mutating a residue 
>>> range to poly-UNK.
>>> 
>>> This is useful where one has a structure containing regions that have 
>>> assignable sequence, and regions where the sequence register is unclear, so 
>>> as to differentiate the two.
>>> 
>>> Cheers,
>>> 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: bernhard.lohk...@ki.se
>> 
>> ---
>> This email has been checked for viruses by Avast antivirus software.
>> https://www.avast.com/antivirus
>> 
> 

Reply via email to