Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Test refresh

  • Loading branch information...
commit 7cc76364f49f34a9813507c7e84f9da2bfac91ba 1 parent 79a0c08
@fangly fangly authored
Showing with 55 additions and 53 deletions.
  1. +55 −53 t/Blat.t
View
108 t/Blat.t
@@ -5,15 +5,15 @@ use strict;
BEGIN {
use Bio::Root::Test;
- test_begin(-tests => 39);
+ test_begin(-tests => 40);
- use_ok('Bio::Tools::Run::Alignment::Blat');
- use_ok('Bio::SeqIO');
- use_ok('Bio::Seq');
+ use_ok 'Bio::Tools::Run::Alignment::Blat';
+ use_ok 'Bio::SeqIO';
+ use_ok 'Bio::Seq';
}
-my $db = test_input_file("blat_dna.fa");
-my $query = test_input_file("blat_dna.fa");
+my $db = test_input_file('blat_dna.fa');
+my $query = test_input_file('blat_dna.fa');
my $factory = Bio::Tools::Run::Alignment::Blat->new(-db => $db);
ok $factory->isa('Bio::Tools::Run::Alignment::Blat');
@@ -25,74 +25,76 @@ SKIP: {
-tests => 24);
my $searchio = $factory->align($query);
+ isa_ok $searchio, 'Bio::SearchIO';
+
my $result = $searchio->next_result;
my $hit = $result->next_hit;
my $hsp = $hit->next_hsp;
isa_ok($hsp, "Bio::Search::HSP::HSPI");
- is($hsp->query->start,1);
- is($hsp->query->end,1775);
- is($hsp->hit->start,1);
- is($hsp->hit->end,1775);
- is($hsp->hsp_length,1775);
-
- my $sio = Bio::SeqIO->new(-file=>$query,-format=>'fasta');
- my $seq = $sio->next_seq ;
+ is $hsp->query->start, 1;
+ is $hsp->query->end, 1775;
+ is $hsp->hit->start, 1;
+ is $hsp->hit->end, 1775;
+ is $hsp->hsp_length, 1775;
+
+ my $sio = Bio::SeqIO->new(-file => $query, -format => 'fasta');
+ my $seq = $sio->next_seq ;
$searchio = $factory->align($seq);
- like($searchio, qr/psl/, 'PSL parser (default)');
+ like $searchio, qr/psl/, 'PSL parser (default)';
$result = $searchio->next_result;
$hit = $result->next_hit;
$hsp = $hit->next_hsp;
- isa_ok($hsp, "Bio::Search::HSP::HSPI");
- is($hsp->query->start,1);
- is($hsp->query->end,1775);
- is($hsp->hit->start,1);
- is($hsp->hit->end,1775);
+ isa_ok $hsp, 'Bio::Search::HSP::HSPI';
+ is $hsp->query->start, 1;
+ is $hsp->query->end, 1775;
+ is $hsp->hit->start, 1;
+ is $hsp->hit->end, 1775;
# test alternate formats (not all of these work!)
- $factory->reset_parameters(# -quiet => 1,
- -db => $db,
+ $factory->reset_parameters(#-quiet => 1,
+ -db => $db,
-out => 'blast');
$searchio = $factory->align($query);
- like($searchio, qr/blast/, 'BLAST parser');
+ like $searchio, qr/blast/, 'BLAST parser';
$result = $searchio->next_result;
$hit = $result->next_hit;
$hsp = $hit->next_hsp;
- isa_ok($hsp, "Bio::Search::HSP::HSPI");
- is($hsp->query->start,1);
- is($hsp->query->end,1775);
- is($hsp->hit->start,1);
- is($hsp->hit->end,1775);
+ isa_ok $hsp, 'Bio::Search::HSP::HSPI';
+ is $hsp->query->start, 1;
+ is $hsp->query->end, 1775;
+ is $hsp->hit->start, 1;
+ is $hsp->hit->end, 1775;
- $factory->reset_parameters(# -quiet => 1,
- -db => $db,
- -out => 'blast9');
+ $factory->reset_parameters(#-quiet => 1,
+ -db => $db,
+ -out => 'blast9');
$searchio = $factory->align($query);
- like($searchio, qr/blasttable/, 'Tabular BLAST parser');
+ like $searchio, qr/blasttable/, 'Tabular BLAST parser';
$result = $searchio->next_result;
$hit = $result->next_hit;
$hsp = $hit->next_hsp;
- isa_ok($hsp, "Bio::Search::HSP::HSPI");
- is($hsp->query->start,1);
- is($hsp->query->end,1775);
- is($hsp->hit->start,1);
- is($hsp->hit->end,1775);
+ isa_ok $hsp, 'Bio::Search::HSP::HSPI';
+ is $hsp->query->start, 1;
+ is $hsp->query->end, 1775;
+ is $hsp->hit->start, 1;
+ is $hsp->hit->end, 1775;
}
# new wrapper; regions
-$db = test_input_file("blat_dna.2bit");
+$db = test_input_file('blat_dna.2bit');
$factory = Bio::Tools::Run::Alignment::Blat->new(
- -db => $db,
- # -quiet => 1,
- # note coordinates here are Blat-compatible, 0-based (start, end]
+ -db => $db,
+ #-quiet => 1,
-qsegment => 'sequence_10:0-100',
- -tsegment => 'sequence_10:0-100'
+ -tsegment => 'sequence_10:0-100',
+ # 0-based, Blat-compatible coordinates (start, end]
);
ok $factory->isa('Bio::Tools::Run::Alignment::Blat');
@@ -106,25 +108,25 @@ SKIP: {
my $result = $searchio->next_result;
my $hit = $result->next_hit;
my $hsp = $hit->next_hsp;
- isa_ok($hsp, "Bio::Search::HSP::HSPI");
- is($hsp->query->start,1);
- is($hsp->query->end,100);
- is($hsp->hit->start,1);
- is($hsp->hit->end,100);
+ isa_ok $hsp, 'Bio::Search::HSP::HSPI';
+ is $hsp->query->start, 1;
+ is $hsp->query->end, 100;
+ is $hsp->hit->start, 1;
+ is $hsp->hit->end, 100;
# No on-the-fly conversion of Bio::Seq yet
my $sio = Bio::SeqIO->new(-file=>$query,-format=>'fasta');
- my $seq = $sio->next_seq ;
+ my $seq = $sio->next_seq ;
$searchio = $factory->align($seq);
$result = $searchio->next_result;
$hit = $result->next_hit;
$hsp = $hit->next_hsp;
- isa_ok($hsp, "Bio::Search::HSP::HSPI");
- is($hsp->query->start,1);
- is($hsp->query->end,1775);
- is($hsp->hit->start,1);
- is($hsp->hit->end,1775);
+ isa_ok $hsp, 'Bio::Search::HSP::HSPI';
+ is $hsp->query->start, 1;
+ is $hsp->query->end, 1775;
+ is $hsp->hit->start, 1;
+ is $hsp->hit->end, 1775;
}
1;
Please sign in to comment.
Something went wrong with that request. Please try again.