From 819962abff970eb012895ec4f1aa6a98a7e94016 Mon Sep 17 00:00:00 2001 From: preecej Date: Sat, 27 Aug 2011 00:12:47 +0000 Subject: [PATCH] Added more Evidence Code and Evidence functionality, GO web services, and GO/PO web service term id lookup capabilities svn path=/; revision=172 --- preecej/semantic_wiki/forms/Annotation.wiki | 1 + .../forms/Ontological_References.wiki | 14 ++++- .../local_settings/dev.LocalSettings.php | 9 ++- .../services/TermSearch_JSON.php | 2 +- .../semantic_wiki/templates/Annotation.wiki | 1 + .../Gene_Ontology_Reference_Repeater.wiki | 56 +++++++++++++++++++ .../Ontological_Reference_Repeater.wiki | 5 ++ .../Plant_Ontology_Reference_Repeater.wiki | 27 +++++++-- 8 files changed, 107 insertions(+), 8 deletions(-) create mode 100644 preecej/semantic_wiki/templates/Gene_Ontology_Reference_Repeater.wiki diff --git a/preecej/semantic_wiki/forms/Annotation.wiki b/preecej/semantic_wiki/forms/Annotation.wiki index 0eed167..32913a3 100644 --- a/preecej/semantic_wiki/forms/Annotation.wiki +++ b/preecej/semantic_wiki/forms/Annotation.wiki @@ -152,6 +152,7 @@ __NOTOC__ |? has_Term_Name |? has_Aspect |? has_Evidence_Code + |? has_Evidence }} | Add ontological associations for this annotation.
{{#formlink:form=Ontological_References|link text=Add|link type=button|query string=Ontological_References[Annotation Page]={{PAGENAME}}&super_page={{PAGENAME}} }} }} diff --git a/preecej/semantic_wiki/forms/Ontological_References.wiki b/preecej/semantic_wiki/forms/Ontological_References.wiki index 0eb3d68..9b6a248 100644 --- a/preecej/semantic_wiki/forms/Ontological_References.wiki +++ b/preecej/semantic_wiki/forms/Ontological_References.wiki @@ -19,7 +19,18 @@ if a page with that name already exists, you will be sent to a form to edit that === Plant Ontology === {{{for template|Plant Ontology Reference Repeater|multiple}}} -'''Term Name:''' {{{field|Term Name|autocomplete from url=remote_PO_terms}}} +'''Term Name:''' {{{field|Term Name|autocomplete from url=remote_PO_terms}}} '''or''' '''Term ID:''' {{{field|Term ID|autocomplete from url=remote_PO_ids}}} +

'''Evidence Code:'''
+{{{field|Evidence Code|list}}} +

'''Evidence:''' {{{field|Evidence|}}} +{{{end template}}} + +=== Gene Ontology === +{{{for template|Gene Ontology Reference Repeater|multiple}}} +'''Term Name:''' {{{field|Term Name|autocomplete from url=remote_GO_terms}}} '''or''' '''Term ID:''' {{{field|Term ID|autocomplete from url=remote_GO_ids}}} +

'''Evidence Code:'''
+{{{field|Evidence Code|list}}} +

'''Evidence:''' {{{field|Evidence|}}} {{{end template}}} === Other Ontologies === @@ -30,6 +41,7 @@ if a page with that name already exists, you will be sent to a form to edit that '''Branch:''' {{{field|Aspect|}}}

'''Evidence Code:'''
{{{field|Evidence Code|list}}} +

'''Evidence:''' {{{field|Evidence|}}} {{{end template}}} {{{standard input|summary}}} diff --git a/preecej/semantic_wiki/local_settings/dev.LocalSettings.php b/preecej/semantic_wiki/local_settings/dev.LocalSettings.php index 749ecf6..3b264e1 100644 --- a/preecej/semantic_wiki/local_settings/dev.LocalSettings.php +++ b/preecej/semantic_wiki/local_settings/dev.LocalSettings.php @@ -144,7 +144,14 @@ require_once( "$IP/extensions/semantic-bundle/SemanticBundle.php" ); include("$IP/extensions/SimpleForms/SimpleForms.php"); -$sfgAutocompletionURLs['remote_PO_terms'] = 'http://dev.planteome.org/w/services/TermSearch_JSON.php?user=paw&type=autocomplete&field=name&qval=&format=json&max=20'; +# PO web service calls +$sfgAutocompletionURLs['remote_PO_terms'] = 'http://dev.planteome.org/w/services/TermSearch_JSON.php?user=paw&type=autocomplete&field=name&ontology=po&qval=&format=json&max=20'; +$sfgAutocompletionURLs['remote_PO_ids'] = 'http://dev.planteome.org/w/services/TermSearch_JSON.php?user=paw&type=autocomplete&field=acc&ontology=po&qval=&format=json&max=20'; + +# GO web service calls +$sfgAutocompletionURLs['remote_GO_terms'] = 'http://dev.planteome.org/w/services/TermSearch_JSON.php?user=paw&type=autocomplete&field=name&ontology=go&qval=&format=json&max=25'; +$sfgAutocompletionURLs['remote_GO_ids'] = 'http://dev.planteome.org/w/services/TermSearch_JSON.php?user=paw&type=autocomplete&field=acc&ontology=go&qval=&format=json&max=25'; + $sfgAutocompleteOnAllChars = false; # END: Justin Preece - Semantic Bundle (SMW and other extensions) diff --git a/preecej/semantic_wiki/services/TermSearch_JSON.php b/preecej/semantic_wiki/services/TermSearch_JSON.php index 93f3b8a..cffbdaf 100644 --- a/preecej/semantic_wiki/services/TermSearch_JSON.php +++ b/preecej/semantic_wiki/services/TermSearch_JSON.php @@ -123,7 +123,7 @@ if(isset($_GET['user']) && ($_GET['user']) == 'paw') { /* output in necessary format */ if($format == 'json') { header('Content-type: application/json'); - echo json_encode(array('PO_result'=>$terms)); + echo json_encode(array('term_detail_result'=>$terms)); } else { die('Sorry, this request cannot be fulfilled in '.$format.' format.'); diff --git a/preecej/semantic_wiki/templates/Annotation.wiki b/preecej/semantic_wiki/templates/Annotation.wiki index b2e901d..259a61c 100644 --- a/preecej/semantic_wiki/templates/Annotation.wiki +++ b/preecej/semantic_wiki/templates/Annotation.wiki @@ -99,6 +99,7 @@ Edit the page to see the template text. |? has_Term_Name |? has_Aspect |? has_Evidence_Code + |? has_Evidence }} | There are no ontological associations available for this gene annotation. }} diff --git a/preecej/semantic_wiki/templates/Gene_Ontology_Reference_Repeater.wiki b/preecej/semantic_wiki/templates/Gene_Ontology_Reference_Repeater.wiki new file mode 100644 index 0000000..019da7a --- /dev/null +++ b/preecej/semantic_wiki/templates/Gene_Ontology_Reference_Repeater.wiki @@ -0,0 +1,56 @@ + +This is the "Gene Ontology Reference Repeater" template. +It should be called in the following format: +
+{{Gene Ontology Reference Repeater
+|Term ID=
+|Term Name=
+|Aspect=
+|Evidence Code=
+|Evidence=
+}}
+
+Edit the page to see the template text. +
{{#get_web_data: + |url=http://dev.planteome.org/w/services/TermSearch_JSON.php?user=paw&field={{#if:{{{Term Name|}}}|name|acc}}&type=term_detail&ontology=go&qval={{#if:{{{Term Name|}}}|{{{Term Name|}}}|{{{Term ID|}}}}}&format=json + |format=JSON + |data=term_name=name,term_id=id,term_aspect=aspect,term_definition=definition,term_comment=comment +}} +{{#set_internal:is_Ontological_Reference +|from_Ontology=Gene Ontology +|has_Term_ID={{#external_value:term_id}} +|has_Term_Name={{#external_value:term_name}} +|has_Aspect={{#external_value:term_aspect}} +|has_Evidence_Code#list={{{Evidence Code|}}} +|has_Evidence#list={{{Evidence|}}} +}} +{| class="wikitable" +! Ontology +| Gene Ontology +|- +! Term Name +| [[Has Term Name::{{#external_value:term_name}}]] +|- +! Term ID +| [[Has Term ID::{{#external_value:term_id}}]] +|- +! Branch +| {{#external_value:term_aspect}} +|- +! Definition +| {{#external_value:term_definition}} +{{#if: {{#external_value:term_comment}} + | {{!}}- +! Comment +{{!}} {{#external_value:term_comment}} + | +}} +|- +! Evidence Code +| {{#arraymap:{{{Evidence Code|}}}|,|x|[[Has Evidence Code::x]]}} +|- +! Evidence +| {{#arraymap:{{{Evidence|}}}|,|x|[[Has Evidence::x]]}} +|} + + diff --git a/preecej/semantic_wiki/templates/Ontological_Reference_Repeater.wiki b/preecej/semantic_wiki/templates/Ontological_Reference_Repeater.wiki index 60368a5..44672e9 100644 --- a/preecej/semantic_wiki/templates/Ontological_Reference_Repeater.wiki +++ b/preecej/semantic_wiki/templates/Ontological_Reference_Repeater.wiki @@ -8,6 +8,7 @@ It should be called in the following format: |Term Name= |Aspect= |Evidence Code= +|Evidence= }} Edit the page to see the template text. @@ -17,6 +18,7 @@ Edit the page to see the template text. |has_Term_Name={{{Term Name|}}} |has_Aspect={{{Aspect|}}} |has_Evidence_Code#list={{{Evidence Code|}}} +|has_Evidence#list={{{Evidence|}}} }} {| class="wikitable" ! Ontology @@ -33,6 +35,9 @@ Edit the page to see the template text. |- ! Evidence Code | {{#arraymap:{{{Evidence Code|}}}|,|x|[[Has Evidence Code::x]]}} +|- +! Evidence +| {{#arraymap:{{{Evidence|}}}|,|x|[[Has Evidence::x]]}} |} diff --git a/preecej/semantic_wiki/templates/Plant_Ontology_Reference_Repeater.wiki b/preecej/semantic_wiki/templates/Plant_Ontology_Reference_Repeater.wiki index 5ee4393..ecfda58 100644 --- a/preecej/semantic_wiki/templates/Plant_Ontology_Reference_Repeater.wiki +++ b/preecej/semantic_wiki/templates/Plant_Ontology_Reference_Repeater.wiki @@ -6,35 +6,52 @@ It should be called in the following format: |Term ID= |Term Name= |Aspect= +|Evidence Code= +|Evidence= }} Edit the page to see the template text. {{#get_web_data: - |url=http://dev.planteome.org/w/services/TermSearch_JSON.php?user=paw&field=name&type=term_detail&qval={{{Term Name|}}}&format=json + |url=http://dev.planteome.org/w/services/TermSearch_JSON.php?user=paw&field={{#if:{{{Term Name|}}}|name|acc}}&type=term_detail&ontology=po&qval={{#if:{{{Term Name|}}}|{{{Term Name|}}}|{{{Term ID|}}}}}&format=json |format=JSON - |data=term_id=id,term_aspect=aspect,term_definition=definition,term_comment=comment + |data=term_name=name,term_id=id,term_aspect=aspect,term_definition=definition,term_comment=comment }} {{#set_internal:is_Ontological_Reference |from_Ontology=Plant Ontology |has_Term_ID={{#external_value:term_id}} -|has_Term_Name={{{Term Name|}}} +|has_Term_Name={{#external_value:term_name}} |has_Aspect={{#external_value:term_aspect}} +|has_Evidence_Code#list={{{Evidence Code|}}} +|has_Evidence#list={{{Evidence|}}} }} +[[Has Term Search Type::{{{Term Search Type|}}}]] {| class="wikitable" ! Ontology | Plant Ontology |- ! Term Name -| [[Has Term Name::{{{Term Name|}}}]] +| [[Has Term Name::{{#external_value:term_name}}]] |- ! Term ID | [[Has Term ID::{{#external_value:term_id}}]] |- ! Branch -| {{#external_value:term_aspect}} +| [[Has Aspect::{{#external_value:term_aspect}}]] |- ! Definition | {{#external_value:term_definition}} +{{#if: {{#external_value:term_comment}} + | {{!}}- +! Comment +{{!}} {{#external_value:term_comment}} + | +}} +|- +! Evidence Code +| {{#arraymap:{{{Evidence Code|}}}|,|x|[[Has Evidence Code::x]]}} +|- +! Evidence +| {{#arraymap:{{{Evidence|}}}|,|x|[[Has Evidence::x]]}} |} -- 2.34.1