Sophie

Sophie

distrib > Mandriva > 2008.1 > x86_64 > by-pkgid > c122914cc03e0ea180f78916e4546128 > files > 145

perl-AcePerl-1.91-2mdv2008.1.x86_64.rpm

<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Ace::Graphics::Track - PNG graphics of Ace::Sequence::Feature objects</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rev="made" href="mailto:root@localhost" />
</head>

<body style="background-color: white">


<!-- INDEX BEGIN -->
<div name="index">
<p><a name="__index__"></a></p>
<!--

<ul>

	<li><a href="#name">NAME</a></li>
	<li><a href="#synopsis">SYNOPSIS</a></li>
	<li><a href="#description">DESCRIPTION</a></li>
	<li><a href="#methods">METHODS</a></li>
	<ul>

		<li><a href="#constructors">CONSTRUCTORS</a></li>
		<li><a href="#object_methods">OBJECT METHODS</a></li>
		<li><a href="#accessors">ACCESSORS</a></li>
		<li><a href="#internal_methods">INTERNAL METHODS</a></li>
	</ul>

	<li><a href="#bugs">BUGS</a></li>
	<li><a href="#see_also">SEE ALSO</a></li>
	<li><a href="#author">AUTHOR</a></li>
</ul>

-->


</div>
<!-- INDEX END -->

<p>
</p>
<h1><a name="name">NAME</a></h1>
<p>Ace::Graphics::Track - PNG graphics of Ace::Sequence::Feature objects</p>
<p>
</p>
<hr />
<h1><a name="synopsis">SYNOPSIS</a></h1>
<pre>
  use Ace::Sequence;
  use Ace::Graphics::Panel;</pre>
<pre>
  my $db     = Ace-&gt;connect(-host=&gt;'brie2.cshl.org',-port=&gt;2005) or die;
  my $cosmid = Ace::Sequence-&gt;new(-seq=&gt;'Y16B4A',
                                  -db=&gt;$db,-start=&gt;-15000,-end=&gt;15000) or die;</pre>
<pre>
  my @transcripts = $cosmid-&gt;transcripts;</pre>
<pre>
  my $panel = Ace::Graphics::Panel-&gt;new(
                                      -segment =&gt; $cosmid,
                                      -width  =&gt; 800
                                     );</pre>
<pre>
  my $track = $panel-&gt;add_track('transcript'
                                -fillcolor =&gt;  'wheat',
                                -fgcolor   =&gt;  'black',
                                -bump      =&gt;  +1,
                                -height    =&gt;  10,
                                -label     =&gt;  1);
  foreach (@transcripts) {
     $track-&gt;add_feature($_);
  }</pre>
<pre>
  my $boxes = $panel-&gt;boxes;
  print $panel-&gt;png;</pre>
<p>
</p>
<hr />
<h1><a name="description">DESCRIPTION</a></h1>
<p>The Ace::Graphics::Track class is used by Ace::Graphics::Panel to lay
out a set of sequence features using a uniform glyph type. You will
ordinarily work with panels rather than directly with tracks.</p>
<p>
</p>
<hr />
<h1><a name="methods">METHODS</a></h1>
<p>This section describes the class and object methods for
Ace::Graphics::Panel.</p>
<p>
</p>
<h2><a name="constructors">CONSTRUCTORS</a></h2>
<p>There is only one constructor, the <a href="#new"><code>new()</code></a> method.  It is ordinarily
called by Ace::Graphics::Panel, and not in end-developer code.</p>
<dl>
<dt><strong><a name="new" class="item">$track = Ace::Graphics::Track-&gt;<code>new($glyph_name,$features,@options)</code></a></strong>

<dd>
<p>The <a href="#new"><code>new()</code></a> method creates a new track object from the provided glyph
name and list of features.  The arguments are similar to those in
Ace::Graphics::Panel-&gt;<a href="#new"><code>new()</code></a>.</p>
</dd>
<dd>
<p>If successful <a href="#new"><code>new()</code></a> will return a new Ace::Graphics::Track.
Otherwise, it will return undef.</p>
</dd>
<dd>
<p>If the specified glyph name is not a valid one, <a href="#new"><code>new()</code></a> will throw an
exception.</p>
</dd>
</li>
</dl>
<p>
</p>
<h2><a name="object_methods">OBJECT METHODS</a></h2>
<p>Once a track is created, the following methods can be invoked.</p>
<dl>
<dt><strong><a name="add_feature" class="item">$track-&gt;<code>add_feature($feature)</code></a></strong>

<dd>
<p>This adds a new feature to the track.  The feature can either be a
single object that implements the Bio::SeqFeatureI interface (such as
an Ace::Sequence::Feature or Das::Segment::Feature), or can be an
anonymous array containing a set of related features.  In the latter
case, the track will attempt to keep the features in the same
horizontal band and will not allow any other features to overlap.</p>
</dd>
</li>
<dt><strong><a name="add_group" class="item">$track-&gt;<code>add_group($group)</code></a></strong>

