Skip to content

Commit

Permalink
sync with run trunk
Browse files Browse the repository at this point in the history
svn path=/bioperl-run/branches/branch-1-6/; revision=15456
  • Loading branch information
cjfields committed Jan 28, 2009
1 parent 384e621 commit 8af630d
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 21 deletions.
17 changes: 9 additions & 8 deletions Bio/Tools/Run/Alignment/MAFFT.pm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -243,15 +243,16 @@ sub version {
# slightly. i've tried to make the change compatible with both... # slightly. i've tried to make the change compatible with both...
# version="v5.860 (2006/06/12)"; export version # version="v5.860 (2006/06/12)"; export version


if( open(NAME, "grep 'export version' $exe | ") ) { if( open(my $NAME, "grep 'export version' $exe | ") ) {
while(<NAME>) { while(<$NAME>) {
if( /version.*?([\d.]+)\s+/ ) { if( /version.*?([\d.a-z]+)\s+/ ) {
return $1; return $1;
} }
} }
close(NAME); $self->warn("No version found");
close($NAME);
} else { } else {
$self->warn("$!"); $self->warn("$!");
} }
return; return;
} }
Expand Down
3 changes: 2 additions & 1 deletion Bio/Tools/Run/Primer3.pm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -420,7 +420,8 @@ sub run {
my($self) = @_; my($self) = @_;
my $executable = $self->executable; my $executable = $self->executable;
my $input = $self->{'primer3_input'}; my $input = $self->{'primer3_input'};
unless (-e $executable) { unless ($executable && -e $executable) {
$self->throw("Executable was not found. Do not know where primer3 is!") if !$executable;
$self->throw("$executable was not found. Do not know where primer3 is!"); $self->throw("$executable was not found. Do not know where primer3 is!");
exit(-1); exit(-1);
} }
Expand Down
13 changes: 8 additions & 5 deletions t/AnalysisFactory_soap.t
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -44,9 +44,12 @@ SKIP: {
isa_ok( $array_ref, 'ARRAY' ); isa_ok( $array_ref, 'ARRAY' );
ok( grep(/seqret/i, @$array_ref), 'available_analyses("edit") returned something' ); ok( grep(/seqret/i, @$array_ref), 'available_analyses("edit") returned something' );


eval { TODO: {
my $service = $factory->create_analysis('edit.seqret'); local $TODO = 'create_analysis() is failing';
isa_ok( $service, 'Bio::Tools::Run::Analysis::soap' ); eval {
}; my $service = $factory->create_analysis('edit.seqret');
ok (!$@) || diag("create_analysis failed :$@"); isa_ok( $service, 'Bio::Tools::Run::Analysis::soap' );
};
ok (!$@) || diag("create_analysis failed :$@");
}
} }
2 changes: 1 addition & 1 deletion t/Primer3.t
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ $seq=$seqio->next_seq;
ok $primer3 = Bio::Tools::Run::Primer3->new(-seq=>$seq); ok $primer3 = Bio::Tools::Run::Primer3->new(-seq=>$seq);


SKIP: { SKIP: {
test_skip(-requires_executable => $primer3,, test_skip(-requires_executable => $primer3,
-tests => 5); -tests => 5);


$args = $primer3->arguments; $args = $primer3->arguments;
Expand Down
10 changes: 8 additions & 2 deletions t/Probcons.t
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ SKIP: {
$aln2 = $factory2->align($seq_array_ref); $aln2 = $factory2->align($seq_array_ref);
my $s2_avg_perid = $aln2->average_percentage_identity; my $s2_avg_perid = $aln2->average_percentage_identity;
my $s2_ovl_perid = $aln2->overall_percentage_identity; my $s2_ovl_perid = $aln2->overall_percentage_identity;
is(int($s2_avg_perid), 43); cmp_ok(int($s2_avg_perid), '>=', 42);
is(int($s2_ovl_perid), 15); cmp_ok(int($s2_ovl_perid), '>=', 15);
}

END {
if (-e 'iterative-refinement') {
unlink('iterative-refinement');
}
} }
23 changes: 19 additions & 4 deletions t/TCoffee.t
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ SKIP: {


my $str = Bio::SeqIO->new('-file' => my $str = Bio::SeqIO->new('-file' =>
test_input_file("cysprot.fa"), test_input_file("cysprot.fa"),
'-format' => 'Fasta'); '-format' => 'fasta');
my @seq_array =(); my @seq_array =();


while ( my $seq = $str->next_seq() ) { while ( my $seq = $str->next_seq() ) {
Expand All @@ -64,10 +64,13 @@ SKIP: {
is $aln->no_sequences, 7; is $aln->no_sequences, 7;
my $s1_perid = $aln->average_percentage_identity; my $s1_perid = $aln->average_percentage_identity;



my $profile1 = test_input_file("cysprot1a.msf"); my $profile1 = test_input_file("cysprot1a.msf");
my $profile2 = test_input_file("cysprot1b.msf"); my $profile2 = test_input_file("cysprot1b.msf");
$aln = $factory->profile_align($profile1,$profile2);
# convert any warnings about program to an actual exception
$factory->verbose(2);
lives_ok {$aln = $factory->profile_align($profile1,$profile2)};
skip("T-COFFEE error, skipping tests", 13) if $@;
is $aln->no_sequences, 7; is $aln->no_sequences, 7;


my $str1 = Bio::AlignIO->new(-file=> test_input_file("cysprot1a.msf")); my $str1 = Bio::AlignIO->new(-file=> test_input_file("cysprot1a.msf"));
Expand Down Expand Up @@ -122,4 +125,16 @@ SKIP: {
'-seq' => test_input_file("cysprot.fa")); '-seq' => test_input_file("cysprot.fa"));
is ($aln->no_sequences, 7); is ($aln->no_sequences, 7);
is ($aln->percentage_identity,$s1_perid); #calculated before is ($aln->percentage_identity,$s1_perid); #calculated before
} }

END {
# warnings are already given above, no need to keep report
if (-e 'error_report.T-COFFEE') {
unlink('error_report.T-COFFEE');
}
if (my @dnds = glob('*.dnd')) {
for my $file (@dnds) {
unlink($file)
}
}
}

0 comments on commit 8af630d

Please sign in to comment.