Difference between revisions of "Sample Code Cookbook"

From NCBO Wiki
Jump to navigation Jump to search
m (SampleCodeCookbook moved to Sample Code Cookbook: Add spaces to page name for readability and searchability.)
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 terms exist in standard ontologies?
+
'''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?'''
** Use the Search Web service to search for your term in all ontologies in BioPortal. If you have a small list of terms, searching each term individually via the [http://www.bioontology.org/wiki/index.php/NCBO_REST_services#Search_services BioPortal Search UI] may be sufficient. Otherwise, for a long list of terms, use the Search Web service directly.  
+
* Use the Search Web service to search for your term in all ontologies in BioPortal. If you have a small list of terms, searching each term individually via the [http://www.bioontology.org/wiki/index.php/NCBO_REST_services#Search_services BioPortal Search UI] may be sufficient. Otherwise, for a long list of terms, use the Search Web service directly.  
*** Search Web service documentation: http://www.bioontology.org/wiki/index.php/NCBO_REST_services#Search_services   
+
** Search Web service documentation: http://www.bioontology.org/wiki/index.php/NCBO_REST_services#Search_services   
*** Example code: https://bmir-gforge.stanford.edu/gf/project/client_examples/scmsvn/?action=browse&path=%2Ftrunk%2F  
+
** Example code: https://bmir-gforge.stanford.edu/gf/project/client_examples/scmsvn/?action=browse&path=%2Ftrunk%2F  
  
* I would like to find all terms mapped from my ontology to other ontologies in BioPortal
 
** Use the Mapping web service to find terms in other BioPortal ontologies similar to terms in your ontology. These mappings include mapping generated manually (DbXrefs) and programatically (LOOM).
 
*** Mapping Web service documentation: http://www.bioontology.org/wiki/index.php/NCBO_REST_services#Mapping_Service
 
*** Example code: 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 papers to identify which papers from PubMed are most related to my database and a good source of new information to add to my database
+
'''I would like to find all terms mapped from my ontology to other ontologies in BioPortal'''
** Use the Annotator Web service to identify ontology terms in textual data.  
+
* Use the Mapping web service to find terms in other BioPortal ontologies similar to terms in your ontology. These mappings include mapping generated manually (DbXrefs) and programatically (LOOM).
*** Annotator Web service documentation: http://www.bioontology.org/wiki/index.php/Annotator_Web_service 
+
** Mapping Web service documentation: http://www.bioontology.org/wiki/index.php/NCBO_REST_services#Mapping_Service
*** Example code: https://bmir-gforge.stanford.edu/gf/project/client_examples/scmsvn/?action=browse&path=%2Ftrunk%2FJava%2FAnnotator%2F (Java), https://bmir-gforge.stanford.edu/gf/project/client_examples/scmsvn/?action=browse&path=%2Ftrunk%2FPython%2FAnnotator%2F (Python)
+
** Example code: https://bmir-gforge.stanford.edu/gf/project/client_examples/scmsvn/?action=browse&path=%2Ftrunk%2FPerl%2FExtractMappings%2F  
  
* I have PubMed abstracts and want to link information in the abstracts to my database of interest.
 
** Use 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 text fields I would like to populate with ontology terms, e.g. to select relevant Gene Ontology terms.
+
'''I am the curator for a database and need to triage papers to identify which papers from PubMed are most related to my database and a good source of new information to add to my database'''
** Use the Autocomplete widget (example for the Gene Ontology, http://bioportal.bioontology.org/ontologies/44532#widgets). Select the "Get Code" button for the code and instructions on how to add this Javascript to your web form. If you would like to limit the terms to a subset of the Gene Ontology, create this subset and then load this ontology subset as a View of the Gene Ontology (http://bioportal.bioontology.org/ontologies/44532#views).
+
* Use the Annotator Web service to identify ontology terms in textual data.  
 +
** Annotator Web service documentation: http://www.bioontology.org/wiki/index.php/Annotator_Web_service 
 +
** Example code: https://bmir-gforge.stanford.edu/gf/project/client_examples/scmsvn/?action=browse&path=%2Ftrunk%2FJava%2FAnnotator%2F (Java), https://bmir-gforge.stanford.edu/gf/project/client_examples/scmsvn/?action=browse&path=%2Ftrunk%2FPython%2FAnnotator%2F (Python)  
  
* I would like to add the graph display of my ontology on my web site.
 
** Use the Visualization widget for your ontology of interest from the widgets page (example for Gene Ontology, http://bioportal.bioontology.org/ontologies/44532#widgets). Select the "Get Code" button for the code and instructions on how to add this Javascript to your web form.
 
  
* I would like to get all terms from an ontology and re-format the data to use in my own system.
+
'''I have PubMed abstracts and want to link information in the abstracts to my database of interest.'''
** Use the Get All Terms Web service to get all terms and properties for your ontology of interest.  
+
* Use 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.
*** Get All Terms Web service documentation: 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.
+
 
 +
 
 +
'''I have a web form with text fields I would like to populate with ontology terms, e.g. to select relevant Gene Ontology terms.'''
 +
* Use the Autocomplete widget (example for the Gene Ontology, http://bioportal.bioontology.org/ontologies/44532#widgets). Select the "Get Code" button for the code and instructions on how to add this Javascript to your web form.  If you would like to limit the terms to a subset of the Gene Ontology, create this subset and then load this ontology subset as a View of the Gene Ontology (http://bioportal.bioontology.org/ontologies/44532#views).
 +
 
 +
 
 +
'''I would like to add the graph display of my ontology on my web site.'''
 +
* Use the Visualization widget for your ontology of interest from the widgets page (example for Gene Ontology, http://bioportal.bioontology.org/ontologies/44532#widgets). Select the "Get Code" button for the code and instructions on how to add this Javascript to your web form.
 +
 
 +
 
 +
'''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 to get all terms and properties for your ontology of interest.  
 +
** Get All Terms Web service documentation: 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 11:40, 3 November 2010

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

Use Cases

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?


I would like to find all terms mapped from my ontology to other ontologies in BioPortal


I am the curator for a database and need to triage papers to identify which papers from PubMed are most related to my database and a good source of new information to add to my database


I have PubMed abstracts and want to link information in the abstracts to my database of interest.

  • Use 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 text fields I would like to populate with ontology terms, e.g. to select relevant Gene Ontology terms.


I would like to add the graph display of my ontology on my web site.


I would like to get all terms from an ontology and re-format the data to use in my own system.