Bio-Graphics

 view release on metacpan or  search on metacpan

lib/Bio/Graphics/Glyph/trace.pm  view on Meta::CPAN

                    formatted files.  This is 
                    multiplied against the max 
                    trace value to determine the
                    hight of peaks.


=head2 Specifying the Trace

The path to the trace file can be specified in two ways. First, you can place
it in the feature itself using a tag named "trace". Second, you can specify it
as a track option using a callback:

  $panel->add_track(\@features,
                    -glyph=>'trace',
                    -trace => sub { my $feature = shift;
                                    my $trace_path = do_something();
                                    return $trace }
                    );

You can of course give -trace a constant string, in which case each feature
will show the same trace.

The trace can be a file on the local operating system or a URL. However, URL
fetching will only work if the LWP module is installed on your system.
Otherwise the glyph will fail with an error message.

If the trace is a relative path (it does not begin with a slash or a URL
protocol), then the contents of -trace_prefix will be prepended to it. This
allows you to specify traces that are relative to a particular directory or a
partial URL. Example:

  $panel->add_track(\@features,
                    -glyph => 'trace',
                    -trace_prefix => 'http://localhost/anatomy/trace-browser_files',
                   );

This specifies that each feature's "trace" tag is to be appended to the partial
localhost URL, thereby saving space.

=head2 Glyph Delegation

The trace glyph consists of two parts: an upper part that shows the extent of
the feature in base pair coordinates, and a lower part that shows the trace.
The upper part will always be displayed.  The lower part will only display if
zoomed close enough to see the sequence.

By default the upper part uses the "generic" glyph, which is a simple rectangle
filled with the bgcolor and outlined with the fgcolor. To use a different glyph
in the upper part, specify the -glyph_delegate option, giving the name of the
glyph you wish to use. For instance, to use the "span" glyph:

  $panel->add_track(\@features,
                    -glyph          => 'trace',
                    -glyph_delegate => 'span'
                   );

This feature does not work with all glyphs, and in particular requires a recent
CVS checkout of Bio::Perl to work properly with the "arrow", "span" and
"primers" glyphs (support for the feature did not make it into version 1.5).

=head1 BUGS AND LIMITATIONS

See the L<DESCRIPTION> for an explaination of how to align the trace with the
reference.

The trace looks a little off when the feature is on the negative strand of the
reference.  This is because the letters are on the oppisite side of the
position line.  This issue should be addressed.

This glyph uses it's own version of the Bio::Graphics::Panel method, map_pt(),
due to that method not behaving as needed.  The new copied method is called
"trace_map_pt".  

If the trace file is gzipped, it will unzip it without destroying the gzipped
file.  However, it will also not remove the newly created file.  This will only
be an issue when the files are stored locally, since web accessed trace files
are stored as temp files anyway. 

=head1 SEE ALSO

L<Bio::Graphics::Panel>,
L<Bio::Graphics::Glyph>,
L<Bio::Graphics::Glyph::arrow>,
L<Bio::Graphics::Glyph::cds>,
L<Bio::Graphics::Glyph::crossbox>,
L<Bio::Graphics::Glyph::diamond>,
L<Bio::Graphics::Glyph::dna>,
L<Bio::Graphics::Glyph::dot>,
L<Bio::Graphics::Glyph::ellipse>,
L<Bio::Graphics::Glyph::extending_arrow>,
L<Bio::Graphics::Glyph::generic>,
L<Bio::Graphics::Glyph::graded_segments>,
L<Bio::Graphics::Glyph::heterogeneous_segments>,
L<Bio::Graphics::Glyph::image>,
L<Bio::Graphics::Glyph::line>,
L<Bio::Graphics::Glyph::pinsertion>,
L<Bio::Graphics::Glyph::primers>,
L<Bio::Graphics::Glyph::rndrect>,
L<Bio::Graphics::Glyph::segments>,
L<Bio::Graphics::Glyph::ruler_arrow>,
L<Bio::Graphics::Glyph::toomany>,
L<Bio::Graphics::Glyph::transcript>,
L<Bio::Graphics::Glyph::transcript2>,
L<Bio::Graphics::Glyph::translation>,
L<Bio::Graphics::Glyph::triangle>,
L<Bio::DB::GFF>,
L<Bio::SeqI>,
L<Bio::SeqFeatureI>,
L<Bio::Das>,
L<GD>

=head1 AUTHOR

Ben Faga E<lt>faga@cshl.eduE<gt>, Lincoln Stein E<lt>lstein@cshl.orgE<gt>, Todd Harris E<lt>harris@cshl.orgE<gt>

Copyright (c) 2006 Cold Spring Harbor Laboratory

This package and its accompanying libraries is free software; you can
redistribute it and/or modify it under the terms of the GPL (either
version 1, or at your option, any later version) or the Artistic
License 2.0.  Refer to LICENSE for the full license text. In addition,



( run in 1.855 second using v1.01-cache-2.11-cpan-39bf76dae61 )