Skip to main content

Crate pombase_gocam

Crate pombase_gocam 

Source
Expand description

A library for parsing and processing GO-CAM JSON format model files

GoCamModel is a high level representation, implemented as a graph of nodes (activities, chemical, complexes etc.) and edges (mostly causal relations).

See gocam_py for a lower level representation that’s more similar to the GO CAM Data Model - gocam-py.

§Example

use std::fs::File;
use pombase_gocam::gocam_py::gocam_py_parse;
use pombase_gocam::{GoCamModel, GoCamNodeType, GoCamActivity};

let mut source = File::open("tests/data/66c7d41500000963.yaml").unwrap();

// Low level representation:
let gocam_py_model = gocam_py_parse(&mut source).unwrap();
assert_eq!(gocam_py_model.id, "gomodel:66c7d41500000963");

// High level representation:
let model = GoCamModel::new_from_gocam_py(gocam_py_model);

for (_, node) in model.node_iterator() {
    println!("node: {}", node);
    if let GoCamNodeType::Activity(GoCamActivity { ref enabler, inputs: _, outputs: _ }) = node.node_type {
        println!("enabler ID: {}", enabler.id());
    }
}

Modules§

gocam_py
Functions for parsing gocam-py models.
graph
Graph algorithms
overlaps
Functions for calculating model overlaps
raw
The module contains code for reading the low-level JSON representation of GO-CAM models.

Structs§

EdgeIterator
An iterator over GoCamEdge returned by GoCamModel::edge_iterator()
GoCamActivity
GoCamChemical
A chemical which will be the input, output or enabler of an activity
GoCamComplex
A complex can have a GO complex ID (from the CC GO aspect) or a Complex Portal ID
GoCamComplexComponent
The component for the ComplexComponent variant of GoCamComponent
GoCamEdge
An edge in the model - a causal relation between two activities.
GoCamGene
A gene in a GoCamNode, possibly enabling an activity
GoCamGeneDetails
GoCamInput
The has_input of an activity
GoCamMRNA
An mRNA - either an input/output or the enabler of an activity
GoCamModel
A high level representation of the model with nodes for activities, chemicals, complexes etc. and edges for causal dependencies between nodes/activities.
GoCamModifiedProtein
A PRO modified protein in a node, possibly enabling an activity
GoCamNode
A gene, chemical, complex or modified protein OR an activity (enabled by gene, chemical, complex or modified protein). These fields more or less match Figure 1 in the GO-CAM paper except for:
GoCamOtherComponent
The component for the OtherComponent variant of GoCamComponent
GoCamOutput
The has_output of an activity
GoCamProcess
A GO biological process
NodeIterator
An iterator over GoCamNode, returned by GoCamModel::node_iterator()

Enums§

GoCamComponent
A complex or a GO cellular component
GoCamDirection
GoCamEnabledBy
An enabler of an activity
GoCamError
GoCamMergeAlgorithm
GoCamNodeType
The type of a node in a GoCamModel
RemoveType

Constants§

BIOLOGICAL_PROCESS_ID
CELLULAR_COMPONENT_ID
MOLECULAR_FUNCTION_ID
PRO_PROTEIN_ID

Statics§

REL_NAMES
A map of edge relation term IDs to term names. Example: “RO:0002211” => “regulates”,

Functions§

parse_gocam_py_model
parse_raw_gocam_model
Read from a JSON source and return a GoCamModel.

Type Aliases§

GoCamGeneIdentifier
A gene ID with DB prefix, like “PomBase:SPAC9E9.05”
GoCamGeneName
A gene name like “cdc2”
GoCamGraph
The Graph representation of a GO-CAM model. See: GoCamModel::graph()
GoCamModelId
GoCamModelIdTitle
GoCamModelResult
GoCamModelTitle
TermId