Skip to content

Commit

Permalink
Merge pull request DaGaMs#2 from neomorphic/master
Browse files Browse the repository at this point in the history
Minor updates to the code. Mostly cleanup.
  • Loading branch information
Benjamin Schuster-Boeckler committed Feb 22, 2012
2 parents aa4eb73 + 3a81c07 commit 746b866
Show file tree
Hide file tree
Showing 9 changed files with 130 additions and 104 deletions.
9 changes: 5 additions & 4 deletions HMM.pm
Expand Up @@ -5,9 +5,9 @@ HMM - representation of hidden markov moddels for computational biology
=head1 SYNOPSIS
use HMM;
my $hmm = HMM->new(-hmmerfile=>$file) || die("Couldn't open $file!\n"); #try to create a new hmm-object from the file
print $hmm->name(); #output the name of the model
print $hmm->transitions(); #show the matrix of transition probabilities
Expand All @@ -26,6 +26,7 @@ it: L<PDL>.
package HMM;

use strict;
use warnings;
use PDL::LiteF;

our $VERSION = '0.81';
Expand Down Expand Up @@ -100,7 +101,7 @@ sub name : lvalue {
$self->{'modelName'};
}


=head2 alphabet()
Usage : my @alphabet = $pHMM->alphabet()
Expand All @@ -113,7 +114,7 @@ sub alphabet : lvalue {
$self->{'alphabet'};
}


=head2 length()
Usage : my $length = $pHMM->length()
Expand Down
17 changes: 15 additions & 2 deletions HMM/Alignment.pm
Expand Up @@ -37,6 +37,7 @@ a graphical representation of the alignment. It is an extension of the HMM Logo
package HMM::Alignment;

use strict;
use warnings;
use vars '@ISA'; #inheritance
use PDL::LiteF;
use Imager ':handy';
Expand Down Expand Up @@ -588,9 +589,21 @@ sub draw_logo {
# y2 => $middleMargin+5,
# aa => 0);
}

# Finally, draw the logo
return $i->write(file=>$args{'-file'});
if ($args{'-file'}) {
$i->write(type=>'png', file=>$args{'-file'});
}
elsif ($args{'-fh'}) {
$i->write(type=>'png', fh=>$args{'-file'});
}
elsif ($args{'-data'}) {
$i->write(type=>'png', data=>$args{'-data'});
}
else {
warn __PACKAGE__." WARN No data output handle passed!\n";
return;
}
}

=head2 toPRC
Expand Down

0 comments on commit 746b866

Please sign in to comment.