[Bioperl-guts-l] [15386] bioperl-live/trunk/t/SearchIO/blastxml.t: fix blastxml skipped test count (thanks to Nathan Haigh)

Christopher John Fields cjfields at dev.open-bio.org
Fri Jan 16 12:22:01 EST 2009


Revision: 15386
Author:   cjfields
Date:     2009-01-16 12:22:01 -0500 (Fri, 16 Jan 2009)

Log Message:
-----------
fix blastxml skipped test count (thanks to Nathan Haigh)

Modified Paths:
--------------
    bioperl-live/trunk/t/SearchIO/blastxml.t

Modified: bioperl-live/trunk/t/SearchIO/blastxml.t
===================================================================
--- bioperl-live/trunk/t/SearchIO/blastxml.t	2009-01-16 17:09:50 UTC (rev 15385)
+++ bioperl-live/trunk/t/SearchIO/blastxml.t	2009-01-16 17:22:01 UTC (rev 15386)
@@ -7,396 +7,400 @@
 	use lib '.';
     use Bio::Root::Test;
     
-    test_begin(-tests => 298);
+    test_begin(-tests => 298,
+			   -requires_module => 'XML::SAX');
 	
 	use_ok('Bio::SearchIO');
 }
 
 my ($searchio, $result,$iter,$hit,$hsp);
 
