~ubuntu-branches/ubuntu/trusty/bioperl/trusty-proposed

« back to all changes in this revision

Viewing changes to t/AlignIO/arp.t

  • Committer: Bazaar Package Importer
  • Author(s): Charles Plessy
  • Date: 2009-03-10 07:19:11 UTC
  • mfrom: (1.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20090310071911-fukqzw54pyb1f0bd
Tags: 1.6.0-2
* Removed patch system (not used):
  - removed instuctions in debian/rules;
  - removed quilt from Build-Depends in debian/control.
* Re-enabled tests:
  - uncommented test command in debian/rules;
  - uncommented previously missing build-dependencies in debian/control.
  - Re-enabled tests and uncommented build-dependencies accordingly.
* Removed libmodule-build-perl and libtest-harness-perl from
  Build-Depends-Indep (provided by perl-modules).
* Better cleaning of empty directories using find -type d -empty -delete
  instead of rmdir in debian/rules (LP: #324001).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*-Perl-*- Test Harness script for Bioperl
 
2
# $Id: arp.t 14971 2008-10-28 16:08:52Z cjfields $
 
3
 
 
4
use strict;
 
5
 
 
6
BEGIN {
 
7
        use lib '.';
 
8
    use Bio::Root::Test;
 
9
    
 
10
    test_begin(-tests => 48);
 
11
        
 
12
        use_ok('Bio::AlignIO::arp');
 
13
}
 
14
 
 
15
my $DEBUG = test_debug();
 
16
 
 
17
my ($str,$aln,$strout,$status);
 
18
 
 
19
# ARP format
 
20
$str  = Bio::AlignIO ->new(
 
21
    '-file'     => test_input_file("testaln.arp"),
 
22
    -verbose => 1,
 
23
    '-format'   => 'arp');
 
24
isa_ok($str,'Bio::AlignIO');
 
25
$aln = $str->next_aln();
 
26
isa_ok($aln,'Bio::Align::AlignI');
 
27
is($aln->get_seq_by_pos(1)->get_nse, '01/1-399','ARP get_nse()');
 
28
is($aln->get_seq_by_pos(1)->length, '407');
 
29
is($aln->no_sequences, 60,'ARP no_sequences()');
 
30
is($aln->id, 'Mandenka', 'ARP id()');
 
31
is($aln->description, 'mtDNA sequences in the Senegalese Mandenka (hypervariable region 1)', 'ARP description()');
 
32
my $coll = $aln->annotation;
 
33
isa_ok($coll, 'Bio::AnnotationCollectionI');
 
34
my ($ann) = $coll->get_Annotations('Samples');
 
35
isa_ok($ann, 'Bio::AnnotationI');
 
36
my %nodes = $ann->pairs;
 
37
is(keys %nodes, 60);
 
38
is($nodes{'03'}, 10);
 
39
is(($coll->get_Annotations('DataType'))[0]->value,'DNA');
 
40
is(($coll->get_Annotations('MissingData'))[0]->value,'?');
 
41
 
 
42
$str  = Bio::AlignIO->new(
 
43
    '-file'     => test_input_file("testaln2.arp"),
 
44
    '-format'   => 'arp');
 
45
isa_ok($str,'Bio::AlignIO');
 
46
$aln = $str->next_aln();
 
47
isa_ok($aln,'Bio::Align::AlignI');
 
48
is($aln->get_seq_by_pos(1)->get_nse, '000/1-29','ARP get_nse()');
 
49
is($aln->no_sequences, 3,'ARP no_sequences()');
 
50
is($aln->id, 'Population 1', 'ARP id()');
 
51
is($aln->description, 'An example of DNA sequence data', 'ARP description()');
 
52
$coll = $aln->annotation;
 
53
isa_ok($coll, 'Bio::AnnotationCollectionI');
 
54
($ann) = $coll->get_Annotations('Samples');
 
55
isa_ok($ann, 'Bio::AnnotationI');
 
56
%nodes = $ann->pairs;
 
57
is(keys %nodes, 3);
 
58
is($nodes{'001'}, 1);
 
59
is(($coll->get_Annotations('DataType'))[0]->value, 'DNA');
 
60
is(($coll->get_Annotations('SampleSize'))[0]->value, 6);
 
61
 
 
62
$aln = $str->next_aln();
 
63
isa_ok($aln,'Bio::Align::AlignI');
 
64
is($aln->get_seq_by_pos(2)->get_nse, '001/1-29','ARP get_nse()');
 
65
is($aln->no_sequences, 8,'ARP no_sequences()');
 
66
is($aln->id, 'Population 2', 'ARP id()');
 
67
is($aln->description, 'An example of DNA sequence data', 'ARP description()');
 
68
$coll = $aln->annotation;
 
69
isa_ok($coll, 'Bio::AnnotationCollectionI');
 
70
($ann) = $coll->get_Annotations('Samples');
 
71
isa_ok($ann, 'Bio::AnnotationI');
 
72
%nodes = $ann->pairs;
 
73
is(keys %nodes, 8);
 
74
is($nodes{'001'}, 1);
 
75
is(($coll->get_Annotations('DataType'))[0]->value, 'DNA');
 
76
is(($coll->get_Annotations('SampleSize'))[0]->value, 8);
 
77
 
 
78
$aln = $str->next_aln();
 
79
isa_ok($aln,'Bio::Align::AlignI');
 
80
is($aln->get_seq_by_pos(2)->get_nse, '024/1-29','ARP get_nse()');
 
81
is($aln->no_sequences, 6,'ARP no_sequences()');
 
82
is($aln->id, 'Population 3', 'ARP id()');
 
83
is($aln->description, 'An example of DNA sequence data', 'ARP description()');
 
84
$coll = $aln->annotation;
 
85
isa_ok($coll, 'Bio::AnnotationCollectionI');
 
86
($ann) = $coll->get_Annotations('Samples');
 
87
isa_ok($ann, 'Bio::AnnotationI');
 
88
%nodes = $ann->pairs;
 
89
is(keys %nodes, 6);
 
90
is($nodes{'024'}, 1);
 
91
is(($coll->get_Annotations('DataType'))[0]->value, 'DNA');
 
92
is(($coll->get_Annotations('SampleSize'))[0]->value, 6);
 
93