00001
#include "foundation_AMOS.hh"
00002
#include <fstream>
00003
#include <ctime>
00004
using namespace std;
00005
using namespace AMOS;
00006
00007 #define ITERS 500000
00008
00009 int main (
int argc,
char ** argv)
00010 {
00011
Message_t msg;
00012
Read_t red;
00013
Contig_t ctg;
00014
00015
double loopa = 0;
00016
double loopb = 0;
00017 clock_t clocka, clockb;
00018
00019 vector<Tile_t> tlevec;
00020
Tile_t tle;
00021
00022 tle . source = 33396;
00023 tle . offset = 512;
00024 tle . range =
Range_t (12,832);
00025 tle . gaps . push_back (12);
00026 tle . gaps . push_back (30);
00027 tle . gaps . push_back (337);
00028 tle . gaps . push_back (508);
00029 tle . gaps . push_back (514);
00030 tle . gaps . push_back (789);
00031
00032
for (
int j = 0; j < 200; j ++ )
00033 tlevec . push_back (tle);
00034
00035
try {
00036
00037 red . setIID (1);
00038 red . setEID (
"str2");
00039 red . setComment (
"GBRAA01TF");
00040 red . setSequence
00041 (
"CCTTTGTGCTGGAAGGTGAATGCGGTGCGGCTGGTAACGGGCCGCGCGGGCGCAATCGGCGTCGTGATGGGCCGCAACAGCGAGTTTCACTTTGCCGAATTCATGCGCGGCATGGCCGAACGGCTGGGGCAGGACGAAGTGGACATTCTCGTCAGCCCCACCTCGCCGACCGGCAATGACGACGAGGTGCAGCTTTGTCACCGGCTGGCAACGAGCGGACGGGTGGATGCCGTTATCGTCACTTCCCCCAGGCCGAATGATGAACGCATCCGCATGTTGCACAAGCTCGGCATGCCGTTTCTGGTCCACGGGCGTTCGCAGATCGACATTCCCCATGCATGGCTTGATATCGACAATGAGAGCGCGGTCTATCATTCCACCGCACATCTGCTCGATCTTGGCCACAAGCGGATTGCGATGATCAACGGGCGCCATGGCTTCACCTTCTCGCTGCACCGCGACGCTGGCTATCGTAAGGCGCTTGAAAGCCGGGGAATCGACTTTGATCCCGACCTGGTGGAACATGGCGATTTCACCGATGAAATCGGCTATTGCCTCGCCCGCAAGCTTCTGGAACGCAATCCACGTCCAACGGCATTCGTCGCAGGCTCC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red . setFragment (1);
00044 red . setClearRange (Range_t(16,823));
00045 red . setVectorClearRange (Range_t(16,823));
00046 red . setQualityClearRange (Range_t(16,823));
00047
00048 ctg . setIID (1);
00049 ctg . setEID (
"str2");
00050 ctg . setComment (
"big contig");
00051
00052 ctg . setSequence
00053 (
"CCTTTGTGCTGGAAGGTGAATGCGGTGCGGCTGGTAACGGGCCGCGCGGGCGCAATCGGCGTCGTGATGGGCCGCAACAGCGAGTTTCACTTTGCCGAATTCATGCGCGGCATGGCCGAACGGCTGGGGCAGGACGAAGTGGACATTCTCGTCAGCCCCACCTCGCCGACCGGCAATGACGACGAGGTGCAGCTTTGTCACCGGCTGGCAACGAGCGGACGGGTGGATGCCGTTATCGTCACTTCCCCCAGGCCGAATGATGAACGCATCCGCATGTTGCACAAGCTCGGCATGCCGTTTCTGGTCCACGGGCGTTCGCAGATCGACATTCCCCATGCATGGCTTGATATCGACAATGAGAGCGCGGTCTATCATTCCACCGCACATCTGCTCGATCTTGGCCACAAGCGGATTGCGATGATCAACGGGCGCCATGGCTTCACCTTCTCGCTGCACCGCGACGCTGGCTATCGTAAGGCGCTTGAAAGCCGGGGAATCGACTTTGATCCCGACCTGGTGGAACATGGCGATTTCACCGATGAAATCGGCTATTGCCTCGCCCGCAAGCTTCTGGAACGCAATCCACGTCCAACGGCATTCGTCGCAGGCTCCATGATGACCGCGCTCGGCATCTACCGTGCCGCCCGCTCCTTCGGCCTTACGATCGGCAAGGATATTTCCGTCATCGCCCATGACGACGTGATCTCGTTCCTCAGCGCCGGTAATATGGGTGCCGTCGCTGACTGCGACACGCTCTTCAATGCGCGCGGCTGGCAAGCGATGCGCCGACCTTTTGATGGATATCCTCGATGGGCGCGCGCCCACCGAAATCCA",
00054
"9878<?JQONBB77:=EGMPDOHRNSTSTSTRSSSREMRSSRSSRSQSSLQLLLLMPPPRRSSSRRRRSSSRSSSRRSRRRRSRIJJJONLTTTTRRROLLLLLLTTTTTTTRRRRPPPSRRSTTTRSRRRSPOLOOLOSSSSRSSRSRPRPPPSPSTSTSQSQTRURSSSSSTTTTRRRSRRSRSSSURRRRSWSSRRRSSTSRRTTTTTTTTTPPSRPPSTTTTRSRUSSSSUSPPPPRSQRTTTTSSSRRRRRTRRSTRTTTRTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTPSPPPPPRRRTTTTTRSSSSRRSRRSTSTTTTTTTTRTTRSSSTRSRSRRSSSTTTRSSRSSSUSSQSSRSSSSRRRRRSRRTRTSRTSURTTTTTRSSSSSSTRTRRRSSRSSRTSPSPPPRTRRSSRRSTRRRSSRRRRTTTRRRUSRSSSTRSSSSRRLLLLOLNOTTTSRRRRSSSTTTTTTTTTTTWRRPPPPPPSTTTTWPPMSTPTTTTTTTTSTSRSRSSTTRSSSSTTTTTTTTPPPPKPPSRSSSTSSSSTSSRRSSSTTTTTRRSSTTSSRSSSSSTTTTTTTTTTTRTTTSRSSSSSTTTTRRRSSPPSPPPTTTTSRRPORSRPPPPLPPSSSSTTSSRSSSRPPNSSQRTTTTTSSPKKGMNPSSQSSRSSSSQLLIL?HSTQPSSPLRSQSSRSUQSMRSSUPRLLPGEPPSNMRPTYRRQPMMGGPMLQE?CENRNCRSLQRNTTKTKLQTXSRSRTTPRQXISRCONK<?IDTPPPDDIR?B<LALBDL@;LQQLCH?E=@IC<9F9?I;9;=8");
00055 ctg . setReadTiling (tlevec);
00056
00057 clocka = clock( );
00058
for (
int i = 0; i <
ITERS; i ++ )
00059 red . writeMessage (msg);
00060 clockb = clock( );
00061 loopa = (
double)(clockb - clocka);
00062
00063 clocka = clock( );
00064
for (
int i = 0; i <
ITERS; i ++ )
00065 red . readMessage (msg);
00066 clockb = clock( );
00067 loopb = (
double)(clockb - clocka);
00068
00069 msg . setField (
"eid",
"hello");
00070 msg . setField (
"bla",
"foo");
00071 msg . write (cerr);
00072
00073
Message_t::const_iterator mi;
00074 cerr <<
"\nField List\n";
00075
for ( mi = msg . begin( ); mi != msg . end( ); ++ mi )
00076 cerr <<
Decode (mi -> first) << endl;
00077
00078 cerr << endl
00079 <<
"loopa: " << (
double)loopa / CLOCKS_PER_SEC <<
" sec.\n"
00080 <<
"loopb: " << (
double)loopb / CLOCKS_PER_SEC <<
" sec.\n"
00081 <<
"granu: " << CLOCKS_PER_SEC <<
" of a sec.\n";
00082 }
00083
catch (
Exception_t & e) {
00084 cerr <<
"ERROR: exception\n" << e;
00085 }
00086
00087
return 0;
00088 }