[Bioperl-guts-l] bioperl commit

Lincoln Stein lstein at dev.open-bio.org
Wed Feb 12 16:43:09 EST 2003


Wed Feb 12 16:43:09 EST 2003
Update of /home/repository/bioperl/bioperl-live/Bio/Graphics
In directory dev:/tmp/cvs-serv2575/Bio/Graphics

Modified Files:
	Glyph.pm Panel.pm 
Added Files:
	ConfiguratorI.pm RendererI.pm 
Log Message:
merged speculative changes to bio::graphics into main trunk; regression tests 2&3 will fail; need to be fixed
bioperl-live/Bio/Graphics ConfiguratorI.pm,1.1,1.2 RendererI.pm,1.1,1.2 Glyph.pm,1.34,1.35 Panel.pm,1.36,1.37
===================================================================
RCS file: /home/repository/bioperl/bioperl-live/Bio/Graphics/ConfiguratorI.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- /tmp/T0jHaOdf	2003-02-12 16:43:09.640008886 -0500
+++ /tmp/T1kHaOdf	2003-02-12 16:43:09.650008002 -0500
@@ -0,0 +1,174 @@
+# $Id$
+#
+# BioPerl module for Bio::Graphics::ConfiguratorI
+#
+# Cared for by Robert Hubley <rhubley at systemsbiology.org>
+#
+# Copyright Robert Hubley
+#
+# You may distribute this module under the same terms as perl itself
+
+# POD documentation - main docs before the code
+
+=head1 NAME
+
+Bio::Graphics::ConfiguratorI - A sectioned map of configuration
+options (a map of maps), with a default section.  Intended to augment
+existing tag->value semantics (ie. of Bio::AnnotationCollectionI) for
+object-representation information (eg. foreground color), and for
+general interface preferences (eg. image width in gbrowse).
+
+=head1 SYNOPSIS
+
+    # get a ConfiguratorI somehow
+    my $fg_color = $configurator->get('fgcolor');
+
+=head1 DESCRIPTION
+
+This object contains various configuration parameters.  It is divided
+up into sections and tags.  This is essentially a multi-level map
+(senction->tag->value).  There is also the concept of a default
+section which is referenced when no section is passed to the
+ConfiguratorI methods.
+
+=head1 FEEDBACK
+
+=head2 Mailing Lists
+
+User feedback is an integral part of the evolution of this and other
+Bioperl modules. Send your comments and suggestions preferably to
+the Bioperl mailing list.  Your participation is much appreciated.
+
+  bioperl-l at bioperl.org            - General discussion
+http://bioperl.org/MailList.shtml  - About the mailing lists
+
+=head2 Reporting Bugs
+
+Report bugs to the Bioperl bug tracking system to help us keep track
+of the bugs and their resolution. Bug reports can be submitted via
+email or the web:
+
+  bioperl-bugs at bioperl.org
+  http://bugzilla.bioperl.org/
+
+=head1 AUTHOR - Robert Hubley
+
+Email rhubley at systemsbiology.org
+
+=head1 CONTRIBUTORS
+
+Paul Edlefsen, pedlefsen at systemsbiology.org
+Lincoln Stein, lstein at cshl.org
+Heikki Lehvaslaiho, heikki at ebi.ac.uk
+
+=head1 APPENDIX
+
+The rest of the documentation details each of the object methods.
+Internal methods are usually preceded with a _
+
+=cut
+
+# Let the code begin...
+
+package Bio::Graphics::ConfiguratorI;
+use vars qw( @ISA );
+use strict;
+use Bio::Root::RootI;
+use Carp;
+
+ at ISA = qw( Bio::Root::RootI );
+
+=head2 get_sections
+
+ Title   : get_sections
+ Usage   : my @values = $configurator->get_sections();
+ Function: Returns a list of the valid sections except
+           the default or undef.
+ Returns : A list of the sections which can be queried.
+ Args    : (optional section as string, tag as string)
+
+=cut
+
+sub get_sections {
+   my ($self) = @_;
+   $self->throw_not_implemented();
+}
+
+=head2 get_tags
+
+ Title   : get_tags
+ Usage   : my @values = $configurator->get_tags();
+           or
+           my @values = $configurator->get_tags('dna');
+ Function: Returns a list of tags for a given section
+           or only the default tags section if no section
+           is given.
+ Returns : A scalar list of tags
+ Args    :
+
+=cut
+
+sub get_tags {
+   my ($self) = @_;
+   $self->throw_not_implemented();
+}
+
+=head2 get
+
+ Title   : get
+ Usage   : my $value = $configurator->get('height');
+           or
+           my $value = $configurator->get('dna','height');
+ Function: Returns a tag value from a configurator from the
+           either the default "_general" section or from
+           a specified section or undef.
+ Returns : A scalar value for the tag
+ Args    : (optional section as string, tag as string)
+
+=cut
+
+sub get {
+   my ($self) = @_;
+   $self->throw_not_implemented();
+}
+
+=head2 set
+
+ Title   : set
+ Usage   : $configurator->set('fgcolor','chartreuse');
+           or
+           $configurator->set('EST','fgcolor','chartreuse');
+ Function: Set a value for a tag
+ Returns : The old value of the tag
+ Args    : (optional section as string, tag as string, value as scalar)
+
+=cut
+
+sub set {
+   my ($self) = @_;
+   $self->throw_not_implemented();
+}
+
+
+=head2 get_and_eval
+
+ Title   : get_and_eval
+ Usage   : my $value = $configurator->get_and_eval('height');
+           or
+           my $value = $configurator->get_and_eval('dna','height');
+ Function: This works like get() except that it is
+           also able to evaluate code references.  These are
+           options whose values begin with the characters
+           "sub {".  In this case the value will be passed to
+           an eval() and the resulting codereference returned.
+ Returns : A value of the tag or undef.
+ Args    : (optional section as string, tag as string)
+
+=cut
+
+sub get_and_eval {
+   my ($self) = @_;
+   $self->throw_not_implemented();
+}
+
+1;

