Permalink
Browse files

Merge pull request #2 from neomorphic/master

Minor updates to the code. Mostly cleanup.
  • Loading branch information...
2 parents aa4eb73 + 3a81c07 commit 746b8664c76cc12f461c2342ec3b86f5616d252b Benjamin Schuster-Boeckler committed Feb 22, 2012
Showing with 130 additions and 104 deletions.
  1. +5 −4 HMM.pm
  2. +15 −2 HMM/Alignment.pm
  3. +86 −76 HMM/Profile.pm
  4. +13 −12 HMM/Utilities.pm
  5. +4 −3 HMM/Utilities3.pm
  6. +0 −1 MANIFEST
  7. +4 −3 Makefile.PL
  8. 0 { → scripts}/hmm2logo.pl
  9. +3 −3 { → scripts}/make_profile.pl
View
@@ -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
@@ -26,6 +26,7 @@ it: L<PDL>.
package HMM;
use strict;
+use warnings;
use PDL::LiteF;
our $VERSION = '0.81';
@@ -100,7 +101,7 @@ sub name : lvalue {
$self->{'modelName'};
}
-
+
=head2 alphabet()
Usage : my @alphabet = $pHMM->alphabet()
@@ -113,7 +114,7 @@ sub alphabet : lvalue {
$self->{'alphabet'};
}
-
+
=head2 length()
Usage : my $length = $pHMM->length()
View
@@ -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';
@@ -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
Oops, something went wrong.

0 comments on commit 746b866

Please sign in to comment.