]> git.donarmstrong.com Git - bamtools.git/blob - bamtools_stats.h
Reorganization of toolkit. Split subtools out to own headers. Added custom getopt...
[bamtools.git] / bamtools_stats.h
1 // ***************************************************************************
2 // bamtools_stats.h (c) 2010 Derek Barnett, Erik Garrison
3 // Marth Lab, Department of Biology, Boston College
4 // All rights reserved.
5 // ---------------------------------------------------------------------------
6 // Last modified: 26 May 2010
7 // ---------------------------------------------------------------------------
8 // Prints general statistics for a single BAM file
9 //
10 // ** Expand to multiple??
11 //
12 // ***************************************************************************
13
14 #ifndef BAMTOOLS_STATS_H
15 #define BAMTOOLS_STATS_H
16
17 #include <iostream>
18 #include <string>
19
20 #include "BamReader.h"
21 #include "bamtools_getopt.h"
22
23 namespace BamTools {
24
25 int BamStatsHelp(void) { 
26     std::cerr << std::endl;
27     std::cerr << "usage:\tbamtools stats [--in BAM file]" << std::endl;
28     std::cerr << "\t-i, --in\tInput BAM file to calculate general stats\t[default=stdin]" << std::endl;
29     std::cerr << std::endl;
30     return 0;
31 }
32
33 int RunBamStats(int argc, char* argv[]) {
34   
35     // else parse command line for args  
36     GetOpt options(argc, argv, 1);
37     
38     std::string inputFilename;
39     options.addOption('t', "inp", &inputFilename);
40     
41     if ( !options.parse() ) return BamStatsHelp();
42     if ( inputFilename.empty() ) { inputFilename = "stdin"; }
43     
44     // open our BAM reader
45 //     BamReader reader;
46 //     reader.Open(inputFilename);
47     
48     // calculate general stats
49     std::cerr << "Calculating general stats for " << inputFilename << std::endl;
50     std::cerr << "FEATURE NOT YET IMPLEMENTED!" << std::endl;
51     
52     // clean & exit
53 //     reader.Close();
54     return 0;
55 }
56
57 } // namespace BamTools
58
59 #endif // BAMTOOLS_STATS_H