Package 'rWikiPathways'

Title: rWikiPathways - R client library for the WikiPathways API
Description: Use this package to interface with the WikiPathways API. It provides programmatic access to WikiPathways content in multiple data and image formats, including official monthly release files and convenient GMT read/write functions.
Authors: Egon Willighagen [aut, cre] , Alex Pico [aut]
Maintainer: Egon Willighagen <[email protected]>
License: MIT + file LICENSE
Version: 1.25.1
Built: 2024-10-02 03:12:22 UTC
Source: https://github.com/bioc/rWikiPathways

Help Index


Download Pathway Archive

Description

Access the monthly archives of pathway content from WikiPathways.

Usage

downloadPathwayArchive(
  date = "current",
  organism = NULL,
  format = c("gpml", "gmt", "svg"),
  destpath = "./"
)

Arguments

date

(optional) The timestamp for a monthly release (e.g., 20171010) or "current" (default) for latest release.

organism

(optional) A particular species. See listOrganisms.

format

(optional) Either gpml (default), gmt or svg.

destpath

(optional) Destination path for file to be downloaded to. Default is current workding directory.

Details

If you do not specify an organism, then an archive file will not be downloaded. Rather, the archive will be opened in a tab in your default browser.

Value

Filename of downloaded file or an opened tab in default browser

See Also

readPathwayGMT

Examples

#downloadPathwayArchive()  ## open in browser
#downloadPathwayArchive(format="gmt")  ## open in browser
#downloadPathwayArchive(date="20230710", format="svg")  ## open in browser
#downloadPathwayArchive(date="20230710", organism="Mus musculus", format="svg")  ## download file
#downloadPathwayArchive(organism="Mus musculus")  ## download file

Find Pathway WPIDs By Literature

Description

Retrieve list of pathway WPIDs containing the query citation.

Usage

findPathwayIdsByLiterature(query = NULL)

Arguments

query

The character string to search for, e.g., a PMID, title keyword or author name.

Value

A list of WPIDs

See Also

findPathwaysByLiterature

Examples

{
findPathwayIdsByLiterature('19649250')
findPathwayIdsByLiterature('smith')
findPathwayIdsByLiterature('cancer')
}

Find Pathway WPIDs By ORCID

Description

Retrieve list of pathway WPIDs containing the query ORCID

Usage

findPathwayIDsByOrcid(query = NULL)

Arguments

query

The character ORCID to search for.

Value

A list of WPIDs

See Also

findPathwaysByOrcid

Examples

{
findPathwayIDsByOrcid(' 0000-0001-9773-4008')
}

Find Pathway WPIDs By Text

Description

Retrieve list of pathway WPIDs containing the query text.

Usage

findPathwayIdsByText(query = NULL, field = NULL)

Arguments

query

A character string to search for, e.g., "cancer"

field

Optional character string to restrict search to a single field, e.g., title, description, wpid, species, revision, authors, datanodes, annotations, or citedIn.

Value

A list of WPIDs

See Also

findPathwaysByText

Examples

{
findPathwayIdsByText('cancer')
}

Find Pathway WPIDs By Xref

Description

Retrieve list of pathway WPIDs containing the query Xref by identifier and system code.

Usage

findPathwayIdsByXref(identifier = NULL, systemCode = NULL)

Arguments

identifier

(character) The official ID specified by a data source or system

systemCode

(character) The BridgeDb code associated with the data source or system, e.g., En (Ensembl), L (Entrez), Ch (HMDB), etc. See column two of https://github.com/bridgedb/datasources/blob/main/datasources.tsv.

Value

A list of WPIDs

See Also

findPathwaysByXref

Examples

{
findPathwayIdsByXref('ENSG00000100031','En')
}

Find Pathway Names By Literature

Description

Retrieve list of pathway names containing the query citation.

Usage

findPathwayNamesByLiterature(query = NULL)

Arguments

query

The character string to search for, e.g., a PMID, title keyword or author name.

Value

A list of lists

See Also

findPathwaysByLiterature

Examples

{
findPathwayNamesByLiterature('19649250')
findPathwayNamesByLiterature('smith')
findPathwayNamesByLiterature('cancer')
}

