Help:WikiPathways Webservice/API

From WikiPathways

(Difference between revisions)
Jump to: navigation, search
(changed link to swagger.ui)
Current revision (23:23, 9 November 2020) (view source)
(points to swagger now)
 
Line 3: Line 3:
  |}
  |}
-
This page documents WikiPathways Web 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 using [http://webservice.wikipathways.org/ui/#!/All_functions Swagger UI]. You can find the swagger description here [http://webservice.wikipathways.org/?swagger http://webservice.wikipathways.org/?swagger]. If you want to know more about swagger, swagger use and/or client code generation: http://swagger.io/tools/
+
-
 
+
-
=== Functions ===
+
-
{{WSFunction
+
-
|name=listOrganisms
+
-
|descr=Get a list of all available organisms.
+
-
|rest_ex=listOrganisms
+
-
}}
+
-
 
+
-
{{WSFunction
+
-
|name=listPathways
+
-
|descr=Get a list of all available pathways.
+
-
|rest_ex=listPathways
+
-
|args=
+
-
{{WSFunction/Argument|name=organism|type=string|descr=Only return pathways for this organism (optional).}}
+
-
}}
+
-
 
+
-
{{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).}}
+
-
}}
+
-
 
+
-
{{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.}}
+
-
}}
+
-
 
+
-
{{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.}}
+
-
}}
+
-
 
+
-
{{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.}}
+
-
}}
+
-
 
+
-
{{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.}}
+
-
}}
+
-
 
+
-
{{WSFunction
+
-
|name=getPathwayAs
+
-
|descr=Download a pathway in the specified file format.
+
-
|rest_ex=getPathwayAs?fileType=gpml&pwId=WP4&revision=0
+
-
|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).}}
+
-
}}
+
-
 
+
-
{{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=string|descr=The authentication info.}}
+
-
{{WSFunction/Argument|name=username|type=string|descr=The username.}}
+
-
}}
+
-
 
+
-
{{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=string|descr=The authentication info.}}
+
-
{{WSFunction/Argument|name=username|type=string|descr=The username.}}
+
-
}}
+
-
 
+
-
{{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).}}
+
-
}}
+
-
 
+
-
{{WSFunction
+
-
|name=findPathwaysByXref
+
-
|descr=Find pathways by searching on the external references of DataNodes (gene/protein/metabolite identifiers). 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://webservice.wikipathways.org/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://www.bridgedb.org/documentation/system-codes/ 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.}}
+
-
}}
+
-
 
+
-
{{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')}}
+
-
}}
+
-
 
+
-
{{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=string|descr=The authentication info.}}
+
-
{{WSFunction/Argument|name=username|type=string|descr=The username.}}
+
-
}}
+
-
 
+
-
{{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=string|descr=The authentication info.}}
+
-
{{WSFunction/Argument|name=username|type=string|descr=The username.}}
+
-
}}
+
-
 
+
-
{{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.}}
+
-
}}
+
-
 
+
-
{{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).}}
+
-
}}
+
-
 
+
-
{{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').}}
+
-
}}
+
-
 
+
-
{{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).}}
+
-
}}
+
-
 
+
-
{{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.}}
+
-
}}
+
-
 
+
-
{{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=string|descr=The authentication info.}}
+
-
{{WSFunction/Argument|name=user|type=string|descr=The username of the WikiPathways account}}
+
-
}}
+
-
 
+
-
{{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=string|descr=The authentication info.}}
+
-
{{WSFunction/Argument|name=user|type=string|descr=The username of the WikiPathways account}}
+
-
}}
+
-
 
+
-
{{WSFunction
+
-
|name=getOntologyTermsByPathway
+
-
|descr=Get ontology terms for a pathway
+
-
|rest_ex=getOntologyTermsByPathway?pwId=WP4
+
-
|args=
+
-
{{WSFunction/Argument|name=pwId|type=string|descr=The pathway identifier}}
+
-
}}
+
-
 
+
-
{{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.}}
+
-
}}
+
-
 
+
-
{{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.}}
+
-
}}
+
-
 
+
-
{{WSFunction
+
-
|name=getUserByOrcid
+
-
|descr=Get WP username by ORCID id.
+
-
|args=
+
-
{{WSFunction/Argument|name=orcid|type=string|descr=The ORCID identifier.}}
+
-
}}
+
-
 
+
-
----
+
-
 
+
-
=== 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