Skip to content
Browse files

Move Pise modules over to bioperl-pise

svn path=/bioperl-pise/trunk/; revision=15350
  • Loading branch information...
1 parent 4f47994 commit b0f8a78ff59fcb4668553dc230551f0e0da19ef0 cjfields committed Jan 13, 2009
Showing with 94 additions and 0 deletions.
  1. +94 −0 t/Pise.t
View
94 t/Pise.t
@@ -0,0 +1,94 @@
+# -*-Perl-*- mode
+use strict;
+
+our $NTESTS;
+
+BEGIN {
+ use Bio::Root::Test;
+ $NTESTS = 15;
+ test_begin(-tests => $NTESTS,
+ -requires_networking => 1);
+ use_ok('Bio::Tools::Run::tRNAscanSE');
+ use_ok('Bio::Root::IO');
+ use_ok('Bio::Seq');
+}
+
+my $actually_submit;
+my $golden_outfile = 'golden.out';
+
+END {
+ if ($actually_submit) {
+ unlink($golden_outfile);
+ }
+}
+
+SKIP: {
+ test_skip(-tests => 11, -requires_module => 'XML::Parser::PerlSAX');
+ use_ok('XML::Parser::PerlSAX');
+ use_ok('Bio::Tools::Run::AnalysisFactory::Pise');
+ use_ok('Bio::Tools::Genscan');
+ use_ok('Bio::SeqIO');
+
+ my $email;
+ if( -e "t/pise-email.test" ) {
+ if( open(my $T, "t/pise-email.test") ) {
+ chomp($email = <$T>);
+ close $T;
+ } else {
+ #email not mandatory anymore, uncomment if this changes
+ #print "skipping tests, cannot run without read access to testfile data";
+ #exit;
+ }
+ }
+
+ my $factory;
+
+ if ($email) {
+ $factory = Bio::Tools::Run::AnalysisFactory::Pise->new(-email => $email);
+ } else {
+ $factory = Bio::Tools::Run::AnalysisFactory::Pise->new();
+ }
+
+ isa_ok($factory,'Bio::Tools::Run::AnalysisFactory::Pise');
+
+ my $golden = $factory->program('golden',
+ -db => 'genbank',
+ -query => 'HUMRASH');
+ isa_ok($golden,'Bio::Tools::Run::PiseApplication::golden');
+
+ my $job;
+ eval { $job = $golden->run(); };
+ skip("Problem with job submission: $@",6) if $@;
+
+ isa_ok($job,'Bio::Tools::Run::PiseJob');
+
+ if ($job->error) {
+ diag("Error: ". $job->error_message);
+ }
+
+ ok(! $job->error, 'No error');
+
+ SKIP: {
+ skip('Job Error', 4) if $job->error;
+ $job->save($golden_outfile);
+ ok (-e $golden_outfile, 'Save data');
+
+ my $in = Bio::SeqIO->new ( -file => $golden_outfile,
+ -format => 'genbank');
+ my $seq = $in->next_seq();
+ my $genscan = $factory->program('genscan',
+ -parameter_file => "HumanIso.smat",
+ );
+ isa_ok($genscan,'Bio::Tools::Run::PiseApplication::genscan');
+
+ $genscan->seq($seq);
+
+ eval{ $job = $genscan->run(); };
+ skip("Problem with job submission: $@",2) if $@;
+
+ isa_ok($job,'Bio::Tools::Run::PiseJob');
+
+ my $parser = Bio::Tools::Genscan->new(-fh => $job->fh('genscan.out'));
+ isa_ok($parser,'Bio::Tools::Genscan');
+ }
+}

0 comments on commit b0f8a78

Please sign in to comment.
Something went wrong with that request. Please try again.