Apply-cs.scm

From CCP4 wiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

(define (apply-cs imol chain-id cs-file-name)
  (if (file-exists? cs-file-name)
      (call-with-input-file cs-file-name
	(lambda (port)
	  (let loop ((resno (read port))
		     (attributes '()))
	    (if (eof-object? resno)
		(set-atom-attributes attributes)
		(let ((cs (read port)))
		  (let* ((atts (map (lambda (atom)
				      (list imol chain-id resno ""
					    (car (car atom))
					    (car (cdr (car atom)))
					    "B" cs))
				    (residue-info imol chain-id resno ""))))
		    (loop (read port)
			  (append atts attributes))))))))))