[Bioperl-guts-l] [15323] bioperl-run/trunk/t: * finish up bioperl-run conversion

Christopher John Fields cjfields at dev.open-bio.org
Sat Jan 10 11:21:47 EST 2009


Revision: 15323
Author:   cjfields
Date:     2009-01-10 11:21:46 -0500 (Sat, 10 Jan 2009)

Log Message:
-----------
* finish up bioperl-run conversion
* will need to add a Bio::Root::Test test_cleanup method for unlinking some files

Modified Paths:
--------------
    bioperl-run/trunk/t/Clustalw.t
    bioperl-run/trunk/t/Coil.t
    bioperl-run/trunk/t/DrawGram.t
    bioperl-run/trunk/t/DrawTree.t
    bioperl-run/trunk/t/EMBOSS.t
    bioperl-run/trunk/t/Genemark.hmm.prokaryotic.t
    bioperl-run/trunk/t/Genewise.t
    bioperl-run/trunk/t/Genscan.t
    bioperl-run/trunk/t/Gerp.t
    bioperl-run/trunk/t/Glimmer2.t
    bioperl-run/trunk/t/Glimmer3.t
    bioperl-run/trunk/t/Gumby.t
    bioperl-run/trunk/t/Hmmer.t
    bioperl-run/trunk/t/Hyphy.t
    bioperl-run/trunk/t/Kalign.t
    bioperl-run/trunk/t/LVB.t
    bioperl-run/trunk/t/MAFFT.t
    bioperl-run/trunk/t/MCS.t
    bioperl-run/trunk/t/Match.t
    bioperl-run/trunk/t/Mdust.t
    bioperl-run/trunk/t/Meme.t
    bioperl-run/trunk/t/Molphy.t
    bioperl-run/trunk/t/Muscle.t
    bioperl-run/trunk/t/Neighbor.t
    bioperl-run/trunk/t/Njtree.t
    bioperl-run/trunk/t/PAML.t
    bioperl-run/trunk/t/Pal2Nal.t
    bioperl-run/trunk/t/PhastCons.t
    bioperl-run/trunk/t/Phrap.t
    bioperl-run/trunk/t/Phyml.t
    bioperl-run/trunk/t/Pise.t
    bioperl-run/trunk/t/Primate.t
    bioperl-run/trunk/t/Primer3.t
    bioperl-run/trunk/t/Prints.t
    bioperl-run/trunk/t/Probalign.t
    bioperl-run/trunk/t/Probcons.t
    bioperl-run/trunk/t/Profile.t
    bioperl-run/trunk/t/Promoterwise.t
    bioperl-run/trunk/t/ProtDist.t
    bioperl-run/trunk/t/ProtPars.t
    bioperl-run/trunk/t/Pseudowise.t
    bioperl-run/trunk/t/QuickTree.t
    bioperl-run/trunk/t/RepeatMasker.t
    bioperl-run/trunk/t/SLR.t
    bioperl-run/trunk/t/Seg.t
    bioperl-run/trunk/t/Semphy.t
    bioperl-run/trunk/t/SeqBoot.t
    bioperl-run/trunk/t/Signalp.t
    bioperl-run/trunk/t/Sim4.t
    bioperl-run/trunk/t/Simprot.t
    bioperl-run/trunk/t/StandAloneFasta.t
    bioperl-run/trunk/t/TCoffee.t
    bioperl-run/trunk/t/TigrAssembler.t
    bioperl-run/trunk/t/Tmhmm.t
    bioperl-run/trunk/t/TribeMCL.t
    bioperl-run/trunk/t/Vista.t
    bioperl-run/trunk/t/tRNAscanSE.t

Modified: bioperl-run/trunk/t/Clustalw.t
===================================================================
--- bioperl-run/trunk/t/Clustalw.t	2009-01-10 00:15:32 UTC (rev 15322)
+++ bioperl-run/trunk/t/Clustalw.t	2009-01-10 16:21:46 UTC (rev 15323)
@@ -18,11 +18,11 @@
 
 
 # setup input files etc
-my $inputfilename = File::Spec->catfile("t","data","cysprot.fa");
+my $inputfilename = test_input_file("cysprot.fa");
 ok( -e $inputfilename, 'Found input file' );
-my $profile1 = File::Spec->catfile('t','data','cysprot1a.msf');
+my $profile1 = test_input_file('cysprot1a.msf');
 ok( -e $profile1, 'Found profile1 file' );
