~ubuntu-branches/ubuntu/saucy/bioperl/saucy-proposed

« back to all changes in this revision

Viewing changes to t/Map/MapIO.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: MapIO.t 15112 2008-12-08 18:12:38Z sendu $
 
3
 
 
4
use strict;
 
5
 
 
6
BEGIN {     
 
7
        use lib '.';
 
8
    use Bio::Root::Test;
 
9
    
 
10
    test_begin(-tests => 51);
 
11
        
 
12
        use_ok('Bio::MapIO');
 
13
}
 
14
 
 
15
my $verbose = test_debug();
 
16
 
 
17
ok my $mapio = Bio::MapIO->new(-verbose => $verbose,
 
18
                                                                                -format => 'mapmaker',
 
19
                                                                                -file   => test_input_file('mapmaker.out'));
 
20
 
 
21
my $map = $mapio->next_map;
 
22
 
 
23
isa_ok($map, 'Bio::Map::MapI');
 
24
 
 
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
 
28
 
 
29
my $count;
 
30
foreach my $marker ( $map->each_element ) {
 
31
        $count++;
 
32
        is($marker->position->order,$count);
 
33
}
 
34
is $count,18;
 
35
 
 
36
ok $mapio = Bio::MapIO->new(-format => 'mapmaker',
 
37
                                                                        -file   => test_input_file('mapmaker.txt'));
 
38
 
 
39
$map = $mapio->next_map;
 
40
is $map->length,382.5;
 
41
 
 
42
$count = 0;
 
43
foreach my $marker ( $map->each_element ) {
 
44
        $count++;
 
45
        is($marker->position->order,$count);
 
46
}
 
47
is $count,13;
 
48
 
 
49
ok $mapio = Bio::MapIO->new(-format => 'fpc',
 
50
                                                                        -file   => test_input_file('ctgdemo.fpc'));
 
51
 
 
52
$map = $mapio->next_map;
 
53
 
 
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);
 
60
 
 
61
$count = 0;
 
62
foreach my $marker ($map->each_markerid) {
 
63
        $count++;
 
64
}
 
65
 
 
66
is($count,150);
 
67
 
 
68
# add tests for get_markerobj
 
69
 
 
70
$count = 0;
 
71
foreach my $clone ($map->each_cloneid) {
 
72
        $count++;
 
73
}
 
74
 
 
75
is($count,618);
 
76
 
 
77
# add tests for get_cloneobj
 
78
 
 
79
$count = 0;
 
80
foreach my $contig ($map->each_contigid) {
 
81
        $count++;
 
82
}
 
83
 
 
84
is($count,2);
 
85
 
 
86
# add tests for get_contigobj
 
87
 
 
88
# need tests for
 
89
# matching_bands
 
90
# coincidence_score
 
91
# print_contiglist
 
92
# print_markerlist
 
93
# print_gffstyle