> Would be great if glycerol (GOL) could be added to the standard options
> in the add atom at pointer menu. Its not an atom, but neither are SO4
> or PO4 and they are in list, and it pops up frequently for structures
> using glycerol in cryo.
It can be indeed somewhat frustrating to click a dozen times just to add a single solvent molecule (get-monomer, delete-hydrogens, merge-molecules etc). However, I'd agree that Place atom at pointer may not be the right place for such molecules.
Below a quick-and-dirty script that does more-or-less the same for frequently used cryoprotectants, or basically anything that has a complete cif description. (I use it as an extension, so it's just one mouse-click away.)
JED
---------
;;; add solvent molecules here
;;; works only for mols with complete cif description!
(define my-solvent-molecules (list
"EDO" ;; ethylene-glycol
"GOL" ;; glycerol
"DMS" ;; DMSO
"MPD" ;; MPD
"ACT" ;; acetate ion
"CIT" ;; citrate ion
"FMT" ;; formate ion
))
(let* ((window (gtk-window-new 'toplevel))
(vbox1 (gtk-vbox-new #f 0))
(frame1 (gtk-frame-new " Add solvent to model: "))
(hbox1 (gtk-hbox-new #f 10))
(menu (gtk-menu-new))
(omenu (gtk-option-menu-new))
(model-list (fill-option-menu-with-coordinates-mol-options menu))
(frame2 (gtk-frame-new " Select solvent molecule: "))
(scr-win (gtk-scrolled-window-new))
(vbox2 (gtk-vbox-new #f 0))
(hsep (gtk-hseparator-new)))
(gtk-window-set-default-size window 250 265)
(gtk-window-set-title window "Add solvent molecule")
(gtk-container-add window vbox1)
(gtk-container-border-width vbox1 6)
(gtk-box-pack-start vbox1 frame1 #f #f 4)
(gtk-container-add frame1 hbox1)
(gtk-box-pack-start hbox1 omenu #t #t 9)
(gtk-option-menu-set-menu omenu menu)
(gtk-container-border-width hbox1 6)
(gtk-box-pack-start vbox1 frame2 #t #t 5)
(gtk-container-add frame2 scr-win)
(gtk-container-border-width scr-win 6)
(gtk-container-border-width vbox2 5)
(gtk-scrolled-window-add-with-viewport scr-win vbox2)
(gtk-scrolled-window-set-policy scr-win 'automatic 'always)
(gtk-box-pack-start vbox1 hsep #f #f 5)
(let buttons ((molecules my-solvent-molecules))
(cond
((null? molecules) 'end)
(else
(let* ((hbox (gtk-hbox-new #f 0))
(button (gtk-button-new-with-label (car molecules))))
(gtk-box-pack-start vbox2 hbox #f #f 2)
(gtk-box-pack-start hbox button #t #t 2)
(gtk-signal-connect button "clicked"
(lambda ()
(let ((imol (get-monomer (car molecules)))
(active-mol-no (get-option-menu-active-molecule omenu model-list)))
(delete-residue-hydrogens imol "A" 1 "" "")
(if (not (null? model-list)) (begin
;;only merge if there's something to merge with
(merge-molecules (list imol) active-mol-no)
(delete-residue imol "A" 1 "")
(add-status-bar-text
(string-append (car molecules) " added to molecule number "
(number->string active-mol-no))))))))
(buttons (cdr molecules))))))
(let ((close-button (gtk-button-new-with-label "Close")))
(gtk-box-pack-start vbox1 close-button #f #f 5)
(gtk-signal-connect close-button "clicked"
(lambda args
(gtk-widget-destroy window))))
(gtk-widget-show-all window))
|