-my $profile2 = File::Spec->catfile('t','data','cysprot1b.msf');
+my $profile2 = test_input_file('cysprot1b.msf');
 ok( -e $profile2, 'Found profile2 file' );
 
 # setup global objects that are to be used in more than one test
@@ -53,17 +53,14 @@
   # remove last bit 
   $ver =~ s{^(\d+\.\d+)\.\d+}{$1};
   
-  my $skip;
-  
   # clustalw2 isn't supported yet.
   if ($ver < 1.8) {
     diag("ClustalW version $ver not supported");
-    $skip++;
+    skip("ClustalW version $ver not supported", 16);
   } if ($ver >= 2.0) {
-    diag("ClustalW version $ver not supported yet.");
-    $skip++
+    diag("Warning: ClustalW version $ver not supported yet.");
+    skip("ClustalW version $ver not supported yet", 16);
   }
-  skip("ClustalW version $ver not supported yet", 16) if $skip;
   
   ok( $ver, "Supported program version $ver" );
   
@@ -142,7 +139,7 @@
     $aln = $factory->profile_align($aln1,$aln2);
     is($aln->get_seq_by_pos(2)->get_nse, 'CATH_HUMAN/1-335', 'Got correct sequence by position');
 	
-    $str2 = Bio::SeqIO->new(-file=> Bio::Root::IO->catfile("t","data","cysprot1b.fa"));
+    $str2 = Bio::SeqIO->new(-file=> test_input_file("cysprot1b.fa"));
     my $seq = $str2->next_seq();
     $aln = $factory->profile_align($aln1,$seq);
     is($aln->get_seq_by_pos(2)->get_nse,  'CATH_HUMAN/1-335', 'Got correct sequence by position');

Modified: bioperl-run/trunk/t/Coil.t
===================================================================
--- bioperl-run/trunk/t/Coil.t	2009-01-10 00:15:32 UTC (rev 15322)
+++ bioperl-run/trunk/t/Coil.t	2009-01-10 16:21:46 UTC (rev 15323)
@@ -19,7 +19,7 @@
              -tests => 4);
    ok $factory->isa('Bio::Tools::Run::Coil');
 
-   my $prot_file=  Bio::Root::IO->catfile("t","data","coil_protein_input");
+   my $prot_file=  test_input_file("coil_protein_input");
 
    my $seq1 = Bio::Seq->new();
    my $seqstream = Bio::SeqIO->new(-file => $prot_file, -fmt => 'Fasta');

Modified: bioperl-run/trunk/t/DrawGram.t
===================================================================
--- bioperl-run/trunk/t/DrawGram.t	2009-01-10 00:15:32 UTC (rev 15322)
+++ bioperl-run/trunk/t/DrawGram.t	2009-01-10 16:21:46 UTC (rev 15323)
@@ -3,9 +3,7 @@
 ## $Id$
 
 use strict;
-use vars qw($DEBUG);
 