Find Pathway Names By ORCID

Description

Retrieve list of pathway names containing the query ORCID

Usage

findPathwayNamesByOrcid(query = NULL)

Arguments

query

The character ORCID to search for.

Value

A list of lists

See Also

findPathwaysByOrcid

Examples

{
findPathwayNamesByOrcid(' 0000-0001-9773-4008')
}

Find Pathway Names By Text

Description

Retrieve list of pathway names containing the query text.

Usage

findPathwayNamesByText(query = NULL, field = NULL)

Arguments

query

A character string to search for, e.g., "cancer"

field

Optional character string to restrict search to a single field, e.g., title, description, wpid, species, revision, authors, datanodes, annotations, or citedIn.

Value

A list of pathway names

See Also

findPathwaysByText

Examples

{
findPathwayNamesByText('cancer')
}

Find Pathway Names By Xref

Description

Retrieve list of pathway names containing the query Xref by identifier and system code.

Usage

findPathwayNamesByXref(identifier = NULL, systemCode = NULL)

Arguments

identifier

(character) The official ID specified by a data source or system

systemCode

(character) The BridgeDb code associated with the data source or system, e.g., En (Ensembl), L (Entrez), Ch (HMDB), etc. See column two of https://github.com/bridgedb/datasources/blob/main/datasources.tsv.

Value

A list of lists

See Also

findPathwaysByXref

Examples

{
findPathwayNamesByXref('ENSG00000100031','En')
}

Find Pathways By Literature

Description

Retrieve pathways containing the query citation.

Usage

findPathwaysByLiterature(query = NULL)

Arguments

query

The character string to search for, e.g., a PMID, title keyword, journal abbreviation, year, or author name.

Value

A dataframe of pathway attributes including the matching citations

Examples

{
findPathwaysByLiterature('15134803')
findPathwaysByLiterature('Schwartz GL')
findPathwaysByLiterature('Eur J Pharmacol')
findPathwaysByLiterature('antihypertensive drug responses')
}

Find Pathways By ORCID

Description

Retrieve pathways containing the query ORCID

Usage

findPathwaysByOrcid(query = NULL)

Arguments

query

The character ORCID to search for.

Value

A dataframe of pathway attributes including the matching ORCIDs

Examples

{
findPathwaysByOrcid(' 0000-0001-9773-4008')
}

Find Pathways By Text

Description

Retrieve pathways matching the query text.

Usage

findPathwaysByText(query = NULL, field = NULL)

Arguments

query

A character string to search for, e.g., "cancer". Case insensitive.

field

Optional character string to restrict search to a single field, e.g., id, name, description, species, revision, authors, datanodes, annotations, or citedIn.

Details

Searches id, name, description, species, revision date, authors, datanode labels, ontology annotations, and citedIn (e.g., PMCIDs).

Value

A dataframe of pathway attributes including the matching attributes

Examples

{
findPathwaysByText('cancer')
findPathwaysByText('cancer','name')
}

Find Pathways By Xref

Description

Retrieve pathways containing the query Xref by identifier and system code.

Usage

findPathwaysByXref(identifier = NULL, systemCode = NULL)

Arguments

identifier

(character) The official ID specified by a data source or system

systemCode

(character) The BridgeDb code associated with the data source or system, e.g., En (Ensembl), L (NCBI gene), H (HGNC), U (UniProt), Wd (Wikidata), Ce (ChEBI), Ik (InChI). See column two of https://github.com/bridgedb/datasources/blob/main/datasources.tsv.

Value

A dataframe of pathway attributes including the matching identifiers

Examples

{
findPathwaysByXref('ENSG00000100031','En')
}

Find Pathway URLs By Literature

Description

Retrieve list of pathway URLs containing the query citation.

Usage

findPathwayUrlsByLiterature(query = NULL)

Arguments

query

The character string to search for, e.g., a PMID, title keyword or author name.

Value

A list of lists

See Also

findPathwaysByLiterature

Examples

{
findPathwayUrlsByLiterature('19649250')
findPathwayUrlsByLiterature('smith')
findPathwayUrlsByLiterature('cancer')
}

