Secondary Structure ******************* The selection of output files for this tutorial is available from the `MartiniGlass examples folder `_. Step 1: Martinize your protein ============================== .. note:: Note that to run the command below as is, `MDTraj `_ must be installed as a dependency of vermouth for the secondary structure to be properly assigned. Create a martini model of a protein following the standard martinize2 protocol: .. code-block:: $ wget https://files.rcsb.org/download/1ubq.pdb $ grep "^ATOM" 1ubq.pdb > 1UBQ_clean.pdb $ martinize2 -f 1UBQ_clean.pdb -x cg.pdb -o topol.top -elastic -dssp These commands: 1. Download a 1ubq.pdb from the protein database 2. Prepare it to be martinized 3. Create a coarse grained model of the protein From this, you should expect the following files: * ``1UBQ_cg.pdb``: a pdb file with the coordinates of the coarse grained beads * ``topol.top``: a gromacs topology file describing your system. * ``molecule.itp``: the coarse grained topology of the 1ubq protein Without any further additions, ``topol.top`` only contains a single copy of your protein. Step 2: Run MartiniGlass ======================== The system is now ready to be processed by MartiniGlass. In this case, we have: * a protein with an elastic network * the strength of the elastic network of the protein is 700 kJ/mol/nm^2. Therefore, the command we need to process with MartiniGlass is: .. code-block:: $ martiniglass -p topol.top -el -vf This will generate the following files describing your system: * ``molecule_0_surplus_en.txt``: bonds which VMD will not be able to visualise * ``molecule_0_en.itp``: the elastic network of the protein * ``molecule_0_vis.itp``: the direct bonded topology of the protein * ``en.top``: a topology file for the elastic networks of the system * ``vis.top``: a topology file for the direct bonded networks of the system * ``molecule_0_cgsecstruct.txt``: a text file containing commands to illustrate secondary structure for molecule_0. Regarding the contents of ``molecule_0_surplus_en.txt``, VMD is not able to draw > 12 bonds between atoms in a system. Because of the way elastic networks are generated by Martinize2, such features are a relatively common occurance. Therefore, when MartiniGlass discovers beads with > 12 bonds attached to them, they are edited such that some are removed so dynamic visualisation is possible. This problem is discussed further in :doc:`elastic_networks`. Alongside these file, several files have been written to enable the topology to be loaded into VMD through the use of the ``-vf`` (Visualisation Files) flag: * ``vis.vmd``: VMD visualisation state file * ``cg_bonds-v6.tcl``: vmd commands to draw bonds between atoms * ``eigen.py``: auxiliary python script required by ``cg_bonds-v6.tcl`` The last of these files is particularly important for visualising secondary structure, as it ensures that geometric objects to indicate helices and sheets are correctly oriented. Step 3: Loading your system in VMD ==================================== Step 3a: Loading the initial system ----------------------------------- To fully view an elastic network in VMD using the files provided, the system needs to be loaded twice in VMD. 1. Load the system in VMD from the command line using the visualisation state file provided: .. code-block:: $ vmd 1UBQ_cg.pdb -e vis.vmd This will load your system into VMD using the suggested visualisation mode. ``vis.vmd`` includes commands that will: * Load the commands described in ``cg_bonds-v6.tcl`` * Read in the visualisation topology described in ``vis.top`` for your system. The image in VMD you now see should look something like this .. image:: https://github.com/user-attachments/assets/a6cc8be9-e0dc-48ee-92b8-c7324ec2267c where the backbone of the protein has been rendered as a continuous object. At this point, the user has one of two options to render secondary structure, which are described in the ``molecule_0_cgsecstruct.txt`` file written by MartiniGlass Step 3b: Rendering secondary structure with objects --------------------------------------------------- Rendering secondary structure as objects will insert cylinders where there are helices, and arrows where there are sheets. The commands to draw these objects are the first commands described in the text file: .. code-block:: % cg_helix {{22 34} {37 40} {56 59}} -hlxcolor "purple" -hlxfilled yes -hlxrad 3 -hlxmethod cylinder -hlxmat "AOChalky" -hlxres 50 % cg_sheet {{1 7} {11 16} {40 45} {65 71}} -shtfilled "yes" -shtmat "AOChalky" -shtres 50 -shtcolor "red" -shtmethod flatarrow -shtarrwidth 5 -shtheadsize 10 -shtarrthick 3 -shtsides "sharp" these commands are executed in the Tk Console of VMD. Secondly, so that the backbone licorice visualisation is not superimposed over or under the objects, the next line in the text file may be included as a new representation in VMD: .. code-block:: name BB and not ((resid > 22 and resid < 34) or (resid > 37 and resid < 40) or (resid > 56 and resid < 59) or (resid > 1 and resid < 7) or (resid > 11 and resid < 16) or (resid > 40 and resid < 45) or (resid > 65 and resid < 71)) These steps should then result in the input structure now looking as so: .. image:: https://github.com/user-attachments/assets/aa3e9ba2-5536-4259-acc6-8b0f88e18247 Step 3c: Rendering secondary structure with colour --------------------------------------------------- If you have just completed the previous step, the way to clear the geometry objects after drawing is using the ``cg_dag`` (delete all graphics) command in the VMD Tk Console. Instead of using geometry objects, the structured regions may instead be indicated by colour. The last two lines in the ``molecule_0_cgsecstruct.txt`` file provided may be used for this purpose, which provide selections that can then be uniquely coloured to indicate secondary structure. Simply add them to the list of representations in the Graphics menu of VMD: .. code-block:: name BB and ((resid > 22 and resid < 34) or (resid > 37 and resid < 40) or (resid > 56 and resid < 59)) name BB and ((resid > 1 and resid < 7) or (resid > 11 and resid < 16) or (resid > 40 and resid < 45) or (resid > 65 and resid < 71)) Together with the default representation of BB atoms in the system, the image will now look something like the following (radii may need to be adjusted): .. image:: https://github.com/user-attachments/assets/0ec3e915-9fd3-45d7-9fe3-c8bc9158e826