| 1 | package Convert::Pheno::BFF::DerivedEntities; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 138 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | 138 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | 138 | ▶ | use autodie; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | 138 | ▶ | use Exporter 'import'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | 138 | ▶ | use Convert::Pheno::Mapping::Compiler qw(load_mapping_document); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | 138 | our @EXPORT_OK = qw( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | execution_entities | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | mapping_entity_overrides | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | compatibility_dataset_id | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | synthesize_bundle_entities | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | 206 | ▶ | sub compatibility_dataset_id { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
compatibility_dataset_id: called CC=13 SCAR=26.6
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | 206 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | 206 | ▶ | return unless $self->{include_dataset_id}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | 9 | my $error = | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | "--include-dataset-id requires a dataset ID at <beacon.datasets.defaults.id> in the mapping file\n"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | die $error | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | 9 | ▶ | unless defined $self->{mapping_file} && length $self->{mapping_file}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
defined $self->{"mapping_file"} and length $self->{"mapping_file"}
MC/DC50%1/2
defined $self->{"mapping_file"} and length $self->{"mapping_file"}
defined $self->{"mapping_file"}
length $self->{"mapping_file"}
Truth table66%2/3
A and B
A= defined $self->{"mapping_file"}B= length $self->{"mapping_file"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | 8 | my $mapping = load_mapping_document( $self->{mapping_file} ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | my $id = | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | ref( $mapping->{beacon} ) eq 'HASH' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | && ref( $mapping->{beacon}{datasets} ) eq 'HASH' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | && ref( $mapping->{beacon}{datasets}{defaults} ) eq 'HASH' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | ? $mapping->{beacon}{datasets}{defaults}{id} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | 8 | ▶ | : undef; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%4/6
ref $mapping->{"beacon"} eq "HASH" and ref $mapping->{"beacon"}{"datasets"} eq "HASH" and ref $mapping->{"beacon"}{"datasets"}{"defaults"} eq "HASH"
ref $mapping->{"beacon"} eq "HASH" and ref $mapping->{"beacon"}{"datasets"} eq "HASH"
MC/DC33%1/3
ref $mapping->{"beacon"} eq "HASH" and ref $mapping->{"beacon"}{"datasets"} eq "HASH" and ref $mapping->{"beacon"}{"datasets"}{"defaults"} eq "HASH"
ref $mapping->{"beacon"} eq "HASH"
ref $mapping->{"beacon"}{"datasets"} eq "HASH"
ref $mapping->{"beacon"}{"datasets"}{"defaults"} eq "HASH"
Truth table50%2/4
A and B and C
A= ref $mapping->{"beacon"} eq "HASH"B= ref $mapping->{"beacon"}{"datasets"} eq "HASH"C= ref $mapping->{"beacon"}{"datasets"}{"defaults"} eq "HASH"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | 8 | ▶ | die $error | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%4/6
defined $id and not ref $id and $id =~ /\S/
defined $id and not ref $id
MC/DC33%1/3
defined $id and not ref $id and $id =~ /\S/
defined $id
not ref $id
$id =~ /\S/
Truth table50%2/4
A and not(B) and C
A= defined $idB= not ref $idC= $id =~ /\S/
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | unless defined($id) && !ref($id) && $id =~ /\S/; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | 7 | my $effective = _entity_overrides($self, 'datasets')->{id}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | 7 | ▶ | die "--include-dataset-id: the dataset ID override conflicts with the mapping file\n" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%3/6
defined $effective and not ref $effective and "$effective" eq "$id"
defined $effective and not ref $effective
MC/DC33%1/3
defined $effective and not ref $effective and "$effective" eq "$id"
defined $effective
not ref $effective
"$effective" eq "$id"
Truth table50%2/4
A and not(B) and C
A= defined $effectiveB= not ref $effectiveC= "$effective" eq "$id"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | unless defined($effective) && !ref($effective) && "$effective" eq "$id"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | 6 | return "$id"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | 47 | ▶ | sub mapping_entity_overrides { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
mapping_entity_overrides: called CC=11 SCAR=24.2
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | 47 | my ($mapping) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | 47 | ▶ | return {} unless ref($mapping) eq 'HASH'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | 38 | ▶ | return {} unless ref( $mapping->{project} ) eq 'HASH'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | 38 | my $project = $mapping->{project}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | 38 | my %overrides; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | 38 | ▶ | if ( defined $project->{id} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | 38 | $overrides{datasets}{id} = $project->{id}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | 38 | $overrides{datasets}{name} = $project->{id}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | 38 | $overrides{cohorts}{id} = $project->{id} . '-cohort'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | 38 | $overrides{cohorts}{name} = $project->{id}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | $overrides{datasets}{description} = $project->{description} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | 38 | ▶ | if defined $project->{description}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | $overrides{datasets}{version} = $project->{version} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | 38 | ▶ | if defined $project->{version}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | 38 | ▶ | if ( ref( $mapping->{beacon} ) eq 'HASH' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | 37 | for my $entity (qw(datasets cohorts)) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | 74 | ▶ | next unless ref( $mapping->{beacon}{$entity} ) eq 'HASH'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | 14 | ▶ | next unless ref( $mapping->{beacon}{$entity}{defaults} ) eq 'HASH'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | 14 | ▶ | $overrides{$entity} ||= {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$overrides{$entity} ||= {}
MC/DC0%0/1
$overrides{$entity} ||= {}
$overrides{$entity}
Truth table50%1/2
A
A= $overrides{$entity}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | _merge_hash_into( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | $overrides{$entity}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | $mapping->{beacon}{$entity}{defaults}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | 14 | ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | 38 | return \%overrides; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | 126 | ▶ | sub execution_entities { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
execution_entities: called CC=6 SCAR=18.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | 126 | my ($entities) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | 126 | ▶ | my @requested = @{ $entities || [] }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$entities || []
MC/DC0%0/1
$entities || []
$entities
Truth table50%1/2
A
A= $entities
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | 126 | ▶ | @requested = ('individuals') unless @requested; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | 126 | my %seen; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | 126 | my @execution = grep { !$seen{$_}++ } @requested; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | # Datasets and cohorts are synthesized from the normalized individuals | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | # collection, so keep individuals in the internal bundle even if the user | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | # only requested the derived entities for output. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | 126 | ▶ | if ( grep { $_ eq 'datasets' || $_ eq 'cohorts' } @execution ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$_ eq 'datasets' || $_ eq 'cohorts'
MC/DC100%2/2
$_ eq 'datasets' || $_ eq 'cohorts'
$_ eq 'datasets'
$_ eq 'cohorts'
Truth table100%3/3
A || B
A= $_ eq 'datasets'B= $_ eq 'cohorts'
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | unshift @execution, 'individuals' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | 31 | ▶ | unless grep { $_ eq 'individuals' } @execution; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | 126 | return \@execution; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | 62 | ▶ | sub synthesize_bundle_entities { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
synthesize_bundle_entities: called CC=6 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | 62 | my ( $self, $bundle, $context ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | 62 | my %requested = map { $_ => 1 } @{ execution_entities( $context->entities ) }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | 62 | my $individuals = $bundle->entities('individuals'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | 62 | ▶ | return $bundle unless @{$individuals}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | 54 | ▶ | if ( $requested{datasets} && !@{ $bundle->entities('datasets') } ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$requested{"datasets"} and not @{$bundle->entities("datasets");}
MC/DC100%2/2
$requested{"datasets"} and not @{$bundle->entities("datasets");}
$requested{"datasets"}
not @{$bundle->entities("datasets");}
Truth table100%3/3
A and not(B)
A= $requested{"datasets"}B= not @{$bundle->entities("datasets");}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | 12 | $bundle->add_entity( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | datasets => _synthesizeDataset( $self, $bundle, $individuals ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | 54 | ▶ | if ( $requested{cohorts} && !@{ $bundle->entities('cohorts') } ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$requested{"cohorts"} and not @{$bundle->entities("cohorts");}
MC/DC100%2/2
$requested{"cohorts"} and not @{$bundle->entities("cohorts");}
$requested{"cohorts"}
not @{$bundle->entities("cohorts");}
Truth table100%3/3
A and not(B)
A= $requested{"cohorts"}B= not @{$bundle->entities("cohorts");}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | 12 | $bundle->add_entity( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | cohorts => _synthesizeCohort( $self, $individuals ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | 54 | return $bundle; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | 12 | ▶ | sub _synthesizeDataset { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_synthesizeDataset: called CC=5 SCAR=16.1
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | 12 | my ( $self, $bundle, $individuals ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | my $dataset = { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | id => 'dataset-1', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | name => 'Converted dataset', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | description => sprintf( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | 'Dataset synthesized from %d individual%s by convert-pheno.', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | 12 | ▶ | scalar @{$individuals}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | 12 | scalar( @{$individuals} ) == 1 ? q{} : 's' | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | ), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | info => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | sourceEntity => 'individuals', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | 12 | individualCount => scalar @{$individuals}, | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | 12 | my $biosamples = $bundle->entities('biosamples'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | 5 | $dataset->{info}{biosampleCount} = scalar @{$biosamples} | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | 12 | ▶ | if @{$biosamples}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | 12 | _merge_hash_into( $dataset, _entity_overrides( $self, 'datasets' ) ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | 12 | ▶ | unless ( $self->{test} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | $dataset->{info}{convertPheno} = $self->{convertPheno} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | 1 | ▶ | if defined $self->{convertPheno}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | 12 | return $dataset; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | 12 | ▶ | sub _synthesizeCohort { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_synthesizeCohort: called CC=4 SCAR=13.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | 12 | my ( $self, $individuals ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | my $cohort = { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | id => 'cohort-1', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | name => 'All individuals', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | cohortType => 'study-defined', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | 12 | cohortSize => scalar @{$individuals}, | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | 12 | my @cohortDataTypes; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | 12 | ▶ | if ( grep { _hasClinicalContent($_) } @{$individuals} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | 8 | push @cohortDataTypes, | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | id => 'OGMS:0000015', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | label => 'clinical history', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 163 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 164 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 165 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 166 | 12 | ▶ | if ( grep { _hasGenomicContent($_) } @{$individuals} ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 167 | 0 | push @cohortDataTypes, | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 168 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 169 | id => 'OBI:0000070', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 170 | label => 'genotyping assay', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 171 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 172 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 173 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 174 | 12 | ▶ | $cohort->{cohortDataTypes} = \@cohortDataTypes if @cohortDataTypes; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 175 | 12 | _merge_hash_into( $cohort, _entity_overrides( $self, 'cohorts' ) ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 176 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 177 | 12 | return $cohort; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 178 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 179 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 180 | 31 | ▶ | sub _entity_overrides { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_entity_overrides: called CC=13 SCAR=27.3
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 181 | 31 | my ( $self, $entity ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 182 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 183 | 31 | my $overrides = {}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 184 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 185 | 31 | ▶ | if ( exists $self->{source_derived_entity_overrides} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%6/9
exists $self->{"source_derived_entity_overrides"} and ref $self->{"source_derived_entity_overrides"} eq "HASH" and exists $self->{"source_derived_entity_overrides"}{$entity} and ref $self->{"source_derived_entity_overrides"}{$entity} eq "HASH"
exists $self->{"source_derived_entity_overrides"} and ref $self->{"source_derived_entity_overrides"} eq "HASH" and exists $self->{"source_derived_entity_overrides"}{$entity}
exists $self->{"source_derived_entity_overrides"} and ref $self->{"source_derived_entity_overrides"} eq "HASH"
MC/DC25%1/4
exists $self->{"source_derived_entity_overrides"} and ref $self->{"source_derived_entity_overrides"} eq "HASH" and exists $self->{"source_derived_entity_overrides"}{$entity} and ref $self->{"source_derived_entity_overrides"}{$entity} eq "HASH"
exists $self->{"source_derived_entity_overrides"}
ref $self->{"source_derived_entity_overrides"} eq "HASH"
exists $self->{"source_derived_entity_overrides"}{$entity}
ref $self->{"source_derived_entity_overrides"}{$entity} eq "HASH"
Truth table40%2/5
A and B and C and D
A= exists $self->{"source_derived_entity_overrides"}B= ref $self->{"source_derived_entity_overrides"} eq "HASH"C= exists $self->{"source_derived_entity_overrides"}{$entity}D= ref $self->{"source_derived_entity_overrides"}{$entity} eq "HASH"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 186 | && ref( $self->{source_derived_entity_overrides} ) eq 'HASH' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 187 | && exists $self->{source_derived_entity_overrides}{$entity} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 188 | && ref( $self->{source_derived_entity_overrides}{$entity} ) eq 'HASH' ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 189 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 190 | _merge_hash_into( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 191 | $overrides, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 192 | 8 | _clone_data( $self->{source_derived_entity_overrides}{$entity} ) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 193 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 194 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 195 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 196 | 31 | ▶ | if ( exists $self->{mapping_file_derived_entity_overrides} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%6/9
exists $self->{"mapping_file_derived_entity_overrides"} and ref $self->{"mapping_file_derived_entity_overrides"} eq "HASH" and exists $self->{"mapping_file_derived_entity_overrides"}{$entity} and ref $self->{"mapping_file_derived_entity_overrides"}{$entity} eq "HASH"
exists $self->{"mapping_file_derived_entity_overrides"} and ref $self->{"mapping_file_derived_entity_overrides"} eq "HASH" and exists $self->{"mapping_file_derived_entity_overrides"}{$entity}
exists $self->{"mapping_file_derived_entity_overrides"} and ref $self->{"mapping_file_derived_entity_overrides"} eq "HASH"
MC/DC25%1/4
exists $self->{"mapping_file_derived_entity_overrides"} and ref $self->{"mapping_file_derived_entity_overrides"} eq "HASH" and exists $self->{"mapping_file_derived_entity_overrides"}{$entity} and ref $self->{"mapping_file_derived_entity_overrides"}{$entity} eq "HASH"
exists $self->{"mapping_file_derived_entity_overrides"}
ref $self->{"mapping_file_derived_entity_overrides"} eq "HASH"
exists $self->{"mapping_file_derived_entity_overrides"}{$entity}
ref $self->{"mapping_file_derived_entity_overrides"}{$entity} eq "HASH"
Truth table40%2/5
A and B and C and D
A= exists $self->{"mapping_file_derived_entity_overrides"}B= ref $self->{"mapping_file_derived_entity_overrides"} eq "HASH"C= exists $self->{"mapping_file_derived_entity_overrides"}{$entity}D= ref $self->{"mapping_file_derived_entity_overrides"}{$entity} eq "HASH"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 197 | && ref( $self->{mapping_file_derived_entity_overrides} ) eq 'HASH' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 198 | && exists $self->{mapping_file_derived_entity_overrides}{$entity} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 199 | && ref( $self->{mapping_file_derived_entity_overrides}{$entity} ) eq 'HASH' ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 200 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 201 | _merge_hash_into( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 202 | $overrides, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 203 | 17 | _clone_data( $self->{mapping_file_derived_entity_overrides}{$entity} ) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 204 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 205 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 206 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 207 | 31 | ▶ | if ( exists $self->{derived_entity_overrides} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition55%5/9
exists $self->{"derived_entity_overrides"} and ref $self->{"derived_entity_overrides"} eq "HASH" and exists $self->{"derived_entity_overrides"}{$entity} and ref $self->{"derived_entity_overrides"}{$entity} eq "HASH"
exists $self->{"derived_entity_overrides"} and ref $self->{"derived_entity_overrides"} eq "HASH" and exists $self->{"derived_entity_overrides"}{$entity}
exists $self->{"derived_entity_overrides"} and ref $self->{"derived_entity_overrides"} eq "HASH"
MC/DC25%1/4
exists $self->{"derived_entity_overrides"} and ref $self->{"derived_entity_overrides"} eq "HASH" and exists $self->{"derived_entity_overrides"}{$entity} and ref $self->{"derived_entity_overrides"}{$entity} eq "HASH"
exists $self->{"derived_entity_overrides"}
ref $self->{"derived_entity_overrides"} eq "HASH"
exists $self->{"derived_entity_overrides"}{$entity}
ref $self->{"derived_entity_overrides"}{$entity} eq "HASH"
Truth table40%2/5
A and B and C and D
A= exists $self->{"derived_entity_overrides"}B= ref $self->{"derived_entity_overrides"} eq "HASH"C= exists $self->{"derived_entity_overrides"}{$entity}D= ref $self->{"derived_entity_overrides"}{$entity} eq "HASH"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 208 | && ref( $self->{derived_entity_overrides} ) eq 'HASH' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 209 | && exists $self->{derived_entity_overrides}{$entity} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 210 | && ref( $self->{derived_entity_overrides}{$entity} ) eq 'HASH' ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 211 | { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 212 | _merge_hash_into( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 213 | $overrides, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 214 | 3 | _clone_data( $self->{derived_entity_overrides}{$entity} ) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 215 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 216 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 217 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 218 | 31 | return $overrides; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 219 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 220 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 221 | 718 | ▶ | sub _clone_data { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_clone_data: called CC=4 SCAR=13.9
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 222 | 718 | my ($data) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 223 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 224 | 718 | ▶ | return $data unless ref($data); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 225 | 180 | ▶ | return { map { $_ => _clone_data( $data->{$_} ) } keys %{$data} } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 226 | if ref($data) eq 'HASH'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 227 | 27 | ▶ | return [ map { _clone_data($_) } @{$data} ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 228 | if ref($data) eq 'ARRAY'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 229 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 230 | 2 | return $data; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 231 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 232 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 233 | 93 | ▶ | sub _merge_hash_into { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_merge_hash_into: called CC=7 SCAR=19.6
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 234 | 93 | my ( $target, $source ) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 235 | 93 | ▶ | return $target unless defined $source && ref($source) eq 'HASH'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $source and ref $source eq "HASH"
MC/DC0%0/2
defined $source and ref $source eq "HASH"
defined $source
ref $source eq "HASH"
Truth table33%1/3
A and B
A= defined $sourceB= ref $source eq "HASH"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 236 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 237 | 93 | for my $key ( keys %{$source} ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 238 | 255 | my $value = $source->{$key}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 239 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 240 | 255 | ▶ | if ( ref($value) eq 'HASH' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 241 | 27 | ▶ | $target->{$key} ||= {}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$target->{$key} ||= {}
MC/DC100%1/1
$target->{$key} ||= {}
$target->{$key}
Truth table100%2/2
A
A= $target->{$key}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 242 | 27 | _merge_hash_into( $target->{$key}, $value ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 243 | 27 | next; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 244 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 245 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 246 | 228 | ▶ | if ( ref($value) eq 'ARRAY' ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 247 | 19 | $target->{$key} = [ @{$value} ]; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 248 | 19 | next; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 249 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 250 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 251 | 209 | $target->{$key} = $value; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 252 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 253 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 254 | 93 | return $target; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 255 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 256 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 257 | 1035 | ▶ | sub _hasClinicalContent { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_hasClinicalContent: called CC=3 SCAR=11.2
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 258 | 1035 | my ($individual) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 259 | return scalar grep { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 260 | 1035 | exists $individual->{$_} | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 261 | && ref( $individual->{$_} ) eq 'ARRAY' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 262 | 6210 | ▶ | && @{ $individual->{$_} } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%4/6
exists $individual->{$_} && ref $individual->{$_} eq 'ARRAY' && @{$individual->{$_};}
exists $individual->{$_} and ref $individual->{$_} eq "ARRAY"
MC/DC33%1/3
exists $individual->{$_} && ref $individual->{$_} eq 'ARRAY' && @{$individual->{$_};}
exists $individual->{$_}
ref $individual->{$_} eq "ARRAY"
@{$individual->{$_};}
Truth table50%2/4
A and B && C
A= exists $individual->{$_}B= ref $individual->{$_} eq "ARRAY"C= @{$individual->{$_};}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 263 | } qw(diseases exposures phenotypicFeatures interventionsOrProcedures measures treatments); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 264 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 265 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 266 | 1035 | ▶ | sub _hasGenomicContent { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_hasGenomicContent: called CC=7 SCAR=21.3
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 267 | 1035 | my ($individual) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 268 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 269 | 1035 | ▶ | return 0 unless exists $individual->{info} && ref( $individual->{info} ) eq 'HASH'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
exists $individual->{"info"} and ref $individual->{"info"} eq "HASH"
MC/DC50%1/2
exists $individual->{"info"} and ref $individual->{"info"} eq "HASH"
exists $individual->{"info"}
ref $individual->{"info"} eq "HASH"
Truth table66%2/3
A and B
A= exists $individual->{"info"}B= ref $individual->{"info"} eq "HASH"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 270 | return 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 271 | unless exists $individual->{info}{phenopacket} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 272 | 1033 | ▶ | && ref( $individual->{info}{phenopacket} ) eq 'HASH'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
exists $individual->{"info"}{"phenopacket"} and ref $individual->{"info"}{"phenopacket"} eq "HASH"
MC/DC50%1/2
exists $individual->{"info"}{"phenopacket"} and ref $individual->{"info"}{"phenopacket"} eq "HASH"
exists $individual->{"info"}{"phenopacket"}
ref $individual->{"info"}{"phenopacket"} eq "HASH"
Truth table66%2/3
A and B
A= exists $individual->{"info"}{"phenopacket"}B= ref $individual->{"info"}{"phenopacket"} eq "HASH"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 273 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 274 | 9 | my $phenopacket = $individual->{info}{phenopacket}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 275 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 276 | return scalar grep { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 277 | 9 | exists $phenopacket->{$_} | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 278 | && ref( $phenopacket->{$_} ) eq 'ARRAY' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 279 | 0 | ▶ | && @{ $phenopacket->{$_} } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%2/6
exists $phenopacket->{$_} && ref $phenopacket->{$_} eq 'ARRAY' && @{$phenopacket->{$_};}
exists $phenopacket->{$_} and ref $phenopacket->{$_} eq "ARRAY"
MC/DC0%0/3
exists $phenopacket->{$_} && ref $phenopacket->{$_} eq 'ARRAY' && @{$phenopacket->{$_};}
exists $phenopacket->{$_}
ref $phenopacket->{$_} eq "ARRAY"
@{$phenopacket->{$_};}
Truth table25%1/4
A and B && C
A= exists $phenopacket->{$_}B= ref $phenopacket->{$_} eq "ARRAY"C= @{$phenopacket->{$_};}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 280 | } qw(genes interpretations variants files); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 281 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 282 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 283 | 138 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||