normal Secondary Structure - cg_secondary_structure.tcl

  • dariush
  • dariush's Avatar Topic Author
  • Offline
  • Senior Boarder
More
10 years 3 months ago #3380 by dariush
Hello All,

I have loaded my trajectory and I am going to create some snapshots. I know "cg_secondary_structure.tcl" dose not work throughout trajectory, but my question is: how can I remove previous representation and redraw next frame.
I know one way is to lead trajectory again, but I thought maybe I can use that loaded trajectory, remove previous representation and draw structure for another desired frame.

Thanks,
Dariush

Please Log in or Create an account to join the conversation.

More
10 years 3 months ago - 10 years 3 months ago #3381 by Clement
If memory serves:

# loop over each frame of the loaded trajectory
for { set frame 0 } { $frame < [molinfo <MOL ID> get numframes] } { incr frame } {

# go to the current frame
animate goto $frame

# this next line deletes all previously drawn graphics
graphics <MOL ID> delete all

# draw the secondary structure
cg_secondary_structure <... YOUR COMMAND LINE ...>

# tune the next line to your preferred rendering method
render Snapshot [format "%05i.tga" $frame]

}


Copy/paste in a Tcl file and source it in VMD.
Last edit: 10 years 3 months ago by Clement.

Please Log in or Create an account to join the conversation.

  • dariush
  • dariush's Avatar Topic Author
  • Offline
  • Senior Boarder
More
10 years 3 months ago #3386 by dariush
Great!

I used:

for { set frame 100 } { $frame < [molinfo 0 get numframes] } { incr frame } {
animate goto $frame
graphics 0 delete all
cg_helix {{50 54} {61 67} {71 74}} -hlxmethod "idealhelix" -hlxcolor "lime" -hlxrad 3.0 -hlxwidth 3.0
render Snapshot [format "%05i.tga" $frame]
}

and it changed everything for frame 100 and I could do it for any frames (set frame $frame).

Thanks!

Please Log in or Create an account to join the conversation.

  • dariush
  • dariush's Avatar Topic Author
  • Offline
  • Senior Boarder
More
10 years 3 months ago #3387 by dariush
one more question:

When I work with a frame that based on PBC protein take apart in two pieces, how can I use this script?
I used it and helix stretched between two pieces.

Thanks,
Dariush

Please Log in or Create an account to join the conversation.

More
10 years 3 months ago #3388 by Clement
You need to rework the trajectory with trjconv -pbc nojump first, then trjconv -pbc whole.

A good way is to center the protein in your box and make sure it's not cut through the PBC in your first frame, and rework the trajectory with trjconv -fit based on the centered protein.

Mmmh... Was I clear?

Please Log in or Create an account to join the conversation.

  • dariush
  • dariush's Avatar Topic Author
  • Offline
  • Senior Boarder
More
10 years 3 months ago #3389 by dariush
You are right!
However when box contains bilayer and some other components and you are running for long time, the chance for protein to cross the box edges will be high. In this system "trjconv -pbc nojump" and "trjconv -pbc whole" don't work. It seems dealing with PBC in such a complex systems is though.

Please Log in or Create an account to join the conversation.

More
10 years 3 months ago - 10 years 3 months ago #3390 by Clement
Nonono, it's not complicated. Just long if your trajectory is large. Here's a bash script I use...:

# usage:
# bash recenter.sh TPR XTC

### make index
# first index is the protein + membrane, I don't include water in the recentered trajectory (change the line below)
# second index are the backbone bead of the protein for the fit
echo "1 | 13 | 14 | 15" > options
echo "keep 18" >> options
echo "a BB" >> options
echo "" >> options
echo "q" >> options
make_ndx -f $1 -o ${2%.xtc}.ndx < options
rm options

### remove jumps over pbc
trjconv -f $2 -o recenter_${3%.xtc}_nojump.xtc -s $1 -n ${2%.xtc}.ndx -nice 0 -pbc nojump -ndec 2 -novel <<< "0"

### center protein + bilayer
trjconv -f recenter_${2%.xtc}_nojump.xtc -o recenter_${2%.xtc}_center-protein-bilayer.xtc -s $1 -n ${2%.xtc}.ndx -nice 0 -center -boxcenter rect -ndec 2 -novel <<< "1 0"

