
<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.jmol.org/index.php?action=history&amp;feed=atom&amp;title=User%3ARemig%2Fplico%2Futilities</id>
	<title>User:Remig/plico/utilities - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.jmol.org/index.php?action=history&amp;feed=atom&amp;title=User%3ARemig%2Fplico%2Futilities"/>
	<link rel="alternate" type="text/html" href="https://wiki.jmol.org/index.php?title=User:Remig/plico/utilities&amp;action=history"/>
	<updated>2026-06-10T00:19:34Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.32.0</generator>
	<entry>
		<id>https://wiki.jmol.org/index.php?title=User:Remig/plico/utilities&amp;diff=9614&amp;oldid=prev</id>
		<title>Remig at 17:36, 12 April 2016</title>
		<link rel="alternate" type="text/html" href="https://wiki.jmol.org/index.php?title=User:Remig/plico/utilities&amp;diff=9614&amp;oldid=prev"/>
		<updated>2016-04-12T17:36:08Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;a href=&quot;https://wiki.jmol.org/index.php?title=User:Remig/plico/utilities&amp;amp;diff=9614&amp;amp;oldid=8948&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>Remig</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.jmol.org/index.php?title=User:Remig/plico/utilities&amp;diff=8948&amp;oldid=prev</id>
		<title>Remig: Some useful scripts for manually folding polypeptides</title>
		<link rel="alternate" type="text/html" href="https://wiki.jmol.org/index.php?title=User:Remig/plico/utilities&amp;diff=8948&amp;oldid=prev"/>
		<updated>2015-09-11T16:02:35Z</updated>

		<summary type="html">&lt;p&gt;Some useful scripts for manually folding polypeptides&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;'''Utils''' presents a menu of actions potentially useful for manual folding of polypeptides:&lt;br /&gt;