+# XML encoding/decoding done within XML::SAX now, though some parsers
+# do not work properly (XML::SAX::PurePerl, XML::LibXML::SAX)
+
+eval {
+	# test with RPSBLAST data first
+	# this needs to be eval'd b/c the XML::SAX parser object is
+	# instantiated in the constructor
+	$searchio = Bio::SearchIO->new('-tempfile' => 1,
+		   '-format' => 'blastxml',
+		   '-file'   => test_input_file('ecoli_domains.rps.xml'),
+		   '-blasttype' => 'blast',
+		   '-verbose' => -1);
+	# PurePerl works with these BLAST reports, so removed verbose promotion
+	$result = $searchio->next_result;
+	die if !defined $result;
+};
+
 SKIP: {
-	# XML encoding/decoding done within XML::SAX now, though some parsers
-	# do not work properly (XML::SAX::PurePerl, XML::LibXML::SAX)
-	test_skip(-tests => 129, -requires_module => 'XML::SAX');
-	
-    eval {
-		# test with RPSBLAST data first
-		# this needs to be eval'd b/c the XML::SAX parser object is
-		# instantiated in the constructor
-		$searchio = Bio::SearchIO->new('-tempfile' => 1,
-			   '-format' => 'blastxml',
-			   '-file'   => test_input_file('ecoli_domains.rps.xml'),
-               '-blasttype' => 'blast',
-			   '-verbose' => -1);
-		# PurePerl works with these BLAST reports, so removed verbose promotion
-		$result = $searchio->next_result;
-		die if !defined $result;
-	};
+	# this should be fixed with newer installations of XML::SAX::Expat, but as we
+	# don't require a certain version (multiple backends can be used) we catch
+	# and skip if needed 
 	if ($@ && $@ =~ m{Handler could not resolve external entity}) {
-		skip("XML::SAX::Expat does not work with XML tests; skipping",129);
+		skip("XML::SAX::Expat does not work with XML tests; skipping",297);
 	} elsif ($@) {
-		skip("Problem with XML::SAX setup: $@. Check ParserDetails.ini; skipping XML tests",129);
+		skip("Problem with XML::SAX setup: $@. Check ParserDetails.ini; skipping XML tests",297);
 	}
-    is($searchio->result_count, 1);	
-    isa_ok($result, 'Bio::Search::Result::ResultI');
-    is($result->database_name, '/data_2/jason/db/cdd/cdd/Pfam', 'database_name()');
-    is($result->query_name,'gi|1786182|gb|AAC73112.1|','query_name()');
-    is($result->query_description, '(AE000111) thr operon leader peptide [Escherichia coli]');
-    is($result->query_accession, 'AAC73112.1');
-    is($result->query_gi, 1786182);
-    is($result->query_length, 21);
-    is($result->algorithm, 'BLASTP');
-    is($result->algorithm_version, 'blastp 2.1.3 [Apr-1-2001]');
-
-    is($result->available_parameters, 8);
-    is($result->get_parameter('gapext'), 1);
-    is($result->available_statistics, 5);
-    is($result->get_statistic('lambda'), 0.267);
-
+	is($searchio->result_count, 1);	
+	isa_ok($result, 'Bio::Search::Result::ResultI');
+	is($result->database_name, '/data_2/jason/db/cdd/cdd/Pfam', 'database_name()');
+	is($result->query_name,'gi|1786182|gb|AAC73112.1|','query_name()');
+	is($result->query_description, '(AE000111) thr operon leader peptide [Escherichia coli]');
+	is($result->query_accession, 'AAC73112.1');
+	is($result->query_gi, 1786182);
+	is($result->query_length, 21);
+	is($result->algorithm, 'BLASTP');
+	is($result->algorithm_version, 'blastp 2.1.3 [Apr-1-2001]');
+	
+	is($result->available_parameters, 8);
+	is($result->get_parameter('gapext'), 1);
+	is($result->available_statistics, 5);
+	is($result->get_statistic('lambda'), 0.267);
+	
 	# this result actually has a hit
-    $result = $searchio->next_result;
-    is($searchio->result_count, 2);
-    $hit = $result->next_hit;
-    is($hit->name, 'gnl|Pfam|pfam00742');
-    is($hit->description(), 'HomoS_dh, HomoS dehydrogenase');
-    is($hit->accession, 'pfam00742');
-    is($hit->ncbi_gi, ''); # not found
-    is($hit->length, 310);
-
-    $hsp = $hit->next_hsp;
-    is($hsp->query->seq_id, $result->query_name,'query name on HSP');
-    is($hsp->query->seqdesc, $result->query_description,'query desc on HSP');
-    is($hsp->hit->seq_id, $hit->name,'hitname');
-    is($hsp->hit->seqdesc, $hit->description,'hitdesc');
-    is($hsp->pvalue, undef);
-    is(sprintf("%g",$hsp->evalue), sprintf("%g",'1.46134e-90'));
-    is($hsp->score, 838);
-    is($hsp->bits,327.405);
-    is($hsp->query->start, 498);
-    is($hsp->query->end,815);
-    is($hsp->hit->start, 3);
-    is($hsp->hit->end, 310);
-    is($hsp->query->frame,0);
-    is($hsp->hit->frame,0);
-    is(sprintf("%.2f", $hsp->percent_identity), 37.73);
-    is(sprintf("%.4f", $hsp->frac_identical('hit')), 0.3994);
-    is(sprintf("%.4f", $hsp->frac_identical('query')), 0.3868);
-    is(sprintf("%.4f",$hsp->query->frac_identical), 0.3868);
-
-    is(sprintf("%.4f",$hsp->frac_conserved('total')),0.5245);
-    is(sprintf("%.4f",$hsp->frac_conserved('hit')),0.5552);
-    is(sprintf("%.4f",$hsp->frac_conserved('query')),0.5377);
-    # gaps should match calculated sequence indices for gaps and vice versa
-    is($hsp->gaps('total'), $hsp->seq_inds('hit', 'gaps') + $hsp->seq_inds('query', 'gaps'));
-    is($hsp->gaps('hit'), $hsp->seq_inds('hit', 'gaps'));
-    is($hsp->gaps('query'), $hsp->seq_inds('query', 'gaps'));
-    is($hsp->length('total'), 326);
-    is($hsp->query_string, 'LRVCGVANSKALLTNVHGLNLENWQEELAQAKEPF-NLGRLIRLVKEYHLLN----PVIVDCTSSQAVAD-QYADFLREGFHVVTPNKKANTSSMDYYHQLRYAAEKSRRKFLYDTNVGAGLPVIENLQNLLNAGDELMKFSGILSGSLSYIFGKLDE-GMSFSEATTLAREMGYTEPDPRDDLSGMDVARKLLILARET-GRELELADIEIEPVLPAEFNAEGDVAAFMANLSQLDDLFAARVAKARDEGKVLRYVGNIDEDGVCRVKIAEVDGNDPLFKVKNGENALAFYSHYYQPLPLVLRGYGAGNDVTAAGVFADLLRTLS');
-    is($hsp->hit_string, 'GVVTGITDSREMLLSRIGLPLEIWKVALRDLEKPRKDLGKLDLTDDAFAVVDDPDIDVVVELTGGIEVARELYLDALEEGKHVVTANKALNASHGDEYLAL---AEKSGVDVLYEAAVAGGIPIIKTLRELLATGDRILKIEGIFNGTTNFILSEMDEKGLPFSDVLAEAQELGYTEADPRDDVEGIDAARKLAILARIAFGIELELDDVYVEGISPITAEDISSADEFGYTLKLLDEAMRQRVEDAESGGEVLRYPTLIPE-------------DHPLASVKGSDNAVAVEGEAYG--PLMFYGPGAGAEPTASAVVADIVRIAR');
-    is($hsp->homology_string, '  V G+ +S+ +L +  GL LE W+  L   ++P  +LG+L      + +++     V+V+ T    VA   Y D L EG HVVT NK  N S  D Y  L   AEKS    LY+  V  G+P+I+ L+ LL  GD ++K  GI +G+ ++I  ++DE G+ FS+    A+E+GYTE DPRDD+ G+D ARKL ILAR   G ELEL D+ +E + P           F   L  LD+    RV  A   G+VLRY   I E             + PL  VK  +NA+A     Y   PL+  G GAG + TA+ V AD++R   ');
-    is(join(' ', $hsp->seq_inds('query', 'gap',1)), '532 548 562 649 690');
-    is($hsp->ambiguous_seq_inds, '');
+	$result = $searchio->next_result;
+	is($searchio->result_count, 2);
+	$hit = $result->next_hit;
+	is($hit->name, 'gnl|Pfam|pfam00742');
+	is($hit->description(), 'HomoS_dh, HomoS dehydrogenase');
+	is($hit->accession, 'pfam00742');
+	is($hit->ncbi_gi, ''); # not found
+	is($hit->length, 310);
 	
+	$hsp = $hit->next_hsp;
+	is($hsp->query->seq_id, $result->query_name,'query name on HSP');
+	is($hsp->query->seqdesc, $result->query_description,'query desc on HSP');
+	is($hsp->hit->seq_id, $hit->name,'hitname');
+	is($hsp->hit->seqdesc, $hit->description,'hitdesc');
+	is($hsp->pvalue, undef);
+	is(sprintf("%g",$hsp->evalue), sprintf("%g",'1.46134e-90'));
+	is($hsp->score, 838);
+	is($hsp->bits,327.405);
+	is($hsp->query->start, 498);
+	is($hsp->query->end,815);
+	is($hsp->hit->start, 3);
+	is($hsp->hit->end, 310);
+	is($hsp->query->frame,0);
+	is($hsp->hit->frame,0);
+	is(sprintf("%.2f", $hsp->percent_identity), 37.73);
+	is(sprintf("%.4f", $hsp->frac_identical('hit')), 0.3994);
+	is(sprintf("%.4f", $hsp->frac_identical('query')), 0.3868);
+	is(sprintf("%.4f",$hsp->query->frac_identical), 0.3868);
+	
+	is(sprintf("%.4f",$hsp->frac_conserved('total')),0.5245);
+	is(sprintf("%.4f",$hsp->frac_conserved('hit')),0.5552);
+	is(sprintf("%.4f",$hsp->frac_conserved('query')),0.5377);
+	# gaps should match calculated sequence indices for gaps and vice versa
+	is($hsp->gaps('total'), $hsp->seq_inds('hit', 'gaps') + $hsp->seq_inds('query', 'gaps'));
+	is($hsp->gaps('hit'), $hsp->seq_inds('hit', 'gaps'));
+	is($hsp->gaps('query'), $hsp->seq_inds('query', 'gaps'));
+	is($hsp->length('total'), 326);
+	is($hsp->query_string, 'LRVCGVANSKALLTNVHGLNLENWQEELAQAKEPF-NLGRLIRLVKEYHLLN----PVIVDCTSSQAVAD-QYADFLREGFHVVTPNKKANTSSMDYYHQLRYAAEKSRRKFLYDTNVGAGLPVIENLQNLLNAGDELMKFSGILSGSLSYIFGKLDE-GMSFSEATTLAREMGYTEPDPRDDLSGMDVARKLLILARET-GRELELADIEIEPVLPAEFNAEGDVAAFMANLSQLDDLFAARVAKARDEGKVLRYVGNIDEDGVCRVKIAEVDGNDPLFKVKNGENALAFYSHYYQPLPLVLRGYGAGNDVTAAGVFADLLRTLS');
+	is($hsp->hit_string, 'GVVTGITDSREMLLSRIGLPLEIWKVALRDLEKPRKDLGKLDLTDDAFAVVDDPDIDVVVELTGGIEVARELYLDALEEGKHVVTANKALNASHGDEYLAL---AEKSGVDVLYEAAVAGGIPIIKTLRELLATGDRILKIEGIFNGTTNFILSEMDEKGLPFSDVLAEAQELGYTEADPRDDVEGIDAARKLAILARIAFGIELELDDVYVEGISPITAEDISSADEFGYTLKLLDEAMRQRVEDAESGGEVLRYPTLIPE-------------DHPLASVKGSDNAVAVEGEAYG--PLMFYGPGAGAEPTASAVVADIVRIAR');
+	is($hsp->homology_string, '  V G+ +S+ +L +  GL LE W+  L   ++P  +LG+L      + +++     V+V+ T    VA   Y D L EG HVVT NK  N S  D Y  L   AEKS    LY+  V  G+P+I+ L+ LL  GD ++K  GI +G+ ++I  ++DE G+ FS+    A+E+GYTE DPRDD+ G+D ARKL ILAR   G ELEL D+ +E + P           F   L  LD+    RV  A   G+VLRY   I E             + PL  VK  +NA+A     Y   PL+  G GAG + TA+ V AD++R   ');
+	is(join(' ', $hsp->seq_inds('query', 'gap',1)), '532 548 562 649 690');
+	is($hsp->ambiguous_seq_inds, '');
+	
 	# one more 
-    $hit = $result->next_hit;
-    isa_ok($hit,'Bio::Search::Hit::HitI');
-    
-    my $results_left = 8;
-    while( $result = $searchio->next_result ) { ok($result); $results_left--; }
-    is($results_left, 0);
-
-    $searchio = Bio::SearchIO->new(-format => 'blastxml',
+	$hit = $result->next_hit;
+	isa_ok($hit,'Bio::Search::Hit::HitI');
+	
+	my $results_left = 8;
+	while( $result = $searchio->next_result ) { ok($result); $results_left--; }
+	is($results_left, 0);
+	

@@ Diff output truncated at 10000 characters. @@



More information about the Bioperl-guts-l mailing list