Home
!!!!!!! Scripting is fully functional. If you miss functionality please send suggestions !!
@ christophgil @ googlemail .com

STRAP-scripting language

The STRAP-alignment can be controlled with Web-links. This page explains how scripts are included in Web-pages. An alphabetic list of all script commands is found here.

When a link in this page is clicked, the example proteins are loaded and the script lines are executed in STRAP. Please watch the Web-addresses in the browser's status line when the mouse pointer hovers over the links.

Embedding in forms: The script text and the list of proteins to be loaded are contained in hidden input fields within an html form. The html code looks as follows:
        <form  action="http://www.bioinformatics.org/strap/strap.php"  method="POST"  style="display:inline;" >
          <input  type="hidden"  name="load"       value="List of protein IDs "  >
          <input  type="hidden"  name="script"     value="...the script text..." >
          <input  type="SUBMIT"  name="SUBMIT" value="Click here"  style="display:inline;" >      
        </form>
      
The field with name "load" contains the protein entries to be loaded. Alternatively, the name "align" or "alignAndRearange" can be used. In this case the proteins are aligned after loading. The field with the name "script" contains the script. The script is run after all proteins are loaded. The style attributes prevent line breaks before and after the submit button.
Examples:



Problems: Java-confirmation dialogs might be hidden behind the browser. If the response of the Browser after pressing the link is too slow, then clear the "Downloads" window in the Web-browser. See Bugzilla.

Java-Web-start: STRAP is a Java-Webstart application. It is not available as a so-called web browser embedded because this technology has proven to be inefficient for complex applicatrions like STRAP.

Security: STRAP and included Bioinformatics tools have full access to the user's files. For file modifications, there is an embedded security check which permits modification of files only within the project directory. Please see Security.html. Users may be concerned about running applications on their computer from program authors they do not know. Therefore the STRAP-lite version has been created which does not offer the full functionality for security reasons: It cannot run native code and cannot run Java code unless specified in the jnlp file.

Alignment

The command "close" removes all proteins from the view. The following example links will load a new set of proteins for the commands to act on.


  close *    
Run

  gaps x---xxxxx-xxxxxxxxxxxxxx--------------------xxxxxxxxxxxxxxxxx , subtilisin.pdb     Run
Gaps are inserted into the protein. This may be used to infer the gaps of a multiple sequence alignment that is computed on a server. The gaps are specified by a string of letters and non-letter characters.

  align hslv_ecoli hslv_bacsu hslv_haein     Run
A number of proteins are aligned. If at least two of the proteins have a 3D-structure then 3D-superposition is used to improve the alignment.

  close hslv_bacsu     Run
Removes the protein.

Residue Annotation

  new_selection subtilisin.pdb/myAnnotation1, a_new_group, 10-30,32    
Run
The residue annotation with name "myAnnotation1" is created. The residues are 10-30 and 32. It is found in the node "a_new_group" of the graphical tree. This tree is usually not visible. It becomes visible when the vertical divider located at the very left is dragged to the right.

  new_aminoacid_selection subtilisin.pdb/myAnnotation2, a_new_group, 3:-5:     Run
For pdb-proteins, the residue number can be specified using the Rasmol notation "residue-number:chain". The chain can be left off if there is only one.

  set_annotation subtilisin.pdb/myAnnotation1, Color, #FF0000     Run
  set_annotation subtilisin.pdb/myAnnotation1, Color, #FF00FF     Run
The Color is specified with command set_annotation which is similar to add_annotation (see below). The only difference is that all previous values are removed before adding the new one. The command set_annotation is used when there should only be one annotation with the given key, here "Color".

  add_annotation subtilisin.pdb/myAnnotation1, Balloon, Example of a balloon message which appears when the mouse is over the underlining     Run
The residue selection "myAnnotation1" has been created with the previous commands. If it does not exist, then an error message will appear. Annotated residue selections contain a set of key-value pairs. The keys are "Note", "Balloon", "Color" etc.. The key-value pair ("Balloon","Example of...") is added to the annotation. Double click the annotation or open "View/edit annotation" from the Context-menu to see the stored information.

  add_annotation subtilisin.pdb/myAnnotation1, Balloon, Another line     Run
