User:Karsten Theis/Linear interpolation

From Proteopedia

< User:Karsten Theis(Difference between revisions)
Jump to: navigation, search
(Try it)
Current revision (14:27, 6 March 2021) (edit) (undo)
 
Line 3: Line 3:
<nowiki>
<nowiki>
load =1BNA
load =1BNA
-
show 5 or 6
+
display 5 or 6
five = {5}.xyz.all
five = {5}.xyz.all
six = {6}.xyz.all
six = {6}.xyz.all
 +
interp = six
progress = 0.5
progress = 0.5
ssergorp = 1 - progress
ssergorp = 1 - progress
-
for (var i FROM [1,21]) {five[i] = (five[i] * progress + six[i] * ssergorp)}
+
for (var i FROM [1,21]) {interp[i] = (five[i] * progress + six[i] * ssergorp)}
-
{6}.xyz = @five
+
{6}.xyz = @interp
</nowiki>
</nowiki>

Current revision

This is a Jmol script that does linear interpolation. You need two sets of atoms that contain the same structure in the same order (but in a different conformation or position). Here, I am using residues 5 and 6 of 1BNA.

load =1BNA
display 5 or 6
five = {5}.xyz.all
six = {6}.xyz.all
interp = six
progress = 0.5
ssergorp = 1 - progress
for (var i FROM [1,21]) {interp[i] = (five[i] * progress + six[i] * ssergorp)}
{6}.xyz = @interp

Try it

PDB ID 1bna

Drag the structure with the mouse to rotate

Proteopedia Page Contributors and Editors (what is this?)

Karsten Theis

Personal tools