PyBioPAX API
- pybiopax.api.model_from_biocyc(identifier)[source]
Return a BioPAX model from a BioCyc entry.
BioCyc contains pathways for model eukaryotes and microbes.
- Parameters
identifier (
str
) – The BioCyc identifier for a pathway (e.g.,P105-PWY
for TCA cycle IV (2-oxoglutarate decarboxylase))- Return type
- Returns
A BioPAX model obtained from the BioCyc pathway.
- pybiopax.api.model_from_ecocyc(identifier)[source]
Return a BioPAX model from a EcoCyc entry.
EcoCyc contains pathways for Escherichia coli K-12 MG1655.
- Parameters
identifier (
str
) – The EcoCyc identifier for a pathway (e.g.,TCA
for TCA cycle I (prokaryotic))- Return type
- Returns
A BioPAX model obtained from the EcoCyc pathway.
- pybiopax.api.model_from_humancyc(identifier)[source]
Return a BioPAX model from a HumanCyc entry.
- Parameters
identifier (
str
) – The HumanCyc identifier for a pathway (e.g.,PWY66-398
for TCA cycle)- Return type
- Returns
A BioPAX model obtained from the HumanCyc pathway.
- pybiopax.api.model_from_metacyc(identifier)[source]
Return a BioPAX model from a MetaCyc entry.
MetaCyc contains pathways for all organisms
- Parameters
identifier (
str
) –The MetaCyc identifier for a pathway (e.g.,
TCA
for TCA cycle I (prokaryotic))- Return type
- Returns
A BioPAX model obtained from the MetaCyc pathway.
- pybiopax.api.model_from_netpath(identifier)[source]
Return a BioPAX model from a NetPath entry.
- Parameters
identifier (
str
) – The NetPath identifier for a pathway (e.g.,22
for the leptin signaling pathway- Return type
- Returns
A BioPAX model obtained from the NetPath resource.
- pybiopax.api.model_from_owl_file(fname, encoding=None)[source]
Return a BioPAX Model from an OWL string.
- Parameters
fname (
Union
[str
,Path
,PathLike
]) – A path to an OWL file of BioPAX content.encoding (
Optional
[str
]) – The encoding type to be passed toopen()
.
- Return type
- Returns
A BioPAX Model deserialized from the OWL file.
- pybiopax.api.model_from_owl_gz(path, encoding=None)[source]
Return a BioPAX Model from an OWL file (gzipped).
- Parameters
path (
Union
[str
,Path
,PathLike
]) – A path to a gzipped OWL file of BioPAX content.encoding (
Optional
[str
]) – The encoding to read the file with. Defaults to the system default. Sometimes, windows users will need to explicitly set this to utf-8.
- Return type
- Returns
A BioPAX Model deserialized from the OWL file.
- pybiopax.api.model_from_owl_str(owl_str)[source]
Return a BioPAX Model from an OWL string.
- Parameters
owl_str (
str
) – A OWL string of BioPAX content.- Returns
A BioPAX Model deserialized from the OWL string.
- Return type
pybiopax.biopax.BioPaxModel
- pybiopax.api.model_from_owl_url(url, request_params=None)[source]
Return a BioPAX Model from an URL pointing to an OWL file.
- Parameters
url (
str
) – A OWL URL with BioPAX content.request_params (
Optional
[Mapping
[str
,Any
]]) – Additional keyword arguments to pass torequests.get()
- Return type
- Returns
A BioPAX Model deserialized from the OWL file.
- pybiopax.api.model_from_pc_query(kind, source, target=None, **query_params)[source]
Return a BioPAX Model from a Pathway Commons query.
For more information on these queries, see http://www.pathwaycommons.org/pc2/#graph
- Parameters
kind (str) – The kind of graph query to perform. Currently 3 options are implemented, ‘neighborhood’, ‘pathsbetween’ and ‘pathsfromto’.
source (list[str]) – A single gene name or a list of gene names which are the source set for the graph query.
target (Optional[list[str]]) – A single gene name or a list of gene names which are the target set for the graph query. Only needed for ‘pathsfromto’ queries.
limit (Optional[int]) – This limits the length of the longest path considered in the graph query. Default: 1
organism (Optional[str]) – The organism used for the query. Default: ‘9606’ corresponding to human.
datasource (Optional[list[str]]) – A list of database sources that the query results should include. Example: [‘pid’, ‘panther’]. By default, all databases are considered.
- Returns
A BioPAX Model obtained from the results of the Pathway Commons query.
- Return type
pybiopax.biopax.BioPaxModel
- pybiopax.api.model_from_reactome(identifier)[source]
Return a BioPAX model from a Reactome entry (pathway, event, etc.).
- Parameters
identifier (
str
) – The Reactome identifier for a pathway (e.g.,177929
for Signaling by EGFR) or reaction (e.g.,177946
for Pro-EGF is cleaved to form mature EGF). For human pathways, the identifier for the BioPAX download is the same as the part that comes afterR-HSA-
. For non-human pathways, this is not so clear.- Return type
- Returns
A BioPAX model obtained from the Reactome resource.
- pybiopax.api.model_to_owl_file(model, fname)[source]
Write an OWL string serialized from a BioPaxModel object into a file.
- Parameters
model (
BioPaxModel
) – The BioPaxModel to serialize into an OWL file.fname (
Union
[str
,Path
,PathLike
]) – The path to the target OWL file.
- pybiopax.api.model_to_owl_str(model)[source]
Return an OWL string serialized from a BioPaxModel object.
- Parameters
model (
BioPaxModel
) – The BioPaxModel to serialize into an OWL string.- Return type
str
- Returns
The OWL string for the model.