| 1 | package Convert::Pheno::Source::Structured; | ||||||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 136 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 4 | 136 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||||||||||||||||||
| 6 | 136 | ▶ | use Convert::Pheno::IO::FileIO qw(io_yaml_or_json); | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 7 | 136 | ▶ | use Convert::Pheno::Mapping::Shared qw(get_info); | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 8 | 136 | ▶ | use Convert::Pheno::Source::Result; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||||||||||||||
| 10 | 61 | ▶ | sub new { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 11 | 61 | my ( $class, $converter ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||
| 12 | 61 | return bless { converter => $converter }, $class; | |||||||||||||||||||||||||||||||||||||||||||||
| 13 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||||||||||||||||||||
| 15 | 61 | ▶ | sub load { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
load: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 16 | 61 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||||||
| 17 | 61 | my $converter = $self->{converter}; | |||||||||||||||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||||||||||||||||
| 19 | return Convert::Pheno::Source::Result->new( | ||||||||||||||||||||||||||||||||||||||||||||||
| 20 | { | ||||||||||||||||||||||||||||||||||||||||||||||
| 21 | data => $converter->{data}, | ||||||||||||||||||||||||||||||||||||||||||||||
| 22 | owned => 0, | ||||||||||||||||||||||||||||||||||||||||||||||
| 23 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 24 | ) | ||||||||||||||||||||||||||||||||||||||||||||||
| 25 | 61 | ▶ | if exists $converter->{data}; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||||||||||||||||||||
| 27 | return Convert::Pheno::Source::Result->new( | ||||||||||||||||||||||||||||||||||||||||||||||
| 28 | { | ||||||||||||||||||||||||||||||||||||||||||||||
| 29 | data => io_yaml_or_json( | ||||||||||||||||||||||||||||||||||||||||||||||
| 30 | { | ||||||||||||||||||||||||||||||||||||||||||||||
| 31 | filepath => $converter->{in_file}, | ||||||||||||||||||||||||||||||||||||||||||||||
| 32 | 45 | mode => 'read', | |||||||||||||||||||||||||||||||||||||||||||||
| 33 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 34 | ), | ||||||||||||||||||||||||||||||||||||||||||||||
| 35 | owned => 1, | ||||||||||||||||||||||||||||||||||||||||||||||
| 36 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 37 | ); | ||||||||||||||||||||||||||||||||||||||||||||||
| 38 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||||||||||||||||||||
| 40 | 42 | ▶ | sub prepare { | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
prepare: called CC=4 SCAR=15.2
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 41 | 42 | my ( $self, $format ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||
| 42 | 42 | my $converter = $self->{converter}; | |||||||||||||||||||||||||||||||||||||||||||||
| 43 | 42 | my $source = $self->load; | |||||||||||||||||||||||||||||||||||||||||||||
| 44 | 42 | $source->apply_to($converter); | |||||||||||||||||||||||||||||||||||||||||||||
| 45 | 42 | delete $converter->{mapping_file_derived_entity_overrides}; | |||||||||||||||||||||||||||||||||||||||||||||
| 46 | 42 | ▶ | $converter->{convertPheno} ||= get_info($converter) | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%2/6
defined $format and $format eq "pxf"
$converter->{"convertPheno"} ||= get_info($converter)
MC/DC0%0/2
defined $format and $format eq "pxf"
defined $format
$format eq "pxf"
MC/DC0%0/2
$converter->{"convertPheno"} ||= get_info($converter)
$converter->{"convertPheno"}
get_info($converter)
Truth table33%1/3
A and B
A= defined $formatB= $format eq "pxf"
Truth table33%1/3
A ||= B
A= $converter->{"convertPheno"}B= get_info($converter)
| |||||||||||||||||||||||||||||||||||||||||||||||
| 47 | if defined $format && $format eq 'pxf'; | ||||||||||||||||||||||||||||||||||||||||||||||
| 48 | 42 | return 1; | |||||||||||||||||||||||||||||||||||||||||||||
| 49 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||||||||||||||||||||
| 51 | 136 | 1; | |||||||||||||||||||||||||||||||||||||||||||||