Binding

Bindings store two sequences and a compact two-strand dot-bracket structure. ( and ) mark paired positions, . marks unpaired positions, and & separates the strands, as in ViennaRNA. For example, (((&))) pairs three bases on each strand. Binding.pairs interprets the structure as zero-based, antiparallel indices; Binding.from_pairs performs the reverse conversion. Candidate bindings reference a therapeutic and a target site by their endpoint IDs. An siRNA owns a guide-passenger binding and needs no endpoint IDs. Bindings are immutable after creation.

class ASOkai.Antisense.BasePair(first_index, second_index)[source]

Bases: object

Zero-based indices into two sequences stored 5’ to 3’.

Parameters:
  • first_index (int)

  • second_index (int)

first_index: int
second_index: int
class ASOkai.Antisense.Binding(first_sequence, second_sequence, structure, *, first_id=None, second_id=None)[source]

Bases: Serializable

Two sequences and their antiparallel dot-bracket alignment.

structure uses ( for paired positions on the first strand, ) for paired positions on the second, . for unpaired positions, and & between strands. IDs link independent bindings to their source records; an siRNA-owned binding has no endpoint IDs.

Parameters:
  • first_sequence (Seq)

  • second_sequence (Seq)

  • structure (str)

  • first_id (str | None)

  • second_id (str | None)

first_sequence: Seq
second_sequence: Seq
structure: str
first_id: str | None
second_id: str | None
property pairs: tuple[BasePair, ...]

Interpret the compact structure as ordered antiparallel pairs.

classmethod from_pairs(first_sequence, second_sequence, pairs, *, first_id=None, second_id=None)[source]

Encode ordered antiparallel base-pair indices as dot-bracket.

Parameters:
  • first_sequence (Seq)

  • second_sequence (Seq)

  • pairs (Sequence[BasePair])

  • first_id (str | None)

  • second_id (str | None)

Return type:

Binding

classmethod from_complementary_sequences(first_sequence, second_sequence, *, first_id=None, second_id=None)[source]

Pair every base of two reverse-complementary sequences.

Parameters:
  • first_sequence (Seq)

  • second_sequence (Seq)

  • first_id (str | None)

  • second_id (str | None)

Return type:

Binding

File contract

This is the JSON record ASOkai stores for Binding. A JSON file has a root value and an objects table. Objects used once are inline; repeatedly used objects move to the table and are linked by references. Nested records follow their own class contracts.

The __class__ and __module__ fields identify the object type. ASOkai adds them when writing JSON; keep the fixed values shown below when supplying an input file yourself.

Example file

{
    "root": {
        "__class__": "Binding",
        "__module__": "ASOkai.Antisense._binding",
        "first_sequence": "A",
        "second_sequence": "T",
        "structure": "(&)",
        "first_id": "aso:example",
        "second_id": "site:example"
    },
    "objects": {}
}

Fields

JSON field

Details

__class__

Accepted value: "Binding"

Requirement: Required; keep unchanged in input files

Meaning: Identifies this JSON object as Binding. ASOkai writes it automatically.

__module__

Accepted value: "ASOkai.Antisense._binding"

Requirement: Required; keep unchanged in input files

Meaning: Tells ASOkai where Binding is defined. ASOkai writes it automatically.

first_sequence

Accepted value: string

Requirement: Required

Example: "A"

Meaning: First sequence.

second_sequence

Accepted value: string

Requirement: Required

Example: "A"

Meaning: Second sequence.

structure

Accepted value: string

Requirement: Required

Meaning: Two-strand dot-bracket structure.

first_id

Accepted value: string or null

Requirement: Required

Example: null

Meaning: First source ID, if this binding is stored independently.

second_id

Accepted value: string or null

Requirement: Required

Example: null

Meaning: Second source ID, if this binding is stored independently.