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