Find Pathway URLs By ORCID

Description

Retrieve list of pathway URLs containing the query ORCID

Usage

findPathwayUrlsByOrcid(query = NULL)

Arguments

query

The character ORCID to search for.

Value

A list of lists

See Also

findPathwaysByOrcid

Examples

{
findPathwayUrlsByOrcid(' 0000-0001-9773-4008')
}

Find Pathway URLs By Text

Description

Retrieve list of pathway URLs containing the query text.

Usage

findPathwayUrlsByText(query = NULL, field = NULL)

Arguments

query

A character string to search for, e.g., "cancer"

field

Optional character string to restrict search to a single field, e.g., title, description, wpid, species, revision, authors, datanodes, annotations, or citedIn.

Value

A list of urls

See Also

findPathwaysByText

Examples

{
findPathwayUrlsByText('cancer')
}

Find Pathway URLs By Xref

Description

Retrieve list of pathway URLs containing the query Xref by identifier and system code.

Usage

findPathwayUrlsByXref(identifier = NULL, systemCode = NULL)

Arguments

identifier

(character) The official ID specified by a data source or system

systemCode

(character) The BridgeDb code associated with the data source or system, e.g., En (Ensembl), L (Entrez), Ch (HMDB), etc. See column two of https://github.com/bridgedb/datasources/blob/main/datasources.tsv.

Value

A list of lists

See Also

findPathwaysByXref

Examples

{
findPathwayUrlsByXref('ENSG00000100031','En')
}

Get Counts for WikiPathways Stats

Description

Retrieve information about various total counts at WikiPathways.

Usage

getCounts()

Value

A data.frame of counts

Examples

{
getCounts()
}

Get Curation Status of a Pathway

Description

Retrieve information about curation status for a specific pathway.

Usage

getCurationStatus(pathway)

Arguments

pathway

WikiPathways identifier (WPID) for the pathway, e.g. WP554

Value

A data.frame of status details

Examples

{
getCurationStatus('WP554')
}

DEPRECATED: Get Curation Tag Names on a Pathway

Description

This function is provided for compatibility with older web services only and will be defunct at the next release.

Usage

getCurationTagNames(pathway)

Arguments

pathway

WikiPathways identifier (WPID) for the pathway to download, e.g. WP4

Value

A list of tag names


DEPRECATED: Get Curation Tags on a Pathway

Description

This function is provided for compatibility with older web services only and will be defunct at the next release.

Usage

getCurationTags(pathway)

Arguments

pathway

WikiPathways identifier (WPID) for the pathway to download, e.g. WP4

Value

A list of tag name, display name, revision, text, timestampe and user


DEPRECATED: Get Every Instance of a Curation Tag

Description

This function is provided for compatibility with older web services only and will be defunct at the next release.

Usage

getEveryCurationTag(tag)

Arguments

tag

(character) Official name of curation tag, e.g., "Curation:FeaturedPathway"

Value

A list of tag name, display name, revision, text, timestampe and user


Get Ontology Term IDs by Pathway

Description

Retrieve identifiers of ontology terms for a specific pathway.

Usage

getOntologyTermIds(pathway = NULL)

Arguments

pathway

WikiPathways identifier (WPID) for the pathway to download, e.g. WP4

Value

A list of term identifiers

Examples

{
getOntologyTermIds('WP554')
}

Get Ontology Term Names by Pathway

Description

Retrieve names of ontology terms for a specific pathway.

Usage

getOntologyTermNames(pathway = NULL)

Arguments

pathway

WikiPathways identifier (WPID) for the pathway to download, e.g. WP4

Value

A list of term names

Examples

{
getOntologyTermNames('WP554')
}

Get Ontology Terms by Pathway

Description

Retrieve information about ontology terms for a specific pathway.

Usage

getOntologyTerms(pathway = NULL)

Arguments

pathway

WikiPathways identifier (WPID) for the pathway, e.g. WP554. If NULL, then ontology term information for all pathways is returned.

Value

A data.frame pathway id and term information

Examples

