Permalink
Browse files

refactor datatype() method into wiggle_minmax.pm

  • Loading branch information...
1 parent 7e2c91a commit e706f80cf29e555c1bb9d0f9eae2435fee37a3be @lstein lstein committed Jan 11, 2012
@@ -1,7 +1,9 @@
package Bio::Graphics::Glyph::wiggle_density;
use strict;
-use base qw(Bio::Graphics::Glyph::box Bio::Graphics::Glyph::smoothing Bio::Graphics::Glyph::wiggle_minmax);
+use base qw(Bio::Graphics::Glyph::box
+ Bio::Graphics::Glyph::smoothing
+ Bio::Graphics::Glyph::wiggle_minmax);
use File::Spec;
sub my_description {
@@ -153,5 +153,24 @@ sub wig {
$d;
}
+sub datatype {
+ my $self = shift;
+ my $feature = $self->feature;
+ my ($tag,$value);
+
+ foreach $tag ('wigfile','wigdata','densefile','coverage') {
+ ($value) = eval{$feature->get_tag_values($tag)};
+ last if $value;
+ }
+ unless ($value) {
+ $tag = 'statistical_summary';
+ $value = eval{$feature->statistical_summary};
+ }
+ unless ($value) {
+ $tag = 'generic';
+ }
+ return wantarray ? ($tag,$value) : $tag;
+}
+
1;
@@ -99,7 +99,7 @@ sub draw {
my ($gd,$dx,$dy) = @_;
my $feature = $self->feature;
- my $datatype = $self->datatype;
+ my $datatype = $self->datatype; # found in wiggle_minmax.pm
my $retval;
$retval = $self->draw_wigfile($feature,@_) if $datatype eq 'wigfile';
@@ -237,25 +237,6 @@ sub _draw_wigfile {
$self->draw_plot($parts,@_);
}
-sub datatype {
- my $self = shift;
- my $feature = $self->feature;
- my ($tag,$value);
-
- foreach $tag ('wigfile','wigdata','densefile','coverage') {
- ($value) = eval{$feature->get_tag_values($tag)};
- last if $value;
- }
- unless ($value) {
- $tag = 'statistical_summary';
- $value = eval{$feature->statistical_summary};
- }
- unless ($value) {
- $tag = 'generic';
- }
- return wantarray ? ($tag,$value) : $tag;
-}
-
sub get_parts {
my $self = shift;
my $feature = $self->feature;

0 comments on commit e706f80

Please sign in to comment.