===================================================================
RCS file: /home/repository/bioperl/bioperl-live/Bio/Graphics/RendererI.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- /tmp/T0YHaqef	2003-02-12 16:43:09.680005078 -0500
+++ /tmp/T1ZHaqef	2003-02-12 16:43:09.690008243 -0500
@@ -0,0 +1,95 @@
+# $Id $
+
+=head1 NAME
+
+Bio::Graphics::RendererI - A renderer for the Bio::Graphics class that
+renders Bio::SeqFeature::CollectionI objects onto
+Bio::Graphics::Panels using configuration information provided by a
+Bio::Graphics::ConfiguratorI.
+
+=head1 SYNOPSIS
+
+ # Get a renderer somehow, called $renderer
+
+ # create a new panel and render contents a feature collection onto it
+ my $config = new ConfigIO( $config_file )->getConfig();
+ my $features = $data_provider->getCollection();
+ my ( $tracks_rendered, $panel ) = $renderer->render( $features, $prefs );
+
+=head1 DESCRIPTION
+
+ Renderer of Bio::SeqFeature::CollectionIs (collections of features)
+ onto a Bio::Graphics::Panel using a Bio::Graphics::ConfiguratorI for general and
+ track-specific rendering options.
+
+=head1 FEEDBACK
+
+=head2 Mailing Lists
+
+User feedback is an integral part of the evolution of this and other
+Bioperl modules. Send your comments and suggestions preferably to
+the Bioperl mailing list.  Your participation is much appreciated.
+
+  bioperl-l at bioperl.org              - General discussion
+  http://bioperl.org/MailList.shtml  - About the mailing lists
+
+=head2 Reporting Bugs
+
+Report bugs to the Bioperl bug tracking system to help us keep track
+of the bugs and their resolution. Bug reports can be submitted via
+email or the web:
+
+  bioperl-bugs at bioperl.org
+  http://bugzilla.bioperl.org/
+
+=head1 AUTHOR
+
+Paul Edlefsen E<lt>paul at systemsbiology.orgE<gt>.
+
+Copyright (c) 2003 Institute for Systems Biology
+
+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.
+
+=head1 CONTRIBUTORS
+
+=head1 APPENDIX
+
+The rest of the documentation details each of the object methods.
+Internal methods are usually preceded with a _
+
+=cut
+
+# Let the code begin...
+
+package Bio::Graphics::RendererI;
+use vars qw( @ISA );
+use strict;
+use Bio::Root::RootI;
+
+ at ISA = qw( Bio::Root::RootI );
+
+=head2 render
+
+ Title   : render
+ Usage   : ( $rendered, $panel ) =
+               $renderer->render( $collection, $configurator [, $panel ] );
+ Function: Renders the SeqFeatures in the given collection onto a
+           Bio::Graphics::Panel (if no panel is given, one will be
+           created), using the given Bio::Graphics::ConfiguratorI for general
+           and track-specific rendering options.
+ Returns : In a scalar context returns the number of tracks rendered.
+           In a list context, returns a two-element list containing
+           the number of features rendered and the panel.
+ Args    : A Bio::SeqFeature::CollectionI and a Bio::Graphics::ConfiguratorI
+           and optionally a Bio::Graphics::Panel.
+ Status  : Public
+
+=cut
+
+sub render {
+  shift->throw_not_implemented();
+}
+
+1;

