PyBioPAX documentation

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

BioPaxModel

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

BioPaxModel

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

BioPaxModel

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

BioPaxModel

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

BioPaxModel

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 to open().

Return type

BioPaxModel

Returns

A BioPAX Model deserialized from the OWL file.

pybiopax.api.model_from_owl_gz(path)[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.

Return type

BioPaxModel

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 to requests.get()

Return type

BioPaxModel

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 after R-HSA-. For non-human pathways, this is not so clear.

Return type

BioPaxModel

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.

BioPAX object model

This module implements the BioPAX Level 3 object model as a set of classes with inheritance. At the top of the class hierarchy is the generic BioPaxObject.

class pybiopax.biopax.model.BioPaxModel(objects, xml_base='http://www.biopax.org/release/biopax-level3.owl#')[source]

Bases: object

BioPAX Model.

Parameters
  • objects (dict or list) – A dict of BioPaxObject instances keyed by their URI string or a list of BioPaxObject instances, which will get converted into a dict keyed their URI strings

  • xml_base (str) – The XML base namespace for the content being represented.

objects

A dict of BioPaxObject instances keyed by their URI string that are part of the model.

Type

dict

xml_base

The XML base namespace for the content being represented. If not provided, the default BioPAX Level 3 base namespace is used.

Type

Optional[str]

classmethod from_xml(tree)[source]

Return a BioPAX Model from an OWL/XML element tree.

Parameters

tree – An element tree from which the model is extracted

Return type

BioPaxModel

Returns

A BioPAX Model deserialized from the OWL XML tree.

to_xml()[source]

Return an OWL string from the content of the model.

Return type

str

pybiopax.biopax.model.PYBIOPAX_TQDM_CONFIG = {'unit_scale': True}

Default configuration for tqdm progress bars in pybiopax. To modify the tqdm configuration, modify this module-level variable. For example, to disable the progress bars, set the disable key to True.

Base classes

class pybiopax.biopax.base.BioPaxObject(uid, comment=None, **kwargs)[source]

Bases: object

Generic BioPAX Object. It is the parent class of all more specific BioPAX classes.

class pybiopax.biopax.base.Controller(**kwargs)[source]

Bases: object

BioPAX Controller.

class pybiopax.biopax.base.Entity(availability=None, data_source=None, **kwargs)[source]

Bases: BioPaxObject, Observable, Named

BioPAX Entity.

availability
Type

str

data_source
Type

List[Provenance]

property name

All names associated with the object including the standard and display name, if available.

class pybiopax.biopax.base.Gene(organism, **kwargs)[source]

Bases: Entity

BioPAX Gene

organism
Type

BioSource

property name

All names associated with the object including the standard and display name, if available.

class pybiopax.biopax.base.Named(display_name=None, standard_name=None, name=None, **kwargs)[source]

Bases: XReferrable

A mixin class to add names to a BioPaxObject.

display_name
Type

str

standard_name
Type

str

name
Type

str

property name

All names associated with the object including the standard and display name, if available.

class pybiopax.biopax.base.Observable(evidence=None, **kwargs)[source]

Bases: object

A mixin class to add evidence to a BioPaxObject.

evidence
Type

List[Evidence]

class pybiopax.biopax.base.Pathway(pathway_component=None, pathway_order=None, organism=None, **kwargs)[source]

Bases: Entity, Controller

BioPAX Pathway.

property name

All names associated with the object including the standard and display name, if available.

class pybiopax.biopax.base.Unresolved(obj_id)[source]

Bases: object

A placeholder class used while deserializing BioPAX models.

class pybiopax.biopax.base.XReferrable(xref=None, **kwargs)[source]

Bases: object

A mixin class to add xrefs to a BioPaxObject.

xref
Type

List[Xref]

Interactions

class pybiopax.biopax.interaction.BiochemicalReaction(delta_s=None, delta_h=None, delta_g=None, k_e_q=None, e_c_number=None, **kwargs)[source]

Bases: Conversion

BioPAX BiochemicalReaction.

delta_s
Type

List[float]

delta_h
Type

List[float]

delta_g
Type

List[DeltaG]

k_e_q
Type

List[KPrime]

e_c_number
Type

List[str]

property name

All names associated with the object including the standard and display name, if available.

class pybiopax.biopax.interaction.Catalysis(catalysis_direction=None, cofactor=None, **kwargs)[source]

Bases: Control

BioPAX Catalysis.

catalysis_direction
Type

str

cofactor
Type

List[PhysicalEntity]

property name

All names associated with the object including the standard and display name, if available.

class pybiopax.biopax.interaction.ComplexAssembly(left=None, right=None, conversion_direction=None, participant_stoichiometry=None, spontaneous=None, **kwargs)[source]

Bases: Conversion

BioPAX ComplexAssembly.

property name

All names associated with the object including the standard and display name, if available.

class pybiopax.biopax.interaction.Control(control_type=None, controller=None, controlled=None, **kwargs)[source]

Bases: Interaction

BioPAX Control.

control_type
Type

str

controller
Type

List[Process]

controlled
Type

Process

property name

All names associated with the object including the standard and display name, if available.

class pybiopax.biopax.interaction.Conversion(left=None, right=None, conversion_direction=None, participant_stoichiometry=None, spontaneous=None, **kwargs)[source]

Bases: Interaction

BioPAX Conversion.

left
Type

List[PhysicalEntity]

right
Type

List[PhysicalEntity]

conversion_direction
Type

str

participant_stoichiometry
Type

List[Stoichiometry]

spontaneous
Type

bool

property name

All names associated with the object including the standard and display name, if available.

class pybiopax.biopax.interaction.Degradation(left=None, right=None, conversion_direction=None, participant_stoichiometry=None, spontaneous=None, **kwargs)[source]

Bases: Conversion

BioPAX Degradation.

property name

All names associated with the object including the standard and display name, if available.

class pybiopax.biopax.interaction.GeneticInteraction(participant=None, interaction_type=None, **kwargs)[source]

Bases: Interaction

BioPAX GeneticInteraction.

property name

All names associated with the object including the standard and display name, if available.

class pybiopax.biopax.interaction.Interaction(participant=None, interaction_type=None, **kwargs)[source]

Bases: Process

BioPAX Interaction.

participant
Type

List[Entity]

interaction_type
Type

List[str]

property name

All names associated with the object including the standard and display name, if available.

class pybiopax.biopax.interaction.Modulation(control_type=None, controller=None, controlled=None, **kwargs)[source]

Bases: Control

BioPAX Modulation.

property name

All names associated with the object including the standard and display name, if available.

class pybiopax.biopax.interaction.MolecularInteraction(participant=None, interaction_type=None, **kwargs)[source]

Bases: Interaction

BioPAX MolecularInteraction.

property name

All names associated with the object including the standard and display name, if available.

class pybiopax.biopax.interaction.Process(**kwargs)[source]

Bases: Entity

BioPAX Process.

property name

All names associated with the object including the standard and display name, if available.

class pybiopax.biopax.interaction.TemplateReaction(template=None, product=None, template_direction=None, **kwargs)[source]

Bases: Interaction

BioPAX TemplateReaction.

template
Type

NucleicAcid

product
Type

List[PhysicalEntity]

template_direction
Type

str

property name

All names associated with the object including the standard and display name, if available.

class pybiopax.biopax.interaction.TemplateReactionRegulation(control_type=None, controller=None, controlled=None, **kwargs)[source]

Bases: Control

BioPAX TemplateReactionRegulation.

property name

All names associated with the object including the standard and display name, if available.

class pybiopax.biopax.interaction.Transport(left=None, right=None, conversion_direction=None, participant_stoichiometry=None, spontaneous=None, **kwargs)[source]

Bases: Conversion

BioPAX Transport.

property name

All names associated with the object including the standard and display name, if available.

class pybiopax.biopax.interaction.TransportWithBiochemicalReaction(delta_s=None, delta_h=None, delta_g=None, k_e_q=None, e_c_number=None, **kwargs)[source]

Bases: BiochemicalReaction

BioPAX TransportWithBiochemicalReaction.

property name

All names associated with the object including the standard and display name, if available.

Physical entities

class pybiopax.biopax.physical_entity.Complex(component=None, component_stoichiometry=None, **kwargs)[source]

Bases: PhysicalEntity

BioPAX Complex.

component
Type

List[PhysicalEntity]

component_stoichiometry
Type

List[Stoichiometry]

property name

All names associated with the object including the standard and display name, if available.

class pybiopax.biopax.physical_entity.Dna(entity_reference=None, **kwargs)[source]

Bases: SimplePhysicalEntity

BioPAX Dna.

property name

All names associated with the object including the standard and display name, if available.

class pybiopax.biopax.physical_entity.DnaRegion(entity_reference=None, **kwargs)[source]

Bases: SimplePhysicalEntity

BioPAX DnaRegion

property name

All names associated with the object including the standard and display name, if available.

class pybiopax.biopax.physical_entity.PhysicalEntity(feature=None, not_feature=None, member_physical_entity=None, cellular_location=None, **kwargs)[source]

Bases: Entity, Controller

BioPAX PhysicalEntity.

feature
Type

List[EntityFeature]

not_feature
Type

List[EntityFeature]

member_physical_entity
Type

List[PhysicalEntity]

cellular_location
Type

CellularLocationVocabulary

property name

All names associated with the object including the standard and display name, if available.

class pybiopax.biopax.physical_entity.Protein(entity_reference=None, **kwargs)[source]

Bases: SimplePhysicalEntity

BioPAX Protein.

property name

All names associated with the object including the standard and display name, if available.

class pybiopax.biopax.physical_entity.Rna(entity_reference=None, **kwargs)[source]

Bases: SimplePhysicalEntity

BioPAX Rna.

property name

All names associated with the object including the standard and display name, if available.

class pybiopax.biopax.physical_entity.RnaRegion(entity_reference=None, **kwargs)[source]

Bases: SimplePhysicalEntity

BioPAX RnaRegion

property name

All names associated with the object including the standard and display name, if available.

class pybiopax.biopax.physical_entity.SimplePhysicalEntity(entity_reference=None, **kwargs)[source]

Bases: PhysicalEntity

BioPAX SimplePhysicalEntity.

entity_reference
Type

EntityReference

property name

All names associated with the object including the standard and display name, if available.

class pybiopax.biopax.physical_entity.SmallMolecule(entity_reference=None, **kwargs)[source]

Bases: SimplePhysicalEntity

BioPAX SmallMolecule.

property name

All names associated with the object including the standard and display name, if available.

Utility classes

class pybiopax.biopax.util.BindingFeature(binds_to=None, intra_molecular=None, **kwargs)[source]

Bases: EntityFeature

BioPAX BindingFeature.

binds_to
Type

BindingFeature

intra_molecular
Type

bool

class pybiopax.biopax.util.BioSource(cell_type=None, tissue=None, taxon_xref=None, **kwargs)[source]

Bases: UtilityClass, Named

BioPAX BioSource.

cell_type
Type

CellVocabulary

tissue
Type

TissueVocabulary

property name

All names associated with the object including the standard and display name, if available.

class pybiopax.biopax.util.BiochemicalPathwayStep(step_conversion=None, step_direction=None, **kwargs)[source]

Bases: PathwayStep

BioPAX BiochemicalPathwayStep.

step_conversion
Type

Conversion

step_direction
Type

str

class pybiopax.biopax.util.CellVocabulary(term=None, **kwargs)[source]

Bases: ControlledVocabulary

BioPAX CellVocabulary.

class pybiopax.biopax.util.CellularLocationVocabulary(term=None, **kwargs)[source]

Bases: ControlledVocabulary

BioPAX CellularLocationVocabulary.

class pybiopax.biopax.util.ChemicalConstant(ionic_strength=None, ph=None, p_mg=None, tempterature=None, **kwargs)[source]

Bases: UtilityClass

BioPAX ChemicalConstant.

ionic_strength
Type

float

ph
Type

float

p_mg
Type

float

temperature
Type

float

class pybiopax.biopax.util.ChemicalStructure(structure_format=None, structure_data=None, **kwargs)[source]

Bases: UtilityClass

BioPAX ChemicalStructure.

structure_format
Type

str

structure_data
Type

str

class pybiopax.biopax.util.ControlledVocabulary(term=None, **kwargs)[source]

Bases: UtilityClass, XReferrable

BioPAX ControlledVocabulary.

term
Type

List[str]

class pybiopax.biopax.util.DeltaG(delta_g_prime0=None, **kwargs)[source]

Bases: ChemicalConstant

BioPAX DeltaG.

delta_g_prime
Type

float

class pybiopax.biopax.util.DnaReference(sub_region=None, **kwargs)[source]

Bases: NucleicAcidReference

BioPAX DnaReference.

property name

All names associated with the object including the standard and display name, if available.

class pybiopax.biopax.util.DnaRegionReference(absolute_region=None, region_type=None, **kwargs)[source]

Bases: NucleicAcidRegionReference

BioPAX DnaRegionReference.

property name

All names associated with the object including the standard and display name, if available.

class pybiopax.biopax.util.EntityFeature(owner_entity_reference=None, feature_location=None, member_feature=None, feature_location_type=None, **kwargs)[source]

Bases: UtilityClass, Observable

BioPAX UtilityClass.

owner_entity_reference
Type

EntityReference

feature_location
Type

SequenceLocation

member_feature
Type

List[EntityFeature]

feature_location_type
Type

SequenceRegionVocabulary

class pybiopax.biopax.util.EntityReference(entity_feature=None, entity_reference_type=None, member_entity_reference=None, owner_entity_reference=None, **kwargs)[source]

Bases: UtilityClass, Named, Observable

BioPAX EntityReference.

entity_feature
Type

List[EntityFeature]

entity_reference_type
Type

List[EntityReferenceTypeVocabulary]

member_entity_reference
Type

List[EntityReference]

owner_entity_reference
Type

List[EntityReference]

property name

All names associated with the object including the standard and display name, if available.

class pybiopax.biopax.util.EntityReferenceTypeVocabulary(term=None, **kwargs)[source]

Bases: ControlledVocabulary

BioPAX EntityReferenceTypeVocabulary.

class pybiopax.biopax.util.Evidence(confidence=None, evidence_code=None, experimental_form=None, **kwargs)[source]

Bases: UtilityClass, XReferrable

BioPAX Evidence.

confidence
Type

List[Score]

evidence_code
Type

List[EvidenceCodeVocabulary]

experimental_form
Type

List[ExperimentalForm]

class pybiopax.biopax.util.EvidenceCodeVocabulary(term=None, **kwargs)[source]

Bases: ControlledVocabulary

BioPAX EvidenceCodeVocabulary.

class pybiopax.biopax.util.ExperimentalForm(experimental_form_entity=None, experimental_form_description=None, experimental_feature=None, **kwargs)[source]

Bases: UtilityClass

BioPAX ExperimentalForm.

experimental_form_entity
Type

Entity

experimental_form_description
Type

List[ExperimentalFormVocabulary]

experimental_feature
Type

List[EntityFeature]

class pybiopax.biopax.util.ExperimentalFormVocabulary(term=None, **kwargs)[source]

Bases: ControlledVocabulary

BioPAX ExperimentalFormVocabulary.

class pybiopax.biopax.util.FragmentFeature(owner_entity_reference=None, feature_location=None, member_feature=None, feature_location_type=None, **kwargs)[source]

Bases: EntityFeature

BioPAX FragmentFeature.

class pybiopax.biopax.util.InteractionVocabulary(term=None, **kwargs)[source]

Bases: ControlledVocabulary

BioPAX InteractionVocabulary.

class pybiopax.biopax.util.KPrime(k_prime, **kwargs)[source]

Bases: ChemicalConstant

BioPAX KPrime.

k_prime
Type

float

class pybiopax.biopax.util.ModificationFeature(modification_type=None, **kwargs)[source]

Bases: EntityFeature

BioPAX ModificationFeature.

modification_type
Type

SequenceModificationVocabulary

class pybiopax.biopax.util.NucleicAcidReference(sub_region=None, **kwargs)[source]

Bases: SequenceEntityReference

BioPAX NucleicAcidReference

sub_region
Type

List[NucleicAcidRegionReference]

property name

All names associated with the object including the standard and display name, if available.

class pybiopax.biopax.util.NucleicAcidRegionReference(absolute_region=None, region_type=None, **kwargs)[source]

Bases: NucleicAcidReference

BioPAX NucleicAcidRegionReference

absolute_region
Type

SequenceLocation

region_type
Type

List[SequenceRegionVocabulary]

property name

All names associated with the object including the standard and display name, if available.

class pybiopax.biopax.util.PathwayStep(step_process=None, next_step=None, **kwargs)[source]

Bases: UtilityClass, Observable

BioPAX PathwayStep.

step_process
Type

List[Process]

next_step
Type

List[Process]

class pybiopax.biopax.util.PhenotypeVocabulary(term=None, **kwargs)[source]

Bases: ControlledVocabulary

BioPAX PhenotypeVocabulary.

class pybiopax.biopax.util.ProteinReference(organism=None, sequence=None, **kwargs)[source]

Bases: SequenceEntityReference

BioPAX ProteinReference.

property name

All names associated with the object including the standard and display name, if available.

class pybiopax.biopax.util.Provenance(**kwargs)[source]

Bases: UtilityClass, Named

BioPAX Provenance.

property name

All names associated with the object including the standard and display name, if available.

class pybiopax.biopax.util.PublicationXref(title=None, url=None, source=None, author=None, year=None, **kwargs)[source]

Bases: Xref

BioPAX PublicationXref.

title
Type

str

url
Type

List[str]

source
Type

List[str]

author
Type

List[str]

year
Type

int

class pybiopax.biopax.util.RelationshipTypeVocabulary(term=None, **kwargs)[source]

Bases: ControlledVocabulary

BioPAX RelationshipTypeVocabulary.

class pybiopax.biopax.util.RelationshipXref(relationship_type=None, **kwargs)[source]

Bases: Xref

BioPAX RelationshipXref.

relationship_type
Type

RelationshipTypeVocabulary

class pybiopax.biopax.util.RnaReference(sub_region=None, **kwargs)[source]

Bases: NucleicAcidReference

BioPAX RnaReference.

property name

All names associated with the object including the standard and display name, if available.

class pybiopax.biopax.util.RnaRegionReference(absolute_region=None, region_type=None, **kwargs)[source]

Bases: NucleicAcidRegionReference

BioPAX RnaRegionReference.

property name

All names associated with the object including the standard and display name, if available.

class pybiopax.biopax.util.Score(score_source=None, value=None, **kwargs)[source]

Bases: UtilityClass, XReferrable

BioPAX Score.

score_source
Type

Provenance

value
Type

str

class pybiopax.biopax.util.SequenceEntityReference(organism=None, sequence=None, **kwargs)[source]

Bases: EntityReference

BioPAX SequenceEntityReference.

organism
Type

BioSource

sequence
Type

str

property name

All names associated with the object including the standard and display name, if available.

class pybiopax.biopax.util.SequenceInterval(sequence_interval_begin=None, sequence_interval_end=None, **kwargs)[source]

Bases: SequenceLocation

BioPAX SequenceInterval.

sequence_interval_begin
Type

SequenceSite

sequence_interval_end
Type

SequenceSite

class pybiopax.biopax.util.SequenceLocation(region_type=None, **kwargs)[source]

Bases: UtilityClass

BioPAX SequenceLocation.

region_type
Type

List[SequenceRegionVocabulary]

class pybiopax.biopax.util.SequenceModificationVocabulary(term=None, **kwargs)[source]

Bases: ControlledVocabulary

BioPAX SequenceModificationVocabulary.

class pybiopax.biopax.util.SequenceRegionVocabulary(term=None, **kwargs)[source]

Bases: ControlledVocabulary

BioPAX SequenceRegionVocabulary.

class pybiopax.biopax.util.SequenceSite(position_status=None, sequence_position=None, **kwargs)[source]

Bases: SequenceLocation

BioPAX SequenceSite.

position_status
Type

str

sequence_position
Type

int

class pybiopax.biopax.util.SmallMoleculeReference(structure=None, chemical_formula=None, molecular_weight=None, **kwargs)[source]

Bases: EntityReference

BioPAX SmallMoleculeReference.

structure
Type

ChemicalStructure

chemical_formula
Type

str

molecular_weight
Type

float

property name

All names associated with the object including the standard and display name, if available.

class pybiopax.biopax.util.Stoichiometry(stoichiometric_coefficient=None, physical_entity=None, **kwargs)[source]

Bases: UtilityClass

BioPAX Stoichiometry.

stoichiometric_coefficient
Type

float

physical_entity
Type

PhysicalEntity

class pybiopax.biopax.util.TissueVocabulary(term=None, **kwargs)[source]

Bases: ControlledVocabulary

BioPAX TissueVocabulary.

class pybiopax.biopax.util.UnificationXref(db=None, id=None, db_version=None, id_version=None, **kwargs)[source]

Bases: Xref

BioPAX UnificationXref.

class pybiopax.biopax.util.UtilityClass(uid, comment=None, **kwargs)[source]

Bases: BioPaxObject

BioPAX UtilityClass.

class pybiopax.biopax.util.Xref(db=None, id=None, db_version=None, id_version=None, **kwargs)[source]

Bases: UtilityClass

BioPAX Xref.

db
Type

str

id
Type

str

db_version
Type

str

id_version
Type

str

Pathway Commons client

A client to the PathwayCommons REST API. For more details about the service, see the documentation at https://www.pathwaycommons.org/pc2/.

pybiopax.pc_client.graph_query(kind, source, target=None, **query_params)[source]

Perform a graph query on PathwayCommons.

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 OWL string that can then be deserialized into a BioPaxModel.

Return type

str

Path finding

This module implements finding paths in a BioPaxModel starting from a given object using a path constraint string.

exception pybiopax.paths.BiopaxClassConstraintError(cls_str)[source]

Bases: KeyError

pybiopax.paths.find_objects(start_obj, path_str)[source]

Return objects matching the given path specification.

Parameters
  • start_obj (BioPaxObject) – The object to start the search from.

  • path_str (str) – A path specification string which consists of one or more parts separated by /. Each part is the name of an object attribute, and can optionally contain a class name as well, separated by : to constrain the class of the target of the attribute to consider. Optionally, each attribute can also have a * suffix to make the search recursive.

Return type

List[BioPaxObject]

Returns

A list of BioPaxObjects satisfying the given path specification.

XML/OWL processing utilities

pybiopax.xml_util.camel_to_snake(txt)[source]

Return snake case from camel case

pybiopax.xml_util.get_attr_tag(element)[source]

Return the tag of an element as an attribute name.

pybiopax.xml_util.get_datatype(attrib)[source]

Return the RDF data type of an element attribute.

pybiopax.xml_util.get_id_or_about(element)[source]

Return the ID or the about associated with an element

pybiopax.xml_util.get_ns(element)[source]

Return the name space of a given element.

pybiopax.xml_util.get_resource(attrib)[source]

Return the resource associated with an element attribute.

pybiopax.xml_util.get_tag(element)[source]

Return the tag of an element.

pybiopax.xml_util.has_ns(element, ns)[source]

Return True if the element is from a given name space.

pybiopax.xml_util.is_datatype(attrib, prefix, datatype)[source]

Return True of the given attribute is of a given type.

pybiopax.xml_util.is_url(txt)[source]

Return true if the given string is an URL.

pybiopax.xml_util.nselem(ns, elem)[source]

Return a full namespaced string with curly brackets with a suffix.

pybiopax.xml_util.nssuffix(ns, suffix)[source]

Return a full namespaced string with a suffix.

pybiopax.xml_util.snake_to_camel(txt)[source]

Return camel case from snake case.

pybiopax.xml_util.wrap_xml_elements(elements, xml_base)[source]

Return a valid BioPAX OWL wrapping XML-serialized BioPAX objects.

pybiopax.xml_util.xml_to_file(xml, fname)[source]

Write an XML element tree to a given file.

pybiopax.xml_util.xml_to_str(xml)[source]

Return the OWL string for an XML element tree.