# Bio.Pathway package

## Subpackages

- Bio.Pathway.Rep package
  - Submodules
    - Bio.Pathway.Rep.Graph module
      - `Graph`
    - Bio.Pathway.Rep.MultiGraph module
      - `MultiGraph`
      - `df_search()`
      - `bf_search()`
  - Module contents

## Module contents

BioPython Pathway module.

Bio.Pathway is a lightweight class library designed to support the following tasks:

> - Data interchange and preprocessing between pathway databases and analysis software.

> - Quick prototyping of pathway analysis algorithms

The basic object in the Bio.Pathway model is Interaction, which represents an arbitrary interaction between any number of biochemical species.

Network objects are used to represent the connectivity between species in pathways and reaction networks.

For applications where it is not necessary to explicitly represent network connectivity, the specialized classes Reaction and System should be used in place of Interacton and Network.

The Bio.Pathway classes, especially Interaction, are intentionally designed to be very flexible. Their intended use are as wrappers around database specific records, such as BIND objects. The value-added in this module is a framework for representing collections of reactions in a way that supports graph theoretic and numeric analysis.

Note: This module should be regarded as a prototype only. API changes are likely.

  Comments and feature requests are most welcome.

class Bio.Pathway.Reaction(reactants=None, catalysts=(), reversible=0, data=None)

  Bases: `object`

  Abstraction for a biochemical transformation.

  This class represents a (potentially reversible) biochemical transformation of the type:

      a S1 + b S2 + ... --> c P1 + d P2 + ...

  where:

    - a, b, c, d … are positive numeric stochiometric coefficients,

    - S1, S2, … are substrates

    - P1, P2, … are products

  A Reaction should be viewed as the net result of one or more individual reaction steps, where each step is potentially facilitated by a different catalyst. Support for ‘Reaction algebra’ will be added at some point in the future.

  Attributes:

    - reactants – dict of involved species to their stochiometric coefficients: reactants[S] = stochiometric constant for S

    - catalysts – list/tuple of tuples of catalysts required for this reaction

    - reversible – true iff reaction is reversible

    - data – reference to arbitrary additional data

  Invariants:

    - for all S in reactants: reactants[S] != 0

    - for all C in catalysts: catalysts[C] != 0

  __init__(reactants=None, catalysts=(), reversible=0, data=None)

    Initialize a new Reaction object.

  __eq__(r)

    Return true iff self is equal to r.

  __hash__()

    Return a hashcode for self.

  __repr__()

    Return a debugging string representation of self.

  __str__()

    Return a string representation of self.

  reverse()

    Return a new Reaction that is the reverse of self.

  species()

    Return a list of all Species involved in self.

  __annotate_func__ = None
  __annotations_cache__ = {}
  __firstlineno__ = 41
  __static_attributes__ = ('catalysts', 'data', 'reactants', 'reversible')

class Bio.Pathway.System(reactions=())

  Bases: `object`

  Abstraction for a collection of reactions.

  This class is used in the Bio.Pathway framework to represent an arbitrary collection of reactions without explicitly defined links.

  Attributes:

    - None

  __init__(reactions=())

    Initialize a new System object.

  __repr__()

    Return a debugging string representation of self.

  __str__()

    Return a string representation of self.

  add_reaction(reaction)

    Add reaction to self.

  remove_reaction(reaction)

    Remove reaction from self.

  reactions()

    Return a list of the reactions in this system.

    Note the order is arbitrary!

  species()

    Return a list of the species in this system.

  stochiometry()

    Compute the stoichiometry matrix for self.

    Returns (species, reactions, stoch) where:

      - species = ordered list of species in this system

      - reactions = ordered list of reactions in this system

      - stoch = 2D array where stoch[i][j] is coef of the jth species in the ith reaction, as defined by species and reactions above

  __annotate_func__ = None
  __annotations_cache__ = {}
  __firstlineno__ = 151
  __static_attributes__ = ('__reactions',)

class Bio.Pathway.Interaction

  Bases: `object`

  An arbitrary interaction between any number of species.

  This class definition is intended solely as a minimal wrapper interface that should be implemented and extended by more specific abstractions.

  Attributes:

    - data – reference to arbitrary additional data

  __hash__()

    Return a hashcode for self.

  __repr__()

    Return a debugging string representation of self.

  __str__()

    Return a string representation of self.

  __annotate_func__ = None
  __annotations_cache__ = {}
  __firstlineno__ = 229
  __static_attributes__ = ('data',)

class Bio.Pathway.Network(species=())

  Bases: `object`

  A set of species that are explicitly linked by interactions.

  The network is a directed multigraph with labeled edges. The nodes in the graph are the biochemical species involved. The edges represent an interaction between two species, and the edge label is a reference to the associated Interaction object.

  Attributes:

    - None

  __init__(species=())

    Initialize a new Network object.

  __repr__()

    Return a debugging string representation of this network.

  __str__()

    Return a string representation of this network.

  add_species(species)

    Add species to this network.

  add_interaction(source, sink, interaction)

    Add interaction to this network.

  source(species)

    Return list of unique sources for species.

  source_interactions(species)

    Return list of (source, interaction) pairs for species.

  sink(species)

    Return list of unique sinks for species.

  sink_interactions(species)

    Return list of (sink, interaction) pairs for species.

  species()

    Return list of the species in this network.

  __annotate_func__ = None
  __annotations_cache__ = {}
  __firstlineno__ = 256
  __static_attributes__ = ('__graph',)
  interactions()

    Return list of the unique interactions in this network.

Biopython v: 1.86

Versions
  Previous
  Latest
  Develop

Biopython Project
  Homepage
  On GitHub