1 // ***************************************************************************
2 // bamtools_stats.cpp (c) 2010 Derek Barnett, Erik Garrison
3 // Marth Lab, Department of Biology, Boston College
4 // All rights reserved.
5 // ---------------------------------------------------------------------------
6 // Last modified: 1 June 2010
7 // ---------------------------------------------------------------------------
8 // Prints general statistics for a single BAM file
10 // ** Expand to multiple??
12 // ***************************************************************************
17 #include "bamtools_stats.h"
18 #include "bamtools_options.h"
19 #include "BamReader.h"
22 using namespace BamTools;
24 // ---------------------------------------------
25 // StatsSettings implementation
27 struct StatsTool::StatsSettings {
30 bool HasInputBamFilename;
33 string InputBamFilename;
37 : HasInputBamFilename(false)
38 , InputBamFilename(Options::StandardIn())
42 // ---------------------------------------------
43 // StatsTool implementation
45 StatsTool::StatsTool(void)
47 , m_settings(new StatsSettings)
49 // set program details
50 Options::SetProgramInfo("bamtools stats", "prints general stats for a BAM file", "[-in <filename>]");
53 OptionGroup* IO_Opts = Options::CreateOptionGroup("Input & Output");
54 Options::AddValueOption("-in", "BAM filename", "the input BAM file", "", m_settings->HasInputBamFilename, m_settings->InputBamFilename, IO_Opts, Options::StandardIn());
57 StatsTool::~StatsTool(void) {
62 int StatsTool::Help(void) {
63 Options::DisplayHelp();
67 int StatsTool::Run(int argc, char* argv[]) {
69 // parse command line arguments
70 Options::Parse(argc, argv, 1);