#console # setup.spt is called as part of initialization, before rockModel(). #set noDelay true; # this also makes rotateBranch go in one giant step. rbranch = "phi"; showPlanes = false; showClashes = false; trailClashes = false; trailClashesStep = 5; # for step 2 degrees, will trailClash every 2*trailClashesStep degrees. atPhi = 165; atPsi = 165; #set waitformoveto true; # This causes "BUSY" to flash 10X(?) after the 20 degree branch rotation is completed, # then show just one clash pattern at the end of the rotation. #atommovedCallback = "jmolscript: script clashes.spt" # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - function rotateBranch(delta) { var hPlaneCorners = "{15.ca} {16.h} {16.ca} {15.o}" var sPlaneCorners = "{16.ca} {17.h} {17.ca} {16.o}" var hPlaneOld = "h0" var sPlaneOld = "s0" var nextPlane var planeChar var jscmd var cmd var step = 2; if (delta < 0) step = -2; # FOR PHI var ratom1 = "16.ca" # PHI var ratom2 = "16.n" planeChar = "h"; var planeCorners = hPlaneCorners; # FOR PSI if (rbranch == "psi") { ratom1 = "16.ca" ratom2 = "16.c" planeChar = "s" planeCorners = sPlaneCorners; } # ROTATE BRANCH LOOP for (var iangle = 0; iangle < abs(delta); iangle += abs(step)) { #print iangle; # iangle is 0, 2, 4, ... 18 in each cycle, regardless of actual angle. # ROTATE BOTH MODELS for (var imodel = 1; imodel <= 2; imodel++) { cmd = "rotate branch {1." + imodel + " and " + ratom1 + "} {1." + imodel + " and " + ratom2 + "} " + step; //print cmd //script inline @{"javascript alert(\'" + cmd + "\')"} script inline @{cmd} } # ROTATE PLANES if (showPlanes) { nextPlane = iangle + abs(step) # LAST STEP if (nextPlane == abs(delta)) nextPlane = 0; // print hPlaneCorners; // hPlaneCorners fails to add: // script inline @{"draw h" + (iangle + 1) + " plane " + hPlaneCorners} cmd = "draw " + planeChar + nextPlane + " plane " + planeCorners // print cmd script inline @cmd cmd = "draw " + planeChar + iangle + " delete;" script inline @cmd } # UPDATE ANGLE VALUES if (rbranch == "phi") { atPhi = atPhi + step if (atPhi < -180) atPhi += 360 if (atPhi > 180) atPhi -= 360 jscmd = "document.getElementById(\'phiangle\').innerHTML = \'" + atPhi + "°\'" } else { atPsi = atPsi + step if (atPsi < -180) atPsi += 360 if (atPsi > 180) atPsi -= 360 jscmd = "document.getElementById(\'psiangle\').innerHTML = \'" + atPsi + "°\'" } javascript @jscmd # REFRESH/TRAIL CLASHES if (showClashes) { if (trailClashes) { atNow = atPhi; if (rbranch == "psi") {atNow = atPsi}; dirNow = abs(atNow); if (atNow < 0) dirNow = "_" + dirNow; atNow = abs(atNow); # instead of making a clash for every 2 deg, make it for every 10 deg # We start at 165 so add 5 to abs(atPxi) and % 10 if (!((atNow + 5) % 10)) { #print "" + iangle + " " + dirNow; # make unique id for each angle and degree value var cid = "h" + dirNow; if (rbranch == "psi") {cid = "s" + dirNow} print cid renderClashes(cid) } # end if every 10 } # end if trailClashes else {renderClashes()} } # end if showClashes refresh } # end loop } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - function rockModel() { # ROCK (time in sec must have opposite sign) delay 1.5 rotate y 35 -2 rotate -y 35 -2 } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - function dotAlanine() { select 1.1 and 16 dots 60% #dots 0.9 color dots black } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - function renderClashes(ii) { showClashes = true #set echo top left; #font echo 30 bold; #echo BUSY; #color echo red; #refresh; # not 16.c select 1.1 and (15.o,16.h,16.o,17.h) define ca1 selected idtail = "999"; if (trailClashes) {idtail = "" + ii;} # IF THE PERCENTAGE VDW IS CHANGED BELOW, CHANGE IT ALSO IN sf-trans.spt makeClash("rc1" + idtail, "{1.1 and sidechain} {ca1}"); makeClash("rc2" + idtail, "{1.1 and 15.o} {1.1 and (17.h or 17.n)}"); makeClash("rc3" + idtail, "{1.1 and 16.o} {1.1 and 15.o}"); makeClash("rc4" + idtail, "{1.1 and 16.h} {1.1 and 17.h}"); makeClash("rc5" + idtail, "{1.1 and 16.ha} {1.1 and (15.o or 17.h)}"); } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - function makeClash(atid, atomsets) { # cmd = "contact ID " + atid + " " + atomsets + " 88% full color orange"; cmd = "contact ID " + atid + " " + atomsets + " 88% full"; if (clashesOrange) { cmd += " color orange"; } # MAKING THE CLASH TRANSLUCENT GREATLY SLOWS BRANCH ROTATION # if (!showVDW) cmd += " translucent 3"; script inline @{cmd}; } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - function renderPlanes() { draw h0 plane {15.ca} {16.h} {16.ca} {15.o} # can't get width to affect thickness draw s0 plane {16.ca} {17.h} {17.ca} {16.o} showPlanes = true #draw p17 color orange } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - function vdwTranslucent() { zoomto 1.0 110 # SECOND MODEL TRANSLUCENT SPACEFILL select 1.2 wireframe off spacefill 88% color cpk # to neutralize white if had been set # QUIVERS EVEN WITHOUT MULTIGIFS #color translucent -1 color translucent 6 # does not quiver set translucent false # hides translucent within translucent frame all showVDW = true setQuality() } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - function setQuality() { if (trailClashes || showVDW) { set antialiasdisplay false; } else { set antialiasdisplay true; } } # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -