~ubuntu-branches/ubuntu/vivid/bioperl/vivid

« back to all changes in this revision

Viewing changes to t/SearchIO/fasta.t

  • Committer: Bazaar Package Importer
  • Author(s): Charles Plessy
  • Date: 2011-06-17 13:51:18 UTC
  • mfrom: (3.1.6 sid)
  • Revision ID: james.westby@ubuntu.com-20110617135118-hncy38e0134j8oi5
Tags: 1.6.901-1
* New upstream release.
* Point debian/watch to search.cpan.org.
* Build using dh and overrides:
  - Use Debhelper 8 (debian/rules, debian/control).
  - Simplified debian/rules.
* Split into libbio-perl-perl, as discussed with the Debian Perl team.
  (debian/control, debian/bioperl.install, debian libbio-perl-perl.install)
* debian/control:
  - Incremented Standards-Version to reflect conformance with Policy 3.9.2.
    No other changes needed.
  - Vcs-Browser URL made redirectable to viewvc.
  - Removed useless ‘svn’ in the Vcs-Svn URL.

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
        use lib '.';
8
8
    use Bio::Root::Test;
9
9
    
10
 
    test_begin(-tests => 289);
 
10
    test_begin(-tests => 299);
11
11
        
12
12
        use_ok('Bio::SearchIO');
13
13
}
317
317
            is($hsp->query->frame(), 0);
318
318
            is($hsp->hit->frame(), 0);
319
319
            is($hsp->gaps('query'), 0);
320
 
            is($hsp->gaps('hit'), 63);
321
 
            is($hsp->gaps, 63);
 
320
            is($hsp->gaps('hit'), 61);
 
321
            is($hsp->gaps, 61);
322
322
            is($hsp->query_string, 'RFALAGALGCAVTHGALTPVDVVKTRIQLEPEVYNRVGRFFNSS*GF*EL*GVVLMSQT\KGMVASFRQIIAKEGAGALLTGFGPTAVGYAIQGAFKFGG*VMMSLQITA*SRANLPISYEFWKKKAIDLVGVDKARENRQAIYLGASAIAEFFADIALCPLEATRIRLVSQPSFANGLSGGFLRILREEGPAAFYAGFGPILFKQVPYTMAKFAV*VDRTA*\YQTFG*YYRSYEVAVEKILKATGKSKDSLTGGQLTGLNLTSGLIAGLAAAVISQPADTLLSKINKTKGAPGQSTTSRLVQMAGQLGVSGLFTGMTTRLVMIGTLTAGQ');
323
323
            is($hsp->hit_string, 'KFALAGAIGCGSTHSSMVPIDVVKTRIQLEPTVYN-------------------------KGMVGSFKQIIAGEGAGALLTGFGPTLLGYSIQGAFKFGG-------------------YEVFKKFFIDNLGYDTASRYKNSVYMGSAAMAEFLADIALCPLEATRIRLVSQPQFANGLVGGFSRILKEEGIGSFYSGFTPILFKQIPYNIAKFLVFERASEF-YYGFAG------------------PKEKLSSTSTTLLNLLSGLTAGLAAAIVSQPADTLLSKVNKTKKAPGQSTVGLLAQLAKQLGFFGSFAGLPTRLVMVGTLTSLQ');
324
324
            is($hsp->homology_string, '.::::::.::. ::....:.::::::::::: :::                         ::::.::.:::: ::::::::::::: .::.:::::::::                   :: .::  :: .: : : . ....:.:..:.:::.:::::::::::::::::::.::::: ::: :::.::: ..::.:: ::::::.::..::: :    .   :  :.                    :..:.. . : ::: ::: ::::::..::::::::::.:::: ::::::.. :.:.: :::  : :.:. :::::.::::. :');
356
356
like($result->database_name, qr/wormpep190/, 'TFASTXY');
357
357
is($result->database_letters, 10449259);
358
358
is($result->database_entries, 23771);
359
 
is($result->algorithm, 'FASTA');
 
359
is($result->algorithm, 'FASTP');
360
360
is($result->algorithm_version, '35.04');
361
361
is($result->query_name, 'BOSS_DROME');
362
362
is($result->query_length, 896);
364
364
is($result->get_parameter('gapext'), -2);
365
365
is($result->get_parameter('ktup'), 2);
366
366
is($result->get_parameter('matrix'), 'BL50');
367
 
is($result->get_parameter('wordsize'), 16);
368
 
is($result->get_parameter('filter'), '15:-5');
 
367
 
 
368
# wordsize is the same as ktup, not opt width, as we used to parse
 
369
# is($result->get_parameter('wordsize'), 16);
 
370
 
 
371
# this is the range of the scoring matrix, not a filter (which is meant
 
372
# to capture whether xS seg filtering used)
 
373
# is($result->get_parameter('filter'), '15:-5');
369
374
 
370
375
is($result->get_statistic('lambda'), 0.122629);
371
376
is($result->get_statistic('dbletters'), 10449259);
403
408
}
404
409
 
405
410
 
 
411
# bug 2937 and version 35.04
 
412
$searchio = Bio::SearchIO->new(
 
413
   -format => 'fasta',
 
414
   -file   => test_input_file('bug2937.fasta'),
 
415
);
 
416
ok($searchio, 'bug 2937 and FASTA version 3.5');
 
417
 
 
418
while ( my $result = $searchio->next_result() ) {
 
419
   is ($result->algorithm_version, '35.04', 'algorithm version');
 
420
   is($result->query_name, 'ILTV-miR1', 'query name');
 
421
   is($result->query_description, '', 'query description');
 
422
   is($result->query_length, 70, 'query length');
 
423
   is($result->algorithm, 'FASTN', 'algorithm');
 
424
   
 
425
   while( my $hit = $result->next_hit ) {
 
426
      # process the Bio::Search::Hit::HitI object
 
427
      while( my $hsp = $hit->next_hsp ) {
 
428
         # process the Bio::Search::HSP::HSPI object
 
429
         is($hsp->num_identical, 26, "num_identical()");
 
430
         is($hsp->num_conserved, 26, "num_conserved()");
 
431
         is($hsp->strand('hit'), '1', 'hsp->strand(hit)');
 
432
                 is($hsp->hit->strand, '1', 'hsp->hit->strand');
 
433
                 is($hsp->strand('query'), '-1', 'hsp->strand(query)');
 
434
                 is($hsp->query->strand, '-1', 'hsp->query->strand');
 
435
      }
 
436
   }
 
437
}