#include "mysql++.h"#include <string>#include "bioseq.h"#include "dynaln.h"#include <math.h>#include <fstream>#include "strformat.h"#include <map>#include "dbinfo.h"#include "dbalnhelper.h"Defines | |
| #define | MYSQLPLUS2 |
Functions | |
| void | getPrt (mysqlpp::Query &q, const string &id, string &prt) |
| void | alignProtein (const string &alnfile, const string &alntabfile, const string &pairtab, const string &prtsrctab, Connection &conn, const int bidx, const int rowcnt) |
| void | alignDNA (const string &alnfile, const string &alntabfile, const string &pairtab, mysqlpp::Connection &conn, mysqlpp::Connection &conn1, mysqlpp::Connection &conn2) |
| void | bufferGenomic (mysqlpp::Connection &conn, const string &sqlstr, map< string, DNA > &id2seq) |
| void | storeProteinIntoMap (Connection &conn, const string &srctab, map< unsigned int, string > &id2seq, const string &pairtab, const int bidx, const int rowcnt) |
| void | storeInMap (Connection &conn, const string &srctab, map< unsigned int, string > &id2seq, const string &pairtab, const int bidx, const int rowcnt) |
| int | main (int argc, char *argv[]) |
| #define MYSQLPLUS2 |
| void alignDNA | ( | const string & | alnfile, | |
| const string & | alntabfile, | |||
| const string & | pairtab, | |||
| mysqlpp::Connection & | conn, | |||
| mysqlpp::Connection & | conn1, | |||
| mysqlpp::Connection & | conn2 | |||
| ) |
| void alignProtein | ( | const string & | alnfile, | |
| const string & | alntabfile, | |||
| const string & | pairtab, | |||
| const string & | prtsrctab, | |||
| Connection & | conn, | |||
| const int | bidx, | |||
| const int | rowcnt | |||
| ) |
| void bufferGenomic | ( | mysqlpp::Connection & | conn, | |
| const string & | sqlstr, | |||
| map< string, DNA > & | id2seq | |||
| ) |
| void getPrt | ( | mysqlpp::Query & | q, | |
| const string & | id, | |||
| string & | prt | |||
| ) |
DESCRIPTION use three connections, the first connection provide the alignment pairs. the second and the third provided the raw sequences All three connections can be the same. each connection provide a table.
Input: all from one database the tab must have id and seq column
| int main | ( | int | argc, | |
| char * | argv[] | |||
| ) |
| void storeInMap | ( | Connection & | conn, | |
| const string & | srctab, | |||
| map< unsigned int, string > & | id2seq, | |||
| const string & | pairtab, | |||
| const int | bidx, | |||
| const int | rowcnt | |||
| ) |
this take advantage the fact that all primary key in the nr should be the gi number which is a value < 2 billion so far
| void storeProteinIntoMap | ( | Connection & | conn, | |
| const string & | srctab, | |||
| map< unsigned int, string > & | id2seq, | |||
| const string & | pairtab, | |||
| const int | bidx, | |||
| const int | rowcnt | |||
| ) |
this function fetches protein sequences and stored them locally as a map data structure. Using a tree map is very slow. needs to use a hash_map
1.5.6