Skip to main content

A frame representation system in Python.

Project description

Camelot: A Pythonic Frame Representation System

Camelot 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 Capabilities

  • Slot annotations

  • Transitive Closure for is-a (i.e., subsumption) and part-of relationships

  • Supports the import of KBs in the attribute-value format of Pathway/Genome Databases as generated by Pathway Tools

  • Implementation of select functions from the Pathway Tools API

  • Enrichment Analysis

Planned Capabilities

  • Visualization of Ontology structure using GraphViz

  • Ties to BioPython for handling sequence data

  • Support data loaders for GO, ENZYME, NCBI Taxonomy DB, and UniProt

How to Build

Run the following at the top of the package repository:

make clean-package
make create-package

How to Install

Camelot 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-package

For development purposes, the following will install an 'editable' version of the package:

make install-dev-package

A 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 MetaCyc

Design Decisions

From 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 objects
  • There are no symbol-equivalent representations of KBs or frames
  • Since 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_children can 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 value
  • Accessing a non-existent slot throws an error. Schema violations should cause code to fail and fail early

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

camelot_frs-0.0.2.tar.gz (17.9 kB view details)

Uploaded Source

Built Distribution

camelot_frs-0.0.2-py3-none-any.whl (24.5 kB view details)

Uploaded Python 3

File details

Details for the file camelot_frs-0.0.2.tar.gz.

File metadata

  • Download URL: camelot_frs-0.0.2.tar.gz
  • Upload date:
  • Size: 17.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.7.6

File hashes

Hashes for camelot_frs-0.0.2.tar.gz
Algorithm Hash digest
SHA256 dfd3fb803dd1b52d929829b50696226b44a2187e710aecc29e227c3c3c18e459
MD5 4d9eb84faef85b055ef1fb739ef608cc
BLAKE2b-256 2e0daf20ea8425d45932d52eed9f17c1793e31ed41a320ae9b7447f1c22bfa01

See more details on using hashes here.

File details

Details for the file camelot_frs-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: camelot_frs-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 24.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.7.6

File hashes

Hashes for camelot_frs-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e0c33a04451acd8b3b8eed692f3565b72bb7dc0e6c2f82cbbab7ac18eabb079d
MD5 c751308d85808038d28c35d3d59db2dd
BLAKE2b-256 8dec4a67e1348108a7eba59934bf5a3c57976784c97db4b244d0793920c637fc

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page