-$DEBUG = $ENV{'BIOPERLDEBUG'} || 0;
 BEGIN {
     use lib '.';
     use Bio::Root::Test;
@@ -27,7 +25,7 @@
 	ok($file);
 	ok(-e $file);
 	
-	if( $DEBUG ) {
+	if( test_debug() ) {
 		`gs $file`;
 	}
 	unlink($file);
@@ -44,7 +42,7 @@
 	ok($file);
 	ok(-e $file);
 	
-	if( $DEBUG ) {
+	if( test_debug() ) {
 		`gs $file`;
 	}
 	unlink($file);

Modified: bioperl-run/trunk/t/DrawTree.t
===================================================================
--- bioperl-run/trunk/t/DrawTree.t	2009-01-10 00:15:32 UTC (rev 15322)
+++ bioperl-run/trunk/t/DrawTree.t	2009-01-10 16:21:46 UTC (rev 15323)
@@ -3,9 +3,7 @@
 ## $Id$
 
 use strict;
-use vars qw($DEBUG);
 
-$DEBUG = $ENV{'BIOPERLDEBUG'} || 0;
 BEGIN {
     use lib '.';
     use Bio::Root::Test;
@@ -26,7 +24,7 @@
 	ok($file);
 	ok(-e $file);
 	
-	if( $DEBUG ) {
+	if( test_debug() ) {
 		`gs $file`;
 	} else { 
 		unlink($file);
@@ -38,7 +36,7 @@
 	ok($file);
 	ok(-e $file);
 	
-	if( $DEBUG ) {
+	if( test_debug() ) {
 		`gs $file`;
 	} else { 
 		unlink($file);

Modified: bioperl-run/trunk/t/EMBOSS.t
===================================================================
--- bioperl-run/trunk/t/EMBOSS.t	2009-01-10 00:15:32 UTC (rev 15322)
+++ bioperl-run/trunk/t/EMBOSS.t	2009-01-10 16:21:46 UTC (rev 15323)
@@ -106,9 +106,7 @@
 	my $cons = $factory->program('cons');
 	$cons->verbose(0);
 	$in = Bio::AlignIO->new(-format => 'msf',
-				   -file   => Bio::Root::IO->catfile('t',
-								 'data',
-								 'cysprot.msf'));
+				   -file   => test_input_file('cysprot.msf'));
 	my $aln2 = $in->next_aln;
 	if( $version ge '2.8.0' ) {
 		$cons->run({ '-sequence' => $aln2,
@@ -155,9 +153,7 @@
 	
 	 %input = ( '-word' => 4,
 		   '-incorrect_option' => 'no value',
-		   '-sequence' => Bio::Root::IO->catfile('t',
-							 'data',
-							 'dna1.fa'),
+		   '-sequence' => test_input_file('dna1.fa'),
 		   '-outfile' => $compseqoutfile);
 	eval {
 		$compseqapp->run(\%input);

Modified: bioperl-run/trunk/t/Genemark.hmm.prokaryotic.t
===================================================================
--- bioperl-run/trunk/t/Genemark.hmm.prokaryotic.t	2009-01-10 00:15:32 UTC (rev 15322)
+++ bioperl-run/trunk/t/Genemark.hmm.prokaryotic.t	2009-01-10 16:21:46 UTC (rev 15323)
@@ -2,12 +2,10 @@
 # ## Bioperl Test Harness Script for Modules
 # #
 use strict;
-use vars qw($NTESTS);
 
 BEGIN {
     use Bio::Root::Test;
-    $NTESTS = 98;
-    test_begin(-tests => $NTESTS,
+    test_begin(-tests => 98,
 	       -requires_modules => [qw(IPC::Run)]);
 
     use_ok('Bio::Tools::Run::Genemark');
@@ -15,7 +13,7 @@
     use_ok('Bio::Seq');
 }
 
-my $verbose   = 1 if $ENV{'BIOPERLDEBUG'};
+my $verbose   = test_debug();
 my $model_dir = $ENV{'GENEMARK_MODELS'} if $ENV{'GENEMARK_MODELS'};
 
 SKIP: {

Modified: bioperl-run/trunk/t/Genewise.t
===================================================================
--- bioperl-run/trunk/t/Genewise.t	2009-01-10 00:15:32 UTC (rev 15322)
+++ bioperl-run/trunk/t/Genewise.t	2009-01-10 16:21:46 UTC (rev 15323)
@@ -4,102 +4,84 @@
 
 use strict;
 BEGIN {
-    eval { require Test; };
-    if( $@ ) {
-        use lib 't';
-    }
-    use Test;
-    use vars qw($NTESTS);
-    $NTESTS = 18;
-    plan tests => $NTESTS;
+    use lib '.';
+    use Bio::Root::Test;
+    test_begin(-tests => 20);
+	use_ok('Bio::Tools::Run::Genewise');
+	use_ok('Bio::Root::IO');
+	use_ok('Bio::Seq');
 }
-use Bio::Tools::Run::Genewise;
-use Bio::Root::IO;
-use Bio::Seq;
 
-END {
-    for ( $Test::ntest..$NTESTS ) {
-        skip("genewise program not found. Skipping. (Be sure you have the wise package > 2.2.0)",1);
-    }
-}
-
-ok(1);
-my $verbose = $ENV{BIOPERLDEBUG} ? 1 : -1;
+my $verbose = test_debug() || -1;
 my @params = ('-verbose' => $verbose, 
 	      'silent' => 1, 
 	      'quiet' => 1);
 
 my $factory = Bio::Tools::Run::Genewise->new(@params);
 
-unless ($factory->executable) {
-   warn("Genewise program not found. Skipping tests $Test::ntest to $NTESTS.\n");
-   exit 0;
-}
+SKIP:{
+	test_skip(-requires_executable => $factory, -tests => 17);
 
-my $version = $factory->version;
-warn("version is $version\n") if $verbose > 0;
-ok $factory->isa('Bio::Tools::Run::Genewise');
+	my $version = $factory->version;
+	warn("version is $version\n") if $verbose > 0;
+	isa_ok $factory,'Bio::Tools::Run::Genewise';
+	
+	my $bequiet = 1;
+	$factory->quiet($bequiet);  # Suppress pseudowise messages to terminal
+	
+	#test with one file with 2 sequences
+	my $inputfilename = test_input_file('road.pep');
+	my $seqstream1 = Bio::SeqIO->new(-file => $inputfilename, 
+					 -format => 'fasta');
+	my $seq1 = Bio::Seq->new();
+	$seq1 = $seqstream1->next_seq();
+	
+	$inputfilename = test_input_file('human.genomic');
+	my $seqstream2 = Bio::SeqIO->new(-file => $inputfilename, 
+					 -format => 'fasta');
+	my $seq2 = Bio::Seq->new();
+	$seq2 = $seqstream2->next_seq();
+	
+	my ($genes) = $factory->predict_genes($seq1, $seq2);
+	
+	my @transcripts = $genes->transcripts;
+	my @feat = $transcripts[0]->exons;
+	my $seqid = $feat[0]->seq_id;
+	is($seqid, 'HSHNRNPA');
+	my ($featpair)= $feat[0]->each_tag_value('supporting_feature');
+	is($featpair->feature2->seq_id,'roa1_drome');
+	is($featpair->feature1->seq_id,'HSHNRNPA');
+	if( defined $version && $version eq 'wise2-2-0' ) {
+		is($transcripts[0]->start, 1386);
+		is($transcripts[0]->end, 3963);
+		is($feat[0]->start, 1386);
+		is($feat[0]->end, 1493);
+		is($feat[0]->strand,1);
+		is($featpair->feature2->start,26);
+		is($featpair->feature2->end,61);
+		is($featpair->feature2->strand,1);
+		is($featpair->feature2->score,'253.10');
+		is($featpair->feature1->start,1386);
+		is($featpair->feature1->end,1493);
+		is($featpair->feature1->strand,1);
+		is($featpair->feature1->score,'253.10');
+	} else {
+		warn("These tests may fail because I'm not sure about your genewise version -- using wise 2.2.3-rc7 values\n");
+		is($transcripts[0]->start, 1386);
+		is($transcripts[0]->end, 4304);
+	
+		is($feat[0]->start, 1386);
+		is($feat[0]->end, 1493);
+		is($feat[0]->strand,1);
+		is($featpair->feature2->start,26);
+		is($featpair->feature2->end,61);
+		is($featpair->feature2->strand,1);
+		is($featpair->feature2->score,'319.10');
+		is($featpair->feature1->start,1386);
+		is($featpair->feature1->end,1493);
+		is($featpair->feature1->strand,1);
+		is($featpair->feature1->score,'319.10');
+	
+	}
 
-my $bequiet = 1;
-$factory->quiet($bequiet);  # Suppress pseudowise messages to terminal
-
-#test with one file with 2 sequences
-my $inputfilename = Bio::Root::IO->catfile(qw(t data road.pep));
-my $seqstream1 = Bio::SeqIO->new(-file => $inputfilename, 
-				 -format => 'fasta');
-my $seq1 = Bio::Seq->new();
-$seq1 = $seqstream1->next_seq();
-
-$inputfilename = Bio::Root::IO->catfile(qw(t data human.genomic));
-my $seqstream2 = Bio::SeqIO->new(-file => $inputfilename, 
-				 -format => 'fasta');
-my $seq2 = Bio::Seq->new();
-$seq2 = $seqstream2->next_seq();
-
-my ($genes) = $factory->predict_genes($seq1, $seq2);
-
-my @transcripts = $genes->transcripts;
-my @feat = $transcripts[0]->exons;
-my $seqid = $feat[0]->seq_id;
-ok($seqid, 'HSHNRNPA');
-my ($featpair)= $feat[0]->each_tag_value('supporting_feature');
-ok($featpair->feature2->seq_id,'roa1_drome');
-ok($featpair->feature1->seq_id,'HSHNRNPA');
-if( defined $version && $version eq 'wise2-2-0' ) {
-    ok($transcripts[0]->start, 1386);
-    ok($transcripts[0]->end, 3963);
-    ok($feat[0]->start, 1386);

@@ Diff output truncated at 10000 characters. @@



More information about the Bioperl-guts-l mailing list