normal Multiple Molecule Visualization

  • luongsh
  • luongsh's Avatar Topic Author
  • Offline
  • Fresh Boarder
More
8 years 7 months ago #4888 by luongsh
Multiple Molecule Visualization was created by luongsh
Hello,

I am using Martini to run a 50 identical molecule simulation. I used VMD to visualize the system. In order to distinguish different molecules, I had to create 50 representation with different color for each molecule.

My question is that is there any other methods or tool that I can use for a system consisting of multiple identical molecules?

Thank you

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

More
8 years 6 months ago #4989 by mnmelo
Replied by mnmelo on topic Multiple Molecule Visualization
Hi,

I believe with VMD you can color by residue. If your molecules are one residue each, then this should already solve your problem.
(The most obvious way would be to color by fragment, which VMD also does, but since it typically can't detect Martini-length bonds this fails).

If you have multi-residue molecules you can make an .itp just for visualization purposes where all atoms in a molecule belong to residue 1. If you then generate a .tpr and extract a .gro from that (using editconf) again you should have your problem solvable by coloring by residue.
(This solution applies to GROMACS. You'll have to adapt to other simulation software).

Finally, VMD can be scripted in either tcl or python, and generating multiple representations doesn't seem a very hard task to script.

I'm not entirely sure if you'll be limited by the number of available colors, but you can also use the occupancy or beta fields of a PDB file to convey molecule number, which will then be colored on a color gradient (tune it in Graphics->Colors->Color Scale). You need only generate a suitable PDB file (maybe even from converting a .gro file and copying over the resnumber column to the beta or occupancy one).
If you go the scripting route VMD also allows you to assign values to a 'user' variable, which will also be colored on a gradient.

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

  • luongsh
  • luongsh's Avatar Topic Author
  • Offline
  • Fresh Boarder
More
8 years 6 months ago #5019 by luongsh
Replied by luongsh on topic Multiple Molecule Visualization
Thanks,
I was able to write a tcl script to create 50 representations, each contain 1 molecular with different color

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

More
8 years 6 months ago #5028 by mnmelo
Replied by mnmelo on topic Multiple Molecule Visualization
That's great!

If it's not too much trouble, could you post here your code snippet, for future reference?

Cheers,
Manel

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

  • luongsh
  • luongsh's Avatar Topic Author
  • Offline
  • Fresh Boarder
More
8 years 6 months ago - 8 years 6 months ago #5034 by luongsh
Replied by luongsh on topic Multiple Molecule Visualization
This is the description and the script I wrote:

I want to investigate how 50 protein molecules assemble so I use gromacs to create 50 copies of a protein in a box. Each molecule contain 65 coarse grain atoms after using "martinized script". For better visualization, I wrote a tcl script to color each molecule with a different color. Basically, the script creates 50 representations. In each representation, it display the specific index for a single molecule and choose a color for it. We can manually do it but it take lots of time if we have multiple simulations.
I am only 3 months old in gromacs so please don't laugh if I do something not so intelligent.

set color 0  				; # initiate the index of color
set index 1  				; # initiate the index of each representation
set begin 0  				; # initiate the index of the first residue of a molecule
set end   64 				; # initiate the index of the last residue of a molecule
	
for {set i 0} {$i < 50} {incr i} {
	mol color ColorID $color 					; # choose a color for a representation
	mol addrep top 							; # add a representation 	 			
	mol modselect $index top "index $begin to $end"			; # choose to display only selected atoms for each representation
	mol modstyle $index top VDW					; # change the drawing style to VDW			
	set begin [expr {$begin + 65}] 					; # reassign the index for the first residue for the next molecule
	set end [expr {$end + 65}]  					; # reassign the index for the last residue for the next molecule
	set index [expr {$index + 1}] 				
		if {$color < 32} {set color [expr {$color + 1}]} else {set color 0}	
	
}

mol delrep 0 top
Last edit: 8 years 6 months ago by mnmelo. Reason: Code formatting

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

More
8 years 6 months ago #5041 by mnmelo
Replied by mnmelo on topic Multiple Molecule Visualization
Big thanks!
(I edited your reply to have neatly formatted code.)

Cheers,
Manel

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

Time to create page: 0.094 seconds