Ace::Graphics::Track(3pm) | User Contributed Perl Documentation | Ace::Graphics::Track(3pm) |
Ace::Graphics::Track - PNG graphics of Ace::Sequence::Feature objects
use Ace::Sequence; use Ace::Graphics::Panel; my $db = Ace->connect(-host=>'brie2.cshl.org',-port=>2005) or die; my $cosmid = Ace::Sequence->new(-seq=>'Y16B4A', -db=>$db,-start=>-15000,-end=>15000) or die; my @transcripts = $cosmid->transcripts; my $panel = Ace::Graphics::Panel->new( -segment => $cosmid, -width => 800 ); my $track = $panel->add_track('transcript' -fillcolor => 'wheat', -fgcolor => 'black', -bump => +1, -height => 10, -label => 1); foreach (@transcripts) { $track->add_feature($_); } my $boxes = $panel->boxes; print $panel->png;
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.
This section describes the class and object methods for Ace::Graphics::Panel.
There is only one constructor, the new() method. It is ordinarily called by Ace::Graphics::Panel, and not in end-developer code.
If successful new() will return a new Ace::Graphics::Track. Otherwise, it will return undef.
If the specified glyph name is not a valid one, new() will throw an exception.
Once a track is created, the following methods can be invoked.
See Ace::Graphics::Panel->boxes() for the format of the result.
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.
Note that in most cases you must change attributes before the track's layout() method is called.
Accessor Name Description ------------- ----------- 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
The following methods are used internally, but may be useful for those implementing new glyph types.
Because layout is an expensive operation, calling this method several times will return the previously-cached result, ignoring any changes to track attributes.
Please report them.
Ace::Sequence,Ace::Sequence::Feature,Ace::Graphics::Panel, Ace::Graphics::GlyphFactory,Ace::Graphics::Glyph
Lincoln Stein <lstein@cshl.org>.
Copyright (c) 2001 Cold Spring Harbor Laboratory
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.
2018-11-01 | perl v5.28.0 |