{
getOntologyTerms('WP554')
}

Get Pathway

Description

Retrieve a specific pathway in the GPML format

Usage

getPathway(pathway, revision = 0)

Arguments

pathway

WikiPathways identifier (WPID) for the pathway to retrieve, e.g. WP554

revision

<ignored> Only the latest version is available.

Value

GPML as string

Examples

{
getPathway('WP554')
}

Get Pathway History

Description

View the revision history of a pathway.

Usage

getPathwayHistory(pathway = NULL, timestamp = NULL)

Arguments

pathway

WikiPathways identifier (WPID) for the pathway, e.g. WP554

timestamp

<ignored>

Value

Opens the GitHub history for a pathway

Examples

#getPathwayHistory('WP554')

Get Pathway IDs By Community

Description

Retrieve the list of pathway IDs per community

Usage

getPathwayIdsByCommunity(community_tag = NULL)

Arguments

community_tag

Abbreviated name of community

Value

A list of pathway IDs

Examples

{
getPathwayIdsByCommunity("AOP")
}

DEPRECATED: Get Pathway WPIDs by Curation Tag

Description

This function is provided for compatibility with older web services only and will be defunct at the next release.

Usage

getPathwayIdsByCurationTag(tag)

Arguments

tag

(character) Official name of curation tag, e.g., "Curation:FeaturedPathway"

Value

A list of pathway WPIDs


Get Pathway WPIDs by Ontology Term

Description

Retrieve pathway WPIDs for every pathway with a given ontology term.

Usage

getPathwayIdsByOntologyTerm(term = NULL)

Arguments

term

(character) Official ID of ontology term, e.g., "PW:0000045"

Value

A list of pathway WPIDs

Examples

{
getPathwayIdsByOntologyTerm('PW:0000045')
}

Get Pathway WPIDs by Parent Ontology Term

Description

Retrieve pathway WPIDs for every pathway with a child term of given ontology term

Usage

getPathwayIdsByParentOntologyTerm(term = NULL)

Arguments

term

(character) Official name of ontology term, e.g., "signaling pathway"

Value

A list of pathway WPIDs

Examples

{
getPathwayIdsByParentOntologyTerm('signaling pathway')
}

Get Pathway Info

Description

Retrieve information for a specific pathway

Usage

getPathwayInfo(pathway = NULL)

Arguments

pathway

WikiPathways identifier (WPID) for the pathway to download, e.g. WP554. If NULL, then all pathways are returned.

Value

A dataframe of pathway WPID, URL, name, species, revision, authors, description, and citedIn

Examples

{
getPathwayInfo('WP554')
}

Get Pathway Names By Community

Description

Retrieve the list of pathway names per community

Usage

getPathwayNamesByCommunity(community_tag = NULL)

Arguments

community_tag

Abbreviated name of community

Value

A list of pathway names

Examples

{
getPathwayNamesByCommunity("AOP")
}

Get Pathways By Community

Description

Retrieve pathways per community

Usage

getPathwaysByCommunity(community_tag = NULL)

Arguments

community_tag

Abbreviated name of community

Value

A data.frame of pathway information

Examples

{
getPathwaysByCommunity("AOP")
}

DEPRECATED: Get Pathways by Curation Tag

Description

This function is provided for compatibility with older web services only and will be defunct at the next release.

Usage

getPathwaysByCurationTag(tag)

Arguments

tag

(character) Official name of curation tag, e.g., "Curation:FeaturedPathway"

Value

A list of pathway information, including WPID, url, name, species and revision


Get Pathways by Ontology Term

Description

Retrieve pathway information for every pathway with a given ontology term.

Usage

getPathwaysByOntologyTerm(term = NULL)

Arguments

term

(character) Official ID of ontology term, e.g., "PW:0000045"

Value

A data.frame of pathway information

Examples

{
getPathwaysByOntologyTerm('PW:0000045')
}

Get Pathways by Parent Ontology Term

Description

Retrieve pathway information for every pathway with a child term of given ontology term.

Usage

getPathwaysByParentOntologyTerm(term = NULL)

Arguments

term

(character) Official name of ontology term, e.g., "signaling pathway"

