line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package BioX::Workflow::Command::run::Utils::Debug; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
726
|
use Moose::Role; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
10
|
|
4
|
1
|
|
|
1
|
|
5899
|
use namespace::autoclean; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
11
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
92
|
use Storable qw(dclone); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
302
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=head1 BioX::Workflow::Command::run::utils::Debug |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
Options for debugging. Stick your whole environment in memory, and figure out what went wrong. |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head2 Variables |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=head3 save_object_env |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
Save object env. This will save all the variables. Useful for debugging, but gets unweildly for larger workflows. |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=cut |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
option 'save_object_env' => ( |
21
|
|
|
|
|
|
|
is => 'rw', |
22
|
|
|
|
|
|
|
isa => 'Bool', |
23
|
|
|
|
|
|
|
default => 0, |
24
|
|
|
|
|
|
|
predicate => 'has_save_object_env', |
25
|
|
|
|
|
|
|
clearer => 'clear_save_object_env', |
26
|
|
|
|
|
|
|
); |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=head2 _classes |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
Saves a snapshot of the entire namespace for the initial environment, and each rule. |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=cut |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
has '_classes' => ( |
35
|
|
|
|
|
|
|
is => 'rw', |
36
|
|
|
|
|
|
|
isa => 'HashRef', |
37
|
|
|
|
|
|
|
default => sub { return {} }, |
38
|
|
|
|
|
|
|
required => 0, |
39
|
|
|
|
|
|
|
predicate => 'has_classes', |
40
|
|
|
|
|
|
|
clearer => 'clear_classes', |
41
|
|
|
|
|
|
|
); |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head2 save_env |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
At each rule save the env for debugging purposes. |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=cut |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub save_env { |
50
|
|
|
|
|
|
|
my $self = shift; |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
return unless $self->save_object_env; |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
$DB::single = 2; |
55
|
|
|
|
|
|
|
$self->_classes->{ $self->key } = dclone($self); |
56
|
|
|
|
|
|
|
return; |
57
|
|
|
|
|
|
|
$DB::single = 2; |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
1; |