[Bioperl-guts-l] [14999] bioperl-live/trunk/t: [tests]

Christopher John Fields cjfields at dev.open-bio.org
Mon Nov 17 17:57:10 EST 2008


Revision: 14999
Author:   cjfields
Date:     2008-11-17 17:57:10 -0500 (Mon, 17 Nov 2008)

Log Message:
-----------
[tests]
* split up SearchIO into more manageable bits
* relevant Bio::Tools parsers get their own Tools_* test files where needed

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

Added Paths:
-----------
    bioperl-live/trunk/t/SearchIO_HTMLWriter.t
    bioperl-live/trunk/t/SearchIO_HitTableWriter.t
    bioperl-live/trunk/t/SearchIO_blast.t
    bioperl-live/trunk/t/SearchIO_blast_pull.t
    bioperl-live/trunk/t/SearchIO_blasttable.t
    bioperl-live/trunk/t/SearchIO_blastxml.t
    bioperl-live/trunk/t/SearchIO_cross_match.t
    bioperl-live/trunk/t/SearchIO_erpin.t
    bioperl-live/trunk/t/SearchIO_exonerate.t
    bioperl-live/trunk/t/SearchIO_fasta.t
    bioperl-live/trunk/t/SearchIO_hmmer.t
    bioperl-live/trunk/t/SearchIO_hmmer_pull.t
    bioperl-live/trunk/t/SearchIO_infernal.t
    bioperl-live/trunk/t/SearchIO_megablast.t
    bioperl-live/trunk/t/SearchIO_psl.t
    bioperl-live/trunk/t/SearchIO_rnamotif.t
    bioperl-live/trunk/t/SearchIO_sim4.t
    bioperl-live/trunk/t/SearchIO_waba.t
    bioperl-live/trunk/t/SearchIO_wise.t
    bioperl-live/trunk/t/Tools_genewise.t
    bioperl-live/trunk/t/Tools_genomewise.t
    bioperl-live/trunk/t/Tools_hmmer.t
    bioperl-live/trunk/t/Tools_sim4.t

Modified: bioperl-live/trunk/t/SearchIO.t
===================================================================
--- bioperl-live/trunk/t/SearchIO.t	2008-11-17 22:54:45 UTC (rev 14998)
+++ bioperl-live/trunk/t/SearchIO.t	2008-11-17 22:57:10 UTC (rev 14999)
@@ -7,2132 +7,15 @@
 	use lib 't/lib';
     use BioperlTest;
     
-    test_begin(-tests => 1833);
+    test_begin(-tests => 19);
 	
 	use_ok('Bio::SearchIO');
-	use_ok('Bio::SearchIO::Writer::HitTableWriter');
-	use_ok('Bio::SearchIO::Writer::HTMLResultWriter');
 }
 
-my ($searchio, $result,$iter,$hit,$hsp);
+# only methods defined in Bio::SearchIO should be tested here; all
+# parsers should have their own separate SearchIO_*.t test file
 