&lt;br /&gt;
Hover text may be enhanced to include atomIndex values.&lt;br /&gt;
&lt;br /&gt;
All collisions may be listed.&lt;br /&gt;
&lt;br /&gt;
Dispersion bonds contributing to secondary structure (displayed as grey arrows between atoms on residues within 4 AAs of eachother) may be toggled on and off.&lt;br /&gt;
&lt;br /&gt;
Dispersion bonds contributing to tertiary structure (displayed as yellow arrows between atoms outside 4 AAs of eachother) may be toggled on and off.&lt;br /&gt;
&lt;br /&gt;
All dispersion bonds may be cleared.&lt;br /&gt;
&lt;br /&gt;
Paired coils may be presented in a format that highlights the forces pairing them: cartoon backbone, ball-and-stick side-chains, hbonds, and halos on CB atoms.&lt;br /&gt;
&lt;br /&gt;
Utils is a member of the Plico suite of protein folding tools described  [[User:Remig/plico|here]]. It may be installed and accessed as a macro with the file:&lt;br /&gt;
&amp;lt;pre&amp;gt;Title=PLICO Utilities&lt;br /&gt;
Script=script &amp;lt;path to your script directory&amp;gt;/utils.spt;plico_utils&lt;br /&gt;
&amp;lt;/pre&amp;gt;saved as utilities.macro in your .jmol/macros directory as described in [[Macro]].&lt;br /&gt;
&lt;br /&gt;
Copy and paste the following into a text editor and save in your scripts directory as utils.spt.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;#   utils - Jmol script by Ron Mignery&lt;br /&gt;
#   v1.0 beta    9/11/2015&lt;br /&gt;
#&lt;br /&gt;
gE = false&lt;br /&gt;
gR = false&lt;br /&gt;
&lt;br /&gt;
function is_collision_in_select() {&lt;br /&gt;
    is = false&lt;br /&gt;
    var cAtoms = ({})&lt;br /&gt;
    var iChain = {selected}.chain&lt;br /&gt;
    for (var no = {selected}.min.atomno; no &amp;lt;= {selected}.max.atomno; no++) {&lt;br /&gt;
        a = {(atomno=no) and (chain=iChain) and thisModel}&lt;br /&gt;
        if (a) {&lt;br /&gt;
            is = true&lt;br /&gt;
            break&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    return is&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# A handy debug routine&lt;br /&gt;
function cc {&lt;br /&gt;
    print count_collisions(true)&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function super_coil_prompt() {&lt;br /&gt;
    prompt(&amp;quot;TBD&amp;quot;)&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function show_interchain_vbonds() {&lt;br /&gt;
    var pc = 0&lt;br /&gt;
    if (not gBusy) {&lt;br /&gt;
        var selsave = {selected}&lt;br /&gt;
        select {visible}&lt;br /&gt;
        gBusy = true&lt;br /&gt;
        background ECHO pink&lt;br /&gt;
        refresh&lt;br /&gt;
        if (gE) {&lt;br /&gt;
            print &amp;quot;Hiding intERchain dispersion bonds&amp;quot;&lt;br /&gt;
            gE = false&lt;br /&gt;
            draw ID &amp;quot;vdwe*&amp;quot; delete&lt;br /&gt;
        }&lt;br /&gt;
        else {&lt;br /&gt;
            print &amp;quot;Showing intERchain dispersion bonds&amp;quot;&lt;br /&gt;
        &lt;br /&gt;
            # For all visible atoms&lt;br /&gt;
            for (var i = {*}.atomIndex.min; i &amp;lt;= {*}.atomIndex.max; i++) {&lt;br /&gt;
                var a = {atomIndex=i}&lt;br /&gt;
                if ((a.group != &amp;quot;hoh&amp;quot;) and (a.element != &amp;quot;H&amp;quot;)) {&lt;br /&gt;
                    var iChain = a.chain&lt;br /&gt;
                    &lt;br /&gt;
                    # If side chain carbon (or sulfur)&lt;br /&gt;
                    if ({a and sidechain and not hydrogen} and a.selected) {&lt;br /&gt;
                        var nset = {within(104, VDW, a)&lt;br /&gt;
                            and ((chain != iChain) or (not within(4,GROUP, a)))&lt;br /&gt;
                            and not hoh and not hydrogen and selected}&lt;br /&gt;
                        for (var j = 1; j &amp;lt;= nset.size; j++) {&lt;br /&gt;
                            var id = format(&amp;quot;vdwe%d.%d&amp;quot;, i, j)&lt;br /&gt;
                            draw ID @id arrow @{a} @{nset[j]}&lt;br /&gt;
                            pc++&lt;br /&gt;
                        }&lt;br /&gt;
                    }&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
            gE = true&lt;br /&gt;
        }&lt;br /&gt;
        background ECHO lightgrey&lt;br /&gt;
        refresh&lt;br /&gt;
        select selsave&lt;br /&gt;
        gBusy = false&lt;br /&gt;
    }&lt;br /&gt;
    return pc&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function show_intrachain_vbonds() {&lt;br /&gt;
    if (not gBusy) {&lt;br /&gt;
        var selsave = {selected}&lt;br /&gt;
        select {visible}&lt;br /&gt;
        gBusy = true&lt;br /&gt;
        var pc = 0&lt;br /&gt;
        background ECHO pink&lt;br /&gt;
        refresh&lt;br /&gt;
        &lt;br /&gt;
        if (gR) {&lt;br /&gt;
            print &amp;quot;Hiding intRAchain dispersion bonds&amp;quot;&lt;br /&gt;
            gR = false&lt;br /&gt;
            draw ID &amp;quot;vdwr*&amp;quot; delete&lt;br /&gt;
        }&lt;br /&gt;
        else {&lt;br /&gt;
            print &amp;quot;Showing intRAchain dispersion bonds&amp;quot;&lt;br /&gt;
    &lt;br /&gt;
            # For all visible atoms&lt;br /&gt;
            for (var i = {*}.atomIndex.min; i &amp;lt;= {*}.atomIndex.max; i++) {&lt;br /&gt;
                var a = {atomIndex=i}&lt;br /&gt;
                var iChain = a.chain&lt;br /&gt;
                &lt;br /&gt;
                if ({a and sidechain and not hydrogen and selected}) {&lt;br /&gt;
                    var nset = {within(100, VDW, a) and within(4,GROUP, a)&lt;br /&gt;
                        and not connected(a) and not connected(connected(a))&lt;br /&gt;
                        and not hydrogen and (chain = iChain) and selected}&lt;br /&gt;
                    for (var j = 1; j &amp;lt;= nset.size; j++) {&lt;br /&gt;
                        var id = format(&amp;quot;vdwr%d.%d&amp;quot;, i, j)&lt;br /&gt;
                        draw ID @id arrow @{a} @{nset[j]}&lt;br /&gt;
                        pc++&lt;br /&gt;
                    }&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
            color $vdwr* lightblue&lt;br /&gt;
            gR = true&lt;br /&gt;
        }&lt;br /&gt;
        background ECHO lightgrey&lt;br /&gt;
        refresh&lt;br /&gt;
        select selsave&lt;br /&gt;
        gBusy = false&lt;br /&gt;
    }&lt;br /&gt;
    return pc&lt;br /&gt;
    &lt;br /&gt;
}&lt;br /&gt;
   &lt;br /&gt;
function calculate_cb(resmin, resmax, ichain, d) {&lt;br /&gt;
&lt;br /&gt;
    # For all atoms in range&lt;br /&gt;
    for (var i = {(resno=resmin) and (chain=ichain)}.atomno.min;&lt;br /&gt;
        i &amp;lt;= {(resno=resmax) and (chain=ichain)}.atomno.max; i++) {&lt;br /&gt;
        var a = {(atomno=i) and (chain=ichain)}&lt;br /&gt;
        &lt;br /&gt;
        # If CB&lt;br /&gt;
        if (a.atomName == &amp;quot;CB&amp;quot;) {&lt;br /&gt;
        &lt;br /&gt;
            # If within(d, a) and cb&lt;br /&gt;
            var nset = {within(@d, a) and (atomName = &amp;quot;CB&amp;quot;) and not a}&lt;br /&gt;
            for (var j = 1; j &amp;lt;= nset.size; j++) {&lt;br /&gt;
                measure @{nset[j]} @a&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function show_alpha_pairs() {&lt;br /&gt;
    if (not gBusy) {&lt;br /&gt;
        gBusy = true&lt;br /&gt;
        background echo pink&lt;br /&gt;
        refresh&lt;br /&gt;
        print &amp;quot;Backbone cartoon, sidechain ball-and-stick, hbonds on, halo on CBs&amp;quot;&lt;br /&gt;
        select all&lt;br /&gt;
        calculate STRUCTURE DSSP&lt;br /&gt;
        cartoons only&lt;br /&gt;
        color structure&lt;br /&gt;
        select {sidechain}&lt;br /&gt;
        wireframe -0.1&lt;br /&gt;
        spacefill 23%&lt;br /&gt;
        color jmol&lt;br /&gt;
        select {atomName=&amp;quot;CB&amp;quot;}&lt;br /&gt;
        halo on&lt;br /&gt;
        set hbondsRasmol off&lt;br /&gt;
        select all&lt;br /&gt;
        calculate hbonds&lt;br /&gt;
        background echo lightgrey&lt;br /&gt;
        refresh&lt;br /&gt;
        gBusy = false&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function utils_click_mb() {&lt;br /&gt;
&lt;br /&gt;
    # If in menu zone&lt;br /&gt;
    if ((_mouseX &amp;lt; 100) and ((_height-_mouseY) &amp;lt; 343)) {&lt;br /&gt;
        var line = ((_mouseX &amp;lt; 125) ? ((_height-_mouseY)\26) : 0)&lt;br /&gt;
        switch (line) {&lt;br /&gt;
        case 1:&lt;br /&gt;
            print &amp;quot;hover++&amp;quot;&lt;br /&gt;
            hi()&lt;br /&gt;
            break&lt;br /&gt;
        case 2:&lt;br /&gt;
            print &amp;quot;Counting collisions&amp;quot;&lt;br /&gt;
            cc()&lt;br /&gt;
            break&lt;br /&gt;
        case 3:&lt;br /&gt;
            print &amp;quot;showing interchain D bonds&amp;quot;&lt;br /&gt;
            print show_interchain_vbonds()&lt;br /&gt;
            break&lt;br /&gt;
        case 4:&lt;br /&gt;
            print &amp;quot;showing intrachain D bonds&amp;quot;&lt;br /&gt;
            print show_intrachain_vbonds()&lt;br /&gt;
            break&lt;br /&gt;
        case 5:&lt;br /&gt;
            print &amp;quot;Hiding all D bonds&amp;quot;&lt;br /&gt;
            draw ID &amp;quot;vdw*&amp;quot; delete&lt;br /&gt;
            gE = false&lt;br /&gt;
            gR = false&lt;br /&gt;
            break&lt;br /&gt;
        case 6:&lt;br /&gt;
            print &amp;quot;Show alpha chain pairs&amp;quot;&lt;br /&gt;
            show_alpha_pairs()&lt;br /&gt;
            break&lt;br /&gt;
        case 7:&lt;br /&gt;
            utils_exit()&lt;br /&gt;
            break&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# Top level of utils&lt;br /&gt;
function plico_utils() {&lt;br /&gt;
&lt;br /&gt;
    # Load common functions if not already&lt;br /&gt;
    if (kCommon &amp;lt; 6) {&lt;br /&gt;
        script $SCRIPT_PATH$plicoCommon.spt&lt;br /&gt;
        if (kCommon &amp;lt; 6) {&lt;br /&gt;
            prompt (&amp;quot;A newer version of plicoCommon.SPT is required&amp;quot;)&lt;br /&gt;
            quit&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    gPlico = &amp;quot;UTILS&amp;quot;&lt;br /&gt;
    plico_prelim(false, false)&lt;br /&gt;
    gE = false&lt;br /&gt;
    gR = false&lt;br /&gt;
&lt;br /&gt;
    gEcho=&amp;quot;______Menu_______|Hover++|List collisions|Show intERchain D bonds|&amp;quot;  +&lt;br /&gt;
     &amp;quot;Show intRAchain D bonds|Hide all D bonds|Show alpha pairs| BACK&amp;quot;&lt;br /&gt;
    set echo top left&lt;br /&gt;
    color echo black&lt;br /&gt;
    background echo lightgrey&lt;br /&gt;
    echo @gEcho&lt;br /&gt;
&lt;br /&gt;
    bind &amp;quot;SHIFT-DOUBLE&amp;quot; &amp;quot;utils_exit&amp;quot;;&lt;br /&gt;
    bind &amp;quot;LEFT-CLICK&amp;quot; &amp;quot;+:plico_menu_toggle&amp;quot;;&lt;br /&gt;
    bind &amp;quot;LEFT-CLICK&amp;quot; &amp;quot;+:utils_click_mb&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function utils_exit() {&lt;br /&gt;
    if (plico_exit(false)) {&lt;br /&gt;
        display all&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# End of UTILS.SPT&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Remig</name></author>
		
	</entry>
</feed>