Ace::G...:Track(3pm)
πΈ NAME
Ace::Graphics::Track β it's giving "PNG graphics of Ace::Sequence::Feature objects", and honestly? Iconic. β¨
(Also hi, this is the Ace::Graphics::Track(3pm) page from the User Contributed Perl Documentation, so you're in exactly the right place, babe π«Ά)
π SYNOPSIS
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;
π DESCRIPTION
okay so bestie, the Ace::Graphics::Track class is the one that Ace::Graphics::Panel uses to lay out a whole set of sequence features using a uniform glyph type. Think of it like: one track = one vibe = one glyph style, and everything on it matches. π
Real talk though β you will ordinarily work with panels rather than directly with tracks. Tracks are the backstage crew; panels are the main character. π
π METHODS
This section describes the class and object methods for Ace::Graphics::Panel. (yes girl, that's what it says, and we respect it π)
π§ CONSTRUCTORS
There is only one constructor, the new() method. It is ordinarily called by Ace::Graphics::Panel, and not in end-developer code. So like, you can call it yourself, but the panel is the one who normally does the asking. π
$track = Ace::Graphics::Track->new($glyph_name,$features,@options)β thenew()method creates a new track object from the provided glyph name and list of features. The arguments are similar to those inAce::Graphics::Panel->new().
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. so like, don't just make up glyph names, she WILL clock it π
π¦ OBJECT METHODS
Once a track is created, the following methods can be invoked.
$track->add_feature($feature)β this adds a new feature to the track. The feature can either be:- a single object that implements the
Bio::SeqFeatureIinterface (such as anAce::Sequence::FeatureorDas::Segment::Feature), or - an anonymous array containing a set of related features.
- a single object that implements the
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. she's protective like that π«Ά
$track->add_group($group)β this behaves the same asadd_feature(), but requires that its argument be an array reference containing a list of grouped features. no single objects allowed, periodt π$track->draw($gd,$left,$top)β render the track on a previously-createdGD::Imageobject. The$leftand$toparguments indicate the position at which to start rendering. π$boxes = $track->boxes($left,$top)@boxes = $track->boxes($left,$top)β return an array of array references indicating glyph coordinates for each of the render features.$leftand$topindicate 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. she contains multitudes β¨
See Ace::Graphics::Panel->boxes() for the format of the result.
πΈ ACCESSORS
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. (yes, it gives you the old one back, it's very generous π)
β οΈ Note that in most cases you must change attributes before the track's layout() method is called. Do not wait. Do not procrastinate. She will not re-check. π
scale()β get/set the track scale, measured in pixels/bplineheight()β get/set the height of each glyph, pixelswidth()β get/set the width of the trackbump()β get/set the bump direction
π₯ INTERNAL METHODS
The following methods are used internally, but may be useful for those implementing new glyph types. iykyk π§
$glyphs = $track->layoutβ layout the features, and return an anonymous array ofAce::Graphics::Glyphobjects that have been created and correctly positioned.
Because layout is an expensive operation, calling this method several times will return the previously-cached result, ignoring any changes to track attributes. (so if you changed stuff after the first callβ¦ she didn't hear you, bestie π)
$height = $track->heightβ invokeslayout()and returns the height of the track.$glyphs = $track->glyphsβ returns the glyph cache. Returnsundefbeforelayout()and a reference to an array of glyphs afterlayout().$factory = $track->make_factory(@options)β given a set of options (argument/value pairs), returns anAce::Graphics::GlyphFactoryfor use in creating the glyphs with the desired settings. πβ¨
π BUGS
Please report them. that's it, that's the whole section, she keeps it short and she keeps it real π
π SEE ALSO
Ace::Sequence, Ace::Sequence::Feature, Ace::Graphics::Panel, Ace::Graphics::GlyphFactory, Ace::Graphics::Glyph
π AUTHOR
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. π«Ά
and that's the whole page, bestie β brought to you by perl v5.42.3, dated 2026-08-19, no cap πβ¨πΈ
π¦ where this page comes from
- ubuntu stonking: libace-perl 1.92-14build1 Β· Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms