Skip to contents

A cycle in the composition graph is a set of GIFTs whose declared anchors close a ring: each member's output boundary is the next member's input boundary, and the last returns to the first. The oxidative citric acid cycle is one, and nothing about it is curated – it follows from four boundary declarations. Compare [gift_graph()], which returns the edges this is derived from.

Usage

gift_cycles(db = NULL, limit = 100L)

Arguments

db

Optional open gifter database connection.

limit

Maximum number of cycles to enumerate. Elementary-cycle enumeration is exponential in the worst case, so the search stops at this many and warns rather than running unbounded.

Value

A tibble with one row per member of each cycle: `cycle_id`, `cycle_length`, `position`, `gift_id`, `shared_anchor` – the anchor through which this member reaches the next – and `named_cycle`.

Details

A cycle is a statement about curated boundaries, not about any genome. Use [evaluate_gift_cycles()] to ask whether a particular genome closes one.

Two loops are excluded because the mode makes them rather than the chemistry: a two-node loop between `interconversion` GIFTs, which that mode's boundary contract produces by construction, and any ring containing both an `anabolic` and a `catabolic` member, which says that a genome can both build a metabolite and break it down. Composition is expected to cycle between modes, which is why the source validator checks acyclicity per mode, so neither loop is circular metabolism.

`named_cycle` is the value of the `metabolic_cycle` facet shared by every member, and `NA` when the members share none. Naming is the only curated part of a cycle; membership and shape are derived, so the two cannot disagree.

Examples

cycles <- gift_cycles()
unique(cycles[, c("cycle_id", "cycle_length", "named_cycle")])
#> # A tibble: 2 × 3
#>   cycle_id cycle_length named_cycle                
#>      <int>        <int> <chr>                      
#> 1        1            4 glyoxylate_cycle           
#> 2        2            5 citric_acid_cycle_oxidative