dbalnhelper.h File Reference

#include <mysql++.h>
#include <string>

Go to the source code of this file.

Classes

struct  Alnrange

Functions

int table2map (map< int, string > &store, mysqlpp::Connection &conn, const string &tab, string idcol="id", string seqcol="seq")
int tableFillMap (map< int, string > &store, mysqlpp::Connection &conn, const string &tab, string idcol="id", string seqcol="seq")
int tableFillMapFirst (map< int, string > &store, const vector< pair< int, int > > &guide, mysqlpp::Connection &conn, const string &tab, string idcol="proteinId", string seqcol="seq")
int table2pair (vector< pair< int, int > > &pairs, mysqlpp::Connection &conn, const string &tab, string id1col="seq1id", string id2col="seq2id")
int table2vector (vector< Alnrange > &store, mysqlpp::Connection &conn, const string &tab, string id1col="seq1id", string id2col="seq2id")
bool tableExists (mysqlpp::Connection &conn, const string &tab)


Function Documentation

int table2map ( map< int, string > &  store,
mysqlpp::Connection &  conn,
const string &  tab,
string  idcol = "id",
string  seqcol = "seq" 
)

store all id => seq from tab in the database connection conn into buff.

Parameters:
conn Mysql database connection
buff result to store the id=>seq map
tab table name
idcol name of the idcolumn, default id
seqcol name of the sequence column default seq
Returns:
the number of proteins stored.

Referenced by alignProtein(), and loadprt::operator()().

int table2pair ( vector< pair< int, int > > &  pairs,
mysqlpp::Connection &  conn,
const string &  tab,
string  id1col = "seq1id",
string  id2col = "seq2id" 
)

Store a cross of two ids into a vector of pair of integers for future usage.

Parameters:
pairs is an empty vector to be filled.
Returns:
the number of distinct pairs.
Note we are only using int,int type. Future extention could convert this to a template function.

Referenced by alignProtein(), and loadpair::operator()().

int table2vector ( vector< Alnrange > &  store,
mysqlpp::Connection &  conn,
const string &  tab,
string  id1col = "seq1id",
string  id2col = "seq2id" 
)

Referenced by loadpair::operator()().

bool tableExists ( mysqlpp::Connection &  conn,
const string &  tab 
)

int tableFillMap ( map< int, string > &  store,
mysqlpp::Connection &  conn,
const string &  tab,
string  idcol = "id",
string  seqcol = "seq" 
)

Store proteinsequence into a map structure

Parameters:
store serve both as the input and output, this program fills the value part. The key part of the map serves as input. mysql Connection object table name
Fetch 100 proteins at a time from the table.

References string().

Referenced by tableFillMapFirst().

int tableFillMapFirst ( map< int, string > &  store,
const vector< pair< int, int > > &  guide,
mysqlpp::Connection &  conn,
const string &  tab,
string  idcol = "proteinId",
string  seqcol = "seq" 
)

overloaded version that uses a vector pair as input

References tableFillMap().

Referenced by alignProtein().


Generated on Wed Oct 14 21:49:19 2009 for Softwares from Orpara by  doxygen 1.5.6