1 # -*-Perl-*- Test Harness script for Bioperl
10 test_begin(-tests => 39);
12 use_ok('Bio::Map::Physical');
16 ok my $phm = Bio::Map::Physical->new();
17 is $phm->version(2), 2;
18 is $phm->version(), 2;
19 is $phm->modification_user('me'), 'me';
20 is $phm->modification_user(), 'me';
22 is $phm->group_type('xx'), 'xx';
23 is $phm->group_type(), 'xx';
25 is $phm->group_abbr('xx'), 'xx';
26 is $phm->group_abbr(), 'xx';
28 is $phm->core_exists, undef, 'code holds and returns a string, definition requires a boolean';
30 is $phm->core_exists(3), 1, 'code holds and returns a string, definition requires a boolean';
32 is $phm->core_exists(1), 1;
33 is $phm->core_exists(), 1;
35 my $fpcpath = test_input_file('biofpc.fpc');
37 # TODO? get Bio::MapIO::fpc to load from a Bio::MapIO call
38 my $mapio = Bio::MapIO->new(-format => "fpc", -species => 'demo', -readcor => 1, -file => $fpcpath);
39 my $fobj = $mapio->next_map();
41 is $fobj->group_abbr(), "Chr";
42 is $fobj->core_exists(), 1;
48 #########################################################
62 foreach my $mid ($f->each_markerid())
65 my $mobj = $f->get_markerobj($mid);
66 if (not defined $mobj)
71 my @remarks = split /\n/, $mobj->remark();
72 $nrem += scalar(@remarks);
73 $types{$mobj->type()} = 1;
77 $grps{$mobj->group()} = 1;
78 $pos += $mobj->global();
80 if ($mobj->framework())
84 foreach my $ctgid ($f->each_contigid())
86 $ctgpos += $mobj->position($ctgid);
91 is scalar(keys %types), 2;
94 is scalar (keys %grps), 4;
99 #########################################################
112 foreach my $cid ($f->each_contigid())
115 my $cobj = $f->get_contigobj($cid);
116 if (not defined $cobj)
121 if ($cobj->chr_remark() ne "")
125 if ($cobj->user_remark() eq "test")
129 if ($cobj->trace_remark() eq "test")
135 $ncb += ($cobj->range()->end() - $cobj->range()->start() + 1);
139 $psum += $cobj->position();
140 $grps{$cobj->group()} = 1;
149 is scalar(keys %grps), 3;
152 #########################################################
164 foreach my $cid ($f->each_cloneid())
167 my $cobj = $f->get_cloneobj($cid);
168 if (not defined $cobj)
173 my $pbands = $cobj->bands();
174 $nbands += scalar(@$pbands);
175 $ctgs{$cobj->contigid()} = 1;
176 if ($cobj->contigid() > 0)
178 if (not defined $cobj->range()->start() or
179 not defined $cobj->range()->end() or
180 $cobj->range()->end() < $cobj->range()->start())
185 foreach my $mid ($cobj->each_markerid())
191 @remarks = split /\n/, $cobj->remark();
192 $nrem += scalar(@remarks);
194 if ($cobj->fpc_remark) {
195 @remarks = split /\n/, $cobj->fpc_remark();
196 $nfprem += scalar(@remarks);
198 $stati{$cobj->sequence_status()} = 1 if $cobj->sequence_status;
202 is scalar(keys %ctgs), 11;
206 is scalar(keys %stati), 5;