Value

A data.frame of pathway information

Examples

{
getPathwaysByParentOntologyTerm('signaling pathway')
}

Get Pathway URLs By Community

Description

Retrieve the list of pathway URLs per community

Usage

getPathwayUrlsByCommunity(community_tag = NULL)

Arguments

community_tag

Abbreviated name of community

Value

A list of pathway URLs

Examples

{
getPathwayUrlsByCommunity("AOP")
}

Get Recent Changes

Description

Retrieve recently changed pathways at WikiPathways.

Usage

getRecentChanges(timestamp = NULL)

Arguments

timestamp

(8 digits, YYYYMMDD) Limit by time, only pathways changed after the given date, e.g., 20180201 for changes since Feb 1st, 2018.

Value

A data.frame of recently changed pathways, including id, name, url, species and revision

Examples

{
getRecentChanges('20180201')
}

Get WPIDs of Recent Changes

Description

Retrieve WPIDs of recently changed pathways at WikiPathways.

Usage

getRecentChangesIds(timestamp)

Arguments

timestamp

(8 digits, YYYYMMDD) Limit by time, only pathways changed after the given date, e.g., 20180201 for changes since Feb 1st, 2018.

Value

A list of WPIDs

Examples

{
getRecentChangesIds('20180201')
}

Get Pathway Names of Recent Changes

Description

Retrieve names of recently changed pathways at WikiPathways.

Usage

getRecentChangesNames(timestamp)

Arguments

timestamp

(8 digits, YYYYMMDD) Limit by time, only pathways changed after the given date, e.g., 20180201 for changes since Feb 1st, 2018.

Value

A list of pathway names. Note: pathway deletions will be listed as blank names.

Examples

{
getRecentChangesNames('20180201')
}

Get Xref List

Description

Retrieve the Xref identifiers for a specific pathway in a particular system code

Usage

getXrefList(pathway = NULL, systemCode = NULL, compact = FALSE)

Arguments

pathway

WikiPathways identifier (WPID) for the pathway to download, e.g. WP554

systemCode

(character) The BridgeDb code associated with the data source or system, e.g., En (Ensembl), L (NCBI gene), H (HGNC), S (UniProt), Wd (Wikidata), Ce (ChEBI), Ik (InChI). See column two of https://github.com/bridgedb/datasources/blob/main/datasources.tsv.

compact

(Boolean) Whether to return compact identifiers, like ncbigene:1215. If FALSE (default), then just the identifier is returned, like 1215

Value

A list of Xrefs identifiers

Examples

{
xrefs = getXrefList("WP2338", "L")
}

List Communities

Description

Retrieve the list of communities hosted by WikiPathways

Usage

listCommunities()

Value

A data.frame of community information

Examples

{
listCommunities()
}

List Organisms

Description

Retrieve the list of organisms supported by WikiPathways

Usage

listOrganisms()

Value

A list of organisms

Examples

{
listOrganisms()
}

List Pathway WPIDs

Description

Retrieve list of pathway WPIDs per species.

Usage

listPathwayIds(organism = "")

Arguments

organism

(character, optional) A particular species. See listOrganisms. Default is all species.

Details

Basically returns a subset of listPathways result

Value

A list of WPIDs

See Also

listPathways

Examples

{
listPathwayIds('Mus musculus')
}

List Pathway Names

Description

Retrieve list of pathway names per species.

Usage

listPathwayNames(organism = "")

Arguments

organism

(character, optional) A particular species. See listOrganisms. Default is all species.

Details

Basically returns a subset of listPathways result

Value

A list of names

See Also

listPathways

Examples

{
listPathwayNames('Mus musculus')
}

List Pathways

Description

Retrieve list of pathways per species, including WPID, name, species, URL and latest revision number.

Usage

listPathways(organism = "")

Arguments

organism

(character, optional) A particular species. See listOrganisms. Default is all species.

Value

A dataframe of pathway information

Examples

{
listPathways('Mus musculus')
}

List Pathway URLs

Description

Retrieve list of pathway URLs per species.

Usage

listPathwayUrls(organism = "")

