PREPRO< GENOME_TYPE > Class Template Reference

#include <prepro.h>

List of all members.

Public Member Functions

 PREPRO (string &f1, string &f2)
void getGenome (string &buff, int whichOne) const
string * gAlign (vector< KIS< GENOME_TYPE > > &kisses, long &len)
vector< lightKIS< GENOME_TYPE > > & lAlign (string &chunks, int whichOne) const
vector< lightKIS< GENOME_TYPE > > & extractGaps (string *results, vector< KIS< GENOME_TYPE > > &kisses) const
vector< vector< lightKIS<
GENOME_TYPE > > * > & 
extractBPCoords (vector< lightKIS< GENOME_TYPE > > &res)
string * extractBP (vector< vector< lightKIS< GENOME_TYPE > > * > &res)
void toString (unsigned long num, string &result) const
vector< lightKIS< GENOME_TYPE > > & stitchHits (vector< lightKIS< GENOME_TYPE > > &res) const
string * GAOnStitchedHits (vector< lightKIS< GENOME_TYPE > > &stitchedHits) const
vector< lightKIS< GENOME_TYPE > > & extractGapsFromHits (string *results, vector< lightKIS< GENOME_TYPE > > &hits) const
void addToKISTable (vector< lightKIS< GENOME_TYPE > > &add, vector< lightKIS< GENOME_TYPE > > &kisTable) const
void print (vector< lightKIS< GENOME_TYPE > > &vec) const
int printToFile (vector< lightKIS< GENOME_TYPE > > &vec, string fileName) const

Private Member Functions

void transformSeq (char *arr) const
void getGene (FILE *f, string &buff)
string labelIt (GENOME_TYPE i, long count, string name) const
void checkStitchedHits (vector< lightKIS< GENOME_TYPE > > &res) const
void unionHits (lightKIS< GENOME_TYPE > &elm1, lightKIS< GENOME_TYPE > &elm2) const
void stitch (vector< lightKIS< GENOME_TYPE > > &res) const
void refineGapTable (long **gaps, long **gaps1, long **gaps2, long &len, string &seq1, string &seq2) const
void refineKISTable (vector< KIS< GENOME_TYPE > > &kisses, long **gaps1, long **gaps2, long len, unsigned int i, vector< lightKIS< GENOME_TYPE > > &newkis) const
void refineHitTable (vector< lightKIS< GENOME_TYPE > > &hits, long **gaps1, long **gaps2, long len, unsigned int i, vector< lightKIS< GENOME_TYPE > > &newhit) const

Private Attributes

string fileName1
string fileName2
string genome1
string genome2

template<class GENOME_TYPE>
class PREPRO< GENOME_TYPE >


Constructor & Destructor Documentation

template<class GENOME_TYPE>
PREPRO< GENOME_TYPE >::PREPRO string &  f1,
string &  f2
[inline]
 

Constructor.

Parameters:
f1,: string& The path for the first *.anchor file.
f2,: string& The path for the second *.anchor file.


Member Function Documentation

template<class GENOME_TYPE>
void PREPRO< GENOME_TYPE >::addToKISTable vector< lightKIS< GENOME_TYPE > > &  add,
vector< lightKIS< GENOME_TYPE > > &  kisTable
const
 

Simply adds the table "add" to the table "kisTable" ("add" is the table we get from the extractGapsFromHits method).

Parameters:
add,: vector< lightKIS<GENOME_TYPE> >&
kisTable,: vector< lightKIS<GENOME_TYPE> >&

template<class GENOME_TYPE>
void PREPRO< GENOME_TYPE >::checkStitchedHits vector< lightKIS< GENOME_TYPE > > &  res  )  const [private]
 

Checks the lengths of the stitched hits against a predefined threshold (stitchMinLen).

Parameters:
res,: vector< lightKIS<GENOME_TYPE> >& Note: The stitched hits are also considered as lightKIS objects so the name of the class doesn't bind it to hold only KIS.

template<class GENOME_TYPE>
string * PREPRO< GENOME_TYPE >::extractBP vector< vector< lightKIS< GENOME_TYPE > > * > &  res  ) 
 

Extracts the breakpoints out of the genomes and returns an array of two strings where both strings are a multifasta file alike. First string is all breakpoints of the first genome, Second string is all breakpoints of the second genome. Each breakpoint is recognized by its title ( >number of genome (1/2) start of breakpoint end of breakpoint)

Parameters:
res,: vector< vector< lightKIS<GENOME_TYPE> >* >& The result we get from extractBPCoords.
Returns:
string*

template<class GENOME_TYPE>
vector< vector< lightKIS< GENOME_TYPE > > * > & PREPRO< GENOME_TYPE >::extractBPCoords vector< lightKIS< GENOME_TYPE > > &  res  ) 
 

