[bug 2262]
[bioperl-live.git] / t / MapIO.t
blob1eeb377918736b642c3746b9bd766288a302a607
1 # -*-Perl-*- Test Harness script for Bioperl
2 # $Id$
4 use strict;
6 BEGIN {     
7         use lib 't/lib';
8     use BioperlTest;
9     
10     test_begin(-tests => 51);
11         
12         use_ok('Bio::MapIO');
15 my $verbose = test_debug();
17 ok my $mapio = Bio::MapIO->new(-verbose => $verbose,
18                                                                                 -format => 'mapmaker',
19                                                                                 -file   => test_input_file('mapmaker.out'));
21 my $map = $mapio->next_map;
23 isa_ok($map, 'Bio::Map::MapI');
25 is $map->units, 'cM';
26 is $map->type, 'Genetic';
27 is $map->name('test map'), 'test map'; # map name is unset for this data type
29 my $count;
30 foreach my $marker ( $map->each_element ) {
31         $count++;
32         is($marker->position->order,$count);
34 is $count,18;
36 ok $mapio = Bio::MapIO->new(-format => 'mapmaker',
37                                                                         -file   => test_input_file('mapmaker.txt'));
39 $map = $mapio->next_map;
40 is $map->length,382.5;
42 $count = 0;
43 foreach my $marker ( $map->each_element ) {
44         $count++;
45         is($marker->position->order,$count);
47 is $count,13;
49 ok $mapio = Bio::MapIO->new(-format => 'fpc',
50                                                                         -file   => test_input_file('ctgdemo.fpc'));
52 $map = $mapio->next_map;
54 is($map->length, 0);
55 is($map->version, 7.2);
56 is($map->modification_user, 'cari');
57 is($map->group_type, 'Chromosome');
58 is($map->group_abbr, 'Chr');
59 is($map->core_exists, 0);
61 $count = 0;
62 foreach my $marker ($map->each_markerid) {
63         $count++;
66 is($count,150);
68 # add tests for get_markerobj
70 $count = 0;
71 foreach my $clone ($map->each_cloneid) {
72         $count++;
75 is($count,618);
77 # add tests for get_cloneobj
79 $count = 0;
80 foreach my $contig ($map->each_contigid) {
81         $count++;
84 is($count,2);
86 # add tests for get_contigobj
88 # need tests for
89 # matching_bands
90 # coincidence_score
91 # print_contiglist
92 # print_markerlist
93 # print_gffstyle