From CCP4 wiki
Jump to navigation Jump to search
(define (low-occ-gui imol occ-threshold)
   "Residues with low occupancy..."
    (lambda (chain-id res-no ins-code res-serial-no)
      (let ((atom-ls (residue-info imol chain-id res-no ins-code)))
	;; return #f if there are no atoms with alt-confs, else return
	;; a list of the residue's spec (chain-id resno ins-code)
	(let g ((atom-ls atom-ls))
	   ((null? atom-ls) #f)
	    (let* ((atom (car atom-ls))
		   (occ (car (car (cdr atom)))))
	      (if (< occ occ-threshold)
		  (g (cdr atom-ls))))))))))))

(let ((menu (coot-menubar-menu "Extras")))
   menu "Residues with low occupancy..."
   (lambda ()
      "Molecule for low occupancy analysis:"
      "Occupancy threshold"
      (lambda (imol text)
	(let ((n (string->number text)))
	  (if (number? n)
	      (low-occ-gui imol n))))))))