<dd>
<p>This behaves the same as <a href="#add_feature"><code>add_feature()</code></a>, but requires that its argument
be an array reference containing a list of grouped features.</p>
</dd>
</li>
<dt><strong><a name="draw" class="item">$track-&gt;<code>draw($gd,$left,$top)</code></a></strong>

<dd>
<p>Render the track on a previously-created GD::Image object.  The $left
and $top arguments indicate the position at which to start rendering.</p>
</dd>
</li>
<dt><strong><a name="boxes" class="item">$boxes = $track-&gt;<code>boxes($left,$top)</code></a></strong>

<dt><strong>@boxes = $track-&gt;<code>boxes($left,$top)</code></strong>

<dd>
<p>Return an array of array references indicating glyph coordinates for
each of the render features.  $left and $top indicate the offset for
the track on the image plane.  In a scalar context, this method
returns an array reference of glyph coordinates.  In a list context,
it returns the list itself.</p>
</dd>
<dd>
<p>See Ace::Graphics::Panel-&gt;<a href="#boxes"><code>boxes()</code></a> for the format of the result.</p>
</dd>
</li>
</dl>
<p>
</p>
<h2><a name="accessors">ACCESSORS</a></h2>
<p>The following accessor methods provide access to various attributes of
the track object.  Called with no arguments, they each return the
current value of the attribute.  Called with a single argument, they
set the attribute and return its previous value.</p>
<p>Note that in most cases you must change attributes before the track's
<a href="#layout"><code>layout()</code></a> method is called.</p>
<pre>
   Accessor Name      Description
   -------------      -----------</pre>
<pre>
   scale()            Get/set the track scale, measured in pixels/bp
   lineheight()       Get/set the height of each glyph, pixels
   width()            Get/set the width of the track
   bump()             Get/set the bump direction</pre>
<p>
</p>
<h2><a name="internal_methods">INTERNAL METHODS</a></h2>
<p>The following methods are used internally, but may be useful for those
implementing new glyph types.</p>
<dl>
<dt><strong><a name="layout" class="item">$glyphs = $track-&gt;layout</a></strong>

<dd>
<p>Layout the features, and return an anonymous array of
Ace::Graphics::Glyph objects that have been created and correctly
positioned.</p>
</dd>
<dd>
<p>Because layout is an expensive operation, calling this method several
times will return the previously-cached result, ignoring any changes
to track attributes.</p>
</dd>
</li>
<dt><strong><a name="height" class="item">$height = $track-&gt;height</a></strong>

<dd>
<p>Invokes <a href="#layout"><code>layout()</code></a> and returns the height of the track.</p>
</dd>
</li>
<dt><strong><a name="glyphs" class="item">$glyphs = $track-&gt;glyphs</a></strong>

<dd>
<p>Returns the glyph cache.  Returns undef before <a href="#layout"><code>layout()</code></a> and a
reference to an array of glyphs after <a href="#layout"><code>layout()</code></a>.</p>
</dd>
</li>
<dt><strong><a name="make_factory" class="item">$factory = $track-&gt;<code>make_factory(@options)</code></a></strong>

<dd>
<p>Given a set of options (argument/value pairs), returns a
Ace::Graphics::GlyphFactory for use in creating the glyphs with the
desired settings.</p>
</dd>
</li>
</dl>
<p>
</p>
<hr />
<h1><a name="bugs">BUGS</a></h1>
<p>Please report them.</p>
<p>
</p>
<hr />
<h1><a name="see_also">SEE ALSO</a></h1>
<p><a href="/AcePerl/docs/./Ace/Sequence.html">the Ace::Sequence manpage</a>,<a href="/AcePerl/docs/./Ace/Sequence/Feature.html">the Ace::Sequence::Feature manpage</a>,<a href="/AcePerl/docs/./Ace/Graphics/Panel.html">the Ace::Graphics::Panel manpage</a>,
<a href="/AcePerl/docs/./Ace/Graphics/GlyphFactory.html">the Ace::Graphics::GlyphFactory manpage</a>,<a href="/AcePerl/docs/./Ace/Graphics/Glyph.html">the Ace::Graphics::Glyph manpage</a></p>
<p>
</p>
<hr />
<h1><a name="author">AUTHOR</a></h1>
<p>Lincoln Stein &lt;<a href="mailto:lstein@cshl.org">lstein@cshl.org</a>&gt;.</p>
<p>Copyright (c) 2001 Cold Spring Harbor Laboratory</p>
<p>This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.  See DISCLAIMER.txt for
disclaimers of warranty.</p>

</body>

</html>