Extracts the breakpoints coordinates out of the KIS table "res" taking into consideration the circularity of both genomes. The method returns a vector of two vector pointers where the first one includes the breakpoint coordinates of the first genome and the second for the second.

Parameters:
res,: vector< lightKIS<GENOME_TYPE> >& The new KIS table we get after extracting gaps.
Returns:
vector< vector< lightKIS<GENOME_TYPE> >* >&

template<class GENOME_TYPE>
vector< lightKIS< GENOME_TYPE > > & PREPRO< GENOME_TYPE >::extractGaps string *  results,
vector< KIS< GENOME_TYPE > > &  kisses
const
 

Extracts the gaps out of the global alignment results on the KIS table (uses file umr.h).

Parameters:
results,: string* A pointer to the array of global alignment results where string 2*i and 2*i+1 are the results of the global alignment on KIS i.
kisses,: vector< KIS<GENOME_TYPE> >& The KIS table.
Returns:
vector< lightKIS<GENOME_TYPE> >& The new and refined KIS table.

template<class GENOME_TYPE>
vector< lightKIS< GENOME_TYPE > > & PREPRO< GENOME_TYPE >::extractGapsFromHits string *  results,
vector< lightKIS< GENOME_TYPE > > &  hits
const
 

Extracts the gaps out of the global alignment results on the SIS table (uses file umr.h).

Parameters:
results,: string* A pointer to the array of global alignment results where string 2*i and 2*i+1 are the results of the global alignment on SIS i.
hits,: vector< KIS<GENOME_TYPE> >& The SIS table.
Returns:
vector< lightKIS<GENOME_TYPE> >& The new and refined SIS table.

template<class GENOME_TYPE>
string * PREPRO< GENOME_TYPE >::gAlign vector< KIS< GENOME_TYPE > > &  kisses,
long &  len
 

Global alignment method (uses MAFFT) (used also to globally align every table that is structured from a vector of KIS objects).

Parameters:
kisses vector< KIS<GENOME_TYPE> >&
len,: long& Will hold the length of the returned string array.
Returns:
string* An array of the results where string 2*i and 2*i+1 are the results of the global alignment on KIS i.

template<class GENOME_TYPE>
string * PREPRO< GENOME_TYPE >::GAOnStitchedHits vector< lightKIS< GENOME_TYPE > > &  stitchedHits  )  const
 

The main global alignment method for stitched hits (used also to globally align every table that is structured from a vector of lightKIS objects).. Receives the stitchedHits method's result and performs MAFFT's global alignment procedure on them. The result of the global alignment is returned as an array of strings where string 2*i and 2*i+1 are the results of the global alignment on SIS i.

Parameters:
stitchedHits,: vector< lightKIS<GENOME_TYPE> >&
Returns:
string*

template<class GENOME_TYPE>
void PREPRO< GENOME_TYPE >::getGene FILE *  f,
string &  buff
[private]
 

Ectracts the genome from file "f" into the string "buff". Note that no title will be saved in buff, just nucleotides.

Parameters:
f,: FILE* The pointer to the file with the genome.
buff,: string& A reference to the string where we want to save the genome in.

template<class GENOME_TYPE>
void PREPRO< GENOME_TYPE >::getGenome string &  buff,
int  whichOne
const
 

Returns one of the genomes in buff (according to whichOne flag, 0 for genome1, 1 for genome2).

Parameters:
buff,: string&
whichOne,: int

template<class GENOME_TYPE>
string PREPRO< GENOME_TYPE >::labelIt GENOME_TYPE  i,
long  count,
string  name
const [private]
 

An auxiliary mathod that returns the string name+i+"."+count.

Parameters:
i,: GENOME_TYPE
count,: long
name,: string
Returns:
string

template<class GENOME_TYPE>
vector< lightKIS< GENOME_TYPE > > & PREPRO< GENOME_TYPE >::lAlign string &  chunks,
int  whichOne
const
 

Local alignment method (includes YASS).

Parameters:
chunks,: string& A parameter which is parallel to a multifasta file given to YASS.
whichOne,: int Tells us which genome we'd like to include to the local alignment process (0 for genome1, 1 for genome2).
Returns:
vector< lightKIS<GENOME_TYPE> >& A vector of all YASS's results sorted in an alphabetic order according to each chunk's title (whatever comes after each ">").

template<class GENOME_TYPE>
void PREPRO< GENOME_TYPE >::print vector< lightKIS< GENOME_TYPE > > &  vec  )  const
 

Prints the table "vec" to the standard output.

Parameters:
vec,: vector< lightKIS<GENOME_TYPE> >&

template<class GENOME_TYPE>
int PREPRO< GENOME_TYPE >::printToFile vector< lightKIS< GENOME_TYPE > > &  vec,
string  fileName
const
 

Prints the table "vec" to the path "fileName".

Parameters:
vec,: vector< lightKIS<GENOME_TYPE> >&
fileName,: The file where the result would be.
Returns:
int 0 in case of success, 1 in case we failed to open the file, 2 in case the table is empty.