### remove the translational movement on the xy plan and put the bilayer back in the box
trjconv -f recenter_${2%.xtc}_center-protein-bilayer.xtc -o recenter_${2%.xtc}_center-protein_nojump_fit-transxy.xtc -s $1 -n ${2%.xtc}.ndx -nice 0 -fit transxy -pbc mol -ndec 2 -novel <<< "1 0"

### fit the rotation around the xy plan
trjconv -f recenter_${2%.xtc}_center-protein_nojump_fit-transxy.xtc -o recenter_${2%.xtc}_center-protein_nojump_fit-transxy+rotxy.xtc -s $1 -n ${2%.xtc}.ndx -nice 0 -fit rotxy+transxy -ndec 2 -novel <<< "1 0"

### final file
mv recenter_${2%.xtc}_center-protein_nojump_fit-transxy+rotxy.xtc ${2%.xtc}_recentered.xtc

### cleaning
rm ${2%.xtc}.ndx recenter_${2%.xtc}*xtc


It recenters the bilayer/membrane along the z-axi of the box, then recenter the protein along the x/y-axes, and finally fit the whole trajectory on the protein, keeping the tilt and undulations of the protein/membrane. Remember it assumes the conformation in your .tpr is centered already... Otherwise you play with your first frame with trjconv/editconf and create a new .tpr with it.
Last edit: 10 years 3 months ago by Clement.

Please Log in or Create an account to join the conversation.

More
10 years 3 months ago #3397 by eprates
Dear all

I have simulated a simpler system, composed of a protein in water. I am facing a similar problem regarding the protein crossing the box edges and appearing as broken in the simulation, even after running “trjconv -pbc nojump” and “trjconv -pbc whole”.

In the first timesteps of my simulation, the protein is centered, but it doesn't take too long time to cross the edges.

I have created the md.ndx file, listing the backbone beads of the protein, then I have run the following commands:
> trjconv -pbc nojump -s md.gro -f md.trr -o nojump-md.trr -n md.ndx

> trjconv -pbc whole -s md.gro -f nojump-md.trr -o whole-md.trr -n md.ndx

but the protein still appears as being broken.
Do you have any hint about something I could be doing wrong?

Should I recenter the protein before using "trjconv -pbc whole"? I appreciate any help!

Regards,
Erica

Please Log in or Create an account to join the conversation.

More
10 years 3 months ago - 10 years 3 months ago #3400 by Clement
Never encountered a problem with the script provided above, IF:
  • the conformation you use as reference isn't broken (and centered) over PBC in the first place (check your md.gro file, or better, provide a .tpr file),
  • you provide the complete trajectory (by that I mean the frames from the moment you start the simulation until the break over PBC have to be present and processed),
  • your protein isn't composed of many subunits (if it is, then create a dummy topology with the complete protein in there; you don't need to define bonds/angles/etc., just the atoms, but as a whole obejct).
Last edit: 10 years 3 months ago by Clement.

Please Log in or Create an account to join the conversation.

More
10 years 3 months ago #3402 by Clement
One last thing: the series of bash commands above are for a MEMBRANE PROTEIN EMBEDDED IN A BILAYER. Remember to tune it, some commands are useless for soluble proteins...

(Sorry, didn't think about that before, and am too lazy to tweak it for you guys now. It's sunday)

Please Log in or Create an account to join the conversation.

More
10 years 3 months ago #3403 by Clement

eprates wrote: Should I recenter the protein before using "trjconv -pbc whole"? I appreciate any help!


Yes you should! ;-)

Please Log in or Create an account to join the conversation.

More
10 years 3 months ago #3415 by eprates
Clement,

Thank you ver much for your quick reply!

The problem is solved.

In fact, when running the command "trjconv -pbc nojump" I was using as first configuration a frame in which the protein was splitted in two pieces. I fixed that and it worked.

Best regards,
Erica

Please Log in or Create an account to join the conversation.

  • dariush
  • dariush's Avatar Topic Author
  • Offline
  • Senior Boarder
More
10 years 3 months ago #3480 by dariush
Clement,

Great! This script is fantastic and solved lots of problems that I had for a long time.

Best,
Dariush

Please Log in or Create an account to join the conversation.

Time to create page: 0.141 seconds