Hi again :-)
I guess I spoke too soon.
The phenix.pdbtools command works as advertised, but the code I shared obviously (if I had cared to read it) changes MET to MSE.
Here is the correct version:
# code start
def mutate_all_mse_to_mets():
mol_id=active_residue()[0]
for ch_id in chain_ids(mol_id):
for resn in range(0,chain_n_residues(ch_id,mol_id)):
if (resname_from_serial_number(mol_id,ch_id,resn)=="MSE"):
seqnum=seqnum_from_serial_number(mol_id,ch_id,resn)
mutate(mol_id,ch_id,seqnum,'',"MET")
mutate_all_mse_to_mets()
# code end
I just tried it, and the script changes the coordinates of the mutated residues. The phenix.pdbtools version does not do that. Both methods seem to work though.