Skip to content
This repository has been archived by the owner on Aug 19, 2020. It is now read-only.

Commit

Permalink
added notes from genome api discussion
Browse files Browse the repository at this point in the history
  • Loading branch information
dangunter committed May 27, 2015
1 parent 76bffad commit ed5c240
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 0 deletions.
40 changes: 40 additions & 0 deletions genome_api_notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Genome API

Data model

+-------+ +--------+ +-------------+
| Genome+-> |Features+-->+Feature +-+----->Amino+acid
+----+--+ +--------+ |sequences | |
| +------+------+ |
| | +----->DNA
| |
+---+-------+ |
| ContigSet +<-----------------+
+-----------+ position info

## Taxonomy

* lineage - list of descriptors
* taxonomy - string
* taxonomic id - string

## Sequence

* get_contig(id, start?, stop?, strand?)
* list of contigs
* list of DNA or AA features, e.g. get_feature_dna(feature_id)

## Annotation

???

## Metadata

* quality score. multidimensional
* circular (true, false, unknown)
* type: 'draft' or 'finished'
* reference
* date of origination
* external resource (see identifiers)
* percent assembled
* number of contigs
29 changes: 29 additions & 0 deletions src/data_api/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,32 @@ class DataModel(SearchableData):
"""
pass

"""
WIP
"""
from .semantics import Type

class Node(object):
def __init__(self, type_=None):
"""
:type type_: Type
"""
self._type = type_

def get(self, subset=()):
"""Projection operator."""
return [getattr(self, name) for name in subset]

def find_related(self, node_type=None, edge_type=None,
node_filter=None, edge_filter=None, max_depth=0):
"""Find all related nodes of type `node_type` that are related
by edges of type `edge_type`. Filter nodes and edges according to
values in `node_filter` and `edge_filter`.
Look `max_depth` nodes away from the origin, with values <= 0
meaning no limit.
:return: List of Node
"""
pass


0 comments on commit ed5c240

Please sign in to comment.