From: Diane Trout Date: Thu, 27 Jul 2006 02:21:39 +0000 (+0000) Subject: update gl.py to show how to add an annotation X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=mussa.git;a=commitdiff_plain;h=ad241c53520a2bec89b837b22417d5dd46173ee2 update gl.py to show how to add an annotation --- diff --git a/py/gl.py b/py/gl.py index 450b1bd..a068a41 100644 --- a/py/gl.py +++ b/py/gl.py @@ -13,10 +13,15 @@ class pyMussaGL: # make up a simple sequence self.s = "AAGGCCTT" * 5 self.seq = mussa.Sequence(self.s) + + # add our annotation + annot = mussa.annot(0, 5, "name", "type") + self.seq.add_annotation(annot) + # AnnotationColors is required, even though it'd be nice # if it were optional self.glseq = mussa.GlSequence(self.seq, mussa.AnnotationColors()) - assert len(self.s) == self.glseq.length + assert len(self.s) == self.glseq.size # set up opengl buffer glutInit(sys.argv) diff --git a/py/glsequence.cpp b/py/glsequence.cpp index d736920..ea456eb 100644 --- a/py/glsequence.cpp +++ b/py/glsequence.cpp @@ -19,6 +19,6 @@ void export_glsequence() return_internal_reference<>()) .add_property("x", &GlSequence::x, &GlSequence::setX) .add_property("y", &GlSequence::y, &GlSequence::setY) - .add_property("__len__", &GlSequence::size) + .add_property("size", &GlSequence::size) ; }