Arguments

organism

(character, optional) A particular species. See listOrganisms. Default is all species.

Details

Basically returns a subset of listPathways result

Value

A list of URLs

See Also

listPathways

Examples

{
listPathwayUrls('Mus musculus')
}

Read GMT File

Description

Reads any generic GMT file to produce a data frame of term-gene associations useful in enrichment analyses and other applications.

Usage

readGMT(file)

Arguments

file

Path to GMT file

Details

The returned data frame includes only terms and genes. If you want another data frame with terms and names, then see readGMTnames.

Value

Data frame of term-gene associations

See Also

readGMTnames

Examples

#readGMT(system.file("extdata","my_gmt_file.gmt", package="rWikiPathways"))
#readGMT("path_to_your_gmt_file.gmt")

Read GMT File for Names

Description

Reads any generic GMT file to produce a data frame of term-name associations useful in enrichment analyses and other applications.

Usage

readGMTnames(file)

Arguments

file

Path to GMT file

Details

The returned data frame includes only terms and names. If you want another data frame with terms and genes, then see readGMT.

Value

Data frame of term-namee associations

See Also

readGMT

Examples

#readGMTnames(system.file("extdata","my_gmt_file.gmt", package="rWikiPathways"))
#readGMTnames("path_to_your_gmt_file.gmt")

Read Pathway GMT File

Description

Reads a WikiPathways GMT file to produce a data frame of pathway-gene associations useful in enrichment analyses and other applications.

Usage

readPathwayGMT(file)

Arguments

file

Path to GMT file

Details

The returned data frame includes pathway name, version, identifier, and organism. The gene content is provided as NCBI Entrez Gene identifiers. The input file can be retrieved by using downloadPathwayArchive(organism="Homo sapiens",format="gmt").

Value

Data frame of pathway-gene associations

References

Adapted from the generic GMT reader provided by clusterProfiler, https://github.com/YuLab-SMU/clusterProfiler/blob/master/R/GMT.R

See Also

downloadPathwayArchive

Examples

#readPathwayGMT(system.file("extdata",
#  "wikipathways-20201010-gmt-Homo_sapiens.gmt", package="rWikiPathways"))

DEPRECATED: Open Swagger docs for WikiPathways API

Description

This function is provided for compatibility with older web services only and will be defunct at the next release.

Usage

wikipathwaysAPI(base.url = .baseUrl)

Arguments

base.url

(optional) Ignore unless you need to specify a custom domain.

Value

New tab in default browser


DEPRECATED: WikiPathways GET

Description

This function is provided for compatibility with older web services only and will be defunct at the next release.

Usage

wikipathwaysGET(
  operation,
  parameters = NULL,
  format = c("json", "xml", "html", "jpg", "pdf", "dump"),
  base.url = .baseUrl
)

Arguments

operation

A character string to be converted to the query namespace

parameters

A named list of values to be converted to query parameters

format

(character) The format of the return, e.g., json (default), xml, html, jpg, pdf, dump

base.url

(optional) Ignore unless you need to specify a custom domain.

Value

query result content


Write GMT File

Description

Writes a GMT (Gene Matrix Transposed) file from a data frame.

Usage

writeGMT(df, outfile)

Arguments

df

Data frame with columns ordered as Identifiers, optional Description column and Genes. Identifiers must be first and Genes must be last.

outfile

Path to output GMT file

Details

The input data frame must include at least two columns: Identifiers (first column) and Genes (last column). The Identifiers will be duplicated to fill the Description column in the output GMT file if none is provided. If more than three columns are provided, then the first n columns will be concatenated with number of columns.

Value

None

References

Adapted from the GMT writer in MAGeCKFlute, https://github.com/WubingZhang/MAGeCKFlute/blob/master/R/readGMT.R

See Also

readPathwayGMT

Examples

#my.df <- data.frame(id=c("WP1000","WP1000","WP1000","WP1001","WP1001"),
#         description=c("cancer","cancer","cancer","diabetes","diabetes"),
#         gene=c("574413","2167","4690","5781","11184"))
#writeGMT(my.df, "my_gmt_file.gmt")