Difference between revisions of "Sample Code Cookbook"

From NCBO Wiki
Jump to navigation Jump to search
(New page: This page lists use cases and provides examples of how these questions can be answered using NCBO software (web services and widgets), with links to code samples and documentation. == Us...)
 
Line 2: Line 2:
  
 
== Use Cases ==
 
== Use Cases ==
* I have a list of terms that were used to annotate a data set, how can I see if any of these match terms from ontologies in BioPortal?
+
* I have a list of terms that were used to annotate a data set, how can I see if any of these terms exist in standard ontologies?
** You can use the Search web service to send your list of terms to BioPortal to identify if any are found in BioPortal ontologies.  The Search web service is described here: http://www.bioontology.org/wiki/index.php/NCBO_REST_services#Search_services and example code can be found here: https://bmir-gforge.stanford.edu/gf/project/client_examples/scmsvn/?action=browse&path=%2Ftrunk%2F  
+
** Use the [http://www.bioontology.org/wiki/index.php/NCBO_REST_services#Search_services Search Web service] to send your list of terms to BioPortal to identify if any are found in BioPortal ontologies.   
* I would like to identify all terms mapped from my ontology interest to all other ontologies in BioPortal
+
*** The Search web service is described here: http://www.bioontology.org/wiki/index.php/NCBO_REST_services#Search_services  
** Use the [http://www.bioontology.org/wiki/index.php/NCBO_REST_services#Mapping_Service|Mapping web service], example code at: https://bmir-gforge.stanford.edu/gf/project/client_examples/scmsvn/?action=browse&path=%2Ftrunk%2FPerl%2FExtractMappings%2F  
+
*** Example code: https://bmir-gforge.stanford.edu/gf/project/client_examples/scmsvn/?action=browse&path=%2Ftrunk%2F  
* I have pages of text that I would like to identify if it contains any ontology terms that I can use for annotation.
+
 
** Use the Annotator web service to identify ontology terms within your text. See http://www.bioontology.org/wiki/index.php/Annotator_Web_service for a description of the web service and code samples.
+
* I would like to find all terms mapped from my ontology to all ontologies in BioPortal
 +
** Use the [http://www.bioontology.org/wiki/index.php/NCBO_REST_services#Mapping_Service Mapping web service],  
 +
*** Example code at: https://bmir-gforge.stanford.edu/gf/project/client_examples/scmsvn/?action=browse&path=%2Ftrunk%2FPerl%2FExtractMappings%2F  
 +
 
 +
* I am the curator for a database and need to triage which papers from PubMed to curate to add new information to my database.  
 +
** Use the Annotator web service to identify ontology terms in textual data.  
 +
*** See http://www.bioontology.org/wiki/index.php/Annotator_Web_service for a description of the web service  
 +
*** Example code at: 
 +
 
 
* I have PubMed abstracts and want to link information in the abstracts to my database of interest.  
 
* I have PubMed abstracts and want to link information in the abstracts to my database of interest.  
 
** Process the text with the Annotator web service. If your database of interest is included in the NCBO Resource Index you can search the database(s) for records that contain these terms. See http://www.bioontology.org/wiki/index.php/Resource_Index for more details on the Resource Index web service.
 
** Process the text with the Annotator web service. If your database of interest is included in the NCBO Resource Index you can search the database(s) for records that contain these terms. See http://www.bioontology.org/wiki/index.php/Resource_Index for more details on the Resource Index web service.
 +
 
* I have a web form with fields I would like to users to fill-in with a specific set of terms from the Gene Ontology.
 
* I have a web form with fields I would like to users to fill-in with a specific set of terms from the Gene Ontology.
 
** Generate this subset of terms and then load this ontology as a view of the Gene Ontology (http://bioportal.bioontology.org/ontologies/44532#views). Then choose the ontology-term autocomplete widget from the Widgets page (http://bioportal.bioontology.org/ontologies/44532#widgets) and select the "Get Code" button for Javascript that you can add to your web form.
 
** Generate this subset of terms and then load this ontology as a view of the Gene Ontology (http://bioportal.bioontology.org/ontologies/44532#views). Then choose the ontology-term autocomplete widget from the Widgets page (http://bioportal.bioontology.org/ontologies/44532#widgets) and select the "Get Code" button for Javascript that you can add to your web form.
 +
 
* I would like to include the graph display of my ontology on my web site.
 
* I would like to include the graph display of my ontology on my web site.
 
** Choose the Visualization widget from the widgets page (e.g. http://bioportal.bioontology.org/ontologies/44532#widgets) for your ontology of interest and select the "Get Code" button to add the ontology graph to your web site.
 
** Choose the Visualization widget from the widgets page (e.g. http://bioportal.bioontology.org/ontologies/44532#widgets) for your ontology of interest and select the "Get Code" button to add the ontology graph to your web site.
 +
 
* I would like to get all terms from an ontology and re-format the data to use in my own system.
 
* I would like to get all terms from an ontology and re-format the data to use in my own system.
 
** Use the "Get all terms" web service (http://www.bioontology.org/wiki/index.php/NCBO_REST_services#Get_all_terms_using_the_specific_ontology_version_id and http://www.bioontology.org/wiki/index.php/NCBO_REST_services#Get_all_terms_using_the_virtual_ontology_id) to get a list of all of the terms and all details about each term, e.g. synonyms, definition, subclass, etc.
 
** Use the "Get all terms" web service (http://www.bioontology.org/wiki/index.php/NCBO_REST_services#Get_all_terms_using_the_specific_ontology_version_id and http://www.bioontology.org/wiki/index.php/NCBO_REST_services#Get_all_terms_using_the_virtual_ontology_id) to get a list of all of the terms and all details about each term, e.g. synonyms, definition, subclass, etc.

Revision as of 22:08, 2 November 2010

This page lists use cases and provides examples of how these questions can be answered using NCBO software (web services and widgets), with links to code samples and documentation.

Use Cases

  • I am the curator for a database and need to triage which papers from PubMed to curate to add new information to my database.
  • I have PubMed abstracts and want to link information in the abstracts to my database of interest.
    • Process the text with the Annotator web service. If your database of interest is included in the NCBO Resource Index you can search the database(s) for records that contain these terms. See http://www.bioontology.org/wiki/index.php/Resource_Index for more details on the Resource Index web service.
  • I would like to include the graph display of my ontology on my web site.