[BLAST_ANAWARE] Saving Coda Events to a file

From: tong@mit.edu
Date: Wed Nov 13 2002 - 16:11:36 EST


    Hi,

    It is really easy to save events in coda format!
I wrote a class call, TBLCodaEvo in libBlast.so.
It work just like input/output stream in C++.
Here is an example:

   TBLCodaEvo out("example.coda"); //Open a file
   while (event.ReadNext() == 0){
      if ( TBLCut ) { //For TBLCut you need to put your own cut
        out<< event.CodaRead;
      }
   }

This is it! Very simple!
You can open multiple files. In case you need to save different types
of events. You just do,
TBLCodaEvo out1("example1.coda");
TBLCodaEvo out2("example2.coda");
TBLCodaEvo out3("example3.coda");

while (event.ReadNext() == 0){
  if (type1) out1 << event.CodaRead;
  if (type2) out2 << event.CodaRead;
  if (type3) out3 << event.CodaRead;
}

Hope this helps.

-T



This archive was generated by hypermail 2.1.2 : Mon Feb 24 2014 - 14:07:28 EST