Help:WikiPathways Webservice/API

From WikiPathways

(Difference between revisions)
Jump to: navigation, search
Current revision (23:23, 9 November 2020) (view source)
(points to swagger now)
 
(25 intermediate revisions not shown.)
Line 3: Line 3:
  |}
  |}
-
This page documents WikiPathways REST API calls. For more information on libraries and code examples, see [[Help:WikiPathways_Webservice|WikiPathways web services]].
+
The WikiPathways Web API calls are documented using [https://webservice.wikipathways.org Swagger].  
-
 
+
For more information on libraries and code examples, see [[Help:WikiPathways_Webservice|WikiPathways web services]].
-
The default return format is xml. Data can also be returned as JSON and html. Try it out at [http://webservice.wikipathways.org/ webservice.wikipathways.org].
+
-
 
+
-
=== Functions ===
+
-
{{WSFunction
+
-
|name=listOrganisms
+
-
|descr=Get a list of all available organisms.
+
-
|rest_ex=listOrganisms
+
-
|returns=
+
-
{{WSFunction/Return|type=array of string|descr=The names of the supported organisms.}}
+
-
}}
+
-
 
+
-
{{WSFunction
+
-
|name=listPathways
+
-
|descr=Get a list of all available pathways.
+
-
|rest_ex=listPathways
+
-
|args=listPathways
+
-
{{WSFunction/Argument|name=organism|type=string|descr=Only return pathways for this organism (optional).}}
+
-
|returns=
+
-
{{WSFunction/Return|type=array of [[#WSPathwayInfo|WSPathwayInfo]]|descr=The available pathways.}}
+
-
}}
+
-
 
+
-
{{WSFunction
+
-
|name=getPathway
+
-
|descr=Download the pathway from WikiPathways.
+
-
|rest_ex=getPathway?pwId=WP4&revision=40020
+
-
|args=
+
-
{{WSFunction/Argument|name=pwId|type=string|descr=The pathway identifier.}}
+
-
{{WSFunction/Argument|name=revision|type=integer|descr=The revision number of the pathway (use '0' for most recent version).}}
+
-
|returns=
+
-
{{WSFunction/Return|type=[[#WSPathway|WSPathway]]|descr=The pathway.}}
+
-
}}
+
-
 
+
-
{{WSFunction
+
-
|name=getPathwayInfo
+
-
|descr=Get some general info about the pathway, such as the name, species, without downloading the GPML.
+
-
|rest_ex=getPathwayInfo?pwId=WP4
+
-
|args=
+
-
{{WSFunction/Argument|name=pwId|type=string|descr=The pathway identifier.}}
+
-
|returns=
+
-
{{WSFunction/Return|type=[[#WSPathwayInfo|WSPathwayInfo]]|descr=The pathway info.}}
+
-
}}
+
-
 
+
-
{{WSFunction
+
-
|name=getPathwayHistory
+
-
|descr=Get the revision history of a pathway.
+
-
|rest_ex=getPathwayHistory?pwId=WP4&timestamp=20110101000000
+
-
|args=
+
-
{{WSFunction/Argument|name=pwId|type=string|descr=The pathway identifier.}}
+
-
{{WSFunction/Argument|name=timestamp|type=string|descr=Limit the results by date, only history items after the given timestamp will be included.}}
+
-
|returns=
+
-
{{WSFunction/Return|type=[[#WSPathwayHistory|WSPathwayHistory]]|descr=The revision history.}}
+
-
}}
+
-
 
+
-
{{WSFunction
+
-
|name=getRecentChanges
+
-
|descr=Get the recently changed pathways.
+
-
 
+
-
'''Note:''' the recent changes table only retains items for a limited time (2 months), so there is no guarantee that you will get all changes when the timestamp points to a date that is more than 2 months in the past.
+
-
 
+
-
 
+
-
|rest_ex=getRecentChanges?timestamp=20110101000000
+
-
|args=
+
-
{{WSFunction/Argument|name=timestamp|type=string|descr=Only get changes from after this time. Timestamp format: yyyymmddMMHHSS.}}
+
-
|returns=
+
-
{{WSFunction/Return|type=array of [[#WSPathwayInfo|WSPathwayInfo]]|descr=The changed pathways.}}
+
-
}}
+
-
 
+
-
{{WSFunction
+
-
|name=login
+
-
|descr=Start a logged in session, using an existing WikiPathways account. This function will return an authentication code that can be used to excecute methods that need authentication (e.g. updatePathway).
+
-
|args=
+
-
{{WSFunction/Argument|name=name|type=string|descr=The username of the WikiPathways account.}}
+
-
{{WSFunction/Argument|name=pass|type=string|descr=The password of the WikiPathways account.}}
+
-
|returns=
+
-
{{WSFunction/Return|type=string|descr=The authentication code for this session.}}
+
-
}}
+
-
 
+
-
{{WSFunction
+
-
|name=getPathwayAs
+
-
|descr=Download a pathway in the specified file format.
+
-
|args=
+
-
{{WSFunction/Argument|name=fileType|type=string|descr=Download a pathway in the specified file format.
+
-
* gpml
+
-
* png
+
-
* svg
+
-
* pdf
+
-
* txt
+
-
* pwf
+
-
* owl (for BioPAX level 3)
+
-
See [[Download_Pathways | the download page]] for an explanation of these file formats.}}
+
-
{{WSFunction/Argument|name=pwId|type=string|descr=The pathway identifier.}}
+
-
{{WSFunction/Argument|name=revision|type=integer|descr=The revision number of the pathway (use '0' for most recent version).}}
+
-
|returns=
+
-
{{WSFunction/Return|type=base64Binary|descr=The file contents (base64 encoded).}}
+
-
'''Note:''' This method could not be exposed through our SOAP/REST interface. So, for REST access use this syntax instead:
+
-
http://www.wikipathways.org//wpi/wpi.php?action=downloadFile&type=png&pwTitle=Pathway:WP4&oldid=40020
+
-
}}
+
-
 
+
-
{{WSFunction
+
-
|name=updatePathway
+
-
|descr=Update a pathway on the wiki with the given GPML code.
+
-
 
+
-
{{WSWriteAccess}}
+
-
|args=
+
-
{{WSFunction/Argument|name=pwId|type=string|descr=The pathway identifier.}}
+
-
{{WSFunction/Argument|name=description|type=string|descr=A description of the modifications.}}
+
-
{{WSFunction/Argument|name=gpml|type=string|descr=The updated GPML code.}}
+
-
{{WSFunction/Argument|name=revision|type=integer|descr=The revision number of the version this GPML code was based on. This is used to prevent edit conflicts in case another client edited the pathway after this client downloaded it.}}
+
-
{{WSFunction/Argument|name=auth|type=object [[#WSAuth|WSAuth]]|descr=The authentication info.}}
+
-
|returns=
+
-
{{WSFunction/Return|type=boolean|descr=True if the pathway was updated successfully.}}
+
-
}}
+
-
 
+
-
{{WSFunction
+
-
|name=createPathway
+
-
|descr=Create a new pathway on the wiki with the given GPML code.
+
-
 
+
-
{{WSWriteAccess}}
+
-
|args=
+
-
{{WSFunction/Argument|name=gpml|type=string|descr=The GPML code.}}
+
-
{{WSFunction/Argument|name=auth|type=object [[#WSAuth|WSAuth]]|descr=The authentication info.}}
+
-
|returns=
+
-
{{WSFunction/Return|type=[[#WSPathwayInfo|WSPathwayInfo]]|descr=The pathway info for the created pathway (containing identifier, revision, etc.).}}
+
-
}}
+
-
 
+
-
{{WSFunction
+
-
|name=findPathwaysByText
+
-
|descr=Find pathways using a textual search on the description and text labels of the pathway objects. The query syntax offers several options:
+
-
* Combine terms with AND and OR. Combining terms with a space is equal to using OR ('p53 OR apoptosis' gives the same result as 'p53 apoptosis').
+
-
* Group terms with parentheses, e.g. '(apoptosis OR mapk) AND p53'
+
-
* You can use wildcards * and ?. * searches for one or more characters, ? searchers for only one character.
+
-
* Use quotes to escape special characters. E.g. '"apoptosis*"' will include the * in the search and not use it as wildcard.
+
-
|rest_ex=findPathwaysByText?query=apoptosis
+
-
|args=
+
-
{{WSFunction/Argument|name=query|type=string|descr=The search query (e.g. 'apoptosis' or 'p53').}}
+
-
{{WSFunction/Argument|name=species|type=string|descr=The species to limit the search to (leave blank to search on all species).}}
+
-
|returns=
+
-
{{WSFunction/Return|type=array of [[#WSSearchResult|WSSearchResult]]|descr=An array of search results.}}
+
-
}}
+
-
 
+
-
{{WSFunction
+
-
|name=findPathwaysByXref
+
-
|descr=Find pathways by searching on the external references of DataNodes (gene/protein/metabolite identifiers). When using the REST style invocation, you can specify multiple <code>ids</code> and <code>codes</code> parameters to query for multiple xrefs at once. In that case, the number of <code>ids</code> and <code>codes</code> parameters should match, they will be paired to form xrefs, e.g.: http://www.wikipathways.org/wpi/webservice/webservice.php/findPathwaysByXref?ids=1234&ids=ENSG00000130164&codes=L&codes=En
+
-
|rest_ex=findPathwaysByXref?ids=1234&codes=L
+
-
|args=
+
-
{{WSFunction/Argument|name=ids|type=array of string|descr=One or more DataNode identifier(s) (e.g. 'P45985').}}
+
-
{{WSFunction/Argument|name=codes|type=array of string|descr=One or more code(s) of the database system to limit the search to. See [http://developers.pathvisio.org/wiki/DatabasesMapps#Supporteddatabasesystems this page] for an overview of available system codes. If you supply multiple codes, the number of codes needs to equal the number of ids supplied. If you supply multiple ids and only one code, this code will be used for all ids.}}
+
-
|returns=
+
-
{{WSFunction/Return|type=array of [[#WSSearchResult|WSSearchResult]]|descr=An array of search results with DataNode [[#GraphId|GraphId]] stored in the 'field' hash.}}
+
-
}}
+
-
 
+
-
{{WSFunction
+
-
|name=findInteractions
+
-
|descr=Find interactions defined in WikiPathways pathways.
+
-
|rest_ex=findInteractions?query=P53
+
-
|args=
+
-
{{WSFunction/Argument|name=query|type=string|descr=The name of an entity to find interactions for (e.g. 'P53')}}
+
-
|returns=
+
-
{{WSFunction/Return|type=array of [[#WSSearchResult|WSSearchResult]]|descr=An array of search results with interaction information stored in the 'field' array of hashes (group objects are stored as arrays).}}
+
-
}}
+
-
 
+
-
{{WSFunction
+
-
|name=saveCurationTag
+
-
|descr=Apply a curation tag to a pahtway. This operation will overwrite any existing tag with the same name.
+
-
 
+
-
{{WSWriteAccess}}
+
-
|args=
+
-
{{WSFunction/Argument|name=pwId|type=string|descr=The pathway identifier.}}
+
-
{{WSFunction/Argument|name=tagName|type=string|descr=The name of the tag to apply.}}
+
-
{{WSFunction/Argument|name=tagText|type=string|descr=The tag text (optional).}}
+
-
{{WSFunction/Argument|name=revision|type=integer|descr=The revision this tag applies to.}}
+
-
{{WSFunction/Argument|name=auth|type=object [[#WSAuth|WSAuth]]|descr=The authentication info.}}
+
-
|returns=
+
-
{{WSFunction/Return|type=boolean|descr=True if the tag was saved successfully.}}
+
-
}}
+
-
 
+
-
{{WSFunction
+
-
|name=removeCurationTag
+
-
|descr=Remove a curation tag from a pathway.
+
-
 
+
-
{{WSWriteAccess}}
+
-
|args=
+
-
{{WSFunction/Argument|name=pwId|type=string|descr=The pathway identifier.}}
+
-
{{WSFunction/Argument|name=tagName|type=string|descr=The name of the tag to remove.}}
+
-
{{WSFunction/Argument|name=auth|type=object [[#WSAuth|WSAuth]]|descr=The authentication info.}}
+
-
|returns=
+
-
{{WSFunction/Return|type=boolean|descr=True if the tag was removed successfully.}}
+
-
}}
+
-
 
+
-
{{WSFunction
+
-
|name=getCurationTags
+
-
|descr=Get all curation tags for the given pathway.
+
-
|rest_ex=getCurationTags?pwId=WP4
+
-
|args=
+
-
{{WSFunction/Argument|name=pwId|type=string|descr=The pathway identifier.}}
+
-
|returns=
+
-
{{WSFunction/Return|type=array of [[#WSCurationTag|WSCurationTag]]|descr=The curation tags.}}
+
-
}}
+
-
 
+
-
{{WSFunction
+
-
|name=getCurationTagsByName
+
-
|descr=Get all curation tags for the given tag name. Use this method if you want to find all pathways that are tagged with a specific curation tag.
+
-
|rest_ex=getCurationTagsByName?tagName=Curation:FeaturedPathway
+
-
|args=
+
-
{{WSFunction/Argument|name=tagName|type=string|descr=The tag name (see [[Special:SpecialCurationTags]] for an overview of available tag names).}}
+
-
|returns=
+
-
{{WSFunction/Return|type=array of [[#WSCurationTag|WSCurationTag]]|descr=The curation tags (one instance for each pathway that has been tagged).}}
+
-
}}
+
-
 
+
-
{{WSFunction
+
-
|name=getColoredPathway
+
-
|descr=Get a colored image version of the pathway.
+
-
|args=
+
-
{{WSFunction/Argument|name=pwId|type=string|descr=The pathway identifier.}}
+
-
{{WSFunction/Argument|name=revision|type=integer|descr=The revision number of the pathway (use '0' for most recent version).}}
+
-
{{WSFunction/Argument|name=graphId|type=array of string|descr=An array with [[#GraphId|GraphIds]] of the objects to color.}}
+
-
{{WSFunction/Argument|name=color|type=array of string|descr=An array with colors of the objects (should be the same length as graphId).
+
-
Colors should be encoded as a hexadecimal number, e.g. FF0000 for red).}}
+
-
{{WSFunction/Argument|name=fileType|type=string|descr=The image type (One of 'svg', 'pdf' or 'png').}}
+
-
|returns=
+
-
{{WSFunction/Return|type=base64Binary|descr=The image data (base64 encoded).}}
+
-
}}
+
-
 
+
-
{{WSFunction
+
-
|name=getXrefList
+
-
|descr=Get a list of external references on the pathway (gene, protein or metabolite ids), translated to the given database system.
+
-
|rest_ex=getXrefList?pwId=WP4&code=S
+
-
|args=
+
-
{{WSFunction/Argument|name=pwId|type=string|descr=The pathway identifier.}}
+
-
{{WSFunction/Argument|name=code|type=string|descr=The code of the system to translate to (e.g. 'S' for UniProt).}}
+
-
|returns=
+
-
{{WSFunction/Return|type=array of string|descr=The external references (ids)}}
+
-
}}
+
-
 
+
-
{{WSFunction
+
-
|name=findPathwaysByLiterature
+
-
|descr=Find pathways by their literature references.
+
-
|rest_ex=findPathwaysByLiterature?query=18651794
+
-
|args=
+
-
{{WSFunction/Argument|name=query|type=string|descr=The query, can be a pubmed id, author name or title keyword.}}
+
-
|returns=
+
-
{{WSFunction/Return|type=array of [[#WSSearchResult|WSSearchResult]] descr=The search results.}}
+
-
}}
+
-
 
+
-
{{WSFunction
+
-
|name=findPathwaysByLiterature
+
-
|descr=Find pathways by their literature references.
+
-
|rest_ex=findPathwaysByLiterature?query=18651794
+
-
|args=
+
-
{{WSFunction/Argument|name=query|type=string|descr=The query, can be a pubmed id, author name or title keyword.}}
+
-
|returns=
+
-
{{WSFunction/Return|type=array of [[#WSSearchResult|WSSearchResult]] descr=The search results.}}
+
-
}}
+
-
 
+
-
{{WSFunction
+
-
|name=saveOntologyTag
+
-
|descr=Add a specific ontology tag to a given pathway.
+
-
|args=
+
-
{{WSFunction/Argument|name=pwId|type=string|descr=The pathway identifier}}
+
-
{{WSFunction/Argument|name=term|type=string|descr=The ontology term}}
+
-
{{WSFunction/Argument|name=termId|type=string|descr=The ontology term identifier}}
+
-
{{WSFunction/Argument|name=auth|type=object [[#WSAuth|WSAuth]]|descr=The authentication info.}}{{WSFunction/Argument|name=user|type=string|descr=The username of the WikiPathways account}}
+
-
|returns=
+
-
{{WSFunction/Return|type=boolean|descr=True if the ontology tag was updated successfully.}}
+
-
}}
+
-
 
+
-
{{WSFunction
+
-
|name=removeOntologyTag
+
-
|descr=Remove a specific ontology tag to a given pathway.
+
-
|args=
+
-
{{WSFunction/Argument|name=pwId|type=string|descr=The pathway identifier}}
+
-
{{WSFunction/Argument|name=termId|type=string|descr=The ontology term identifier}}
+
-
{{WSFunction/Argument|name=auth|type=object [[#WSAuth|WSAuth]]|descr=The authentication info.}}{{WSFunction/Argument|name=user|type=string|descr=The username of the WikiPathways account}}
+
-
|returns=
+
-
{{WSFunction/Return|type=boolean|descr=True if the ontology tag was updated successfully.}}
+
-
}}
+
-
 
+
-
{{WSFunction
+
-
|name=getOntologyTermsByOntology
+
-
|descr=Get a list of ontology terms from a given ontology.
+
-
|rest_ex=getOntologyTermsByOntology?ontology=Disease
+
-
|args=
+
-
{{WSFunction/Argument|name=ontology|type=string|descr=The ontology term (for possible values, see the Ontology Tags section on the pathway page.}}
+
-
|returns=
+
-
{{WSFunction/Return|type=array of [[#WSOntologyTerm|WSOntologyTerm]]|descr=The ontology terms.}}
+
-
}}
+
-
 
+
-
{{WSFunction
+
-
|name=getPathwaysByOntologyTerm
+
-
|descr=Get a list of pathways tagged with a given ontology term.
+
-
|rest_ex=getPathwaysByOntologyTerm?term=DOID:344
+
-
|args=
+
-
{{WSFunction/Argument|name=term|type=string|descr=The ontology term identifier.}}
+
-
|returns=
+
-
{{WSFunction/Return|type=array of [[#WSPathwayInfo|WSPathwayInfo]]|descr=The pathway information.}}
+
-
}}
+
-
 
+
-
{{WSFunction
+
-
|name=getPathwaysByParentOntologyTerm
+
-
|descr=Get a list of pathways tagged with any ontology term that is the child of the given Ontology term.
+
-
|rest_ex=getPathwaysByParentOntologyTerm?term=DOID:344
+
-
|args=
+
-
{{WSFunction/Argument|name=term|type=string|descr=The ontology term identifier.}}
+
-
|returns=
+
-
{{WSFunction/Return|type=array of [[#WSPathwayInfo|WSPathwayInfo]]|descr=The pathway information.}}
+
-
}}
+
-
 
+
-
{{WSFunction
+
-
|name=getUserByOrcid
+
-
|descr=Get WP username by ORCID id.
+
-
|args=
+
-
{{WSFunction/Argument|name=orcid|type=string|descr=The ORCID identifier.}}
+
-
|returns=
+
-
{{WSFunction/Return|type=string|descr=The WikiPathways username}}
+
-
}}
+
-
 
+
-
----
+
-
=== GPML Elements ===
+
-
Relevant attributes and elements defined for the GPML pathway file format. Also see [http://pathvisio.org/wiki/EverythingGpml#GraphRefsGraphIds complete GPML documentation].
+
-
 
+
-
{{WSObject
+
-
|name=GraphId
+
-
|descr=Internal identifier for datanodes used to define graph model in GPML. The GraphID is a randomly generated hexidecimal. See sample GPML below:
+
-
}}
+
-
    <DataNode TextLabel="HTR1B" Type="Protein" GraphId="c8d79">
+
-
 
+
-
 
+
-
----
+
-
[[Help:WikiPathways_Webservice|Return to Web Services help page]]
+

Current revision

The WikiPathways Web API calls are documented using Swagger. For more information on libraries and code examples, see WikiPathways web services.

Personal tools