===================================================================
RCS file: /home/repository/bioperl/bioperl-live/Bio/Graphics/Glyph.pm,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- /tmp/T0IIa4ef	2003-02-12 16:43:09.740005709 -0500
+++ /tmp/T1JIa4ef	2003-02-12 16:43:09.750009415 -0500
@@ -637,9 +637,11 @@
   if (@parts) {
     my($x1,$y1,$x2,$y2) = $self->bounds(0,0);
     my($xl,$xt,$xr,$xb) = $parts[0]->bounds;
-    $self->_connector($gd,$dx,$dy,$x1,$xt,$x1,$xb,$xl,$xt,$xr,$xb)      if $x1 <= $self->panel->left;
+#    $self->_connector($gd,$dx,$dy,$x1,$xt,$x1,$xb,$xl,$xt,$xr,$xb)      if $x1 <= $self->panel->left;
+    $self->_connector($gd,$dx,$dy,$x1,$xt,$x1,$xb,$xl,$xt,$xr,$xb)      if $x1 < $xl;
     my ($xl2,$xt2,$xr2,$xb2) = $parts[-1]->bounds;
-    $self->_connector($gd,$dx,$dy,$parts[-1]->bounds,$x2,$xt2,$x2,$xb2) if $x2 >= $self->panel->right;
+#    $self->_connector($gd,$dx,$dy,$parts[-1]->bounds,$x2,$xt2,$x2,$xb2) if $x2 >= $self->panel->right;
+    $self->_connector($gd,$dx,$dy,$parts[-1]->bounds,$x2,$xt2,$x2,$xb2) if $x2 > $xr;
   }
 
 }

===================================================================
RCS file: /home/repository/bioperl/bioperl-live/Bio/Graphics/Panel.pm,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- /tmp/T0BJaGff	2003-02-12 16:43:09.790012446 -0500
+++ /tmp/T1CJaGff	2003-02-12 16:43:09.810009506 -0500
@@ -152,8 +152,8 @@
 
 sub scale {
   my $self = shift;
-  $self->{scale} ||= ($self->{width}-$self->pad_left-$self->pad_right-1)/($self->length-1);  # wrong!
-#  $self->{scale} ||= ($self->{width}-$self->pad_left-$self->pad_right-1)/($self->length);   # right, but I don't want to fix regression tests!
+#  $self->{scale} ||= ($self->{width}-$self->pad_left-$self->pad_right-1)/($self->length-1);  # wrong!
+  $self->{scale} ||= ($self->{width}-$self->pad_left-$self->pad_right)/($self->length);   # right, but I don't want to fix regression tests!
 }
 
 sub start { shift->{offset}+1}



More information about the Bioperl-guts-l mailing list