Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

realigneralgo.cc

Go to the documentation of this file.
00001 #include "realigneralgo.h"
00002 
00003 #include <unistd.h>
00004 #include <ctime>
00005 #include <iostream>
00006 #include <cstdlib>
00007 #include <cstddef> // definierar bl.a. size_t
00008 // #include <boost/timer.hpp>
00009 
00010 #include "AlAlgs.hpp"
00011 #include "dna_alphabet_n_x.hpp"
00012 #include "MalWrapper.hpp"
00013 
00014 
00015 // include the realigner
00016 #include "Realigner_h.hpp"
00017 using namespace std;
00018 // using boost::timer;
00019 
00020 typedef al::dna_alphabet_n_x alphabet;
00021 
00022 typedef MAlWrapper<alphabet> LayAlCont;
00023 
00024 void RealignerAlgo::start() 
00025 {
00026   bool debug_update = false;
00027   bool debug_alignment = false;
00028   bool draw = false;
00029   int type = 1;
00030 
00031   // important parameters
00032   int bandSize = 8;
00033   double a_koeff = 0.5;
00034 
00035   // create a realigner
00036 
00037   al::Realigner<LayAlCont, alphabet> rea;  
00038 
00039   // initialize the realigner with bandSize, a_koeff an other things
00040 
00041   rea.init_div(bandSize, debug_update, debug_alignment, type, draw, a_koeff);
00042 
00043 
00044   // construct and initialize the wrapper with the mal object
00045 
00046   LayAlCont la(getMAl());
00047 
00048   // read alignment from stdin (doesn't work with MalWrapper)
00049   //  al::read_layout_alignment<al::dna_alphabet>(la, cin);
00050 
00051   // register the wrapped mal object in the realigner
00052 
00053   std::pair<bool, bool> set_la_ok = rea.set_la(la);
00054 
00055 //   ofstream ut("alignment.my");
00056 //   // write alignment to stdout
00057 //   al::write_layout_alignment<al::dna_alphabet>(la, ut);
00058 //   cerr << "Written file!" << endl;
00059 
00060   // do the actual realigning
00061 
00062 //   timer t0;
00063 
00064   if (set_la_ok.first) {
00065 //     t0.restart();
00066     rea.realign_loop();
00067     
00068 //     cerr << "realign_loop(): " << t0.elapsed() << "seconds" << endl;
00069     
00070   }
00071   
00072 }

Generated on Fri Mar 17 17:44:24 2006 for trapper by  doxygen 1.4.4