Skip to content

Commit

Permalink
Update to acommodate changes to LinkML schema
Browse files Browse the repository at this point in the history
mod_id slot changed to mod_entity_id, and disease_annotation_summary
slot replaced by related_notes slot
  • Loading branch information
markquintontulloch committed Feb 15, 2022
1 parent 6d79921 commit 8529943
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions scripts/AGR/curation_db_submissions/make_agr_disease_json.pl
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
}

my $annot = {
mod_id => $obj->name,
mod_entity_id => $obj->name,
object => $obj->Disease_term->name,
data_provider => ['WB'],
date_last_modified => $evi_date,
Expand All @@ -157,7 +157,11 @@
};
$annot->{modified_by} = 'WB:' . $obj->Curator_confirmed->name if $obj->Curator_confirmed;
$annot->{genetic_sex} = $obj->Genetic_sex->name if $obj->Genetic_sex;
$annot->{disease_annotation_summary} = $obj->Disease_model_description->name if $obj->Disease_model_description; # or could be disease_annotation_note
$annot->{related_notes} = [{
note_type => 'disease_summary',
private => JSON::false,
free_text => $obj->Disease_model_description->name
}] if $obj->Disease_model_description;

unless ($modifier eq 'no_modifier') {
$annot->{disease_genetic_modifier} = $modifier;
Expand Down Expand Up @@ -230,7 +234,6 @@

my $condition_relations = get_condition_relations($obj);
$annot->{conditionRelations} = $condition_relations if @$condition_relations;


if ($obj_type eq 'gene') {
push @gene_annots, $annot;
Expand Down Expand Up @@ -263,7 +266,7 @@ sub print_json {

open(my $out_fh, ">$outfile") or die("cannot open $outfile : $!\n");
my $json_obj = JSON->new;
my $string = $json_obj->allow_nonref->canonical->pretty->encode([$data]);
my $string = $json_obj->allow_nonref->canonical->pretty->encode($data);
print $out_fh $string;
close $out_fh;

Expand Down

0 comments on commit 8529943

Please sign in to comment.