With add_annotation, more text can be added. Annotations with the key "Balloon" appear in the

  delete subtilisin.pdb/myAnnotation1     Run
Deletes the residue annotation.

Residue Annotation from BioDAS services

  DAS_features CSA%20-%20extended uniprot cbs_total netphos netoglyc , hslv_ecoli     Run
The given DAS services are contacted to obtain the sequence features. The sequence features appear as underlining. The first feature demonstrates of white space within names.

The DAS-features which are shown as underlinings under the sequences can be dragged with the mouse to 3D views like Astex. See below, how to open a 3D-view.

Residue selections and Displaced positions

Consider, the residues 80 to 90 "CLEASGMQCPI" of the protein P29590.
  close *
load UNIPROT:P29590
ants UNIPROT:P29590/80-90
scroll_to UNIPROT:P29590/80-90  
  Run
Now let's load PFAM:PF00097 and highlight these residues in Pfam.
  close *
load PFAM:PF00097
new_aminoacid_selection UNIPROT:P29590/select80_to_90, myTest, 80-90
scroll_to UNIPROT:P29590/80-90  
  Run
However in earlier PFAM-releases the selection, had been displaced by 2 amino acids because it it had been using an earlier UNIPROT version of UNIPROT P29590. This is a rare situation but might occure due to sequence updates in Uniprot entries.
Solution to the Problem: Specification of the sequence object:
  new_aminoacid_selection UNIPROT:P29590/select80_to_90, myTest, REFERENCE=UNIPROT:P29590 80-90     Run

3D

  wire subtilisin.pdb    
Run
  wire subtilisin.pdb PDB:1wmd_A PDB:1v6c_A     Run
The C-Alpha atom trace of the protein structures are shown.

  wire PDB:1v6c_A     Run
Proteins can be specified by name. But they can also be specified by the expression they were loaded with or by an accession or PDB id. In the URL the protein is loaded with "PDB:1v6c_A".

  wire .*pdb     Run
The proteins matching the regular expressions *\.pdb are added to the 3D-view of subtilisin.pdb. If subtilisin.pdb is not yet in a 3D-view, then a new 3D panel is created.

  close_wire *     Run
Closes the C-alpha trace of all proteins.

  project_coordinates PDB:1ned_A , hslv_bacsu
wire hslv_bacsu  
  Run
The Swissprot file hslv_bacsu contains only the amino acid sequence. The 3D-coordinates of PDB:1ned_A will be infered. The PDB-file can refer to the smae protein or to a homologous protein. A sequence alignment algorithm is used for mapping the postition.
  project_coordinates AUTO , hslv_ecoli
wire hslv_ecoli  
  Run
If the pdb ID is not known, "AUTO" indicates that STRAP should automatically search for the best structure. This may even fail. It depends on precomputed blast results.

  superimpose subtilisin.pdb PDB:1wmd_A PDB:1v6c_A
wire subtilisin.pdb PDB:1wmd_A PDB:1v6c_A  
  Run
A number of proteins are superimposed three-dimensionally. The optimal reference structure is selected automatically. After superimposition all but one proteins are in a new coordinate system. The user can restore the original coordinates: Context-menu-of-proteins>3D.

  rotate_translate NULL , subtilisin.pdb PDB:1wmd_A PDB:1v6c_A     Run
Restore original coordinates:



  rotate_translate -0.51 -0.69 0.50 0.22 0.45 0.86 -0.82 0.55 -0.80 91.15 25.13 55.68 , subtilisin.pdb     Run
The rotation matrix (9 numbers) and the translation vector (3 numbers) are applied.
        X' = X *  -0.51 +  Y *  -0.69 +  Z *   0.50 +   91.15
        Y' = Y *   0.22 +  Y *   0.45 +  Z *   0.86 +   25.13
        Z' = Z *  -0.82 +  Y *   0.55 +  Z *  -0.80 +   55.68




  load PDB:1a34
wire PDB:1a34_A  
  Run
  select_3D $ANY_WIRE, PDB:1a34
3D_biomolecule -1  
  Run
  select_3D $ANY_WIRE, PDB:1a34
3D_biomolecule 0x2  
  Run
Show 1 or the respectively. The biological units are given as a decimal or hexadecimal bit masks. For example 0x8 denotes the biological unit 3 since 2^3=8. Also see the BIOMT lines in PDB files.


