~ubuntu-branches/ubuntu/lucid/bioperl/lucid

« back to all changes in this revision

Viewing changes to t/QRNA.t

  • Committer: Bazaar Package Importer
  • Author(s): Matt Hope
  • Date: 2004-04-18 14:24:11 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20040418142411-gr92uexquw4w8liq
Tags: 1.4-1
* New upstream release
* Examples and working code are installed by default to usr/bin,
  this has been moved to usr/share/doc/bioperl/bin

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*-Perl-*-
 
2
## Bioperl Test Harness Script for Modules
 
3
# $Id: QRNA.t,v 1.1 2003/07/25 16:21:07 jason Exp $
 
4
 
 
5
use strict;
 
6
BEGIN {
 
7
    eval { require Test; };
 
8
    if( $@ ) {
 
9
        use lib 't';
 
10
    }
 
11
    use Test;
 
12
    use vars qw($NTESTS);
 
13
    $NTESTS = 29;
 
14
    plan tests => $NTESTS;
 
15
}
 
16
use Bio::Tools::QRNA;
 
17
use Bio::Root::IO;
 
18
 
 
19
my $inputfilename= Bio::Root::IO->catfile("t","data","ecoli-trna-qrna.out");
 
20
my $parser = new Bio::Tools::QRNA(-file => $inputfilename);
 
21
ok($parser);
 
22
my $rnacount = 0;
 
23
while( my $f = $parser->next_feature ) {
 
24
    if( $f->primary_tag eq 'RNA' ) { # winning model is primary tag
 
25
        if( ! $rnacount ) { # 1st time through let's test
 
26
            ok($f->feature1->start,4);
 
27
            ok($f->feature1->end,  70);
 
28
            ok($f->score, 22.147);
 
29
            ok($f->feature1->seq_id,'DA0780-1-');
 
30
            
 
31
            ok($f->feature2->start, 4);
 
32
            ok($f->feature2->end,  70);
 
33
            ok($f->feature2->seq_id, 'ECOLI-3979754-');
 
34
            ok(($f->get_tag_values('alignment_len'))[0], 70);
 
35
            ok(($f->get_tag_values('alignment_pid'))[0], '72.86');
 
36
            ok(($f->get_tag_values('COD_score'))[0], '16.954');
 
37
            ok(($f->get_tag_values('COD_logoddspost'))[0], '-4.365');
 
38
            ok(($f->get_tag_values('OTH_score'))[0], '21.319');
 
39
            ok(($f->get_tag_values('OTH_logoddspost'))[0], '0.000');
 
40
        }
 
41
        $rnacount++;
 
42
    }
 
43
}
 
44
ok($rnacount, 21);
 
45
$inputfilename= Bio::Root::IO->catfile("t","data","qrna-relloc.out");
 
46
$parser = new Bio::Tools::QRNA(-file => $inputfilename);
 
47
 
 
48
my $qrna = $parser->next_feature;
 
49
ok($qrna->primary_tag, 'COD');
 
50
ok($qrna->source_tag, 'qrna');
 
51
ok($qrna->feature1->seq_id, 'Contig1');
 
52
ok($qrna->feature2->seq_id, 'chr5.pseudo');
 
53
ok($qrna->feature1->start, 24732);
 
54
ok($qrna->feature1->end, 24881);
 
55
 
 
56
ok($qrna->feature2->start, 527251);
 
57
ok($qrna->feature2->end, 527400);
 
58
 
 
59
ok($parser->seq_file,'tst.out');
 
60
ok($parser->RNA_model, '/mix_tied_linux.cfg');
 
61
ok($parser->PAM_model, 'BLOSUM62 scaled by 1.000');
 
62
ok($parser->program_name, 'qrna');
 
63
ok($parser->program_version, '1.2b');
 
64
ok($parser->program_date, 'Tue Dec 18 15:04:38 CST 2001');
 
65