JAL-1620 version bump and release notes
[jalview.git] / examples / embeddedWJmol.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2 <!--
3  * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2b1)
4  * Copyright (C) 2014 The Jalview Authors
5  * 
6  * This file is part of Jalview.
7  * 
8  * Jalview is free software: you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License 
10  * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
11  *  
12  * Jalview is distributed in the hope that it will be useful, but 
13  * WITHOUT ANY WARRANTY; without even the implied warranty 
14  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
15  * PURPOSE.  See the GNU General Public License for more details.
16  * 
17  * You should have received a copy of the GNU General Public License along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
18  * The Jalview Authors are detailed in the 'AUTHORS' file.
19 -->
20 <head>
21   <TITLE>Jalview and Jmol</TITLE>
22   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 
23
24   <link href="css/reset.css" rel="stylesheet" type="text/css" />
25   <link href="css/style.css" rel="stylesheet" type="text/css" />
26   
27   <!--[if IE 6]>
28       <link rel="stylesheet" type="text/css" href="css/ie6.css" />
29       <![endif]-->
30
31   <!--[if IE 7]>
32       <link rel="stylesheet" type="text/css" href="css/ie7.css" />
33       <![endif]-->
34
35   <!-- dd menu -->
36   <script type="text/javascript">
37     <!--
38         var timeout         = 500;
39         var closetimer  = 0;
40         var ddmenuitem      = 0;
41
42         // open hidden layer
43         function mopen(id)
44         { 
45         // cancel close timer
46         mcancelclosetime();
47
48         // close old layer
49         if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
50
51         // get new layer and show it
52         ddmenuitem = document.getElementById(id);
53         ddmenuitem.style.visibility = 'visible';
54
55         }
56         // close showed layer
57         function mclose()
58         {
59         if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
60         }
61
62         // go close timer
63         function mclosetime()
64         {
65         closetimer = window.setTimeout(mclose, timeout);
66         }
67
68         // cancel close timer
69         function mcancelclosetime()
70         {
71         if(closetimer)
72         {
73         window.clearTimeout(closetimer);
74         closetimer = null;
75         }
76         }
77
78         // close layer when click-out
79         document.onclick = mclose; 
80         // -->
81   </script>
82   <script>
83     <!--//--><![CDATA[//><!--
84 var _gaq = _gaq || [];_gaq.push(["_setAccount", "UA-9060947-1"]);_gaq.push(["_trackPageview"]);(function() {var ga = document.createElement("script");ga.type = "text/javascript";ga.async = true;ga.src = ("https:" == document.location.protocol ? "https://ssl" : "http://www") + ".google-analytics.com/ga.js";var s = document.getElementsByTagName("script")[0];s.parentNode.insertBefore(ga, s);})();
85 //--><!]]>
86   </script>
87 <script src="javascript/deployJava.js"></script>
88 <script src="jmol/Jmol.js"></script>
89 <script src="javascript/jquery-1.4.4.min.js"></script>
90 <script src="javascript/jquery.timer.js"></script>
91 <script src="javascript/jquery.blockUI.js"></script>
92 <script src="javascript/jshashtable-2.1.js" language="javascript"></script>
93 <!-- <script src="archive-min.js" language="javascript"></script>
94 -->
95 <script src="javascript/jalview.js" language="javascript"></script>
96 <script language="JavaScript">
97 // instead of this, we use a custom JmolApplet spec
98 // jmolInitialize('jmol');
99 jmolInitialize("","JmolApplet-12.2.4.jar");
100 function genHref()
101 {
102  var s1 = "ml:i@midd..", s2 = "atelcpoueau", s3 = "iomyob.neck", href="";
103  for(i=0; i<11; i++)
104  { href = href + s1.charAt(i) + s2.charAt(i) + s3.charAt(i); 
105  }
106  window.location=href;
107 }
108 </script>
109 <script>
110  var loglevel=1;
111  function dbg(lvl,string) {
112   if (_console && lvl<=loglevel) {_console.value += string + "\n";}
113  }
114  var _lastTime=new Date();
115  var _path;
116  var _datazip;
117  var _zip;
118  var alignA;
119  var alignB;
120  var featuresA;
121  var featuresB;
122  var pairs;
123  var atompairs;
124  var structdata;
125  var jmolview;
126  var jvstructassoc;
127  var modeltofiles = new Array();
128
129  function lJvA() {
130   jvfollower = document.getElementById("jvA");
131   setConsole(document.getElementById("stdout"));
132   
133   sep = jvfollower.getSeparator();
134   //jvapp.setSeparator(""+jvapp.getSeparator());
135   linkJvJmol(jvfollower, "jmolView", modeltofiles);
136  };
137
138  var _jvA=new Object();
139  _jvA.attributes = {
140   code : 'jalview.bin.JalviewLite',
141   archive : 'jalviewApplet.jar',
142   width : '500',
143   height : '350',
144   mayscript : 'True',
145   scriptable: 'True',
146   id : 'jvA'
147  };
148  _jvA.parameters = {
149    java_arguments : "-Xmx256m",
150   externalstructureviewer : "true",
151    oninit : "lJvA",
152   automaticScrolling : "true",
153 //  <!-- defaultColour : "Strand Propensity", -->
154   file : "uniref50_mz.fa",
155   
156   relaxedidmatch : "true",
157   debug : "true",
158   wrap : "false",
159   // separator : "^",
160   showAnnotation : "false",
161   embedded : "true",
162   showFullId : "false",
163   RGB : "F2F2FF",
164   linkLabel_1 : "EMBL-EBI Search",
165   linkUrl_1 : "http://www.ebi.ac.uk/ebisearch/search.ebi?db=allebi&query=$SEQUENCE_ID$"
166   ,
167   linkLabel_2 : "Uniprot"
168   ,
169   linkUrl_2 : "http://www.uniprot.org/uniprot/$SEQUENCE_ID$",
170   APPLICATION_URL : "http://www.jalview.org/services/launchApp",
171   PDBfile : "1gaq.txt FER1_MAIZE",
172   permissions : "sandbox"
173  };
174  jmolSetCallback("hoverCallback","_jmolhover");
175   jmolSetCallback("pickCallback","_jmolpick");
176   modeltofiles+="1gaq.txt";
177 </script>
178
179 </head>
180
181
182 <body>
183
184
185   <div id="header">
186     <div id="logo"><a href="http://www.jalview.org" title="Home"></a></div>
187     <ul id="buttons">
188       <li id="applet"><a href="applets.html" title="applet"></a></li>
189       <li id="desktop"><a href="../webstart/jalview.jnlp" title="desktop"></a></li>
190     </ul>
191   </div>
192
193   
194   <div id ="nav">
195     <div id="navInner">
196
197       <ul id="sddm">
198         <li><a href="http://www.jalview.org">Home</a></li>
199         <li><a href="http://www.jalview.org/about" onmouseover="mopen('m1')" onmouseout="mclosetime()">About</a>
200           <div id="m1" onmouseover="mcancelclosetime()" onmouseout="mclosetime()">
201             <a href="http://www.jalview.org/about/documentation">Documentation</a>
202             <a href="http://www.jalview.org/about/citation">Publications</a>
203             <a href="http://www.jalview.org/about/credits">Credits</a>
204           </div>
205         </li>
206         <li><a href="http://www.jalview.org/faq">FAQ</a></li>
207         <li><a href="http://www.jalview.org/community" onmouseover="mopen('m3')" onmouseout="mclosetime()" class="community">Community</a>
208           <div id="m3" onmouseover="mcancelclosetime()" onmouseout="mclosetime()">
209             <a href="http://www.jalview.org/mailman/listinfo/jalview-announce">News Mailing List</a>
210             <a href="http://www.jalview.org/mailman/listinfo/jalview-discuss">Discussion Mailing List</a>
211             <a href="http://www.jalview.org/community/links">Links</a>
212             <a href="http://www.jalview.org/community/community-news">Community News</a>
213           </div>
214         </li>
215         <li><a href="http://www.jalview.org/development" onmouseover="mopen('m4')" onmouseout="mclosetime()" class="development">Development</a>
216           <div id="m4" onmouseover="mcancelclosetime()" onmouseout="mclosetime()">
217             <a href="http://www.jalview.org/development/release-history">Release History</a>
218             <a href="http://issues.jalview.org">Jalview Bug Tracker</a>
219             <a href="http://source.jalview.org/gitweb/">Jalview Git Web</a>
220             <a href="http://www.jalview.org/development/development-news">Development News</a>
221           </div>
222         </li>
223         <li><a href="http://www.jalview.org/training" onmouseover="mopen('m5')" onmouseout="mclosetime()" class="training">Training</a>
224           <div id="m5" onmouseover="mcancelclosetime()" onmouseout="mclosetime()">
225             <a href="http://www.jalview.org/training/training-courses">Training Courses</a>
226             <a href="http://www.jalview.org/training/training-news">Training News</a>
227           </div>
228         </li>
229         <li><a href="http://www.jalview.org/download" class="download-right">Download</a></li>
230       </ul>
231       <div style="clear:both"></div>
232     </div>
233
234   </div>
235 <div id="pageWrap">
236
237 <div id="sideNav">
238   <ul>
239       <li ><a href="applets.html">JalviewLite Examples</a></li>
240       <li ><a href="jalviewLiteJs.html">Javascript API</a></li>
241       <li ><a href="appletParameters.html">Applet Parameters</a></li>
242       <li ><a href="embedded.html">Embedded Alignment</a></li>
243       <li class="jvlite-nav-small"><a href="embeddedWJmol.html">Jalview and Jmol</a></li>
244       <li ><a href="formComplete.html">Access from Javascript</a></li>
245       <li ><a href="javascriptLaunch.html">Javascript Launch</a></li>
246       <li ><a href="linkedapplets_ng.html">Linked JalviewLites</a></li>
247   </ul>
248 </div>
249
250 <div id="content" class="content">
251
252
253 <!-- boiler plate link to alternate demopage -->
254
255 <div style="width: 100%">
256 <div style="width:35%; align:left; float:right;">
257 <div style="margin:8px; padding:8px; border: 2px solid black; align: center; float:center;">
258  Examples aren't working ?<br/>Try <a href="u_embeddedWJmol.html">the unsigned applet demos</a>
259 </div>
260 <div style="margin:8px; padding:10px; align: left;">
261 <p>Quick Links to jars for example:<br/><a href="jalviewApplet.jar">jalviewApplet.jar</a> and <a href="JmolApplet-12.2.4.jar">JmolApplet.jar</a>
262 </p></div>
263 </div>
264 </div>
265
266 <!-- content template start -->
267 <h2>Structure and Alignment</h2>
268 <p>This demo shows how JalviewLite and Jmol can be integrated with the JalviewLite javascript library.</p>
269 <center>
270  <script>
271   jmolApplet("500x500","zap; load FILE '1gaq.txt'; frame 0; select all; wireframe off; spacefill off; cartoons; restrict; center *; set selectionhalos true;select 0","jmolView");
272  </script>
273  <script>
274   deployJava.runApplet(_jvA.attributes, _jvA.parameters, '1.4');
275  </script>
276 </center>
277 <!-- content template end -->
278
279
280
281 </div> <!-- end content div -->
282
283 </div> <!-- content -->
284 </div> <!-- pagewrap -->
285 <div id ="footer">
286 <div id="innerFooter">
287 <div id="copyright"><p>Published under <a href="http://creativecommons.org/licenses/by-sa/3.0/">CC-SA 3.0</a></p></div>
288 <div id="cite">
289 <p>
290 If you use Jalview in your work, please cite this publication:
291 </p>
292 <br />
293 <p>
294 Waterhouse, A.M., Procter, J.B., Martin, D.M.A, Clamp, M. and Barton, G. J. (2009)
295 "Jalview Version 2 - a multiple sequence alignment editor and analysis workbench"
296 Bioinformatics 25 (9) 1189-1191 <a href="http://dx.doi.org/10.1093/bioinformatics/btp033">doi: 10.1093/bioinformatics/btp033</a>
297 </p>
298 </div>
299 </div>
300 </div>
301 </body>
302 </html>