Help:WikiPathways Webservice/API
From WikiPathways
(added ontology functions) |
|||
| Line 240: | Line 240: | ||
|returns= | |returns= | ||
{{WSFunction/Return|type=array of [[#WSSearchResult|WSSearchResult]] descr=The search results.}} | {{WSFunction/Return|type=array of [[#WSSearchResult|WSSearchResult]] descr=The search results.}} | ||
| + | }} | ||
| + | |||
| + | {{WSFunction | ||
| + | |name=getOntologyTermsByPathway | ||
| + | |descr=Get a list of ontology terms for a given pathway. | ||
| + | |rest_ex=getOntologyTermsByPathway?pwId=WP4 | ||
| + | |args= | ||
| + | {{WSFunction/Argument|name=pwId|type=string|descr=The pathway identifier}} | ||
| + | |returns= | ||
| + | {{WSFunction/Return|type=array of [[#WSOntologyTerm|WSOntologyTerm]] descr=The ontology terms.}} | ||
| + | }} | ||
| + | |||
| + | {{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.}} | ||
}} | }} | ||
| Line 440: | Line 480: | ||
}} | }} | ||
| + | |||
| + | {{WSObject | ||
| + | |name=WSOntologyTerm | ||
| + | |descr=Represents an ontology term | ||
| + | |fields={{WSObject/Field | ||
| + | |name=ontology | ||
| + | |type=string | ||
| + | |descr=The name of the ontology. | ||
| + | }} | ||
| + | {{WSObject/Field | ||
| + | |name=id | ||
| + | |type=string | ||
| + | |descr=The ontology term identifier | ||
| + | }} | ||
| + | {{WSObject/Field | ||
| + | |name=name | ||
| + | |type=string | ||
| + | |descr=The ontology term name | ||
| + | }} | ||
| + | }} | ||
---- | ---- | ||
=== GPML Elements === | === GPML Elements === | ||
Revision as of 08:14, 15 May 2011
Functions
listOrganisms
listPathways
Get a list of all available pathways.
Example: http://webservice.wikipathways.org/listPathways
Arguments: listPathways
-
stringorganism- Only return pathways for this organism (optional).
getPathway
Download the pathway from WikiPathways.
Example: http://webservice.wikipathways.org/getPathway?pwId=WP4&revision=40020
Arguments:
-
stringpwId- The pathway identifier.
-
integerrevision- The revision number of the pathway (use '0' for most recent version).
getPathwayInfo
Get some general info about the pathway, such as the name, species, without downloading the GPML.
Example: http://webservice.wikipathways.org/getPathwayInfo?pwId=WP4
Arguments:
-
stringpwId- The pathway identifier.
getPathwayHistory
Get the revision history of a pathway.
Example: http://webservice.wikipathways.org/getPathwayHistory?pwId=WP4×tamp=20110101000000
Arguments:
-
stringpwId- The pathway identifier.
-
stringtimestamp- Limit the results by date, only history items after the given timestamp will be included.
getRecentChanges
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.
Example: http://webservice.wikipathways.org/getRecentChanges?timestamp=20110101000000
Arguments:
-
stringtimestamp- Only get changes from after this time. Timestamp format: yyyymmddMMHHSS.
login
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).
Arguments:
-
stringname- The username of the WikiPathways account.
-
stringpass- The password of the WikiPathways account.
getPathwayAs
Download a pathway in the specified file format.
Arguments:
-
stringfileType- Download a pathway in the specified file format.
- gpml
- png
- svg
- txt
- pwf
- owl (for BioPAX level 3)
See the download page for an explanation of these file formats.
-
stringpwId- The pathway identifier.
-
integerrevision- The revision number of the pathway (use '0' for most recent version).
updatePathway
Update a pathway on the wiki with the given GPML code.
Note: To create/modify pathways via the web service, you need to have an account with web service write permissions. Please contact us to request write access for the web service.
Arguments:
-
stringpwId- The pathway identifier.
-
stringdescription- A description of the modifications.
-
stringgpml- The updated GPML code.
-
integerrevision- 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.
-
object WSAuthauth- The authentication info.
createPathway
Create a new pathway on the wiki with the given GPML code.
Note: To create/modify pathways via the web service, you need to have an account with web service write permissions. Please contact us to request write access for the web service.
Arguments:
-
stringgpml- The GPML code.
-
object WSAuthauth- The authentication info.
findPathwaysByText
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.
Example: http://webservice.wikipathways.org/findPathwaysByText?query=apoptosis
Arguments:
-
stringquery- The search query (e.g. 'apoptosis' or 'p53').
-
stringspecies- The species to limit the search to (leave blank to search on all species).
findPathwaysByXref
Find pathways by searching on the external references of DataNodes (gene/protein/metabolite identifiers).
Example: http://webservice.wikipathways.org/findPathwaysByXref?ids=1234&codes=L
Arguments:
-
array of stringids- One or more DataNode identifier(s) (e.g. 'P45985').
-
array of stringcodes- One or more code(s) of the database system to limit the search to. See 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.
findInteractions
Find interactions defined in WikiPathways pathways.
Example: http://webservice.wikipathways.org/findInteractions?query=P53
Arguments:
-
stringquery- The name of an entity to find interactions for (e.g. 'P53')
saveCurationTag
Apply a curation tag to a pahtway. This operation will overwrite any existing tag with the same name.
Note: To create/modify pathways via the web service, you need to have an account with web service write permissions. Please contact us to request write access for the web service.
Arguments:
-
stringpwId- The pathway identifier.
-
stringtagName- The name of the tag to apply.
-
stringtagText- The tag text (optional).
-
integerrevision- The revision this tag applies to.
-
object WSAuthauth- The authentication info.
removeCurationTag
Remove a curation tag from a pathway.
Note: To create/modify pathways via the web service, you need to have an account with web service write permissions. Please contact us to request write access for the web service.
Arguments:
-
stringpwId- The pathway identifier.
-
stringtagName- The name of the tag to remove.
-
object WSAuthauth- The authentication info.
getCurationTags
Get all curation tags for the given pathway.
Example: http://webservice.wikipathways.org/getCurationTags?pwId=WP4
Arguments:
-
stringpwId- The pathway identifier.
getCurationTagsByName
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.
Example: http://webservice.wikipathways.org/getCurationTagsByName?tagName=Curation:FeaturedPathway
Arguments:
-
stringtagName- The tag name (see Special:SpecialCurationTags for an overview of available tag names).
getColoredPathway
Get a colored image version of the pathway.
Arguments:
-
stringpwId- The pathway identifier.
-
integerrevision- The revision number of the pathway (use '0' for most recent version).
-
array of stringgraphId- An array with GraphIds of the objects to color.
-
array of stringcolor- 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).
-
stringfileType- The image type (One of 'svg', 'pdf' or 'png').
getXrefList
Get a list of external references on the pathway (gene, protein or metabolite ids), translated to the given database system.
Example: http://webservice.wikipathways.org/getXrefList?pwId=WP4&code=S
Arguments:
-
stringpwId- The pathway identifier.
-
stringcode- The code of the system to translate to (e.g. 'S' for UniProt).
findPathwaysByLiterature
Find pathways by their literature references.
Example: http://webservice.wikipathways.org/findPathwaysByLiterature?query=18651794
Arguments:
-
stringquery- The query, can be a pubmed id, author name or title keyword.
getOntologyTermsByPathway
Get a list of ontology terms for a given pathway.
Example: http://webservice.wikipathways.org/getOntologyTermsByPathway?pwId=WP4
Arguments:
-
stringpwId- The pathway identifier
getOntologyTermsByOntology
Get a list of ontology terms from a given ontology.
Example: http://webservice.wikipathways.org/getOntologyTermsByOntology?ontology=Disease
Arguments:
-
stringontology- The ontology term (for possible values, see the Ontology Tags section on the pathway page.
getPathwaysByOntologyTerm
Get a list of pathways tagged with a given ontology term.
Example: http://webservice.wikipathways.org/getPathwaysByOntologyTerm?term=DOID:344
Arguments:
-
stringterm- The ontology term identifier.
getPathwaysByParentOntologyTerm
Get a list of pathways tagged with any ontology term that is the child of the given Ontology term.
Example: http://webservice.wikipathways.org/getPathwaysByParentOntologyTerm?term=DOID:344
Arguments:
-
stringterm- The ontology term identifier.
Objects
This section explains the different object classes defined in the WSDL.
WSPathwayInfo
Container for pathway metadata, such as name, organism and url.
Fields:
-
stringid- The pathway identifier
-
stringname- The name of the pathway
-
stringspecies- The species (organism) of the pathway
-
stringrevision- The revision number of the pathway
-
stringurl- The url to the pathway
WSPathway
Extends WSPathwayInfo.
Container for pathway metadata and content. This object inherits all fields from WSPathwayInfo and has one additional field:
Fields:
-
stringgpml- The content of the pathway (as GPML).
WSPathwayHistory
Extends WSPathwayInfo.
Container for pathway revision history. This object inherits all fields from WSPathwayInfo and has one additional field:
Fields:
-
array of WSHistoryRowhistory- The revision history of the pathway.
WSHistoryRow
Info about a single revision of a pathway.
Fields:
-
stringrevision- The revision number of this revision
-
stringcomment- The edit description
-
stringuser- The username of the user that edited this revision
-
stringtimestamp- The timestamp of this revision
WSAuth
Container for authentication data for a logged in WikiPathways session.
Fields:
-
stringuser- The username of a WikiPathways account
-
stringkey- The authentication key of the session (can be obtained by calling the login function).
WSSearchResult
Container for a single search result.
Fields:
-
doublescore- The score of the search result
-
stringid- The pathway identifier
-
stringname- The name of the pathway
-
stringspecies- The species (organism) of the pathway
-
stringrevision- The revision number of the pathway
-
stringurl- The url to the pathway
-
array of WSIndexFieldfields- An array of index fields that were returned with the search. The included fields vary among different search functions. For example, it includes an array of hashes of arrays to represent interactions involving grouped objects.
WSIndexField
Container for a single index field.
Fields:
-
stringname- The name of the index field.
-
array of stringvalues- An array with the value(s) of the field.
WSCurationTag
Container for a single index field.
Fields:
-
stringname- The internal tag name.
-
stringdisplayName- The display name of the tag.
-
object WSPathwayInfopathway- The pathway this tag applies to.
-
stringrevision- The revision this tag applies to. '0' is used for tags that apply to all revisions.
-
stringtext- The tag text.
-
longtimeModified- The timestamp of the last modified date.
-
stringuserModified- The username of the user that last modified the tag.
WSOntologyTerm
Represents an ontology term
Fields:
-
stringontology- The name of the ontology.
-
stringid- The ontology term identifier
-
stringname- The ontology term name
GPML Elements
Relevant attributes and elements defined for the GPML pathway file format. Also see complete GPML documentation.
GraphId
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">

