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