template<class GENOME_TYPE>
void PREPRO< GENOME_TYPE >::refineGapTable long **  gaps,
long **  gaps1,
long **  gaps2,
long &  len,
string &  seq1,
string &  seq2
const [private]
 

Refines the gap table by saving the absolute value of the coordinates of "gaps" (gaps holds the extracted unmatched regions. see umr.h) in "gaps1" (coordinates of first genome) and "gaps2" (coordinates of second genome).

Parameters:
gaps,: long**
gaps1,: long**
gaps2,: long**
len,: long& At the beginning of the method it symbolizes the number of unmatched regions in "gaps", at the end it symbolizes the number of unmatched regions in each one of "gaps1" and "gaps2".
seq1,: string& The first sequence we are working on.
seq2,: string& The second sequence we are working on.

template<class GENOME_TYPE>
void PREPRO< GENOME_TYPE >::refineHitTable vector< lightKIS< GENOME_TYPE > > &  hits,
long **  gaps1,
long **  gaps2,
long  len,
unsigned int  i,
vector< lightKIS< GENOME_TYPE > > &  newhit
const [private]
 

Refines the i'th hit of the hits table according to the given refined gaps for both sequences in the hit.

Parameters:
hits,: vector< lightKIS<GENOME_TYPE> >&
gaps1,: long** The result of "refineGapTable" method.
gaps2,: long** The result of "refineGapTable" method.
len,: long The number of entries in "gaps1" and "gaps2".
i,: unsigned int The hit we want to refine.
newhit,: vector< lightKIS<GENOME_TYPE> >& The new refined table (adds the refined hit to the end of the table newhit).

template<class GENOME_TYPE>
void PREPRO< GENOME_TYPE >::refineKISTable vector< KIS< GENOME_TYPE > > &  kisses,
long **  gaps1,
long **  gaps2,
long  len,
unsigned int  i,
vector< lightKIS< GENOME_TYPE > > &  newkis
const [private]
 

Refines the i'th KIS of the KIS table according to the given refined gaps for both sequences in the KIS.

Parameters:
kisses,: vector< KIS<GENOME_TYPE> >&
gaps1,: long** The result of "refineGapTable" method.
gaps2,: long** The result of "refineGapTable" method.
len,: long The number of entries in "gaps1" and "gaps2".
i,: unsigned int The KIS we want to refine.
newkis,: vector< lightKIS<GENOME_TYPE> >& The new refined table (includes just the refined KIS).

template<class GENOME_TYPE>
void PREPRO< GENOME_TYPE >::stitch vector< lightKIS< GENOME_TYPE > > &  res  )  const [private]
 

Performs the action of stitching hits on a given local alignment result (which can also be held in a lightKIS object).

Parameters:
res,: vector< lightKIS<GENOME_TYPE> >&

template<class GENOME_TYPE>
vector< lightKIS< GENOME_TYPE > > & PREPRO< GENOME_TYPE >::stitchHits vector< lightKIS< GENOME_TYPE > > &  res  )  const
 

The main stitching method that receives the result of the local alignment and performs the procedure of stitching hits on it. The stitched hits are returned in a vector of lightKIS objects.

Parameters:
res,: vector< lightKIS<GENOME_TYPE> >&
Returns:
vector< lightKIS<GENOME_TYPE> >&

template<class GENOME_TYPE>
void PREPRO< GENOME_TYPE >::toString unsigned long  num,
string &  result
const
 

Converts the positive number num to a string.

Parameters:
num,: unsigned long
result,: string& The result of the converted number.

template<class GENOME_TYPE>
void PREPRO< GENOME_TYPE >::transformSeq char *  arr  )  const [private]
 

An auxiliary mathod that inverts and transforms a given sequence (A<=>T , G<=>C).

Parameters:
arr,: char* A pointer to the array including the sequence.

template<class GENOME_TYPE>
void PREPRO< GENOME_TYPE >::unionHits lightKIS< GENOME_TYPE > &  elm1,
lightKIS< GENOME_TYPE > &  elm2
const [private]
 

Unions two stitched hits according to MAGIC's paper.

Parameters:
elm1,: lightKIS<GENOME_TYPE>&
elm2,: lightKIS<GENOME_TYPE>&


Member Data Documentation

template<class GENOME_TYPE>
string PREPRO< GENOME_TYPE >::fileName1 [private]
 

The path for the first *.anchor file.

template<class GENOME_TYPE>
string PREPRO< GENOME_TYPE >::fileName2 [private]
 

The path for the second *.anchor file.

template<class GENOME_TYPE>
string PREPRO< GENOME_TYPE >::genome1 [private]
 

The first genome (extracted from file *.genome).

template<class GENOME_TYPE>
string PREPRO< GENOME_TYPE >::genome2 [private]
 

The second genome (extracted from file *.genome).


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