Skip to content

Commit cdf8de2

Browse files
Disease submission fix and update
1 parent b241765 commit cdf8de2

File tree

1 file changed

+24
-17
lines changed

1 file changed

+24
-17
lines changed

scripts/AGR/curation_db_submissions/make_agr_disease_json.pl

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
use Const::Fast;
1616
use XML::LibXML;
1717

18-
const my $LINKML_SCHEMA => 'v2.9.1';
18+
const my $LINKML_SCHEMA => 'v2.10.0';
1919
const my $CHEBI_PURL => 'http://purl.obolibrary.org/obo/chebi.owl';
2020

2121
my ($debug, $test, $verbose, $store, $wormbase, $acedbpath, $ws_version, $outfile, $schema, $dates_file);
@@ -174,7 +174,7 @@
174174
date_updated => $evi_date,
175175
annotation_type_name => 'manually_curated',
176176
evidence_code_curies => \@evi_codes,
177-
reference_curie => $paper,
177+
evidence_curie => $paper,
178178
internal => JSON::false,
179179
obsolete => JSON::false
180180
};
@@ -351,12 +351,12 @@ sub get_chemical_ontology_id {
351351
sub get_condition_relations {
352352
my ($obj, $chebi_name_map) = @_;
353353

354-
my $condition_relation_type;
355354
my (@modifiers, @inducers);
356355
my $conditions = [];
356+
my $modifier_conditions = [];
357357
my $condition_relations = [];
358358
if ($obj->Experimental_condition){
359-
$condition_relation_type = 'induced_by';
359+
my $condition_relation_type = 'induced_by';
360360
my @inducing_chemicals = map {{
361361
condition_chemical_curie => get_chemical_ontology_id($_),
362362
condition_class_curie => $zeco{'chemical treatment'},
@@ -369,9 +369,16 @@ sub get_condition_relations {
369369
}} $obj->Inducing_agent;
370370
@inducers = (@inducing_chemicals, @inducing_agents);
371371
push @$conditions, @inducers;
372+
373+
my $cr_json = {
374+
condition_relation_type_name => $condition_relation_type,
375+
condition_dtos => $conditions,
376+
internal => JSON::false
377+
};
378+
push @$condition_relations, $cr_json;
372379
}
373380
if ($obj->Modifier_info and ($obj->Modifier_molecule or $obj->Other_modifier)) {
374-
$condition_relation_type = 'has_condition';
381+
my $condition_relation_type = 'has_condition';
375382
if ($obj->Modifier_association_type) {
376383
if ($obj->Modifier_association_type->name eq 'condition_ameliorated_by') {
377384
$condition_relation_type = 'ameliorated_by';
@@ -391,20 +398,20 @@ sub get_condition_relations {
391398
internal => JSON::false
392399
}} $obj->Other_modifier;
393400
@modifiers = (@modifying_molecules, @other_modifiers);
394-
push @$conditions, @modifiers;
395-
}
401+
push @$modifier_conditions, @modifiers;
396402

397-
unless ($condition_relation_type eq 'has_condition'){
398-
$condition_relation_type = 'not_' . $condition_relation_type if $obj->at('Modifier_qualifier_not');
399-
}
403+
unless ($condition_relation_type eq 'has_condition'){
404+
$condition_relation_type = 'not_' . $condition_relation_type if $obj->at('Modifier_qualifier_not');
405+
}
400406

401-
if ($condition_relation_type) {
402-
my $cr_json = {
403-
condition_relation_type_name => $condition_relation_type,
404-
condition_dtos => $conditions,
405-
internal => JSON::false
406-
};
407-
push @$condition_relations, $cr_json;
407+
if ($condition_relation_type) {
408+
my $cr_json = {
409+
condition_relation_type_name => $condition_relation_type,
410+
condition_dtos => $modifier_conditions,
411+
internal => JSON::false
412+
};
413+
push @$condition_relations, $cr_json;
414+
}
408415
}
409416

410417
return ($condition_relations);

0 commit comments

Comments
 (0)