Crate pombase_gocam

Crate pombase_gocam 

Source
Expand description

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

GoCamRawModel is a low level representation which closely matches the JSON data, containing Fact, Individual and Annotation structs.

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

This high level representation is somewhat similar to the GO CAM Data Model - gocam-py.

§Example

use std::fs::File;
use pombase_gocam::raw::gocam_parse_raw;

let mut source = File::open("tests/data/gomodel_66187e4700001744.json").unwrap();

// Low level representation:
let raw_model = gocam_parse_raw(&mut source).unwrap();
assert_eq!(raw_model.id(), "gomodel:66187e4700001744");

for fact in raw_model.facts() {
    let subject_id = &fact.subject;
    println!("subject_id: {}", subject_id);
    let subject_individual = raw_model.get_individual(subject_id);
    let first_type = &subject_individual.types[0];
    if let Some(ref label) = first_type.label {
        println!("type label: {}", label);
    }
}

// Higher level representation:
use pombase_gocam::{GoCamModel, GoCamNodeType, GoCamActivity};
let model = GoCamModel::new(raw_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
Code for parsing gocam-py YAML models See: https://github.com/geneontology/gocam-py
graph
Graph algorithms
raw
The module contains code for reading the low-level JSON representation of GO-CAM models.

Structs§

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
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:
GoCamNodeOverlap
An overlap returned by GoCamModel::find_overlaps()
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
GoCamNodeType
The type of a node in a GoCamModel
RemoveType

Statics§

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

Functions§

parse_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
GoCamModelTitle