Well, jet-lag enables me to tinker with this script further. Now it does fitting, refinement, scoring and sorting - not what you asked for, but it might be useful.

Paul.


########################################################################

To unsubscribe from the COOT list, click the following link:
https://www.jiscmail.ac.uk/cgi-bin/webadmin?SUBED1=COOT&A=1
(define (mutate-poly-ala seq pdb-file-name ch-id)

   (let ((imol (read-pdb pdb-file-name))) ;; or whatever

      (let* ((residues (residues-in-chain imol ch-id))
             (n-residues (length residues))
             (resno-start (residue-spec->res-no (car residues)))
             (resno-end   (residue-spec->res-no (car (reverse residues))))
             (n-trials (- (string-length seq) n-residues)))

        (map (lambda (i-trial)
                    (let ((file-name (string-append "trial-" (number->string 
i-trial) ".pdb"))
                          (mol-name (string-append "trial-" (number->string 
i-trial)))
                          (imol-copy (copy-molecule imol))
                          (frag-seq (substring seq i-trial (+ i-trial 
n-residues)))
                          (score 0)
                          (alt-loc "")
                          (ins-code ""))
                      (mutate-chain imol-copy ch-id frag-seq)
                      (for-each (lambda (res-no)
                                   (let ((s (auto-fit-best-rotamer res-no 
alt-loc ins-code ch-id imol-copy (imol-refinement-map) 1 0.5)))
                                     (set! score (+ score s))))
                                (number-list resno-start resno-end))
                      (with-auto-accept (chain-refine imol-copy ch-id))
                      (set-molecule-name imol-copy mol-name)
                      (write-pdb-file imol-copy file-name)
                      (let ((c (map-to-model-correlation imol-copy residues '() 
2 (imol-refinement-map))))
                         (list mol-name c))))
                  (range n-trials)))))


(let ((seq "DVSGTVCLSALPPEATDTLNLIASDGPFPYSQD") ;; or whatever
      (pdb-file-name "poly-ala-frag.pdb")
      (ch-id "A"))

  (let ((scores (mutate-poly-ala seq pdb-file-name ch-id)))
    (let ((sorted (sort scores (lambda (e1 e2) (> (cadr e1) (cadr e2))))))
       (for-each (lambda (i) (format #t "sorted list: ~s~%" i)) sorted))))




########################################################################

To unsubscribe from the COOT list, click the following link:
https://www.jiscmail.ac.uk/cgi-bin/webadmin?SUBED1=COOT&A=1

Reply via email to