Skip to content

Commit

Permalink
Fixing the json output
Browse files Browse the repository at this point in the history
  • Loading branch information
olaaustine committed Jan 4, 2024
1 parent ffe9b52 commit ff5b374
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions PhenotypeOrthologous.pm
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,18 @@ sub run {
} @{$self->get_data($vf->{chr}, $vf_start, $vf_end)};

return $res ? $res->{result} : {} if !$output_format{'json'};

if ($output_format{'json'}) {
my $result = $res->{result};

my %split_result = map {
$_ =~ /Phenotype/ ? ($_ => [split /,\s*/, $result->{$_}]) : ($_ => $result->{$_})
} keys %$result;

return { PhenotypeOrthologous => $res->{result} } if $output_format{'json'};

return {
PhenotypeOrthologous => \%split_result,
};
}
}

sub parse_data {
Expand Down

0 comments on commit ff5b374

Please sign in to comment.