~ubuntu-branches/ubuntu/quantal/genometools/quantal-backports

« back to all changes in this revision

Viewing changes to www/genometools.org/htdocs/examples_tmpl.html

  • Committer: Package Import Robot
  • Author(s): Sascha Steinbiss
  • Date: 2012-07-09 14:10:23 UTC
  • Revision ID: package-import@ubuntu.com-20120709141023-juuu4spm6chqsf9o
Tags: upstream-1.4.1
ImportĀ upstreamĀ versionĀ 1.4.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
 
2
<html>
 
3
<head>
 
4
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
 
5
<title>The AnnotationSketch module</title>
 
6
<link rel="stylesheet" type="text/css" href="style.css">
 
7
</head>
 
8
<body>
 
9
<div id="menu">
 
10
<ul>
 
11
<li><a href="index.html">Overview</a></li>
 
12
<li><a href="pub/">Download</a></li>
 
13
<li><a href="cgi-bin/gitweb.cgi?p=genometools.git;a=summary">Browse source</a></li>
 
14
<li><a href="mailman/listinfo/gt-users">Mailing list</a></li>
 
15
<li><a href="http://genometools.lighthouseapp.com/">Issue tracker</a></li>
 
16
<li><a href="design.html">Design</a></li>
 
17
<li><a href="libgenometools.html">C API</a></li>
 
18
<li><a href="docs.html"><tt>gtscript</tt> docs</a></li>
 
19
<li><a href="annotationsketch.html"><tt>AnnotationSketch</tt></a></li>
 
20
  <ul class="submenu">
 
21
    <li><a href="annotationsketch.html#collapsing">Collapsing</a></li>
 
22
    <li><a href="annotationsketch.html#styles">Styles</a></li>
 
23
    <li><a href="trackselectors.html">Track assignment</a></li>
 
24
    <li><a href="customtracks.html">Custom tracks</a></li>
 
25
    <li><a href="annotationsketch.html#gtsketch">The <tt>gt sketch</tt> tool</a></li>
 
26
    <li><a id="current" href="examples.html">Code examples</a></li>
 
27
    <li><a href="cgi-bin/annotationsketch_demo.cgi">Try it online</a></li>
 
28
    <li><a href="libgenometools.html">API reference</a></li>
 
29
  </ul>
 
30
<li><a href="/cgi-bin/gff3validator.cgi">GFF3 validator</a></li>
 
31
<li><a href="license.html">License</a></li>
 
32
</ul>
 
33
</div>
 
34
 
 
35
 
 
36
<div id="main">
 
37
<h1><em>AnnotationSketch</em> code examples</h1>
 
38
 
 
39
<a name="examples-parsed"></a>
 
40
<h2>Using <em>AnnotationSketch</em> to draw annotations from a file</h2>
 
41
The following code examples (in C and Lua) illustrate how to produce an image from a given GFF3 file using <em>AnnotationSketch</em>. The result is shown in Fig. <a href="#fig7">7</a>. In essence, these code examples implement something like a simple version of the <tt>gt sketch</tt> tool from <em>GenomeTools</em> without most command-line options.
 
42
<div class="figure">
 
43
  <p><a name="fig7"></a><img src="images/parsed.png" alt="[Example rendering from parsed GFF3 file]"></p>
 
44
  <p><b>Figure 7: </b>Example rendering of a GFF3 file with default style.</p>
 
45
</div>
 
46
 
 
47
<h4>C code</h4>
 
48
(See <a href="http://genometools.org/cgi-bin/gitweb.cgi?p=genometools.git;a=blob_plain;f=src/examples/sketch_parsed.c;hb=HEAD"><tt>src/examples/sketch_parsed.c</tt></a> in the source distribution.)
 
49
<pre class="code">
 
50
<!--#include file="src/examples/sketch_parsed.c"-->
 
51
</pre>
 
52
 
 
53
<h4>Lua code</h4>
 
54
(See <a href="http://genometools.org/cgi-bin/gitweb.cgi?p=genometools.git;a=blob_plain;f=gtscripts/sketch_parsed.lua;hb=HEAD"><tt>gtscripts/sketch_parsed.lua</tt></a> in the source distribution. This example can be run by the command line <tt>gt gtscripts/sketch_parsed.lua &lt;style_file&gt; &lt;PNG_file&gt; &lt;GFF3_file&gt;</tt>)
 
55
<pre class="code">
 
56
<!--#include file="gtscripts/sketch_parsed.lua"-->
 