Multi-Protein-complexes

A protein-complex consist of several peptide chains. If two multimeric proteins are loaded, the script command "superimpose" can not be applied because it would also superimpose non-homologous chains of the same multimeric structure.

For the structural comparison of two protein-complexes the command superimpose_protein_complexes can be used. Now knowledge of which chains are matching is needed.

  load PDB:1scg PDB:1a0r
wire PDB:1scg PDB:1a0r
superimpose_protein_complexes PDB:1scg PDB:1a0r  
 
Run
For superimposing these two heter-trimeric G-proteins, the superpositions of all three chains of PDB:1scg versus the three chains of PDB:1a0r is probed. Comparing the score values of these nine superpositions shows that the chains PDB:1A0R_B PDB:1SCG_B are very similar. Having identified this pair of similar peptide chains, the superposition of the two complexes will be based on these chains.

If it is already known, which chains from either complex are best matching, these chains can be directly superimposed. Then the resulting transformation matrix can be applied to the other chains in the complex using the command rotate_translate_protein_complex.

  superimpose PDB:1SCG_B PDB:1A0R_B     Run
  rotate_translate_protein_complex PDB:1A0R_B , PDB:1A0R_B     Run
  rotate_translate_protein_complex PDB:1SCG_B , PDB:1SCG_B     Run


3D-Viewer

Strap contains full featured 3D-molecule viewers such as OpenAstex.

  open_3D myView , subtilisin.pdb 1wmd.pdb PDB:1v6c_A    
Run
The three proteins (given after the colon) are loaded into the same 3D view. The 3D-view is called "myView". This id will be used in the subsequent commands.

  select_3D myView , subtilisin.pdb
3D_select 20-30,35
3D_spheres on  
  Run
The respective residues are shown as spheres. Residue numbering starts at 1. To refer to the pdb-residue numbering, please use the Rasmol syntax "number-colon-chain". For example "20:A" means amino acid with number 20 in chain A.

  select_3D myView , subtilisin.pdb
3D_select 20-30,35
3D_spheres off  
  Run


  select_3D myView , subtilisin.pdb
3D_select 100-130.CA.CB
3D_spheres on  
  Run
The atoms can be specified. Asterisks are allowed as for example ".N*" denoting all nitrogen atoms.

  select_3D myView , subtilisin.pdb
3D_select 100-120
3D_center  
  Run
Move the view such that the selection is centered in the viewer panel. Otherwise, the change might remain unnoticed when it is beyond the screen border.

There are many other style commands which can be used in this context. See menu of the 3D-view.



  close_3D myView , subtilisin.pdb     Run
Removes a protein from view "myView".

  close_3D myView     Run
Removes the entire 3D-view "myView".

  use_3D_viewer jmol     Run
The prefered 3D-viewer can be selected. The above 3D-commands are viewer-independent and should work more or less with all 3D-programs embedded in STRAP.
  use_3D_viewer astex     Run

  use_3D_viewer pymol     Run


Change order of proteins

  to_row 1, hslv_ecoli    
Run
  to_row 3, hslv_ecoli     Run
  to_row 99 , hslv_ecoli     Run
  to_row hslv_haein , hslv_ecoli     Run
  below_row hslv_haein , hslv_ecoli     Run
  to_row 2, hslv_ecoli hslv_haein hslv_bacsu     Run
Move the given protein to the given row. A row can be defined by a number or indirectly by another protein.

  hide subtilisin.pdb     Run
The protein is not shown in the alignment but it remains loaded. To access hidden proteins open the vertical divider which is at the left edge of the STRAP panel.

  unhide subtilisin.pdb     Run
Show the protein again.

  hide *     Run
  unhide *     Run

Navigation

  scroll_to hslv_ecoli/150-170    
Run
  scroll_to hslv_ecoli/20-30     Run
The alignment is scrolled so that amino acids 20-30 of protein hslv_ecoli is visible. If more than one item is given, then the program tries to find a scroll position where all items are visible.

  scroll_to PDB:1v6c_A     Run
  scroll_to hslv_bacsu     Run
If the vertical scroll bar is visible, the alignment is scrolled so that protein hslv_ecoli is visible. The horizontal scroll position remains unchanged.

  scroll_to subtilisin.pdb/274:A     Run
  scroll_to subtilisin.pdb/20:A     Run
