lib/Bio/NEXUS/AssumptionsBlock.pm

filter: Statementstmt 85.2% 173 / 203 Branchbran 73.6% 53 / 72 Conditioncond 57.1% 12 / 21 MC/DCmcdc 30.7% 4 / 13 Subroutinesub 95.8% 23 / 24 Podpod 100% 10 / 10 totaltotal 80.1% 275 / 343 CC 54 SCAR 17.8
CC
54
Cov
80%
select_assumptions
12.0
_validate_options
10.0
_write
8.6
CRAP 5.9
« lib/Bio/NEXUS/UnknownBlock.pm ↑ Summary lib/Bio/NEXUS/NHXCmd.pm »
1 ######################################################
2 # AssumptionsBlock.pm
3 ######################################################
4 # Author: Chengzhi Liang, Weigang Qiu, Eugene Melamud, Peter Yang, Thomas Hladish
5 # $Id: AssumptionsBlock.pm,v 1.51 2012/02/07 21:38:09 astoltzfus Exp $
6  
7 #################### START POD DOCUMENTATION ##################
8  
9 =head1 NAME
10  
11 Bio::NEXUS::AssumptionsBlock - Represents ASSUMPTIONS block of a NEXUS file
12  
13 =head1 SYNOPSIS
14  
15 if ( $type =~ /assumptions/i ) {
16 $block_object = new Bio::NEXUS::AssumptionsBlock($block_type, $block, $verbose);
17 }
18  
19 =head1 DESCRIPTION
20  
21 If a NEXUS block is an assumptions block, this module parses the block and stores the assumptions data. Currently this only works with SOAP weight data, but we hope to extend its functionality.
22  
23 =head1 FEEDBACK
24  
25 All feedback (bugs, feature enhancements, etc.) are greatly appreciated.
26  
27 =head1 AUTHORS
28  
29 Chengzhi Liang (liangc@umbi.umd.edu)
30 Weigang Qiu (weigang@genectr.hunter.cuny.edu)
31 Eugene Melamud (melamud@carb.nist.gov)
32 Peter Yang (pyang@rice.edu)
33 Thomas Hladish (tjhladish at yahoo)
34  
35 =head1 VERSION
36  
37 $Revision: 1.51 $
38  
39 =head1 METHODS
40  
41 =cut
42  
43 package Bio::NEXUS::AssumptionsBlock;
44  
45 35 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
46 35 ▶use Bio::NEXUS::Functions;
Subroutine BEGIN: called CC=1 SCAR=0.0
47 35 ▶use Bio::NEXUS::Block;
Subroutine BEGIN: called CC=1 SCAR=0.0
48 35 ▶use Bio::NEXUS::WeightSet;
Subroutine BEGIN: called CC=1 SCAR=0.0
49 35 ▶use Bio::NEXUS::Util::Logger;
Subroutine BEGIN: called CC=1 SCAR=0.0
50 35 ▶use Bio::NEXUS::Util::Exceptions 'throw';
Subroutine BEGIN: called CC=1 SCAR=0.0
51 35 ▶use vars qw(@ISA $AUTOLOAD $VERSION);
Subroutine BEGIN: called CC=1 SCAR=0.0
52 35 ▶use Bio::NEXUS; $VERSION = $Bio::NEXUS::VERSION;
Subroutine BEGIN: called CC=1 SCAR=0.0
53  
54 35 @ISA = qw(Bio::NEXUS::Block);
55 35 my $logger = Bio::NEXUS::Util::Logger->new();
56  
57 =head2 new
58  
59 Title : new
60 Usage : block_object = new Bio::NEXUS::AssumptionsBlock($block_type, $commands, $verbose );
61 Function: Creates a new Bio::NEXUS::AssumptionsBlock object
62 Returns : Bio::NEXUS::AssumptionsBlock object
63 Args : type (string), the commands/comments to parse (array ref), and a verbose flag (0 or 1; optional)
64  
65 =cut
66  
67 14 ▶sub new {
Subroutine new: called CC=4 SCAR=13.9
Pod documented
68 14 my ( $class, $type, $commands, $verbose ) = @_;
69 14 ▶ if ( not $type ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($type) 2 12 14
70 2 ( $type = lc $class ) =~ s/Bio::NEXUS::(.+)Block/$1/i;
71 }
72 14 my $self = {
73 'type' => $type,
74 'assumptions' => [],
75 'options' => undef
76 };
77 14 bless $self, $class;
78 14 ▶ if ( ( defined $commands ) and @$commands ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $commands and @$commands) 12 2 14
Condition66%2/3
defined $commands and @$commands
!ll&&!rl&&r
2012
MC/DC50%1/2
defined $commands and @$commands
defined $commands @$commands
Truth table66%2/3
A and B
A= defined $commandsB= @$commands
ABresult
0X0
100
111
79 12 $self->_parse_block( $commands, $verbose );
80 }
81 13 return $self;
82 }
83  
84 =begin comment
85  
86 Title : _parse_wtset
87 Usage : $self->_parse_wtset($buffer); (private)
88 Function: Processes the buffer containing weights data
89 Returns : name and array of weights
90 Args : the buffer to parse (string)
91 Method : Creates a Bio::NEXUS::WeightSet object and sets the name and list of weight values.
92 Adds the newly created WeightSet object to the set of assumptions
93 this block contains.
94  
95 =end comment
96  
97 =cut
98  
99 7 ▶sub _parse_wtset {
Subroutine _parse_wtset: called CC=4 SCAR=13.9
100 7 my ( $self, $buffer ) = @_;
101 7 my ( $name, $weights ) = split /=/, $buffer;
102 7 $name =~ s/(\(.*\))//;
103 7 my $flags = $1;
104 7 my ( $type, $tokens );
105 7 ▶ $type = ( $flags =~ /vector/i ) ? 'VECTOR' : 'STANDARD';
Branch: 1 branch
BranchTrueFalseTotal
$flags =~ /vector/i ? : 7 0 7
106 7 ▶ $tokens = ( $flags =~ /notokens/i ) ? 0 : 1;
Branch: 1 branch
BranchTrueFalseTotal
$flags =~ /notokens/i ? : 1 6 7
107 7 $name =~ s/^\s*(\S+)\s*$/$1/;
108 7 $weights =~ s/^\s*(\S+.*\S+)\s*$/$1/s;
109 7 my @weights;
110 7 ▶ if ( $tokens ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($tokens) { } 6 1 7
111 6 @weights = split /\s*/, $weights;
112 }
113 else {
114 1 @weights = split //, $weights;
115 }
116 7 my $is_weightset = 1;
117 7 my $new_weightset = Bio::NEXUS::WeightSet->new(
118 $name,
119 \@weights,
120 $is_weightset,
121 $tokens,
122 $type
123 );
124 7 $self->add_weightset($new_weightset);
125 7 return ( $name, \@weights, $is_weightset, $tokens, $type );
126 }
127  
128 =begin comment
129  
130 Title : _parse_options
131 Usage : ...
132 Function: parses the $buffer and populates the 'options' data structure; see options command in the assumptions block (Maddison p 611)
133 Returns : n/a
134 Args : $buffer (string) - the option command and its subcommands
135 Method : extracts the options and their values from the buffer.
136 Creates a hash from those data, and adds it to the Bio::NEXUS::AssumptionsBlock object.
137  
138 =end comment
139  
140 =cut
141  
142 4 ▶sub _parse_options {
Subroutine _parse_options: called CC=7 SCAR=21.5
143 4 my ( $self, $buffer ) = @_;
144 4 my @mix = split( /\s+/, $buffer );
145 4 for my $word ( @mix ) {
146 11 my ( $command, $value ) = $word =~ m/^(.+?)=(.+)$/;
147 11 ▶ next if !defined $command;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $command 6 5 11
148  
149 # check if the value should be converted to a 'preferred synonym'
150 5 $command = lc $command;
151 5 $value = lc $value;
152 0 ▶ if ( $value eq 'irrev.up' || $value eq 'irrev.dn' ) { $value = 'irrev' }
Branch: 1 branch
BranchTrueFalseTotal
if ($value eq "irrev.up" or $value eq "irrev.dn") 0 5 5
Condition33%1/3
$value eq "irrev.up" or $value eq "irrev.dn"
l!l&&r!l&&!r
005
MC/DC0%0/2
$value eq "irrev.up" or $value eq "irrev.dn"
$value eq "irrev.up" $value eq "irrev.dn"
Truth table33%1/3
A or B
A= $value eq "irrev.up"B= $value eq "irrev.dn"
ABresult
1X1
011
000
153 0 ▶ if ( $value eq 'dollo.up' || $value eq 'dollo.dn' ) { $value = 'dollo' }
Branch: 1 branch
BranchTrueFalseTotal
if ($value eq "dollo.up" or $value eq "dollo.dn") 0 5 5
Condition33%1/3
$value eq "dollo.up" or $value eq "dollo.dn"
l!l&&r!l&&!r
005
MC/DC0%0/2
$value eq "dollo.up" or $value eq "dollo.dn"
$value eq "dollo.up" $value eq "dollo.dn"
Truth table33%1/3
A or B
A= $value eq "dollo.up"B= $value eq "dollo.dn"
ABresult
1X1
011
000
154 5 $self->{'options'}->{$command} = $value;
155 }
156 4 $self->_validate_options($self->{'options'});
157 }
158  
159  
160 =begin comment
161  
162 Title : _validate_options
163 Usage : _validate_options($options);
164 Function: checks if the options passed conform to the Nexus file standard
165 Returns : n/a
166 Args : $options (hashref) - hash containing option-value pairs
167  
168 =end comment
169  
170 =cut
171  
172 11 ▶sub _validate_options {
Subroutine _validate_options: called CC=10 SCAR=23.1
173 11 my ( $self, $opts ) = @_;
174 11 my $is_valid = 1;
175 11 ▶ if ( defined $opts ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $opts) { } 10 1 11
176 10 for my $option ( keys %{ $opts } ) {
177 18 my $is_ok = 1;
178 18 my $value = $$opts{$option};
179 18 ▶ if ($option eq 'deftype') {
Branch: 3 branches
BranchTrueFalseTotal
if ($option eq 'deftype') { } 8 10 18
elsif ($option eq 'polytcount') { } 1 9 10
elsif ($option eq 'gapmode') { } 5 4 9
180 8 ▶ if ($value !~ m/^(unord|ord|irrev|irrev\.up|irrev\.dn|dollo|dollo\.up|dollo\.dn)$/i) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($value =~ /^(unord|ord|irrev|irrev\.up|irrev\.dn|dollo|dollo\.up|dollo\.dn)$/i) 2 6 8
181 2 $is_valid = 0;
182 2 $is_ok = 0;
183 }
184 }
185 elsif ($option eq 'polytcount') {
186 1 ▶ if ($value !~ m/^(maxsteps|minsteps)$/i) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($value =~ /^(maxsteps|minsteps)$/i) 0 1 1
187 0 $is_valid = 0;
188 0 $is_ok = 0;
189 }
190 }
191 elsif ($option eq 'gapmode') {
192 5 ▶ if ($value !~ m/^(missing|newstate)$/i) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($value =~ /^(missing|newstate)$/i) 1 4 5
193 1 $is_valid = 0;
194 1 $is_ok = 0;
195 }
196 }
197 # the option is not in the Nexus file standard
198 else {
199 4 $is_valid = 0;
200 4 $logger->info("Unknown option $option");
201 }
202 18 ▶ if ( $is_ok == 0 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($is_ok == 0) 3 15 18
203 3 $logger->info("Unknown value ($value) for $option");
204 }
205 }
206 }
207 else {
208 1 $logger->warn("Missing argument 'options'");
209 1 return 0;
210 }
211 10 return $is_valid;
212 }
213  
214  
215 =head2 get_option
216  
217 Title : get_option
218 Usage : $val = $assump_block->get_option($option_type);
219 Function: Returns the value of the specified option
220 Returns : $value (string)
221 Args : $option_type (string); nexus standard permits: deftype, polytcount, gapmode
222  
223 =cut
224  
225 9 ▶sub get_option {
Subroutine get_option: called CC=5 SCAR=16.1
Pod documented
226 9 my ( $self, $option ) = @_;
227  
228 9 ▶ return undef if not defined $option;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $option 0 9 9
229 9 $option = lc $option;
230 9 ▶ if ( $option =~ qr/^(?:deftype|polytcount|gapmode)$/ ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($option =~ qr/^(?:deftype|polytcount|gapmode)$/) { } 7 2 9
231 7 ▶ if ( defined $self->{'options'}->{$option} ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $self->{'options'}{$option}) { } 5 2 7
232 5 return $self->{'options'}->{$option};
233 }
234 else {
235 2 return undef;
236 }
237 }
238 else {
239 2 ▶ if ( defined $self->{'options'}->{$option} ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $self->{'options'}{$option}) { } 1 1 2
240 1 return $self->{'options'}->{$option};
241 }
242 else {
243 1 return undef;
244 }
245 }
246 }
247  
248 =head2 set_option
249  
250 Title : set_option
251 Usage : $assumption_block->set_option($option, $value)
252 Function: Updates/sets a particular option (DefType, PolyTCount, GapMode, etc.)
253 Returns : n/a
254 Args : $option (string) , $value (string)
255  
256 =cut
257  
258 4 ▶sub set_option {
Subroutine set_option: called CC=3 SCAR=11.8
Pod documented
259 4 my ( $self, $option, $value ) = @_;
260 4 ▶ if ( defined $option && defined $value ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $option and defined $value) { } 4 0 4
Condition33%1/3
defined $option and defined $value
!ll&&!rl&&r
004
MC/DC0%0/2
defined $option and defined $value
defined $option defined $value
Truth table33%1/3
A and B
A= defined $optionB= defined $value
ABresult
0X0
100
111
261 4 $option = lc $option;
262 4 $value = lc $value;
263 4 $self->{'options'}->{$option} = $value;
264 # validate the input
265 4 my $data = {$option => $value};
266 4 $self->_validate_options($data);
267 }
268 else {
269 0 $logger->warn("Missing argument(s)");
270 }
271 }
272  
273 =head2 get_all_options
274  
275 Title : get_all_options
276 Usage : $hash_ref = $assumption_block->get_all_options();
277 Function: Retrieve all the options stored in the block
278 Returns : a hash reference (key-value pair), where each 'key' is an option (subcommand) and the 'value' is the corresponding value
279 Args : none
280  
281 =cut
282  
283 3 ▶sub get_all_options {
Subroutine get_all_options: called CC=4 SCAR=14.2
Pod documented
284 # note: this method returns a copy of
285 # the 'options' hash, rather thatn a
286 # reference to the original. Why?
287 # By passing a reference to the actual
288 # data structure you give the user
289 # direct access to it. And ...
290 # direct access to the objects
291 # bypasses the validation and correction
292 # which are a major part of the various
293 # 'set_' methods - not a good thing.
294 3 my ($self) = @_;
295  
296 3 ▶ if ( defined $self->{'options'} ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $self->{'options'}) { } 3 0 3
297 3 my %options;
298 3 for my $key ( keys %{ $self->{'options'} } ) {
299 9 my $value = $self->{'options'}->{$key};
300 9 ▶ if ( defined $value ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $value) 9 0 9
301 9 $options{$key} = $value;
302 }
303 }
304 3 $self->_validate_options(\%options);
305 3 return \%options;
306 }
307 else {
308 0 return undef;
309 }
310 }
311  
312 =head2 set_all_options
313  
314 Title : set_all_options
315 Usage : $assumption_block->set_all_options($options);
316 Function: Updates/sets options (of this assumptions block) and their values
317 Returns : n/a
318 Args : $options (hashref) {'option' => 'value', ... }
319  
320 =cut
321  
322 2 ▶sub set_all_options {
Subroutine set_all_options: called CC=3 SCAR=11.3
Pod documented
323 2 my ( $self, $options ) = @_;
324 2 ▶ if ( defined $options ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $options) { } 2 0 2
325 2 for my $key ( keys %{$options} ) {
326 6 my $value = $$options{$key};
327 6 $self->{'options'}->{ lc $key } = lc $value;
328 }
329 }
330 else {
331 0 $logger->warn("Missing argument(s)");
332 }
333 }
334  
335 =head2 add_weightset
336  
337 Title : add_weightset
338 Usage : $block->add_weightset(weightset);
339 Function: add a weightset to this assumption block
340 Returns : none
341 Args : WeightSet object
342  
343 =cut
344  
345 7 ▶sub add_weightset {
Subroutine add_weightset: called CC=1 SCAR=0.0
Pod documented
346 7 my ( $self, $weight ) = @_;
347 7 push @{ $self->{'assumptions'} }, $weight;
348 }
349  
350 =head2 get_assumptions
351  
352 Title : get_assumptions
353 Usage : $block->get_assumptions();
354 Function: Gets the list of assumptions (Bio::NEXUS::WeightSet objects) and returns it
355 Returns : ref to array of Bio::NEXUS::WeightSet objects
356 Args : none
357  
358 =cut
359  
360 14 ▶sub get_assumptions { shift->{'assumptions'} || [] }
Subroutine get_assumptions: called CC=2 SCAR=7.6
Pod documented
Branch: 1 branch
BranchTrueFalseTotal
+(shift())->{"assumptions"} or [] 14 0 14
361  
362 =head2 select_assumptions
363  
364 Title : select_assumptions
365 Usage : $block->select_assumptions($columns);
366 Function: select assumptions (Bio::NEXUS::WeightSet objects) for a set of characters (columns)
367 Returns : none
368 Args : column numbers for the set of characters to be selected
369  
370 =cut
371  
372 0 ▶sub select_assumptions {
Subroutine select_assumptions: not called CC=3 SCAR=24.8
Pod documented
373 0 my ( $self, $columns ) = @_;
374 0 ▶ if ( !$self->get_assumptions() ) { return; }
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->get_assumptions) 0 0 0
375 0 my @assump = @{ $self->get_assumptions() };
376 0 for my $assump (@assump) {
377 0 $assump->select_weights($columns);
378 }
379 }
380  
381 =head2 add_otu_clone
382  
383 Title : add_otu_clone
384 Usage : ...
385 Function: ...
386 Returns : ...
387 Args : ...
388  
389 =cut
390  
391 1 ▶sub add_otu_clone {
Subroutine add_otu_clone: called CC=1 SCAR=0.0
Pod documented
392 1 my ( $self, $original_otu_name, $copy_otu_name ) = @_;
393 1 $logger->warn("Bio::NEXUS::AssumptionsBlock::add_otu_clone() method not fully implemented");
394  
395 }
396  
397 =head2 equals
398  
399 Name : equals
400 Usage : $assump->equals($another);
401 Function: compare if two Bio::NEXUS::AssumptionsBlock objects are equal
402 Returns : boolean
403 Args : a Bio::NEXUS::AssumptionsBlock object
404  
405 =cut
406  
407 3 ▶sub equals {
Subroutine equals: called CC=5 SCAR=19.7
Pod documented
408 3 my ( $self, $block ) = @_;
409 3 ▶ if ( ! $self->SUPER::equals($block) ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->SUPER::equals($block)) 1 2 3
410 1 return 0;
411 }
412 2 my @weightset1 = @{ $self->get_assumptions() };
413 2 my @weightset2 = @{ $block->get_assumptions() };
414 2 ▶ if ( @weightset1 != @weightset2 ) {
Branch: 1 branch
BranchTrueFalseTotal
if (@weightset1 != @weightset2) 0 2 2
415 0 return 0;
416 }
417 # XXX Schwartzian transforms
418 @weightset1 =
419 0 map { $_->[0] }
420 0 sort { $a->[1] cmp $b->[1] }
421 0 map { [ $_, $_->get_name() ] } @weightset1;
422 @weightset2 =
423 0 map { $_->[0] }
424 0 sort { $a->[1] cmp $b->[1] }
425 0 map { [ $_, $_->get_name() ] } @weightset2;
426 2 for my $i ( 0 .. $#weightset1 ) {
427 0 ▶ if ( !$weightset1[$i]->equals( $weightset2[$i] ) ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($weightset1[$i]->equals($weightset2[$i])) 0 0 0
428 0 return 0;
429 }
430 }
431 2 return 1;
432 }
433  
434 =begin comment
435  
436 Name : _write_options
437 Usage : $assump->_write_options($filehandle, $verbose);
438 Function: Writes 'options' command
439 Returns : none
440 Args : $fh - (filehandle) output target; if undefined, STDOUT will be used
441  
442 =end comment
443  
444 =cut
445  
446 4 ▶sub _write_options {
Subroutine _write_options: called CC=6 SCAR=17.9
447 4 my ( $self, $fh, $verbose ) = @_;
448 4 ▶ $fh ||= \*STDOUT;
Condition50%1/2
$fh ||= \*STDOUT
l!l
40
MC/DC0%0/1
$fh ||= \*STDOUT
$fh
Truth table50%1/2
A
A= $fh
Aresult
11
00
449 4 my $return_val = "";
450 4 for my $option ( keys %{ $self->{'options'} } ) {
451 5 my $value = $self->{'options'}->{$option};
452 5 ▶ if ( defined $value && ( $value ne "" ) ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $value and $value ne "") 3 2 5
Condition100%3/3
defined $value and $value ne ""
!ll&&!rl&&r
113
MC/DC100%2/2
defined $value and $value ne ""
defined $value $value ne ""
Truth table100%3/3
A and B
A= defined $valueB= $value ne ""
ABresult
0X0
100
111
453 3 $return_val .= " " . $option . "=" . $value;
454 }
455 }
456 4 ▶ if ( $return_val ne "" ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($return_val ne "") 2 2 4
457 2 $return_val = "Options" . $return_val . ";";
458 2 print $fh $return_val, "\n";
459 }
460 }
461  
462 =begin comment
463  
464 Name : _write
465 Usage : $assump->_write($filehandle, $verbose);
466 Function: Writes NEXUS block from stored data
467 Returns : none
468 Args : none
469  
470 =end comment
471  
472 =cut
473  
474 4 ▶sub _write {
Subroutine _write: called CC=8 SCAR=21.5
475 4 my ( $self, $fh, $verbose ) = @_;
476 4 ▶ $fh ||= \*STDOUT;
Condition100%2/2
$fh ||= \*STDOUT
l!l
22
MC/DC100%1/1
$fh ||= \*STDOUT
$fh
Truth table100%2/2
A
A= $fh
Aresult
11
00
477  
478 4 $self->SUPER::_write($fh);
479 4 $self->_write_options($fh);
480 4 for my $assumption ( @{ $self->get_assumptions() } ) {
481 2 ▶ if ( $assumption->is_wt() ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($assumption->is_wt) 2 0 2
482 2 my @wt = @{ $assumption->get_weights() };
483 2 my $delimiter = ' ';
484 2 my $format = '(STANDARD TOKENS)'; ## This is the NEXUS default
485 2 ▶ if ( !$assumption->_is_tokens() ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($assumption->_is_tokens) 0 2 2
486 0 $delimiter = '';
487 0 $format =~ s/TOKENS/NOTOKENS/;
488 }
489 2 ▶ if ( $assumption->_is_vector() ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($assumption->_is_vector) 2 0 2
490 2 $format =~ s/STANDARD/VECTOR/;
491 }
492 2 my @wtstring = join $delimiter, @wt;
493 2 print $fh "\tWTSET ", $assumption->get_name(), " $format = \n\t";
494 2 print $fh @wtstring, ";\n";
495 }
496 }
497 4 ▶ for my $comm ( @{ $self->{'unknown'} || [] } ) {
Condition50%1/2
$self->{'unknown'} || []
l!l
04
MC/DC0%0/1
$self->{'unknown'} || []
$self->{'unknown'}
Truth table50%1/2
A
A= $self->{'unknown'}
Aresult
11
00
498 0 print $fh "\t$comm;\n";
499 }
500 4 print $fh "END;\n";
501 }
502  
503 17 ▶sub AUTOLOAD {
Subroutine AUTOLOAD: called CC=3 SCAR=12.6
504 17 ▶ return if $AUTOLOAD =~ /DESTROY$/;
Branch: 1 branch
BranchTrueFalseTotal
if $Bio::NEXUS::AssumptionsBlock::AUTOLOAD =~ /DESTROY$/ 16 1 17
505 1 my $package_name = __PACKAGE__ . '::';
506  
507 # The following methods are deprecated and are temporarily supported
508 # via a warning and a redirection
509 1 my %synonym_for =
510 ( "${package_name}parse_weightset" => "${package_name}_parse_wtset", );
511  
512 1 ▶ if ( defined $synonym_for{$AUTOLOAD} ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $synonym_for{$Bio::NEXUS::AssumptionsBlock::AUTOLOAD}) { } 0 1 1
513 0 $logger->warn("$AUTOLOAD() is deprecated; use $synonym_for{$AUTOLOAD}() instead");
514 0 goto &{ $synonym_for{$AUTOLOAD} };
515 }
516 else {
517 1 throw 'UnknownMethod' => "ERROR: Unknown method $AUTOLOAD called";
518 }
519 0 return;
520 }
521  
522 35 1;
« lib/Bio/NEXUS/UnknownBlock.pm ↑ Summary lib/Bio/NEXUS/NHXCmd.pm »