[Bioperl-guts-l] [15003] bioperl-live/trunk: * seq_inds is not defined for Model-based HSPs

Christopher John Fields cjfields at dev.open-bio.org
Mon Nov 17 21:58:03 EST 2008


Revision: 15003
Author:   cjfields
Date:     2008-11-17 21:58:02 -0500 (Mon, 17 Nov 2008)

Log Message:
-----------
* seq_inds is not defined for Model-based HSPs
* remove redundant tests

Modified Paths:
--------------
    bioperl-live/trunk/Bio/Search/HSP/ModelHSP.pm
    bioperl-live/trunk/t/SearchIO_infernal.t

Modified: bioperl-live/trunk/Bio/Search/HSP/ModelHSP.pm
===================================================================
--- bioperl-live/trunk/Bio/Search/HSP/ModelHSP.pm	2008-11-18 02:43:47 UTC (rev 15002)
+++ bioperl-live/trunk/Bio/Search/HSP/ModelHSP.pm	2008-11-18 02:58:02 UTC (rev 15003)
@@ -17,11 +17,11 @@
 =head1 SYNOPSIS
 
     use Bio::Search::HSP::ModelHSP;
-    # us it just like a Bio::Search::HSP::GenericHSP object
+    # us it just like a Bio::Search::HSP::ModelHSP object
 
 =head1 DESCRIPTION
 
-This object is a specialization of L<Bio::Search::HSP::GenericHSP> and is used
+This object is a specialization of L<Bio::Search::HSP::ModelHSP> and is used
 for searches which involve a query model, such as a Hidden Markov Model (HMM),
 covariance model (CM), descriptor, or anything else besides a sequence. Note
 that results from any HSPI class methods which rely on the query being a
@@ -60,7 +60,6 @@
 
 # Let the code begin...
 
-
 package Bio::Search::HSP::ModelHSP;
 use strict;
 use Bio::Seq::Meta;
@@ -75,7 +74,7 @@
  Returns : Bio::Search::HSP::ModelHSP
  Args    :
 
-Plus Bio::Seach::HSP::GenericHSP methods
+Plus Bio::Seach::HSP::ModelHSP methods
 
            -algorithm => algorithm used (Infernal, RNAMotif, ERPIN, etc)
            -evalue    => evalue
@@ -460,7 +459,7 @@
 
 =cut
 
-=head1 GenericHSP methods overridden in ModelHSP
+=head1 ModelHSP methods overridden in ModelHSP
 
 The following methods have been overridden due to their current reliance on
 sequence-based queries. They may be implemented in future versions of this class.
@@ -469,6 +468,16 @@
 
 =cut
 
+sub seq_inds {
+    my $self = shift;
+    $self->warn('$hsp->seq_inds not implemented for Model-based searches');
+    return;    
+}
+
+=head2 frac_identical
+
+=cut
+
 sub frac_identical {
     my $self = shift;
     $self->warn('$hsp->frac_identical not implemented for Model-based searches');

Modified: bioperl-live/trunk/t/SearchIO_infernal.t
===================================================================
--- bioperl-live/trunk/t/SearchIO_infernal.t	2008-11-18 02:43:47 UTC (rev 15002)
+++ bioperl-live/trunk/t/SearchIO_infernal.t	2008-11-18 02:58:02 UTC (rev 15003)
@@ -7,7 +7,7 @@
     use lib 't/lib';
     use BioperlTest;
     
-    test_begin(-tests => 346);
+    test_begin(-tests => 316);
     
     use_ok('Bio::SearchIO');
 }
@@ -150,7 +150,6 @@
    "HSP query_string");
 is($hsp->range, 102, "HSP range");
 is($hsp->rank, 1, "HSP rank");
-is($hsp->seq_inds, 67, "HSP seq_inds");
 is($hsp->significance, undef, "HSP significance");
 is($hsp->end, 102, "HSP end");
 is($hsp->expect, undef, "HSP expect");
@@ -159,6 +158,8 @@
 # Bio::Search::HSP::ModelHSP; they may be integrated over time but will require
 # some reconfiguring for Model-based searches
 
+eval {$hsp->seq_inds};
+like($@, qr'seq_inds not implemented for Model-based searches','HSP seq_inds not implemented');
 eval {$hsp->matches};
 like($@, qr'matches not implemented for Model-based searches','HSP matches not implemented');
 eval {$hsp->frac_conserved};
@@ -216,7 +217,6 @@
    "HSP query_string");
 is($hsp->range, 102, "HSP range");
 is($hsp->rank, 2, "HSP rank");
-is($hsp->seq_inds, 69, "HSP seq_inds");
 is($hsp->significance, undef, "HSP significance");
 is($hsp->end, 102, "HSP end");
 is($hsp->expect, undef, "HSP expect");
@@ -283,7 +283,6 @@
    "HSP query_string");
 is($hsp->range, 102, "HSP range");
 is($hsp->rank, 1, "HSP rank");
-is($hsp->seq_inds, 64, "HSP seq_inds");
 is($hsp->significance, undef, "HSP significance");
 is($hsp->end, 102, "HSP end");
 is($hsp->expect, undef, "HSP expect");
@@ -383,49 +382,6 @@
 is($hit->name, 'gi|633168|emb|X83878.1|', "Hit name");
 is($hit->num_hsps, 2, "Hit num_hsps");
 
