Skip to content

Commit

Permalink
fixed xic construction, added commandline options
Browse files Browse the repository at this point in the history
  • Loading branch information
Buote Xu authored and Buote Xu committed Jun 15, 2012
1 parent 49d992c commit dfe8604
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions examples/example-bruker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ struct ProgramOptions
{
std::string inputfileName_;
std::string outputfileName_;
unsigned int segments_;
unsigned int overlap_;
};


Expand Down Expand Up @@ -112,11 +114,17 @@ int parseProgramOptions(int argc, char* argv[], ProgramOptions& options)
;

po::options_description config("Allowed options");
config.add_options();
config.add_options()
("segments", po::value<unsigned int>(&options.segments_)->default_value(
1),
"Number of segments the data should be partitioned in before using libfbi)
("overlap", po::value<double>(&options.overlap_)->default_value(
0),
"Overlap in time-dimension taken into account to not have 'jumps'");
po::options_description cmdline_options("Options available via command line");

cmdline_options.add(generic).add(config);
po::options_description visible("Allowed options");
po::positional_options_description p;
Expand Down Expand Up @@ -316,9 +324,9 @@ int main(int argc, char * argv[]) {
std::vector<unsigned int> labelcounts;
labelcounts.resize(nComponents, 0);
for (unsigned int i = 0; i < labels.size(); ++i) {
xics[labels[i]].mz_ += centroids[i].mz_;
xics[labels[i]].rt_ += centroids[i].rt_;
++labelcounts[labels[i]];
xics[labels[i] - 1].mz_ += centroids[i].mz_;
xics[labels[i] - 1].rt_ += centroids[i].rt_;
++labelcounts[labels[i] - 1];
}
for (unsigned int i = 0; i < xics.size(); ++i) {
xics[i].mz_ /= labelcounts[i];
Expand Down

0 comments on commit dfe8604

Please sign in to comment.