Commit c55b92c9 authored by Swift Genomics's avatar Swift Genomics Committed by swiftgenomics
Browse files

Use a func to add indexing options.

Also format the code.
parent 9620d139
Loading
Loading
Loading
Loading
+19 −9
Original line number Diff line number Diff line
@@ -9,16 +9,25 @@
#include "cxxopts.hpp"

namespace chromap {
namespace {

void ChromapDriver::ParseArgsAndRun(int argc, char *argv[]) {
  cxxopts::Options options(
      "chromap", "Fast alignment and preprocessing of chromatin profiles");
void AddIndexingOptions(cxxopts::Options &options) {
  options.add_options("Indexing")("i,build-index", "Build index")(
      "min-frag-length",
      "Min fragment length for choosing k and w automatically [30]",
      cxxopts::value<int>(),
      "INT")("k,kmer", "Kmer length [17]", cxxopts::value<int>(), "INT")(
      "w,window", "Window size [7]", cxxopts::value<int>(), "INT");
}

}  // namespace

void ChromapDriver::ParseArgsAndRun(int argc, char *argv[]) {
  cxxopts::Options options(
      "chromap", "Fast alignment and preprocessing of chromatin profiles");

  AddIndexingOptions(options);

  options.set_width(120).add_options("Mapping")
      //("m,map", "Map reads")
      ("preset",
@@ -120,8 +129,9 @@ void ChromapDriver::ParseArgsAndRun(int argc, char *argv[]) {
          cxxopts::value<std::string>(),
          "FILE")("barcode-translate",
                  "Convert barcode to the specified sequences during output",
                  cxxopts::value<std::string>(), "FILE")
            ("summary", "Summarize the mapping statistics at bulk or barcode level",
                  cxxopts::value<std::string>(), "FILE")(
          "summary",
          "Summarize the mapping statistics at bulk or barcode level",
          cxxopts::value<std::string>(), "FILE");
  //("PAF", "Output mappings in PAF format (only for test)");
  options.add_options()("v,version", "Print version")("h,help", "Print help");