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§
- GoCam
Activity - GoCam
Chemical - A chemical which will be the input, output or enabler of an activity
- GoCam
Complex - A complex can have a GO complex ID (from the CC GO aspect) or a Complex Portal ID
- GoCam
Complex Component - The component for the ComplexComponent variant of GoCamComponent
- GoCam
Edge - An edge in the model - a causal relation between two activities.
- GoCam
Gene - A gene in a GoCamNode, possibly enabling an activity
- GoCam
Input - The
has_inputof an activity - GoCamMRNA
- An mRNA - either an input/output or the enabler of an activity
- GoCam
Model - A high level representation of the model with nodes for activities, chemicals, complexes etc. and edges for causal dependencies between nodes/activities.
- GoCam
Modified Protein - A PRO modified protein in a node, possibly enabling an activity
- GoCam
Node - 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:
- GoCam
Node Overlap - An overlap returned by GoCamModel::find_overlaps()
- GoCam
Other Component - The component for the OtherComponent variant of GoCamComponent
- GoCam
Output - The
has_outputof an activity - GoCam
Process - A GO biological process
- Node
Iterator - An iterator over GoCamNode, returned by GoCamModel::node_iterator()
Enums§
- GoCam
Component - A complex or a GO cellular component
- GoCam
Direction - GoCam
Enabled By - An enabler of an activity
- GoCam
Node Type - The type of a node in a GoCamModel
- Remove
Type
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§
- GoCam
Gene Identifier - A gene ID with DB prefix, like “PomBase:SPAC9E9.05”
- GoCam
Gene Name - A gene name like “cdc2”
- GoCam
Graph - The Graph representation of a GO-CAM model. See: GoCamModel::graph()
- GoCam
Model Id - GoCam
Model IdTitle - GoCam
Model Title