-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;
-	};
-	if ($@ && $@ =~ m{Handler could not resolve external entity}) {
-		skip("XML::SAX::Expat does not work with XML tests; skipping",129);
-	} elsif ($@) {
-		skip("Problem with XML::SAX setup: $@. Check ParserDetails.ini; skipping XML tests",129);
-	}
-    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);
-    is($hsp->gaps('total'), 26);
-    is($hsp->length('hsp'), 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',
-								  -verbose => -1,
-				  -file => test_input_file('plague_yeast.bls.xml'));
-
-    $result = $searchio->next_result;
-    is($searchio->result_count, 1);
-    is($result->database_name, 'yeast.aa');
-    is($result->query_name, 'gi|5763811|emb|CAB53164.1|');
-    is($result->query_description,  'putative transposase [Yersinia pestis]');
-    is($result->query_accession, 'CAB53164.1');
-    is($result->query_gi, 5763811);  
-    is($result->query_length, 340);
-
-    $hit = $result->next_hit;
-    ok(! $hit);
-
-    $searchio = Bio::SearchIO->new(-format => 'blastxml',
-								  -verbose => -1,
-				  -file => test_input_file('mus.bls.xml'));
-
-    $result = $searchio->next_result;
-    is($searchio->result_count, 1);
-    is($result->database_name,'Hs15_up1000');
-    is($result->query_name,'NM_011441_up_1000_chr1_4505586_r');
-    is($result->query_description,'chr1:4505586-4506585');
-    is($result->query_accession,'NM_011441_up_1000_chr1_4505586_r');
-    is($result->query_gi, '');
-    is($result->query_length,'1000');
-    $hit = $result->next_hit;
-    is($hit->name,'NM_001938_up_1000_chr1_93161154_f');
-    is($hit->description,'chr1:93161154-93162153');
-    is($hit->ncbi_gi, ''); # none reported
-    is($hit->accession,'3153');
-    is($hit->length,'1000');
-    
-    # deal with new BLAST XML changes
-    $searchio = Bio::SearchIO->new(-format => 'blastxml',
-								  -verbose => -1,
-				  -file => test_input_file('newblast.xml'));
-
-    $result = $searchio->next_result;
-    is($searchio->result_count, 1);
-    is($result->database_name,'nr');
-    is($result->database_name,'nr');
-    is($result->database_letters,'1479795817');
-    is($result->database_entries,'4299737');
-    is($result->algorithm,'BLASTP');
-    is($result->algorithm_version,'BLASTP 2.2.15 [Oct-15-2006]');
-    
-    # some XML::SAX parsers (PurePerl, XML::SAX::LibXML) don't decode entities
-    # properly, not fixable using decode_entities()
-    like($result->algorithm_reference, qr{Nucleic Acids Res} ); 
-    is($result->available_parameters,4);
-    is($result->available_statistics,5);
-    is($result->query_name,'gi|15600734|ref|NP_254228.1|');
-    is($result->query_description,'dihydroorotase [Pseudomonas aeruginosa PAO1]');
-    is($result->query_accession,'NP_254228.1');
-    is($result->query_gi, 15600734);
-    is($result->query_length,'445');
-    $hit = $result->next_hit;
-    is($hit->name,'gi|15600734|ref|NP_254228.1|');
-    is($hit->description,'dihydroorotase [Pseudomonas aeruginosa PAO1] '.
-       '>gi|107104643|ref|ZP_01368561.1| hypothetical protein PaerPA_01005722 '.
-       '[Pseudomonas aeruginosa PACS2] >gi|9951880|gb|AAG08926.1|AE004966_8 '.
-       'dihydroorotase [Pseudomonas aeruginosa PAO1]');
-    is($hit->accession,'NP_254228');
-    is($hit->length,'445');
-    $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",'0'));
-    is($hsp->score, 2251);
-    is($hsp->bits,871.692);
-    is($hsp->query->start, 1);
-    is($hsp->query->end,445);
-    is($hsp->hit->start, 1);
-    is($hsp->hit->end, 445);
-    is($hsp->query->frame,0);
-    is($hsp->hit->frame,0);
-    
-    $result = $searchio->next_result;
-    is($searchio->result_count, 2);
-    is($result->database_name,'nr'); 
-    is($result->database_letters,'1479795817'); 
-    is($result->database_entries,'4299737');
-    is($result->algorithm,'BLASTP');
-    is($result->algorithm_version,'BLASTP 2.2.15 [Oct-15-2006]'); 
-    like($result->algorithm_reference, qr{Nucleic Acids Res} );
-    is($result->available_parameters,4); 
-    is($result->available_statistics,5);
-    is($result->query_name,'gi|15598723|ref|NP_252217.1|');
-    is($result->query_description,'dihydroorotase [Pseudomonas aeruginosa PAO1]');
-    is($result->query_accession,'NP_252217.1');
-    is($result->query_gi, 15598723);
-    is($result->query_length,'348');
-    $hit = $result->next_hit;
-    is($hit->name,'gi|15598723|ref|NP_252217.1|');
-    is($hit->description,'dihydroorotase [Pseudomonas aeruginosa PAO1] '.
-       '>gi|6226683|sp|P72170|PYRC_PSEAE Dihydroorotase (DHOase) '.
-       '>gi|9949676|gb|AAG06915.1|AE004773_4 dihydroorotase [Pseudomonas aeruginosa PAO1] '.
-       '>gi|3868712|gb|AAC73109.1| dihydroorotase [Pseudomonas aeruginosa]');
-    is($hit->ncbi_gi, 15598723);
-    is($hit->accession,'NP_252217');
-    is($hit->length,'348');
-    $hsp = $hit->next_hsp;
-    is($hsp->query->seq_id, $result->query_name,'query name on HSP');

@@ Diff output truncated at 10000 characters. @@



More information about the Bioperl-guts-l mailing list