Skip to content

Commit

Permalink
attempt to add basic taxon constraint info with things we now find in…
Browse files Browse the repository at this point in the history
… the neighborhood json; pass at #56
  • Loading branch information
kltm committed Nov 29, 2023
1 parent c6a4840 commit 5db564b
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
18 changes: 18 additions & 0 deletions perl/lib/AmiGO/WebApp/HTMLClient.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1588,6 +1588,24 @@ sub mode_term_details {
#$self->set_template_parameter('NEIGHBORHOOD_INFO', Dumper($nay_info));
$self->set_template_parameter('NEIGHBORHOOD_INFO', $nay_info);

###
### Taxon constraints.
###

my $tc = [];
foreach my $parent (@{$nay_info->{parents}}){
if( $parent->{acc} =~ /^NCBITaxon/ ){
push @$tc,
{
taxon_rel_acc => $parent->{rel},
taxon_name => $parent->{name},
taxon_acc => $parent->{acc},
taxon_link => $parent->{link}
};
}
}
$self->set_template_parameter('TAXON_CONSTRAINTS', $tc);

###
### Bridge variables from old system.
###
Expand Down
21 changes: 21 additions & 0 deletions templates/html/bs3/common/term_details_main.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,27 @@
title="See term history.">history for [% TERM_INFO.acc %]</a> at QuickGO</dd>
[% END %]

<!-- Taxon constraints. -->
<dt>Taxon info</dt>
[% IF TAXON_CONSTRAINTS.size == 0 %]
<dd>None</dd>
[% ELSE %]
[% FOREACH xtrain = TAXON_CONSTRAINTS %]
<dd>
[% IF xtrain.taxon_rel_acc == 'RO:0002160' %]
<i>only in taxon</i>
[% ELSIF xtrain.taxon_rel_acc == 'RO:0002161' %]
<i>never in taxon</i>
[% ELSIF xtrain.taxon_rel_acc == 'RO:0002162' %]
<i>in taxon</i>
[% ELSE %]
[% xtrain.taxon_rel_acc %]
[% END %]
<a href="[% xtrain.taxon_link %]">[% xtrain.taxon_name %]</a>
</dd>
[% END %]
[% END %]

<!-- Subsets -->
<dt>Subset</dt>
[% IF TERM_INFO.subsets.size != 0 %]
Expand Down

0 comments on commit 5db564b

Please sign in to comment.