https://wiki.uni-konstanz.de/ccp4/index.php?title=Save-partial.scm&feed=atom&action=history
Save-partial.scm - Revision history
2024-03-29T08:54:54Z
Revision history for this page on the wiki
MediaWiki 1.39.6
https://wiki.uni-konstanz.de/ccp4/index.php?title=Save-partial.scm&diff=104&oldid=prev
Wgscott: New page: <pre> (define (save-partial imol atom-selection filename) (if (valid-model-molecule? imol) (begin (let ((imol-new (new-molecule-by-atom-selection imol atom-selection)))...
2008-02-09T20:20:35Z
<p>New page: <pre> (define (save-partial imol atom-selection filename) (if (valid-model-molecule? imol) (begin (let ((imol-new (new-molecule-by-atom-selection imol atom-selection)))...</p>
<p><b>New page</b></p><div><pre><br />
<br />
(define (save-partial imol atom-selection filename)<br />
<br />
(if (valid-model-molecule? imol)<br />
(begin<br />
(let ((imol-new <br />
(new-molecule-by-atom-selection imol atom-selection)))<br />
(if (not (valid-model-molecule? imol-new))<br />
(let ((s "That atom selection did not create a valid molecule"))<br />
(add-status-bar-text s))<br />
(let ((s (string-append "Saved partial model to "<br />
filename)))<br />
(write-pdb-file imol-new filename)<br />
(add-status-bar-text s)<br />
(close-molecule imol-new)))))))<br />
<br />
<br />
(let ((menu (coot-menubar-menu "Extensions")))<br />
<br />
(add-simple-coot-menu-menuitem<br />
menu "Save Partial Model..."<br />
(lambda () <br />
<br />
(molecule-chooser-gui <br />
"Save a selection from molecule: "<br />
(lambda (imol) <br />
(let ((cv (coot-version)))<br />
(if (string<? cv "0.3.3")<br />
(generic-double-entry "Atom Selection: " "Coordinates Filename: "<br />
"//A/1-10" "save.pdb" " Save Partial Model "<br />
(lambda (atom-selection-str pdb-name)<br />
(save-partial imol atom-selection-str pdb-name)))<br />
(generic-double-entry "Atom Selection: " "Coordinates Filename: "<br />
"//A/1-10" "save.pdb" #f #f " Save Partial Model "<br />
(lambda (atom-selection-str pdb-name button-state)<br />
(save-partial imol atom-selection-str pdb-name))))))))))<br />
<br />
</pre></div>
Wgscott