Skip to content

Commit

Permalink
latest changes to the inferred_genes in DAF for -build
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Paulini committed Apr 25, 2019
1 parent 4fb1cd4 commit cf2ea0a
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions scripts/AGR/make_agr_disease_json.pl
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@
# WB/CalTech specific changes to the format
push @with_list, "WB:" . $gene->name if (defined $gene && $build);
push @with_list, "WBTransgene:" . $transgene->name if (defined $transgene && $build);
push @with_list, "WBVar:" . $allele->name if (defined $name && $build);
push @with_list, "WBVar:" . $allele->name if (defined $allele && $build);

}elsif (defined $allele) {
$obj_type = "allele";
Expand All @@ -223,8 +223,7 @@
$assoc_type = 'is_implicated_in';
$obj_id = 'WB:' . $gene->name;

# WB/CalTech specific changes to the format
@inferred_genes = () if $build;
# @inferred_genes = ();

} else {
die "Could not identify a central object for the annotation from Disease_model_annotation $obj->name\n";
Expand Down Expand Up @@ -395,6 +394,12 @@ sub write_DAF_line {
}elsif (exists $obj->{objectRelation}->{inferredGeneAssociation}) {
map {$inferred_genes{$_} =1} @{$obj->{objectRelation}->{inferredGeneAssociation}};
}

# another crude -build block
if ($build && exists $obj->{objectRelation}->{inferredGeneAssociation}){
map {$inferred_genes{$_} =1} @{$obj->{objectRelation}->{inferredGeneAssociation}};
}

my $inferred_gene = join(",", keys %inferred_genes);

printf($fh "%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n",
Expand All @@ -415,7 +420,7 @@ sub write_DAF_line {
(exists $obj->{modifier} and exists $obj->{modifier}->{experimentalConditionsText}) ? join(',', @{$obj->{modifier}->{experimentalConditionsText}}) : '',
join(",", @{$obj->{evidence}->{evidenceCodes}}),
($obj->{geneticSex}||''),
$obj->{evidence}->{publication}->{pubMedId},
$obj->{evidence}->{publication}->{publicationId},
$date,
'WB');
}

0 comments on commit cf2ea0a

Please sign in to comment.