31 void dumpHistogram(std::vector<std::vector< unsigned int> > &hist,
float step)
35 for(
unsigned int ui=0;ui<hist.size();ui++)
37 cout << step*ui <<
"\t";
39 for(
unsigned int uj=0;uj<hist.size();uj++)
41 cout << hist[ui][uj] <<
"\t";
48 int main(
int argc,
char *argv[])
54 cerr <<
"USAGE : " << argv[0] <<
" EPOSFILE MASS_STEP" << endl;
62 cerr <<
"Unable to understand stepsize :" << argv[2] << endl;
68 cerr <<
"Stepsize must be nonzero and positive " << endl;
73 std::string filename = argv[1];
74 cerr <<
"Processing file :" << filename << endl;
76 vector<vector<unsigned int> > histogram;
77 unsigned int offset=0;
78 unsigned int entriesLeft;
79 const float END_MASS=300;
88 const unsigned int CHUNK_SIZE=1e4;
89 vector<EPOS_ENTRY> eposIons;
95 cerr <<
"Unable to load file :" << filename << endl;
96 cerr <<
" reason :" << errCode << endl;
103 pb.
update(100.0f*(
float)offset/(
float)(offset+entriesLeft/CHUNK_SIZE));
110 (eposIons,histogram,stepSize,END_MASS))
112 cerr <<
"Correlation histogram generation failed. Are ions sequenced correctly??" << endl;
int main(int argc, char *argv[])
bool accumulateCorrelationHistogram(const std::vector< EPOS_ENTRY > &eposIons, std::vector< std::vector< unsigned int > > &histogram, float stepMass, float endMass, bool lowerTriangular=true)
Increments a correlation histogram, as per correlationHistogram,.
void finish()
Finalise the progress bar. It is not necessary for the progress to be set to 100%, this is done for you.
void init()
Draw the initial progress bar.
void dumpHistogram(std::vector< std::vector< unsigned int > > &hist, float step)
void setLength(unsigned int l)
Set the number of markers in the progress bar.
bool stream_cast(T1 &result, const T2 &obj)
Template function to cast and object to another by the stringstream.
void update(unsigned int newProgress)
Draw the progress bar as needed, using the given progress value [0,100].
size_t chunkLoadEposFile(std::vector< EPOS_ENTRY > &outData, const char *filename, unsigned int chunkSize, unsigned int chunkOffset, unsigned int &nEntriesLeft)
Load an "EPOS" file, with a maximum chunk size.