CleanFile< GENOME_TYPE > Class Template Reference

#include <cleanfile.h>

List of all members.

Public Member Functions

void getCleanRes (string fileRes)
 CleanFile (string &filename)
 ~CleanFile ()
void intersection (const CleanFile< GENOME_TYPE > &clean, vector< SEQ< GENOME_TYPE > > &res1, vector< SEQ< GENOME_TYPE > > &res2, string fileRes) const
void MakeLegal ()

Private Types

typedef std::set< SEQ< GENOME_TYPE
> >::iterator 
itr

Private Member Functions

void copy_title (FILE *file, FILE *legal_file) const
void legalize_it (FILE *file)
int check_it (string buff)
bool isspace (char c)
bool isdigit (char c)
int skipspaces (string ar)
int checkO (string Or)
int checkS (string Start)
int checkE (string End)
int checkK (string KO)
GENOME_TYPE string2GENOMEType (string str)
const char get_or (string Orientation)
void copy_it (string buff, FILE *LG) const
void Tokenize (const string &str, vector< string > &tokens, const string &delimiters)

Private Attributes

string fileN
set< SEQ< GENOME_TYPE > > * segments

template<class GENOME_TYPE>
class CleanFile< GENOME_TYPE >


Member Typedef Documentation

template<class GENOME_TYPE>
typedef std::set< SEQ<GENOME_TYPE> >::iterator CleanFile< GENOME_TYPE >::itr [private]
 

An auxiliary declaration of a set iterator.


Constructor & Destructor Documentation

template<class GENOME_TYPE>
CleanFile< GENOME_TYPE >::CleanFile string &  filename  ) 
 

Main constructor.

Parameters:
filename,: The file *.anchor.

template<class GENOME_TYPE>
CleanFile< GENOME_TYPE >::~CleanFile  ) 
 

Destructor.


Member Function Documentation

template<class GENOME_TYPE>
int CleanFile< GENOME_TYPE >::check_it string  buff  )  [private]
 

Given one entry from the file *.anchor, the method checks its regularity.

Parameters:
buff,: The entry itself.
Returns:
0 if legal, 1 otherwise.

template<class GENOME_TYPE>
int CleanFile< GENOME_TYPE >::checkE string  End  )  [private]
 

Checks if End is a legal number.

Parameters:
End,: string
Returns:
0 if legal, 1 otherwise.

template<class GENOME_TYPE>
int CleanFile< GENOME_TYPE >::checkK string  KO  )  [private]
 

Checks if the KO is legal.

Parameters:
KO,: string
Returns:
0 if legal, 1 otherwise.

template<class GENOME_TYPE>
int CleanFile< GENOME_TYPE >::checkO string  Or  )  [private]
 

Checks if Or is a legal orientation value.

Parameters:
Or,: string
Returns:
0 if legal, 1 otherwise.

template<class GENOME_TYPE>
int CleanFile< GENOME_TYPE >::checkS string  Start  )  [private]
 

Checks if Start is a legal number.

Parameters:
Start,: string
Returns:
0 if legal, 1 otherwise.

template<class GENOME_TYPE>
void CleanFile< GENOME_TYPE >::copy_it string  buff,
FILE *  LG
const [private]
 

Copies buff to file LG.

Parameters:
buff,: string.
LG,: FILE*.

template<class GENOME_TYPE>
void CleanFile< GENOME_TYPE >::copy_title FILE *  file,
FILE *  legal_file
const [private]
 

Copies the title of the original file (*.anchor) to the "legal" file (*.anchor.clean).

Parameters:
file,: FILE* of the *.anchor.
legal_file,: FILE* of the *.anchor.clean.

template<class GENOME_TYPE>
const char CleanFile< GENOME_TYPE >::get_or string  Orientation  )  [private]
 

Extracts the orientation out of the string Orientation.

Parameters:
Orientation,: string.
Returns:
+ or - according to the extracted value.

template<class GENOME_TYPE>
void CleanFile< GENOME_TYPE >::getCleanRes string  fileRes  ) 
 

Copies the result of the CleanFile phase into the file fileRes.

Parameters:
fileRes,: The name of the file where the result will be saved in (*.anchor.clean in our case).

template<class GENOME_TYPE>
void CleanFile< GENOME_TYPE >::intersection const CleanFile< GENOME_TYPE > &  clean,
vector< SEQ< GENOME_TYPE > > &  res1,
vector< SEQ< GENOME_TYPE > > &  res2,
string  fileRes
const
 

Copies the intersection result between two CleanFile objects into the file fileRes and returns two vector of the intersected entries, one of each CleanFile object.

Parameters:
clean,: A CleanFile object which will be tested with intersection with the calling object.
res1,: A vector< SEQ<GENOME_TYPE> > reference where the entries of the calling object (which are a part of the intersection) will be saved in.
res2,: A vector< SEQ<GENOME_TYPE> > reference where the entries of the "clean" object (which are a part of the intersection) will be saved in.
fileRes,: The name of the file where the intersection result will be saved in.

template<class GENOME_TYPE>
bool CleanFile< GENOME_TYPE >::isdigit char  c  )  [private]
 

Checks if the given character is a digit.

Parameters:
c,: char
Returns:
bool: true if c is a digit, false otherwise

template<class GENOME_TYPE>
bool CleanFile< GENOME_TYPE >::isspace char  c  )  [private]
 

Checks if the given character is a space.

Parameters:
c,: char
Returns:
bool: true if c is space, false otherwise

template<class GENOME_TYPE>
void CleanFile< GENOME_TYPE >::legalize_it FILE *  file  )  [private]
 

The main method of this class which legalizes the *.anchor file.

Parameters:
file,: FILE* of the *.anchor file.

template<class GENOME_TYPE>
void CleanFile< GENOME_TYPE >::MakeLegal  ) 
 

The main method of the CleanFile class is MakeLegal which actually invokes the legalizing process.

template<class GENOME_TYPE>
int CleanFile< GENOME_TYPE >::skipspaces string  ar  )  [private]
 

Skips leading spaces of the given string.

Parameters:
ar,: string
Returns:
int: The first index of the cell that differs from space

template<class GENOME_TYPE>
GENOME_TYPE CleanFile< GENOME_TYPE >::string2GENOMEType string  str  )  [private]
 

Converts a string into an unsigned GENOME_TYPE number.

Parameters:
str,: string
Returns:
The unsigned GENOME_TYPE number.

template<class GENOME_TYPE>
void CleanFile< GENOME_TYPE >::Tokenize const string &  str,
vector< string > &  tokens,
const string &  delimiters
[private]
 

Splits str into tokens according to the given delimiters.

Parameters:
str,: string.
tokens,: vector<string> reference to the place where the result will be saved in.
delimiters,: string


Member Data Documentation

template<class GENOME_TYPE>
string CleanFile< GENOME_TYPE >::fileN [private]
 

fileN variable holds the name of the file (*.anchor) containing the KO's.

template<class GENOME_TYPE>
set< SEQ<GENOME_TYPE> >* CleanFile< GENOME_TYPE >::segments [private]
 

A set of all legal entries (SEQ<GENOME_TYPE> objects) of the given file.


The documentation for this class was generated from the following file:
Generated on Tue May 9 18:43:46 2006 for PrePro by  doxygen 1.4.6-NO