1 # -*-Perl-*- Test Harness script for Bioperl
2 # $Id: arp.t 14971 2008-10-28 16:08:52Z cjfields $
9 test_begin(-tests => 48,
10 -requires_module => 'Data::Stag');
12 use_ok('Bio::AlignIO::arp');
15 my $DEBUG = test_debug();
17 my ($str,$aln,$strout,$status);
20 $str = Bio::AlignIO ->new(
21 '-file' => test_input_file("testaln.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->num_sequences, 60,'ARP num_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;
39 is(($coll->get_Annotations('DataType'))[0]->value,'DNA');
40 is(($coll->get_Annotations('MissingData'))[0]->value,'?');
42 $str = Bio::AlignIO->new(
43 '-file' => test_input_file("testaln2.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->num_sequences, 3,'ARP num_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');
59 is(($coll->get_Annotations('DataType'))[0]->value, 'DNA');
60 is(($coll->get_Annotations('SampleSize'))[0]->value, 6);
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->num_sequences, 8,'ARP num_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');
75 is(($coll->get_Annotations('DataType'))[0]->value, 'DNA');
76 is(($coll->get_Annotations('SampleSize'))[0]->value, 8);
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->num_sequences, 6,'ARP num_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');
91 is(($coll->get_Annotations('DataType'))[0]->value, 'DNA');
92 is(($coll->get_Annotations('SampleSize'))[0]->value, 6);