57
</pre>
 
58
 
 
59
<h4>Ruby code</h4>
 
60
(See <a href="http://genometools.org/cgi-bin/gitweb.cgi?p=genometools.git;a=blob_plain;f=gtruby/sketch_parsed.rb;hb=HEAD"><tt>gtruby/sketch_parsed.rb</tt></a> in the source distribution.)
 
61
<pre class="code">
 
62
<!--#include file="gtruby/sketch_parsed.rb"-->
 
63
</pre>
 
64
 
 
65
<h4>Python code</h4>
 
66
(See <a href="http://genometools.org/cgi-bin/gitweb.cgi?p=genometools.git;a=blob_plain;f=gtpython/sketch_parsed.py;hb=HEAD"><tt>gtpython/sketch_parsed.py</tt></a> in the source distribution.)
 
67
<pre class="code">
 
68
<!--#include file="gtpython/sketch_parsed.py"-->
 
69
</pre>
 
70
 
 
71
 
 
72
<a name="examples-generated"></a>
 
73
<h2>Using <em>AnnotationSketch</em> to draw user-generated annotations</h2>
 
74
The following C code example illustrates how to produce an image from annotation graphs created by user code.
 
75
 The result is shown in Fig. <a href="#fig8">8</a>.
 
76
<div class="figure">
 
77
  <p><a name="fig8"></a><img src="images/constructed.png" alt="[Example rendering from user-generated annotations]"></p>
 
78
  <p><b>Figure 8: </b>Example rendering of user-generated annotations with default style.</p>
 
79
</div>
 
80
 
 
81
<h4>C code</h4>
 
82
(See <a href="http://genometools.org/cgi-bin/gitweb.cgi?p=genometools.git;a=blob_plain;f=src/examples/sketch_constructed.c;hb=HEAD"><tt>src/examples/sketch_constructed.c</tt></a> in the source distribution.)
 
83
<pre class="code">
 
84
<!--#include file="src/examples/sketch_constructed.c"-->
 
85
</pre>
 
86
 
 
87
<h4>Lua code</h4>
 
88
(See <a href="http://genometools.org/cgi-bin/gitweb.cgi?p=genometools.git;a=blob_plain;f=gtscripts/sketch_constructed.lua;hb=HEAD"><tt>gtscripts/sketch_constructed.lua</tt></a> in the source distribution.  This example can be run by the command line <tt>gt gtscripts/sketch_constructed.lua &lt;style_file&gt; &lt;PNG_file&gt;</tt>)
 
89
<pre class="code">
 
90
<!--#include file="gtscripts/sketch_constructed.lua"-->
 
91
</pre>
 
92
 
 
93
<h4>Ruby code</h4>
 
94
(See <a href="http://genometools.org/cgi-bin/gitweb.cgi?p=genometools.git;a=blob_plain;f=gtruby/sketch_constructed.rb;hb=HEAD"><tt>gtruby/sketch_constructed.rb</tt></a> in the source distribution.)
 
95
<pre class="code">
 
96
<!--#include file="gtruby/sketch_constructed.rb"-->
 
97
</pre>
 
98
 
 
99
<h4>Python code</h4>
 
100
(See <a href="http://genometools.org/cgi-bin/gitweb.cgi?p=genometools.git;a=blob_plain;f=gtpython/sketch_constructed.py;hb=HEAD"><tt>gtpython/sketch_constructed.py</tt></a> in the source distribution.)
 
101
<pre class="code">
 
102
<!--#include file="gtpython/sketch_constructed.py"-->
 
103
</pre>
 
104
 
 
105
<div id="footer">
 
106
Copyright &copy; 2007-2011 Sascha Steinbiss. Last update: 2011-02-11
 
107
</div>
 
108
</div>
 
109
<!-- Piwik -->
 
110
<script type="text/javascript">
 
111
var pkBaseURL = (("https:" == document.location.protocol) ?  "https://gremme.org/piwik/" : "http://gremme.org/piwik/");
 
112
document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
 
113
</script><script type="text/javascript">
 
114
try {
 
115
var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 5);
 
116
piwikTracker.trackPageView();
 
117
piwikTracker.enableLinkTracking();
 
118
} catch( err ) {}
 
119
</script><noscript><p><img src="http://gremme.org/piwik/piwik.php?idsite=5" style="border:0" alt="" /></p></noscript>
 
120
<!-- End Piwik Tracking Tag -->
 
121
</body>
 
122
</html>