Thanks Nat, this is exactly what I was looking for and it makes perfect sense!

To make this more convenient when one has many unidentified densities of 
varying lengths, I've written a little extension for Coot that generates a new 
UNL residue with a specified number of carbons, makes restraints and 
jiggle-fits it to the map (if a refinement map is set):

menu=coot_menubar_menu("Custom")
def make_alkyl_chain():
  def make_alkyl_chain_length_n(n):
    smiles_string=int(n)*"c"
    new_molecule_by_smiles_string(smiles_string,smiles_string)
    delete_hydrogens(molecule_number_list()[-1])
    mol_id=molecule_number_list()[-1]
    ch_id="A"
    res_no=1
    ins_code=""
    new_residue_name="UNL"
    set_residue_name(mol_id,ch_id,res_no,ins_code,new_residue_name)
    prodrg_ify(mol_id,ch_id,res_no,ins_code)
    if imol_refinement_map()!=-1:
      fit_chain_to_map_by_random_jiggle(mol_id,ch_id,1000,0.1)
  generic_single_entry("How many carbons do you want in the chain?",
    "10","Make alkyl chain",make_alkyl_chain_length_n)
add_simple_coot_menu_menuitem(menu, "Make alkyl chain of length n", lambda 
func: make_alkyl_chain())

Reply via email to