Using the Rasmol notation "residue-number:chain".

  scroll_to subtilisin.pdb/myAnnotation1     Run
The alignment is scrolled so that the given selection is visible.

  cursor hslv_ecoli/20     Run
  cursor hslv_ecoli/30     Run
The alignment cursor is set to the given amino acid.

Selecting proteins and residue selections

  select hslv_ecoli subtilisin.pdb/myAnnotation1 subtilisin.pdb/myAnnotation2    
Run
The given protein and the given residue selections are selected. The residue selections are surrounded by marching ants.

  select *     Run
All proteins are selected.

  select hslv.*     Run
Regular expression matching is activated if an asterisk or a square bracket occurs in the text.

  select subtilisin.pdb/*     Run
All residue selections of this protein are selected.

  select subtilisin.pdb/myA.*     Run
myAnnotation1 and myAnnotation2 is matching.

  unselect *     Run
Unselect all proteins.

  unselect */*     Run
Unselect all residue selections.

  ants hslv_ecoli/20-30 subtilisin.pdb/myAnnotation1     Run
A ants is drawn encompassing all given residue annotations and amino acids.

Nucleotide Reading Frame

  cds 1 , M57965    
Run
Use the first CDS of the EMBL or GenBank file.

  cds join(10..20,30..40) , M57965     Run
  cds complement(join(10..20,30..40)) , M57965     Run
Apply the given coding sequence for translation into amino acids.

  cds 1 , M57965     Run
  new_nucleotide_selection M57965/myNucleotides , a_new_group, 5731-5750     Run
The "new_nucleotide_selection" command works the same as "new_aminoacid_selection" with the difference, that the positions refer to the nucleotide sequence.

Animations

  new_aminoacid_selection hslv_ecoli/myAnnot, a_new_group, 10-20
scroll_to hslv_ecoli/myAnnot
mseconds 1000 set_annotation hslv_ecoli/myAnnot, Color, #0000FF
mseconds 2000 set_annotation hslv_ecoli/myAnnot, Color, #FF0000
mseconds 3000 set_annotation hslv_ecoli/myAnnot, Color, #FFFF00
mseconds 4000 set_annotation hslv_ecoli/myAnnot, Color, #00FF00  
 
Run

Icons for proteins and for residue selections

  new_aminoacid_selection subtilisin.pdb/myAnnotation1, a_new_group, 10-30,32
icon http://www.goldenweb.it/software/immagini/icone/animals/insects/Bee.gif , subtilisin.pdb/myAnnotation1  
 
Run
  icon NULL ,subtilisin.pdb     Run
Removes an icon.

  icon http://www.goldenweb.it/software/immagini/icone/animals/insects/Bee.gif , subtilisin.pdb     Run
Sets a protein icon.

External applications

Depending on the security settings, STRAP may start external applications.   seqvista M57965
iconify  
 
Run
Loads a nucleotide file in EMBO or Genbank format into SeqVista and hides the STRAP window. Sequista cannot be used in Strap-Lite version yet.

  jalview *     Run
Loads the specified proteins into Jalview.

  spice hslv_ecoli     Run
Loads the specified protein into Spice.

Accession-IDs

Accession-IDs and cross references act as references to protein database entries. They are listed in the balloon texts of the protein labels. These balloon texts appear when the mouse is over the left edge of the protein label. Read the balloon texts to observe the effect of the commands above. These database IDs allow to obtain additional information from Web-resources such as sequence features like phosphorylation sites, active sites and signal peptides. Further they are used for forming Web links. A list of Web links can be obtained by clicking the left part of a protein label in the row-header of the alignment.

  accession_id SWISS:HSLV_ECOLI , hslv_ecoli     Run
  accession_id UNIPROT:P0A7B8 , hslv_ecoli     Run
  accession_id UNIPROT:P12883 , M57965     Run
  remove_xref PDB:1NED , hslv_ecoli     Run
  add_xref PDB:1NED , hslv_ecoli     Run
In case of errorneous PDB reference. Wrong PDB will be noticed at least when it is used to assiociate a 3D-structure by the bad alignment.

  add_xref PDB:1RYP:F , M57965     Run

Test your own script lines