File: index.html

package info (click to toggle)
pymol 3.1.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 74,084 kB
  • sloc: cpp: 482,660; python: 89,328; ansic: 29,512; javascript: 6,792; sh: 84; makefile: 25
file content (109 lines) | stat: -rw-r--r-- 3,217 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<html>
<head>
<meta http-equiv="Pragma" content="no-cache"/>
<meta http-equiv="Cache-Control" content="no-cache"/>
<meta http-equiv="Expires" content="-1" />
<title>Web Services - Sample 15: Launching PyMOL on Demand</title>

<style><!--
a{text-decoration:none;
  padding: 1px;
  background-color: #dddddd}
--></style>

<script src="json2.js"></script> 
<script src="pymol.js"></script>

<script type="text/javascript">

var pymol8085 = new PyMOL('localhost', 8085, 'on');

var pymol8086 = new PyMOL('localhost', 8086, 'on');

function launchPymol(port) {
  var iframe = document.getElementById("iframe"+port);
  iframe.src = "start"+port+".pwg";
}

function quitPymol(port) {
  var iframe = document.getElementById("iframe"+port);
  iframe.src = "http://localhost:"+port+"/apply/_quit";
}

function usePymol8085() {
  pymol8085.cmd.reinitialize();
  pymol8085.cmd.load("$PYMOL_PATH/test/dat/1tii.pdb");
  pymol8085.cmd.show_as("cartoon");
  pymol8085.flush();
}

function usePymol8086() {
  pymol8086.cmd.reinitialize();
  pymol8086.cmd.load("$PYMOL_PATH/test/dat/il2.pdb");
  pymol8086.cmd.show_as("cartoon");
  pymol8086.flush();
}

</script>

</head>
<body>

<h3>Web Services - Sample 15: Launching PyMOL on Demand</h3>


<a href="javascript:window.close()">Close Window</a> (FireFox only: <a href="javascript:void(0)" onclick="window.open('view-source:' + location.href)">view page source</a>)

<p>So far, all of the examples have launched PyMOL at the time the web
page was opened.  However, this isn't necessary: with a multi-origin
application, or or more instances of PyMOL can be launched on demand,
each on its own port, simply by populating an IFRAME with a PWG
file.</p>

<pre>
<a href="javascript:launchPymol(8085)">launchPymol(8085)</a>  <a href="javascript:launchPymol(8086)">launchPymol(8086)</a> 


 <a href="javascript:usePymol8085()">usePymol8085()</a>     <a href="javascript:usePymol8086()">usePymol8086()</a>


<a href="javascript:quitPymol(8085)">quitPymol(8085)</a>    <a href="javascript:quitPymol(8086)">quitPymol(8086)</a> 
</pre>

<p>In addition launching multiple simultaneous PyMOL instances, this
sample application also demonstrates the use of the "options" keyword
in the associated PWG files, which is being used to modify the startup
configuration of PyMOL so as to launch as a simple 3D viewer window.
A restricted subset of standard PyMOL command-line arguments are
available for such customization tasks.  For information on launch options,
please refer to the <a href="http://pymol.org/dsc/dokuwiki/doku.php?id=launch">Official
PyMOL Documentation</a>.</p>

<p>startup8085.pwg</p>

<pre>
port 8085
options -qxie -F 0 -X 10 -Y 50 -W 250 -H 250 
</pre>

<p>startup8085.pwg</p>
<pre>
port 8086
options -qxi -F 0 -X 10 -Y 350 -W 250 -H 250
</pre>

<!-- the only purpose of these IFRAMEs is to launch PyMOL via the PWG
  -- helper mechanism -->

<iframe src="" id="iframe8085" name="iframe8085" onLoad=""
 width="0" height="0" frameborder="0"
 marginheight="0" marginwidth="0"
 scrolling="auto"></iframe>

<iframe src="" id="iframe8086" name="iframe8086" onLoad=""
 width="0" height="0" frameborder="0"
 marginheight="0" marginwidth="0"
 scrolling="auto"></iframe>

</body>
</html>