all: targets
include alg/module.mk
+include alg/test/module.mk
+include py/module.mk
include gui/module.mk
-include test/module.mk
include module.mk
# process what the module.mks defined
--- /dev/null
+#include "alg/glsequence.h"
+
+#include <iostream>
+#include <cassert>
+#include <math.h>
+#include <stdexcept>
+using namespace std;
+
+GlSequence::GlSequence(const Sequence &s)
+ : seq(s),
+ seq_x(0.0),
+ seq_y(0.0),
+ seq_z(1.0),
+ seq_width(s.size()),
+ seq_height(gl_track_height)
+{
+ assert (seq.size() == seq_width);
+}
+
+GlSequence::GlSequence(const GlSequence &s)
+ : seq(s.seq),
+ seq_x(s.seq_x),
+ seq_y(s.seq_y),
+ seq_z(s.seq_z),
+ seq_width(s.seq_width),
+ seq_height(s.seq_height)
+{
+ assert (seq.size() == seq_width);
+}
+
+GlSequence &GlSequence::operator=(const GlSequence & s)
+{
+ if (this != &s) {
+ const_cast<Sequence &>(seq) = s.seq;
+ seq_x = s.seq_x;
+ seq_y = s.seq_y;
+ seq_z = s.seq_z;
+ seq_width = s.seq_width;
+ seq_height = s.seq_height;
+ }
+ return *this;
+}
+
+const Sequence& GlSequence::sequence() const
+{
+ return seq;
+}
+
+void GlSequence::setX(GLfloat value)
+{
+ seq_x = value;
+}
+
+GLfloat GlSequence::x() const
+{
+ return seq_x;
+}
+
+void GlSequence::setY(GLfloat value)
+{
+ seq_y = value;
+}
+
+GLfloat GlSequence::y() const
+{
+ return seq_y;
+}
+
+void GlSequence::setWidth(GLfloat value)
+{
+ seq_width = value;
+}
+
+GLfloat GlSequence::width() const
+{
+ return seq_width;
+}
+
+
+void GlSequence::draw(GLfloat left, GLfloat right) const
+{
+ glLineWidth(seq_height);
+ glColor3f(0.0, 0.0, 0.0);
+ // draw main sequence track
+ glBegin(GL_LINES);
+ glVertex3f(seq_x, seq_y, seq_z);
+ glVertex3f(seq_x+seq_width, seq_y, seq_z);
+ //clog << "drawing " << seq_x << " " << seq_y << " " << seq_width
+ // << std::endl;
+ glEnd();
+ // draw annotations
+ GLfloat annotation_z = seq_z + 1.0;
+ std::list<annot> annots = seq.annotations();
+ for (std::list<annot>::const_iterator annot_itor = annots.begin();
+ annot_itor != annots.end();
+ ++annot_itor, ++annotation_z)
+ {
+ glColor3f(0.0, 0.5, 0.0);
+ glBegin(GL_LINES);
+ glVertex3f(annot_itor->start, seq_y, annotation_z);
+ glVertex3f(annot_itor->end , seq_y, annotation_z);
+ glEnd();
+ }
+ draw_sequence(left, right);
+}
+
+const int PT = 1;
+const int STROKE = 2;
+const int END =3;
+
+typedef struct charpoint {
+ GLfloat x, y;
+ int type;
+} CP;
+
+CP Adata[] = {
+ {0, 0, PT}, {0, 9, PT}, {1, 10, PT}, {4, 10, PT},
+ {5, 9, PT}, {5, 0, STROKE}, {0, 5, PT}, {5, 5, END}
+};
+
+CP Tdata[] = {
+ {2.5, 0, PT}, {2.5,10, STROKE}, {0, 10, PT}, {5,10, END}
+};
+
+CP Gdata[] = {
+ {5, 9, PT}, {4, 10, PT}, {1, 10, PT}, {0, 9, PT}, {0, 1, PT},
+ {1, 0, PT}, {5, 0, PT}, {5, 4, PT}, {3.5, 4, END}
+};
+
+CP Cdata[] = {
+ {5, 8, PT}, {3, 10, PT}, {2, 10, PT}, {0, 8, PT}, {0, 2, PT},
+ {2, 0, PT}, {3, 0, PT}, {5, 2, END}
+};
+
+CP Xdata[] = {{ 0, 10, PT}, {5,0,STROKE},{0,0,PT},{5,10,END}};
+CP Ndata[] = {{ 0, 0, PT}, {0, 10, PT}, {5, 0, PT}, {5, 10, END}};
+
+static void drawLetter(CP *l)
+{
+ glBegin(GL_LINE_STRIP);
+ while(1) {
+ switch (l->type) {
+ case PT:
+ glVertex2fv(&l->x);
+ break;
+ case STROKE:
+ glVertex2fv(&l->x);
+ glEnd();
+ glBegin(GL_LINE_STRIP);
+ break;
+ case END:
+ glVertex2fv(&l->x);
+ glEnd();
+ return;
+ break;
+ default:
+ throw runtime_error("data structure failure");
+ }
+ l++;
+ }
+}
+
+void GlSequence::draw_sequence(GLfloat left, GLfloat right) const
+{
+ int viewport[4];
+ glGetIntegerv(GL_VIEWPORT, viewport);
+ int port_width = viewport[3]; // grab the viewport width
+ GLfloat world_width = right - left;
+ int left_base = (left > 0) ? (int)ceil(left) : 0;
+ int right_base = (int)floor(right);
+ int render_count = (right_base < seq.size()) ? right_base : seq.size();
+ render_count -= left_base;
+
+ glLineWidth(0.01);
+ GLfloat char_width = 1.1;
+ GLfloat pixels_needed = char_width * world_width;
+
+ cout << "seq width needed " << pixels_needed
+ << " port width " << port_width
+ << " count " << render_count
+ << " left " << left_base
+ << " right " << right_base
+ << " size " << seq.size() << endl;
+ // if the number of pixels taken up by rendering the characters
+ // that'd show up in the current ortho width is less than the window
+ // width we can actually draw something
+ if (pixels_needed < port_width and render_count > 0) {
+ cout << "rendering: ";
+ string bases = seq.subseq(left_base, render_count);
+ glColor3f(0.1, 0.1, 0.1);
+ for (string::size_type basepair = 0; basepair != bases.size(); ++basepair)
+ {
+ glPushMatrix();
+ glTranslatef( left_base + basepair, seq_y+20, 1.0 );
+ glScalef(0.1, 1.0, 1.0);
+ switch (bases[basepair]) {
+ case 'A': case 'a':
+ drawLetter(Adata);
+ break;
+ case 'T': case 't':
+ drawLetter(Tdata);
+ break;
+ case 'G': case 'g':
+ drawLetter(Gdata);
+ break;
+ case 'C': case 'c':
+ drawLetter(Cdata);
+ break;
+ case 'N': case 'n':
+ drawLetter(Ndata);
+ break;
+ default:
+ drawLetter(Xdata);
+ break;
+ }
+ cout << bases[basepair];
+ glPopMatrix();
+ }
+ cout << endl;
+ }
+}
--- /dev/null
+#ifndef _GL_SEQUENCE_H_
+#define _GL_SEQUENCE_H_
+
+#include "alg/sequence.hh"
+#include <GL/gl.h>
+
+//! Manage rendering a mussa sequence track
+/*! The idea is this will keep track of the location of where the sequence
+ * is being rendered, and handle displaying annotations on that track
+ */
+class GlSequence
+{
+public:
+ GlSequence(const Sequence & s);
+ GlSequence(const GlSequence & s);
+ GlSequence &operator=(const GlSequence &s);
+
+ //! draw a track
+ /*! left and right are the current edges of the viewable world
+ */
+ void draw(GLfloat left, GLfloat right) const;
+
+ const Sequence& sequence() const;
+ void setX(GLfloat);
+ GLfloat x() const;
+ void setY(GLfloat);
+ GLfloat y() const;
+ void setWidth(GLfloat);
+ GLfloat width() const;
+
+protected:
+ const Sequence& seq;
+ GLfloat seq_x;
+ GLfloat seq_y;
+ GLfloat seq_z;
+ GLfloat seq_width;
+ GLfloat seq_height;
+
+ //! render a sequence (if we have enough space
+ /*! left and right are the current edges of the viewable world
+ */
+ void draw_sequence(GLfloat, GLfloat) const;
+};
+
+const float gl_track_height = 10.0;
+
+#endif
+++ /dev/null
-#include <boost/test/auto_unit_test.hpp>
-#include <boost/assign/std/vector.hpp>
-using namespace boost::assign;
-
-#include <vector>
-using namespace std;
-
-#include "alg/conserved_path.h"
-
-//! write tests for our conserved path types (just to make sure they
-//! don't change on us.
-BOOST_AUTO_TEST_CASE ( conserved_path_simple )
-{
- vector<int> path;
- path += 3,4,5,1; // magic from boost assign
-
- ConservedPath cp1;
- BOOST_CHECK_EQUAL( cp1.size(), 0 ); //empty
- BOOST_CHECK( cp1.begin() == cp1.end() );
-
- cp1.score = 18;
- cp1.track_indexes = path;
- BOOST_CHECK_EQUAL( cp1.size(), path.size() );
-
- ConservedPath cp2(18, path);
- BOOST_CHECK_EQUAL (cp1, cp2);
- BOOST_CHECK_EQUAL( cp2.size(), path.size() );
-
- ConservedPath::iterator cp2_itor;
- vector<int>::iterator path_itor;
- for (cp2_itor = cp2.begin(), path_itor = path.begin();
- cp2_itor != cp2.end() && path_itor != path.end();
- ++cp2_itor, ++path_itor)
- {
- BOOST_CHECK_EQUAL( *cp2_itor, *path_itor );
- }
-
- ConservedPath cp3( cp2 );
- BOOST_CHECK_EQUAL( cp3.size(), cp2.size() );
- ConservedPath::iterator cp3_itor;
- for (cp2_itor = cp2.begin(), cp3_itor = cp3.begin();
- cp2_itor != cp2.end() && cp3_itor != cp3.end();
- ++cp2_itor, ++cp3_itor)
- {
- BOOST_CHECK_EQUAL( *cp2_itor, *cp3_itor );
- }
-}
-
-//! do vector like operations work?
-BOOST_AUTO_TEST_CASE ( conserved_path_vector )
-{
- ConservedPath cp;
- cp.score = 21.0;
-
- BOOST_CHECK_EQUAL( cp.size(), 0 );
- cp.push_back( 3 );
- BOOST_CHECK_EQUAL( cp.size(), 1);
- BOOST_CHECK_EQUAL( cp[0], 3 );
- cp.push_back( 4 );
- BOOST_CHECK_EQUAL( cp.size(), 2);
- BOOST_CHECK_EQUAL( cp[1], 4 );
- cp.pop_back();
- BOOST_CHECK_EQUAL( cp.size(), 1 );
-}
-
-BOOST_AUTO_TEST_CASE ( extended_conserved_path_simple )
-{
- vector<int> path;
- path += 3,4,5,1; // magic from boost assign
-
- ExtendedConservedPath ecp1;
- ecp1.window_size = 30;
- ecp1.score = 18;
- ecp1.track_indexes = path;
- BOOST_CHECK_EQUAL ( ecp1.size(), path.size() );
-
- ExtendedConservedPath ecp2(30, 18.0, path);
- BOOST_CHECK_EQUAL ( ecp1, ecp2 );
- BOOST_CHECK_EQUAL ( ecp2.size(), path.size() );
-
- ExtendedConservedPath ecp_ne(35, 20.0, path);
- BOOST_CHECK(ecp2 != ecp_ne);
-
- ConservedPath cp1;
- cp1.score = 18;
- cp1.track_indexes = path;
-
- ExtendedConservedPath ecp3(30, cp1);
- BOOST_CHECK_EQUAL( ecp2, ecp3 );
- BOOST_CHECK_EQUAL( ecp3.size(), path.size() );
-}
-
-//! Can we grow succesfully?
-BOOST_AUTO_TEST_CASE ( extended_conserved_path_growth )
-{
- vector<int> path_base;
- path_base += 3,4,5,1; // magic from boost assign
- vector<int> path_next;
- path_next += 4,5,6,2;
- vector<int> path_next_reversed;
- path_next_reversed += 4,5,6,-2;
- vector<int> path_not_next;
- path_not_next += 4,5,6,5;
- const int window_size = 4;
-
- ExtendedConservedPath ecp_base(window_size, 20, path_base);
- ConservedPath cp_next(25, path_next);
- ConservedPath cp_next_reversed(25, path_next_reversed);
- ConservedPath cp_not_next(22, path_not_next);
-
- BOOST_CHECK(ecp_base.nextTo(cp_next));
- BOOST_CHECK(!ecp_base.nextTo(cp_not_next));
- // FIXME: should something like this actually extend?
- BOOST_CHECK(!ecp_base.nextTo(cp_next_reversed));
-
- const int growth = 2;
- ecp_base.extend(growth);
- BOOST_CHECK_EQUAL( ecp_base.window_size, window_size + growth );
-}
-CURDIR := $(BASEDIR)test/
+CURDIR := $(BASEDIR)alg/test/
SOURCES.cxx := test_conserved_path.cxx \
test_flp.cxx \
test_main.cxx \
test_mussa.cxx \
test_nway.cxx \
- test_sequence.cxx \
- ../qui/GlSequence.cxx
+ test_sequence.cxx
TESTSRC := $(addprefix $(CURDIR), $(SOURCES.cxx))
TESTOBJ := $(TESTSRC:.cxx=$(OBJEXT))
--- /dev/null
+#include <boost/test/auto_unit_test.hpp>
+#include <boost/assign/std/vector.hpp>
+using namespace boost::assign;
+
+#include <vector>
+using namespace std;
+
+#include "alg/conserved_path.h"
+
+//! write tests for our conserved path types (just to make sure they
+//! don't change on us.
+BOOST_AUTO_TEST_CASE ( conserved_path_simple )
+{
+ vector<int> path;
+ path += 3,4,5,1; // magic from boost assign
+
+ ConservedPath cp1;
+ BOOST_CHECK_EQUAL( cp1.size(), 0 ); //empty
+ BOOST_CHECK( cp1.begin() == cp1.end() );
+
+ cp1.score = 18;
+ cp1.track_indexes = path;
+ BOOST_CHECK_EQUAL( cp1.size(), path.size() );
+
+ ConservedPath cp2(18, path);
+ BOOST_CHECK_EQUAL (cp1, cp2);
+ BOOST_CHECK_EQUAL( cp2.size(), path.size() );
+
+ ConservedPath::iterator cp2_itor;
+ vector<int>::iterator path_itor;
+ for (cp2_itor = cp2.begin(), path_itor = path.begin();
+ cp2_itor != cp2.end() && path_itor != path.end();
+ ++cp2_itor, ++path_itor)
+ {
+ BOOST_CHECK_EQUAL( *cp2_itor, *path_itor );
+ }
+
+ ConservedPath cp3( cp2 );
+ BOOST_CHECK_EQUAL( cp3.size(), cp2.size() );
+ ConservedPath::iterator cp3_itor;
+ for (cp2_itor = cp2.begin(), cp3_itor = cp3.begin();
+ cp2_itor != cp2.end() && cp3_itor != cp3.end();
+ ++cp2_itor, ++cp3_itor)
+ {
+ BOOST_CHECK_EQUAL( *cp2_itor, *cp3_itor );
+ }
+}
+
+//! do vector like operations work?
+BOOST_AUTO_TEST_CASE ( conserved_path_vector )
+{
+ ConservedPath cp;
+ cp.score = 21.0;
+
+ BOOST_CHECK_EQUAL( cp.size(), 0 );
+ cp.push_back( 3 );
+ BOOST_CHECK_EQUAL( cp.size(), 1);
+ BOOST_CHECK_EQUAL( cp[0], 3 );
+ cp.push_back( 4 );
+ BOOST_CHECK_EQUAL( cp.size(), 2);
+ BOOST_CHECK_EQUAL( cp[1], 4 );
+ cp.pop_back();
+ BOOST_CHECK_EQUAL( cp.size(), 1 );
+}
+
+BOOST_AUTO_TEST_CASE ( extended_conserved_path_simple )
+{
+ vector<int> path;
+ path += 3,4,5,1; // magic from boost assign
+
+ ExtendedConservedPath ecp1;
+ ecp1.window_size = 30;
+ ecp1.score = 18;
+ ecp1.track_indexes = path;
+ BOOST_CHECK_EQUAL ( ecp1.size(), path.size() );
+
+ ExtendedConservedPath ecp2(30, 18.0, path);
+ BOOST_CHECK_EQUAL ( ecp1, ecp2 );
+ BOOST_CHECK_EQUAL ( ecp2.size(), path.size() );
+
+ ExtendedConservedPath ecp_ne(35, 20.0, path);
+ BOOST_CHECK(ecp2 != ecp_ne);
+
+ ConservedPath cp1;
+ cp1.score = 18;
+ cp1.track_indexes = path;
+
+ ExtendedConservedPath ecp3(30, cp1);
+ BOOST_CHECK_EQUAL( ecp2, ecp3 );
+ BOOST_CHECK_EQUAL( ecp3.size(), path.size() );
+}
+
+//! Can we grow succesfully?
+BOOST_AUTO_TEST_CASE ( extended_conserved_path_growth )
+{
+ vector<int> path_base;
+ path_base += 3,4,5,1; // magic from boost assign
+ vector<int> path_next;
+ path_next += 4,5,6,2;
+ vector<int> path_next_reversed;
+ path_next_reversed += 4,5,6,-2;
+ vector<int> path_not_next;
+ path_not_next += 4,5,6,5;
+ const int window_size = 4;
+
+ ExtendedConservedPath ecp_base(window_size, 20, path_base);
+ ConservedPath cp_next(25, path_next);
+ ConservedPath cp_next_reversed(25, path_next_reversed);
+ ConservedPath cp_not_next(22, path_not_next);
+
+ BOOST_CHECK(ecp_base.nextTo(cp_next));
+ BOOST_CHECK(!ecp_base.nextTo(cp_not_next));
+ // FIXME: should something like this actually extend?
+ BOOST_CHECK(!ecp_base.nextTo(cp_next_reversed));
+
+ const int growth = 2;
+ ecp_base.extend(growth);
+ BOOST_CHECK_EQUAL( ecp_base.window_size, window_size + growth );
+}
#include <string>
-#include "qui/GlSequence.h"
+#include "alg/glsequence.h"
#include "alg/sequence.hh"
using namespace std;
# Input
HEADERS += mussa_exceptions.hh \
- qui/GlSequence.h \
qui/PathWindow.h \
qui/PathScene.h \
qui/ThresholdWidget.h \
qui/ImageSaveDialog.h \
alg/conserved_path.h \
alg/flp.hh \
+ alg/glsequence.h \
alg/mussa_class.hh \
alg/nway_paths.hh \
alg/parse_options.h \
alg/sequence.hh
SOURCES += mussagl.cxx \
- qui/GlSequence.cxx \
qui/PathWindow.cxx \
qui/PathScene.cxx \
qui/ThresholdWidget.cxx \
alg/conserved_path.cxx \
alg/flp.cxx \
alg/flp_seqcomp.cxx \
+ alg/glsequence.cxx \
alg/mussa_class.cxx \
alg/nway_entropy.cxx \
alg/nway_other.cxx \
+++ /dev/null
-#include "qui/GlSequence.h"
-
-#include <iostream>
-#include <cassert>
-#include <math.h>
-#include <stdexcept>
-using namespace std;
-
-GlSequence::GlSequence(const Sequence &s)
- : seq(s),
- seq_x(0.0),
- seq_y(0.0),
- seq_z(1.0),
- seq_width(s.size()),
- seq_height(gl_track_height)
-{
- assert (seq.size() == seq_width);
-}
-
-GlSequence::GlSequence(const GlSequence &s)
- : seq(s.seq),
- seq_x(s.seq_x),
- seq_y(s.seq_y),
- seq_z(s.seq_z),
- seq_width(s.seq_width),
- seq_height(s.seq_height)
-{
- assert (seq.size() == seq_width);
-}
-
-GlSequence &GlSequence::operator=(const GlSequence & s)
-{
- if (this != &s) {
- const_cast<Sequence &>(seq) = s.seq;
- seq_x = s.seq_x;
- seq_y = s.seq_y;
- seq_z = s.seq_z;
- seq_width = s.seq_width;
- seq_height = s.seq_height;
- }
- return *this;
-}
-
-const Sequence& GlSequence::sequence() const
-{
- return seq;
-}
-
-void GlSequence::setX(GLfloat value)
-{
- seq_x = value;
-}
-
-GLfloat GlSequence::x() const
-{
- return seq_x;
-}
-
-void GlSequence::setY(GLfloat value)
-{
- seq_y = value;
-}
-
-GLfloat GlSequence::y() const
-{
- return seq_y;
-}
-
-void GlSequence::setWidth(GLfloat value)
-{
- seq_width = value;
-}
-
-GLfloat GlSequence::width() const
-{
- return seq_width;
-}
-
-
-void GlSequence::draw(GLfloat left, GLfloat right) const
-{
- glLineWidth(seq_height);
- glColor3f(0.0, 0.0, 0.0);
- // draw main sequence track
- glBegin(GL_LINES);
- glVertex3f(seq_x, seq_y, seq_z);
- glVertex3f(seq_x+seq_width, seq_y, seq_z);
- //clog << "drawing " << seq_x << " " << seq_y << " " << seq_width
- // << std::endl;
- glEnd();
- // draw annotations
- GLfloat annotation_z = seq_z + 1.0;
- std::list<annot> annots = seq.annotations();
- for (std::list<annot>::const_iterator annot_itor = annots.begin();
- annot_itor != annots.end();
- ++annot_itor, ++annotation_z)
- {
- glColor3f(0.0, 0.5, 0.0);
- glBegin(GL_LINES);
- glVertex3f(annot_itor->start, seq_y, annotation_z);
- glVertex3f(annot_itor->end , seq_y, annotation_z);
- glEnd();
- }
- draw_sequence(left, right);
-}
-
-const int PT = 1;
-const int STROKE = 2;
-const int END =3;
-
-typedef struct charpoint {
- GLfloat x, y;
- int type;
-} CP;
-
-CP Adata[] = {
- {0, 0, PT}, {0, 9, PT}, {1, 10, PT}, {4, 10, PT},
- {5, 9, PT}, {5, 0, STROKE}, {0, 5, PT}, {5, 5, END}
-};
-
-CP Tdata[] = {
- {2.5, 0, PT}, {2.5,10, STROKE}, {0, 10, PT}, {5,10, END}
-};
-
-CP Gdata[] = {
- {5, 9, PT}, {4, 10, PT}, {1, 10, PT}, {0, 9, PT}, {0, 1, PT},
- {1, 0, PT}, {5, 0, PT}, {5, 4, PT}, {3.5, 4, END}
-};
-
-CP Cdata[] = {
- {5, 8, PT}, {3, 10, PT}, {2, 10, PT}, {0, 8, PT}, {0, 2, PT},
- {2, 0, PT}, {3, 0, PT}, {5, 2, END}
-};
-
-CP Xdata[] = {{ 0, 10, PT}, {5,0,STROKE},{0,0,PT},{5,10,END}};
-CP Ndata[] = {{ 0, 0, PT}, {0, 10, PT}, {5, 0, PT}, {5, 10, END}};
-
-static void drawLetter(CP *l)
-{
- glBegin(GL_LINE_STRIP);
- while(1) {
- switch (l->type) {
- case PT:
- glVertex2fv(&l->x);
- break;
- case STROKE:
- glVertex2fv(&l->x);
- glEnd();
- glBegin(GL_LINE_STRIP);
- break;
- case END:
- glVertex2fv(&l->x);
- glEnd();
- return;
- break;
- default:
- throw runtime_error("data structure failure");
- }
- l++;
- }
-}
-
-void GlSequence::draw_sequence(GLfloat left, GLfloat right) const
-{
- int viewport[4];
- glGetIntegerv(GL_VIEWPORT, viewport);
- int port_width = viewport[3]; // grab the viewport width
- GLfloat world_width = right - left;
- int left_base = (left > 0) ? (int)ceil(left) : 0;
- int right_base = (int)floor(right);
- int render_count = (right_base < seq.size()) ? right_base : seq.size();
- render_count -= left_base;
-
- glLineWidth(0.01);
- GLfloat char_width = 1.1;
- GLfloat pixels_needed = char_width * world_width;
-
- cout << "seq width needed " << pixels_needed
- << " port width " << port_width
- << " count " << render_count
- << " left " << left_base
- << " right " << right_base
- << " size " << seq.size() << endl;
- // if the number of pixels taken up by rendering the characters
- // that'd show up in the current ortho width is less than the window
- // width we can actually draw something
- if (pixels_needed < port_width and render_count > 0) {
- cout << "rendering: ";
- string bases = seq.subseq(left_base, render_count);
- glColor3f(0.1, 0.1, 0.1);
- for (string::size_type basepair = 0; basepair != bases.size(); ++basepair)
- {
- glPushMatrix();
- glTranslatef( left_base + basepair, seq_y+20, 1.0 );
- glScalef(0.1, 1.0, 1.0);
- switch (bases[basepair]) {
- case 'A': case 'a':
- drawLetter(Adata);
- break;
- case 'T': case 't':
- drawLetter(Tdata);
- break;
- case 'G': case 'g':
- drawLetter(Gdata);
- break;
- case 'C': case 'c':
- drawLetter(Cdata);
- break;
- case 'N': case 'n':
- drawLetter(Ndata);
- break;
- default:
- drawLetter(Xdata);
- break;
- }
- cout << bases[basepair];
- glPopMatrix();
- }
- cout << endl;
- }
-}
+++ /dev/null
-#ifndef _GL_SEQUENCE_H_
-#define _GL_SEQUENCE_H_
-
-#include "alg/sequence.hh"
-#include <GL/gl.h>
-
-//! Manage rendering a mussa sequence track
-/*! The idea is this will keep track of the location of where the sequence
- * is being rendered, and handle displaying annotations on that track
- */
-class GlSequence
-{
-public:
- GlSequence(const Sequence & s);
- GlSequence(const GlSequence & s);
- GlSequence &operator=(const GlSequence &s);
-
- //! draw a track
- /*! left and right are the current edges of the viewable world
- */
- void draw(GLfloat left, GLfloat right) const;
-
- const Sequence& sequence() const;
- void setX(GLfloat);
- GLfloat x() const;
- void setY(GLfloat);
- GLfloat y() const;
- void setWidth(GLfloat);
- GLfloat width() const;
-
-protected:
- const Sequence& seq;
- GLfloat seq_x;
- GLfloat seq_y;
- GLfloat seq_z;
- GLfloat seq_width;
- GLfloat seq_height;
-
- //! render a sequence (if we have enough space
- /*! left and right are the current edges of the viewable world
- */
- void draw_sequence(GLfloat, GLfloat) const;
-};
-
-const float gl_track_height = 10.0;
-
-#endif
#include <GL/gl.h>
#include <math.h>
-#include "qui/GlSequence.h"
+#include "alg/glsequence.h"
+#include "mussa_exceptions.hh"
using namespace std;
#include <vector>
#include "alg/mussa_class.hh"
-#include "qui/GlSequence.h"
+#include "alg/glsequence.h"
+#include "GL/gl.h"
class QMouseEvent;
class QRubberBand;