New INSTALL.WIN doc (from wiki)
[bioperl-live.git] / t / LinkageMap.t
blobde113ac37a5fc9d61ed4a655cd33ed53e6d01d29
1 # -*-Perl-*-
2 ## Bioperl Test Harness Script for Modules
3 ## $Id$
6 use strict;
8 BEGIN {
9     use vars qw($DEBUG);
10     $DEBUG = $ENV{'BIOPERLDEBUG'};
11     # to handle systems with no installed Test module
12     # we include the t dir (where a copy of Test.pm is located)
13     # as a fallback
14     eval { require Test; };
15     if( $@ ) {
16         use lib 't';
17     }
18     use Test;
19     plan tests => 16;
22 # END {
23 # }
25 require 'dumpvar.pl';
27 use Bio::Map::LinkagePosition;
28 use Bio::Map::Microsatellite;
29 use Bio::Map::LinkageMap;
31 ok 1 ;
32 my $verbose = 0;
33 ok my $map = new Bio::Map::LinkageMap('-verbose' => $verbose,
34                                    '-name'    => 'Leviathon',
35                                    '-type'    => 'Genetic',
36                                    '-units'   => 'cM',
37                                    '-species' => "Brassica");
38 ok ref($map), 'Bio::Map::LinkageMap';
39 ok $map->name, 'Leviathon';
40 ok $map->type, 'Genetic';
41 ok $map->units, 'cM';
42 ok $map->species, 'Brassica';
43 ok $map->unique_id, '1';
45 ok my $position = new Bio::Map::LinkagePosition('-order' => 2,
46                                                 '-map' =>  $map, 
47                                                 '-value' => 22.3
48                                                 );
50 ok $position->order, 2;
51 ok $position->map, $map,
52 ok $position->value, 22.3;
54 ok my $o_usat = new Bio::Map::Microsatellite('-name'     => "Chad marker",
55                                              '-position' => $position);
57 ok $o_usat->name, 'Chad marker';
58 ok $o_usat->position, $position ;
59 ok $map->add_element($o_usat);
61 #use Data::Dumper; print Dumper($map);
62 #----------------------------
63 #ok my $position2 = new Bio::Map::LinkagePosition(-order => qw(3 4 5),
64 #                                                );
65 # print("position2 looks like this:\n");
66 # dumpValue($position2);
67 #ok(($position2->each_position_value('fakemap'))[0] == 0);
68 #ok $position2->order, 3;
70 #-------------
71 #ok($position->order, 2);
72 #ok(($position->each_position_value($map))[0], 22.3);
73         # what should be printed if this was ok?
74         # ok(1);
76 #ok my $o_usat = new Bio::Map::Microsatellite('-name'     => "Chad marker",
77 #                                             '-position' => $position);
79 #ok $o_usat->name, 'Chad marker';
80 #ok $o_usat->position, $position ;
81 #ok $map->add_element($o_usat);
82 # what should be printed if this is ok?
83 #dumpValue($map);
85 # add more tests
86 # see also t/microsatellite.t and t/linkageposition.t