User:Wayne Decatur/3kg2 Morph Methods

From Proteopedia

Jump to: navigation, search

Contents

MORPH

First split all chains A, B, C, and D into single files and then used PyMol to change all chains to A for chains:
 
for example:

alter (chain B),chain='A'
sort


Used Beta server - mainly because it allows turning off fitting so I can show relationship (symmetry operations until the SYMOP functions within Jmol work within Proteopedia when newer version added) of identical conformations, left fitting on for showing difference between chain A and chain B.


OTHER THING I HAD TO DO OF COURSE WAS THE MORPHS I DECIDED TO USE WITHOUT ROTATION AS I RECEIVED THEM FROM THE SERVER (THE ONES RELATING TO SYMMETRY OF EQUIVALENT SUBUNITS) I HAD TO AT LEAST CHANGE THE MODEL NUMBERS TO NOT INCLUDE 'MODEL 0'. JUST ADDING 1 TO EACH FIXED.


TRYING TO GET TO LOAD WITH VIEW ALREADY CLOSER TO WHAT I WANT WHEN LOADED FILE OPENED IN PROTEOPEDIA

In PyMol

Next I was trying to get the subunit A to B morph to load already close to the familiar arrangement, so I tried in PyMol to orient it like I wanted it and then save all states (just fyi...found I could show all states at same time on screen with 'set all_states,1' from - PyMol reference card - 'set all_states,0' turns it back to one frame only shown). From http://www.mail-archive.com/pymol-users@lists.sourceforge.net/msg02004.html found this series of commands (ENTERED ONE LINE AT A TIME) helped make a file with all models from PyMOL:
 

split_states 3kg2atob 
delete 3kg2atob 
alter all, segi = model[-4:] 
rewind 
save test.pdb, all 

(By the way 'hide everything' can be typed as command since hard to hit using sidebar menu with many large files open.)

However, this didn't save the orientation I had moved it to at the start. Seems I could use get_view and set_view commands to get back to what I wanted after reload but I need it to open in Jmol the way I wanted so that doesn't help. A little more searching turned up on the Modeling and Editing Structures page of the PyMol Wiki that I could save with transformed coordinates using a simple Python script:

# Adds the command save_transformed
# Usage: save_transformed object, file
def save_transformed(object,file):
    m = cmd.get_view(0)
    ttt = [m[0], m[1], m[2], 0.0,
           m[3], m[4], m[5], 0.0,
           m[6], m[7], m[8], 0.0,
           0.0,   0.0,  0.0, 1.0]
    cmd.transform_object(object,ttt)
    cmd.save(file,object)

cmd.extend('save_transformed',save_transformed)

And so I again loaded the 3kg2 a to b morph (assigned secondary structure so cartoon look matched what I was used to looking at) and oriented like I wanted, then split them all and deleted original using commands above up until 'rewind' command, then ran the script I had saved on my drive, and then typed 'save_transformed all, test.pdb'
'However, that didn't save orientation I expected. I tried it on a single pdb file (no multiple models in the file) that I did rotate and instead of using 'all' as the name I used the object ('save_transformed 3KG2a, test.pdb') and it did save it as a different orientation; however, strangely not the exact one I expected. There must be an error in how the matrix is applied or the script is old and the matrix was altered after.. Yet since each of the ten models in the subunit A to B morph would need to be changed individually, it wouldn't be worth it when Jmol can fix it right after it loads.

Problem was earlier in PyMol that I was orienting the view the way I wanted but not actually changing orientation of molecule. To move one molecule to where I want and change coordinates I really need to just go into the 3-butting editing mode and while holding down the SHIFT BUTTON, rotate the molecule to where I want, and then save from the main menu. This is similar to how it tells you to superimpose by hand according to Modeling and Editing Structures page of the PyMol Wiki. Except I don't have a real other molecule there. I just have a vision of where I want the molecule to be. Now to test of I can load the subunit a to b morph and get the correct file back out?
Doing that (a) only rotates one of the models at a time; and (b) results in saving only the one model in first frame even if you issue command 'save test.pdb, all'. Though I could do by commands such as' rotate x, 270, state=0' so it will move all at once (http://pymolwiki.org/index.php/Rotate) and then get past saving problem by issuing the 'split_states' command I used earlier. HOWEVER DOING THIS SAME APPROACH, IN ESSENCE, IS MUCH EASIER IN JMOL (SEE BELOW) BECAUSE KEEPS ALL MODELS, ROTATES THEM ALL AT SAME TIME, and SAVE AS ONE FILE WITH ALL DESIGNATIONS STILL THERE AUTOMATICALLY. THUS IN JMOL THE ONLY EFFORT IS ISSUING THE ROTATE AND TRANSLATE COMMANDS UNTIL YOU GET WHAT YOU WANT.


FITTING: Saving a layer from pymol after it had been pair_fit (PyMol moves the first object in a command like 'pair_fit 3KG2a,3KG2b' onto the second one does indeed change the orientation of the second one;note DeepView keeps what you loaded first in place and magic fits second item when magicfitting default way so second orientation gets changed and saves different) and so they will be able to be superimposed in Jmol when superimposed that way.

Note: When the structures don't match perfectly causing Pymol to give the error 'ExecutiveRMS-Error: Atom counts between selection sets don't match (VALUE != VALUE).' then use 'super structure 1,structure 2' as described here to be more robust (and sequence-independent) than 'align structure1,structure 2' as described at Introduction to structural alignment with PyMOL. See also [here in Protopedia] for an example and comparison to other methods.

In Jmol Application

In JMOL,

select all; write COORDS PDB "test.pdb" 

saves both models with model numbers already included if multiple PDB files loaded with 'append' selected originally in the Jmol application.


To force reorientation of actual coordinates saved, load and then use commands like below to move in appropriate axes

rotateSelected molecular x -30

and then save with

 
write COORDS PDB "test.pdb" 

'translateSelected' is available too which helps as gets off screen. Just be careful not to move view using mouse before set. Doing this worked and all the individual models in the file saved in the near rotated view with all model designations still in file.

FITTING: My test example first. load subunit A and then B with load append on in Jmol

 
compare {1.1} {2.1} ROTATE TRANSLATE
write COORDS PDB "test.pdb" 

And it saves a rotated and translated version of model 1 with model 2 in same position in file coordinates (similar to PyMol behavior).

After various fitting steps I used the reoriented version to reorient one of them to that by fit and then deleted the model I fit it to and then fit again between the domains and saved as separate files from when I did it without reorientation.

Proteopedia Page Contributors and Editors (what is this?)

Wayne Decatur

Personal tools