API Overview

PyProBound distinguishes between experiment-specific and experiment-independent parameters. For example, the positional dependency of binding along the length of a sequence is experiment-specific, whereas the sequence parameters in a PSAM should be independent of a specific experimental design. The experiment-independent parameters are organized into a LayerSpec object, which is then wrapped into a Layer object that adds the experiment-specific parameters and implements that layer’s calculation in its forward function.

A single Mode can contain multiple Layer s, which are applied sequentially as in torch.nn.Sequential.

Each Mode is then joined with a round-specific log_activity parameter in a Contribution object. Multiple Contribution s can then be combined in an Aggregate object, which is used for calculating \(Z_{i,r}\) as described in the User Guide.

An overview of the different classes and their attributes and types is shown below.

Additionally, most objects inherit from Component. This object contains functions for checkpointing parameters to a file, freezing and unfreezing parameters, implementing the sequential optimization procedure recursively, and caching the output of a component to avoid recomputation if it appears multiple times in the architecture of a model.

PyProBound class diagram