-# These Bio::Search::Hit::HitI methods are currently unimplemented in
-# Bio::Search::Hit::ModelHit; they may be integrated over time but will require
-# some reconfiguring for Model-based searches
-
-eval { $hit->length_aln() };
-like($@, qr'length_aln not implemented for Model-based searches',
-     "Hit length_aln() not implemented");
-eval {$hit->num_unaligned_hit};
-like($@, qr'num_unaligned_hit/num_unaligned_sbjct not implemented for Model-based searches',
-     "Hit num_unaligned_hit() not implemented");
-eval {$hit->num_unaligned_query};
-like($@, qr'num_unaligned_query not implemented for Model-based searches',
-     "Hit num_unaligned_query() not implemented");
-eval {$hit->num_unaligned_sbjct};
-like($@, qr'num_unaligned_hit/num_unaligned_sbjct not implemented for Model-based searches',
-     "Hit num_unaligned_sbjct() not implemented");
-eval {$hit->start};
-like($@, qr'start not implemented for Model-based searches','Hit start not implemented');
-eval {$hit->end};
-like($@, qr'end not implemented for Model-based searches','Hit end not implemented');
-eval {$hit->strand};
-like($@, qr'strand not implemented for Model-based searches','Hit strand not implemented');
-eval {$hit->logical_length};
-like($@, qr'logical_length not implemented for Model-based searches','Hit logical_length not implemented');
-eval {$hit->frac_aligned_hit};
-like($@, qr'frac_aligned_hit not implemented for Model-based searches','Hit frac_aligned_hit not implemented');
-eval{$hit->frac_aligned_query};
-like($@, qr'frac_aligned_query not implemented for Model-based searches','Hit frac_aligned_query not implemented');
-eval {$hit->frac_conserved};
-like($@, qr'frac_conserved not implemented for Model-based searches','Hit frac_conserved not implemented');
-eval{$hit->frac_identical};
-like($@, qr'frac_identical not implemented for Model-based searches','Hit frac_identical not implemented');
-eval{$hit->matches};
-like($@, qr'matches not implemented for Model-based searches','Hit matches not implemented');
-eval{$hit->gaps};
-like($@, qr'gaps not implemented for Model-based searches','Hit gaps not implemented');
-eval{$hit->frame};
-like($@, qr'frame not implemented for Model-based searches','Hit frame not implemented');
-eval {$hit->range};
-like($@, qr'range not implemented for Model-based searches','Hit range not implemented');
-eval {$hit->seq_inds};
-like($@, qr'seq_inds not implemented for Model-based searches','Hit seq_inds not implemented');
-
 # p() works but there are no evalues yet for Infernal output, so catch and check...
 eval {$hit->p};
 like($@, qr'P-value not defined. Using expect\(\) instead',
@@ -473,33 +429,10 @@
    "HSP query_string");
 is($hsp->range, 102, "HSP range");
 is($hsp->rank, 1, "HSP rank");
-is($hsp->seq_inds, 64, "HSP seq_inds");
 is($hsp->significance, 1.945e-07, "HSP significance");
 is($hsp->end, 102, "HSP end");
 is($hsp->expect, 1.945e-07, "HSP expect");
-$hsp->verbose(2);
 
-# These Bio::Search::HSP::HSPI methods are currently unimplemented in
-# Bio::Search::HSP::ModelHSP; they may be integrated over time but will require
-# some reconfiguring for Model-based searches
-
-eval {$hsp->matches};
-like($@, qr'matches not implemented for Model-based searches','HSP matches not implemented');
-eval {$hsp->frac_conserved};
-like($@, qr'frac_conserved not implemented for Model-based searches','HSP frac_conserved not implemented');
-eval {$hsp->frac_identical};
-like($@, qr'frac_identical not implemented for Model-based searches','HSP frac_identical not implemented');
-eval {$hsp->num_conserved};
-like($@, qr'num_conserved not implemented for Model-based searches','HSP num_conserved not implemented');
-eval {$hsp->num_identical};
-like($@, qr'num_identical not implemented for Model-based searches','HSP num_identical not implemented');
-eval {$hsp->percent_identity};
-like($@, qr'percent_identity not implemented for Model-based searches','HSP percent_identity not implemented');
-eval {$hsp->cigar_string};
-like($@, qr'cigar_string not implemented for Model-based searches','HSP cigar_string not implemented');
-eval {$hsp->generate_cigar_string};
-like($@, qr'generate_cigar_string not implemented for Model-based searches','HSP cigar_string not implemented');
-
 isa_ok($hsp->seq, 'Bio::LocatableSeq');
 is($hsp->seq_str,
    'aAaaauaaAaaaaaaaauaCuCgUAUAaucucgggAAUAUGGcccgagaGUuUCUACCaGgcaaCCGUAAAuugcCuGACUAcGaGuaAauauuaaauauuu',
@@ -540,7 +473,6 @@
    "HSP query_string");
 is($hsp->range, 102, "HSP range");
 is($hsp->rank, 2, "HSP rank");
-is($hsp->seq_inds, 31, "HSP seq_inds");
 is($hsp->significance, 6.802, "HSP significance");
 is($hsp->end, 102, "HSP end");
 is($hsp->expect, 6.802, "HSP expect");
@@ -607,7 +539,6 @@
    "HSP query_string");
 is($hsp->range, 102, "HSP range");
 is($hsp->rank, 1, "HSP rank");
-is($hsp->seq_inds, 69, "HSP seq_inds");
 is($hsp->significance, 1.259e-07, "HSP significance");
 is($hsp->end, 102, "HSP end");
 is($hsp->expect, 1.259e-07, "HSP expect");




More information about the Bioperl-guts-l mailing list