Package: camelot-frs
Camelot: A Pythonic Frame Representation SystemCamelot is a Frame Representation System (FRS) for Python. It is
inspired by the Ocelot FRS which powers the Pathway Tools software
from SRI International's Bioinformatcs Research Group. Thus, it is
called 'Camelot' as a Pythonic Ocelot.Current CapabilitiesSlot annotationsTransitive Closure for is-a (i.e., subsumption) and part-of relationshipsSupports the import of KBs in the attribute-value format of
Pathway/Genome Databases as generated by Pathway ToolsImplementation of select functions from the Pathway Tools APIEnrichment AnalysisPlanned CapabilitiesVisualization of Ontology structure using GraphVizTies to BioPython for handling sequence dataSupport data loaders for GO, ENZYME, NCBI Taxonomy DB, and UniProtHow to BuildRun the following at the top of the package repository:make clean-package
make create-packageHow to InstallCamelot FRS is released as a Python package. It can easily be
installed using FIXME.To manually install the package from the Git repository, do the
following at the top-level of the repository:make install-packageFor development purposes, the following will install an 'editable'
version of the package:make install-dev-packageA Simple Tutorial## Import Camelot functions for working with ontology:
from camelot_frs.pgdb_loader import load_pgdb
from camelot_frs.pgdb_api    import reactions_of_compound
from camelot_frs.camelot_frs import get_kb, get_frame, get_frames, get_frame_all_parents, get_frame_all_children

## Load MetaCyc:
load_pgdb("/home/ubuntu/data/metacyc/23.1/data")

## Assign the MetaCyc Knowledge Base (KB) to a variable:
metaKB = get_kb('META')

### Find all reactions of 'ACET':

## Get the frame for acetic acid:
acet = get_frame(metaKB, 'ACET')

## Get all reactions that directly 

## Get all reactions that indirectly consume acetic acid:
## (Either an instance or sub-class or a super-class of acetic acid is consumed in the reaction)
indirect_rxns = reactions_of_compound(acet, generic_rxns_p=True, consumed_p=True)A Tutorial using MetaCycDesign DecisionsFrom my years of experience working with the Ocelot DB, I had some
definite opinions about how to design the user experience with Camelot. The
following is a summary of some of these decisions:All KBs and frames are objectsThere are no symbol-equivalent representations of KBs or framesSince a user has to deal with objects directly, objects have a
rational and human-readable display form, such as 'frame:proton' for
a proton object, rather than '(Python object 0x399823498)'Since all frames are represented as objects, each object points
specifically to the KB that it comes from (and every KB has a link
to the frames it contains). Only frame look-up functions require the
KB as a co-argument. This greatly simplifies the code.KB-agnostic code is kept strictly separate from KB-specific code
(e.g., the PGDB Loader)Core algorithms for processing ontology datastructures are separated
out from the 'business logic'Instead of having separate functions for dealing with classes versus
instances, functions are written to be as generic as possible, and
named arguments are optional for specifying between them (e.g.,get_frame_all_childrencan specify optionally to return only
classes, only instances, or both, which is the default)All slots are lists, even if they usually only have a single valueAccessing a non-existent slot throws an error. Schema violations
should cause code to fail and fail early