#CFLAGS=-ftemplate-depth-20
-CFLAGS=-O -ftemplate-depth-20
-LDFLAGS=
+CFLAGS=-O -Winline -ftemplate-depth-20
+LDFLAGS= -lfltk
#all: seqcomp
mussa_nway.o : mussa_nway.cc mussa_nway.hh
g++ $(CFLAGS) -c mussa_nway.cc
+mussa_gui_seq.o : mussa_gui_seq.cc mussa_gui_seq.hh
+ g++ $(CFLAGS) -c mussa_gui_seq.cc
+
+mussa_gui_conn.o : mussa_gui_conn.cc mussa_gui_conn.hh
+ g++ $(CFLAGS) -c mussa_gui_conn.cc
+
mussa_class.o : mussa_class.cc mussa_class.hh
g++ $(CFLAGS) -c mussa_class.cc
-mussa : mussa.cc mussa_class.o mussa_nway.o flp_seqcomp.o flp.o sequence.o
- g++ $(CFLAGS) -o mussa mussa.cc mussa_class.o mussa_nway.o flp_seqcomp.o flp.o sequence.o
+mussa : sequence.o flp.o flp_seqcomp.o mussa_nway.o mussa_gui_seq.o mussa_gui_conn.o mussa_class.o mussa.cc
+ g++ $(CFLAGS) $(LDFLAGS) -o mussa mussa.cc mussa_class.o mussa_gui_conn.o mussa_gui_seq.o mussa_nway.o flp_seqcomp.o flp.o sequence.o
#match_list_type.o : modules/match_list_type.c modules/match_list_type.h \
if (is_RC)
i2_offset = window_size - seq2_length;
else
- i2_offset = 1;
+ i2_offset = 0;
// loop thru the start positions for sequence 1
(seq1[seq1_i+window_size] != 'N')) // N's match nothing
matches = matches + 1;
- add(seq1_i + 1, seq2_i, matches, i2_offset);
+ add(seq1_i + 1, seq2_i + 1, matches, i2_offset);
seq1_i = seq1_i + 1; // increment seq1_i to next window
seq2_i = seq2_i + 1; // increment seq2_i to next window
(seq1[seq1_i+window_size] != 'N')) // N's match nothing
matches = matches + 1;
- add(seq1_i + 1, seq2_i, matches, i2_offset);
+ add(seq1_i + 1, seq2_i + 1, matches, i2_offset);
seq1_i = seq1_i + 1; // increment seq1_i to next window
seq2_i = seq2_i + 1; // increment seq2_i to next window
int main(int argc, char **argv)
{
Mussa overlord;
- char * para_file;
+ char * para_file, * ana_file;
+ string an_arg;
time_t t1, t2, begin, end;
double setuptime, seqloadtime, seqcomptime, nwaytime, savetime, totaltime;
+ string run_mode;
+ int seq_num;
+
begin = time(NULL);
// need more sophisticated arg reading structure
// support -w and -t override options...other stuff??
- para_file = * ++argv;
-
- t1 = time(NULL);
- overlord.setup(para_file);
- t2 = time(NULL);
- setuptime = difftime(t2, t1);
-
-
- cout << "fee\n";
- t1 = time(NULL);
- overlord.get_Seqs();
- t2 = time(NULL);
- seqloadtime = difftime(t2, t1);
-
-
- cout << "fie\n";
- t1 = time(NULL);
- overlord.seqcomp();
- t2 = time(NULL);
- seqcomptime = difftime(t2, t1);
-
-
- cout << "foe\n";
- t1 = time(NULL);
- overlord.nway();
- t2 = time(NULL);
- nwaytime = difftime(t2, t1);
-
-
- cout << "fum\n";
- t1 = time(NULL);
- overlord.save();
- t2 = time(NULL);
- savetime = difftime(t2, t1);
-
- end = time(NULL);
- totaltime = difftime(end, begin);
-
- cout << "setup\tseqload\tseqcomp\tnway\tsave\ttotal\n";
- cout << setuptime << "\t";
- cout << seqloadtime << "\t";
- cout << seqcomptime << "\t";
- cout << nwaytime << "\t";
- cout << savetime << "\t";
- cout << totaltime << "\n";
-
+ an_arg = * ++argv;
+
+ if (an_arg == "-v")
+ {
+ seq_num = atoi(* ++argv);
+ ana_file = * ++argv;
+ run_mode = "v";
+ }
+ else
+ {
+ para_file = (char*) an_arg.c_str();
+ run_mode = "f";
+ }
+
+ if (run_mode == "v")
+ {
+ cout << "load file = " << ana_file << " seq num = " << seq_num << endl;
+ overlord.load_old(ana_file, seq_num);
+ }
+ else if (run_mode == "f")
+ {
+ t1 = time(NULL);
+ overlord.setup(para_file);
+ t2 = time(NULL);
+ setuptime = difftime(t2, t1);
+
+
+ cout << "fee\n";
+ t1 = time(NULL);
+ overlord.get_Seqs();
+ t2 = time(NULL);
+ seqloadtime = difftime(t2, t1);
+
+
+ cout << "fie\n";
+ t1 = time(NULL);
+ overlord.seqcomp();
+ t2 = time(NULL);
+ seqcomptime = difftime(t2, t1);
+
+
+ cout << "foe\n";
+ t1 = time(NULL);
+ overlord.nway();
+ t2 = time(NULL);
+ nwaytime = difftime(t2, t1);
+
+
+ cout << "fum\n";
+ t1 = time(NULL);
+ overlord.save_old();
+ t2 = time(NULL);
+ savetime = difftime(t2, t1);
+
+ end = time(NULL);
+ totaltime = difftime(end, begin);
+
+ cout << "setup\tseqload\tseqcomp\tnway\tsave\ttotal\n";
+ cout << setuptime << "\t";
+ cout << seqloadtime << "\t";
+ cout << seqcomptime << "\t";
+ cout << nwaytime << "\t";
+ cout << savetime << "\t";
+ cout << totaltime << "\n";
+ }
+
+
+ if (run_mode == "v")
+ overlord.FuckingPieceOfShit(1000,500);
}
}
}
+/*
+ aSeq.seq();
+ cout << "\n";
+ aSeq.hdr();
+ cout << "\n";
+*/
void
Mussa::seqcomp()
all_comps[i][i2].setup("m", window, threshold, seq_lens[i],seq_lens[i2]);
all_comps[i][i2].seqcomp(the_Seqs[i].seq(), the_Seqs[i2].seq(), false);
all_comps[i][i2].seqcomp(the_Seqs[i].seq(),the_Seqs[i2].rev_comp(),true);
+ save_file_string = "ana";
+ if (i == 0)
+ save_file_string += "0";
+ else if (i == 1)
+ save_file_string += "1";
+ if (i2 == 1)
+ save_file_string += "1";
+ else if (i2 == 2)
+ save_file_string += "2";
+
+ all_comps[i][i2].file_save(save_file_string);
}
}
void
-Mussa::save()
+Mussa::save_old()
{
+ fstream save_file;
int i;
save_file.open(ana_name.c_str(), ios::out);
the_paths.save_old(ana_name);
}
+
+void
+Mussa::load_old(char * load_file_path, int s_num)
+{
+ fstream save_file;
+ string file_data_line;
+ int i, space_split_i, comma_split_i;
+ vector<int> loaded_path;
+ string node_pair, node;
+ Sequence a_seq;
+
+ seq_num = s_num;
+ the_paths.setup(seq_num);
+ save_file.open(load_file_path, ios::in);
+
+ // currently loads old mussa format
+
+ // get sequences
+ for(i = 0; i < seq_num; i++)
+ {
+ getline(save_file, file_data_line);
+ a_seq.set_seq(file_data_line);
+ the_Seqs.push_back(a_seq);
+ }
+
+ // get window size
+ getline(save_file, file_data_line);
+ window = atoi(file_data_line.c_str());
+ // get paths
+
+ while (!save_file.eof())
+ {
+ loaded_path.clear();
+ getline(save_file, file_data_line);
+ if (file_data_line != "")
+ for(i = 0; i < seq_num; i++)
+ {
+ space_split_i = file_data_line.find(" ");
+ node_pair = file_data_line.substr(0,space_split_i);
+ //cout << "np= " << node_pair;
+ comma_split_i = node_pair.find(",");
+ node = node_pair.substr(comma_split_i+1);
+ //cout << "n= " << node << " ";
+ loaded_path.push_back(atoi (node.c_str()));
+ file_data_line = file_data_line.substr(space_split_i+1);
+ }
+ //cout << endl;
+ the_paths.add_path(loaded_path);
+ }
+ save_file.close();
+
+ //the_paths.save("tmp.save");
+}
+
+
+// In Memorial to Everything that's gone wrong in the last week
+// and Everything that will go wrong in the next 2 weeks 03/02/2004 - Tristan
+void
+Mussa::FuckingPieceOfShit(int x_max, int y_max)
+{
+
+ Fl_Window *conn_window = new Fl_Window(x_max, y_max, "Mussa Connections");
+ ConnView *conn_box = new ConnView(0, 0, x_max, y_max);
+ conn_box->setup(ana_name, seq_num, window, &the_Seqs, &the_paths);
+ conn_box->scale_paths();
+ conn_box->spawnSeq();
+ conn_window->end();
+ conn_window->show();
+
+ Fl::run();
+}
+
/*
cout << "fee\n";
cout << "fie\n";
// ---------- mussa_class.hh -----------
// ----------------------------------------
-#include "mussa_nway.hh"
+#include "mussa_gui_conn.hh"
class Mussa
void get_Seqs();
void seqcomp();
void nway();
- void save();
-
- fstream save_file;
+ void save_old();
+ void load_old(char * load_file_path, int s_num);
+ void FuckingPieceOfShit(int x_max, int y_max);
};
--- /dev/null
+#include "mussa_gui_conn.hh"
+
+
+
+void
+ConnView::setup(string name, int sq_num, int win_len,
+ vector<Sequence> *some_seqs,
+ Nway_Paths *some_paths)
+{
+ int i;
+ Sequence a_seq;
+
+ ana_name = name;
+ seq_num = sq_num;
+ window = win_len;
+ S = some_seqs;
+ P = some_paths;
+
+ for(i = 0; i < seq_num; ++i)
+ {
+ a_seq = (*S)[i];
+ seq_lens.push_back(a_seq.len());
+ }
+
+ x_scale_factor = (float) seq_lens[0] / x_max;
+ cout << "scale factor is " << x_scale_factor << endl;
+ y_seq_incre = (y_max-20) / (seq_num - 1);
+}
+
+
+void
+ConnView::scale_paths()
+{
+ vector<int> a_path;
+ list<vector<int> >::iterator pathz_i;
+ int i2;
+
+
+ scaled_pathz.clear();
+
+ for(pathz_i = P->pathz.begin(); pathz_i != P->pathz.end(); ++pathz_i)
+ {
+ a_path = *pathz_i;
+ for(i2 = 0; i2 < seq_num; i2++)
+ a_path[i2] = (int) (a_path[i2] / x_scale_factor);
+ scaled_pathz.push_back(a_path);
+ }
+}
+
+
+
+
+void
+ConnView::draw()
+{
+ list<vector<int> >::iterator i;
+ int i2, y_loc, x_loc;
+ vector<int> a_path;
+
+ fl_color(FL_RED);
+ fl_line_style(FL_SOLID, 1, NULL);
+
+ for(i = scaled_pathz.begin(); i != scaled_pathz.end(); ++i)
+ {
+ a_path = *i;
+ y_loc = 10;
+ for(i2 = seq_num - 1; i2 > 0; i2--)
+ {
+ // RC case handling
+ // ugh, and xor...only want blue if one of the nodes is rc
+ if ( ((a_path[i2] < 0) || (a_path[i2-1] < 0)) &&
+ !((a_path[i2] < 0) && (a_path[i2-1] < 0)) )
+ fl_color(FL_BLUE);
+
+ fl_line((int)abs(a_path[i2]),y_loc,(int)abs(a_path[i2-1]),y_loc + y_seq_incre);
+ y_loc += y_seq_incre;
+ fl_color(FL_RED);
+ }
+ }
+
+ fl_color(FL_BLACK);
+ fl_line_style(FL_SOLID, 3, NULL);
+ y_loc = 10;
+ for(i2 = seq_num - 1; i2 >= 0; i2--)
+ {
+ x_loc = (int)(seq_lens[i2] / x_scale_factor);
+ fl_line(0,y_loc,x_loc,y_loc);
+ y_loc += y_seq_incre;
+ }
+}
+
+void
+ConnView::spawnSeq()
+{
+ int seq_box_x;
+
+ Fl_Window *seq_window = new Fl_Window(x_max, y_max, "Mussa Sequence");
+ Fl_Scroll *scroll_seq = new Fl_Scroll(0, 0, x_max, y_max);
+
+ seq_box_x = 32000;
+ //seq_lens[0]*14;
+ SeqView *seq_box = new SeqView(0, 0, seq_box_x, y_max-20);
+ seq_box->setup(ana_name, seq_num, window, S, P, seq_lens);
+
+ seq_window->end();
+ seq_window->show();
+}
--- /dev/null
+#include "mussa_gui_seq.hh"
+
+
+
+class ConnView : public Fl_Box
+{
+ private:
+ string ana_name;
+ int seq_num, window, threshold;
+ bool win_append, thres_append;
+
+ //this data is passed as pointers to the instantiated classes
+ vector<Sequence> *S;
+ Nway_Paths *P;
+
+ int x_max, y_max;
+ float x_scale_factor;
+ int y_seq_incre;
+ //list< will be list of these later for zooming history
+ list<vector<int> > scaled_pathz;
+ vector<int> seq_lens;
+
+
+ public:
+ ConnView(int x_top,int y_top,int x_bot,int y_bot) :
+ Fl_Box(x_top,y_top,x_bot,y_bot)
+ {
+ x_max = x_bot;
+ y_max = y_bot;
+ }
+
+ void setup(string name, int sq_num, int win_len,
+ vector<Sequence> *, Nway_Paths *);
+ void scale_paths();
+ void draw();
+ void spawnSeq();
+};
--- /dev/null
+#include "mussa_gui_seq.hh"
+
+
+void
+SeqView::setup(string name, int sq_num, int win_len,
+ vector<Sequence> *some_seqs,
+ Nway_Paths *some_paths, vector<int> some_lens)
+{
+ ana_name = name;
+ seq_num = sq_num;
+ base_window_len = win_len;
+ S = some_seqs;
+ P = some_paths;
+ seq_lens = some_lens;
+
+ y_seq_incre = (y_max-10) / (seq_num - 1);
+
+ fl_font(FL_COURIER, 14);
+ cout << fl_width('A') << endl;
+}
+
+
+void
+SeqView::draw()
+{
+ int seq_i;
+ Sequence a_seq;
+ int i, y_loc;
+ vector<int> a_path;
+ list<vector<int> >::iterator pathz_i;
+ int i2;
+ int x_start, y_start, x_end, y_end;
+ double ch_width;
+ int window_length, win_i;
+ int rc_1 = 0;
+ int rc_2 = 0;
+
+
+ window_length = base_window_len;
+ fl_font(FL_COURIER, 14);
+ fl_color(FL_BLACK);
+ //blatantly stolen from FR2
+ ch_width = fl_width('A'); // monospaced: all characters are same width
+
+ y_loc = 10;
+ for(seq_i = seq_num-1; seq_i >= 0; --seq_i)
+ {
+ //a_seq = a_seq;
+ fl_draw((*S)[seq_i].c_seq(), 0+x(), y_loc+y());
+ y_loc += y_seq_incre;
+ }
+
+ fl_color(FL_RED);
+ fl_line_style(FL_SOLID, 1, NULL);
+ //fl_line(x(),10+y(),20+x(),y_max/2 + y());
+
+ //fl_color(FL_RED);
+
+
+ for(pathz_i = P->pathz.begin(); pathz_i != P->pathz.end(); ++pathz_i)
+ {
+ a_path = *pathz_i;
+ y_loc = 0;
+ for(i2 = seq_num - 1; i2 > 0; i2--)
+ {
+ // RC case handling
+
+ // ugh, and xor...only want black if one of the nodes is rc
+ if ( ((a_path[i2] < 0) || (a_path[i2-1] < 0)) &&
+ !((a_path[i2] < 0) && (a_path[i2-1] < 0)) )
+ fl_color(FL_BLUE);
+
+ // no matter the case, any RC node needs an offset
+ if (a_path[i2] < 0)
+ rc_1 = window_length;
+ if (a_path[i2-1] < 0)
+ rc_2 = window_length;
+ // normal case
+ for(win_i = 0; win_i < window_length; win_i++)
+ fl_line(abs((int)((a_path[i2]-rc_1+win_i+x()+0.5)*ch_width)),
+ y_loc + 10+y(),
+ abs((int)((a_path[i2-1]-rc_2+win_i+x()+0.5)*ch_width)),
+ y_loc+y_seq_incre+y());
+ y_loc += y_seq_incre;
+ //if ((a_path[i2] < 0) || (a_path[i2-1] < 0))
+ //{
+ fl_color(FL_RED);
+ rc_1 = 0;
+ rc_2 = 0;
+ //}
+ }
+ }
+}
+/*
+ x_start = (int) ();
+ y_start = ;
+ x_end = (int) ();
+ y_end = ;
+ x_start,y_start,x_end,y_end
+*/
+
+
+/*
+ if ((a_path[i2] >= 0) && (a_path[i2-1] >= 0))
+ {
+ }
+ else if ((a_path[i2] < 0) && (a_path[i2-1] < 0))
+ {
+ for(win_i = 0; win_i < window_length; win_i++)
+ fl_line(abs((int)((a_path[i2]+window_length+win_i+x())*ch_width)),
+ y_loc + 10+y(),
+ abs((int)((a_path[i2-1]+window_length+win_i+x())*ch_width)),
+ y_loc+y_seq_incre+y());
+
+ }
+ else
+ {
+ fl_color(FL_BLACK);
+ for(win_i = 0; win_i < window_length; win_i++)
+ fl_line(abs((int)((a_path[i2]+window_length+win_i+x())*ch_width)),
+ y_loc + 10+y(),
+ abs((int)((a_path[i2-1]+win_i+x())*ch_width)),
+ y_loc+y_seq_incre+y());
+ fl_color(FL_RED);
+ }
+ else //
+ {
+ fl_color(FL_BLACK);
+ for(win_i = 0; win_i < window_length; win_i++)
+ fl_line(abs((int)((a_path[i2]+win_i+x())*ch_width)),
+ y_loc + 10+y(),
+ abs((int)((a_path[i2-1]+window_length+win_i+x())*ch_width)),
+ y_loc+y_seq_incre+y());
+ fl_color(FL_RED);
+ }
+*/
--- /dev/null
+#include "mussa_nway.hh"
+
+#include <math.h>
+#include <FL/Fl.H>
+#include <FL/Fl_Window.H>
+#include <FL/Fl_Box.H>
+#include <FL/fl_draw.H>
+#include <FL/Fl_Scroll.H>
+
+class SeqView : public Fl_Box
+{
+ private:
+ string ana_name;
+ int seq_num;
+ int base_window_len;
+
+ //this data is passed as pointers to the instantiated classes
+ vector<Sequence> *S;
+ Nway_Paths *P;
+ vector<int> seq_lens;
+
+ int x_max, y_max;
+ int y_seq_incre;
+
+ public:
+ SeqView(int x_top,int y_top,int x_bot,int y_bot) :
+ Fl_Box(x_top,y_top,x_bot,y_bot)
+ {
+ x_max = x_bot;
+ y_max = y_bot;
+ }
+
+ void setup(string, int, int, vector<Sequence> *, Nway_Paths *, vector<int>);
+ void draw();
+};
Nway_Paths::setup(int sp_num)
{
species_num = sp_num;
+ pathz.clear();
}
{
trans_check_good = true;
trans_check_nodes = all_comparisons[i][depth].matches(path[i]);
- if (trans_check_nodes.end() == find(trans_check_nodes.begin(),trans_check_nodes.end(), *new_nodes_i) )
+ if ( (trans_check_nodes.end() == find(trans_check_nodes.begin(),
+ trans_check_nodes.end(),
+ *new_nodes_i) ) &&
+ (trans_check_nodes.end() == find(trans_check_nodes.begin(),
+ trans_check_nodes.end(),
+ *new_nodes_i * -1) ) )
trans_check_good = false;
}
if (trans_check_good)
{
- path.push_back(*new_nodes_i);
+ if ( path[depth-1] >= 0)
+ path.push_back(*new_nodes_i);
+ else
+ path.push_back(*new_nodes_i * -1);
if (depth < species_num - 1)
path_search(all_comparisons, path, depth + 1);
else
}
}
+
+void
+Nway_Paths::add_path(vector<int> loaded_path)
+{
+ pathz.push_back(loaded_path);
+}
+
+
void
Nway_Paths::save(string save_file_path)
{
}
}
*/
+
+
+
+
class Nway_Paths
{
+ friend class ConnView;
+ friend class SeqView;
private:
int species_num;
int threshold;
void save(string save_file_path);
void save_old(string save_file_path);
void load(string load_file_path);
+ void add_path(vector<int> loaded_path);
void find_paths(vector<vector<FLPs> > all_comparisons);
void refine();
void print();
+
+ list<vector<int> > scaled_paths(float scale_factor);
};
--- /dev/null
+PathList
+ExtendPathWindows(PathList raw_list)
+{
+ // to keep track of everything, this function acts like a finite state
+ // automata: 3 bitfields: reset, extending, scanning - ie 8 states
+ int reset = 0, extending = 0, scanning = 0;
+
+ int species_num = raw_list.SpeciesNum();
+ int win_num = raw_list.WinNum();
+
+ int *cur_path, *next_path;
+
+ cur_path = new int[species_num];
+ next_path = new int[species_num];
+
+ raw_list.ResetIndex();
+
+ while (no more windows avaible)
+ {
+ //cur_indices[0] + ref_ext == next_indices[0] + 1:
+
+ // state 000 - start/nominal search
+ //
+ if !reset && !extending && !scanning
+ {
+ if cur_path[0] == next_path[0]
+ {
+ scanning = 1; // go to state 001
+ raw_list.IncreIndex();
+ }
+ else if cur_path[0] + 1 == next_path[0]
+ {
+ extending = 1; // go to state 010
+ win_ext = 1;
+ raw_list.SetDirty();
+ raw_list.IncreIndex();
+ }
+ else
+ reset = 1; // go to state 100
+ }
+
+ // state 001 - scanning for ext window thru possible interleaving
+ //
+ else if !reset && !extending && scanning
+ {
+ if cur_path[0] == next_path[0]
+ raw_list.IncreIndex();
+ else if cur_path[0] + 1 == next_path[0]
+ {
+ extending = 1; // go to state 011
+ win_ext = 1;
+ raw_list.SetDirty();
+ raw_list.IncreIndex();
+ }
+ else
+ reset = 1; // go to state 101
+ }
+
+ // state 010 - extending window with no interleaving
+ //
+ else if !reset && extending && !scanning
+ {
+ if (cur_path[0] + win_ext) == next_path[0]
+ {
+ extending = 1; // go to state 011
+ raw_list.IncreIndex();
+ }
+ else if (cur_path[0] + win_ext + 1) == next_path[0]
+ {
+ win_ext++;
+ raw_list.SetDirty();
+ raw_list.IncreIndex();
+ }
+ else
+ reset = 1; // go to state 110
+ }
+
+ // state 011 - extending window with interleaving
+ //
+ else if !reset && extending && scanning
+ {
+ if (cur_path[0] + win_ext) == next_path[0]
+ raw_list.IncreIndex();
+ else if (cur_path[0] + win_ext + 1) == next_path[0]
+ {
+ win_ext++;
+ raw_list.SetDirty();
+ raw_list.IncreIndex();
+ }
+ else
+ reset = 1; // go to state 111
+ }
+
+
+ // reset condition states, return to 000 after taking appropiate action
+
+ // state 100 - no extended window, no scanning happened
+ // save basic window to extended window list
+ if reset && !extending && !scanning
+ {
+ // return to start/nominal search state
+ reset = 0;
+ }
+
+ // state 101 - no extended window, scanned for interleaving
+ // save basic window to extended window list, return to first clean
+ else if reset && !extending && scanning
+ {
+ // return to start/nominal search state
+ reset = 0;
+ scanning = 0;
+ }
+
+ // state 110 - extended window, no interleaving
+ // calc extended window, save to extended window list
+ else if reset && extending && !scanning
+ {
+ // return to start/nominal search state
+ reset = 0;
+ extending = 0;
+ }
+
+ // state 111 - extended window, interleaved
+ // calc extended window, save to ext win list, return to first clean
+ else if reset && extending && scanning
+ {
+ // return to start/nominal search state
+ reset = 0;
+ extending = 0;
+ scanning = 0;
+ }
+
+ return ext_win;
+}
data_file.close();
+ // need more sequence filtering for non AGCTN and convert to N
transform(sequence.begin(), sequence.end(), sequence.begin(), toupper);
}
void
Sequence::load_annot(string file_path)
{
+ fstream data_file;
+ string file_data_line;
+ annot an_annot;
+
+ data_file.open(file_path.c_str(), ios::in);
+
+ data_file.close();
+
}
return sequence;
}
+const char *
+Sequence::c_seq()
+{
+ return sequence.c_str();
+}
+
string
Sequence::rev_comp()
{
return header;
}
+
+void
+Sequence::set_seq(string a_seq)
+{
+ sequence = a_seq;
+}
+
+
/*
string
Sequence::species()
class Sequence
{
+ friend class ConnView;
+ friend class SeqView;
private:
string sequence;
int length;
struct annot
{
int start, end;
- string name, type, color;
+ string name, type;
};
list<annot> annots;
void load_fasta(string file_path, int seq_num);
void load_annot(string file_path);
string seq();
+ const char * c_seq();
string rev_comp();
int len();
string hdr();
+ void set_seq(string a_seq);
// string species();
void clear();
};