]> git.donarmstrong.com Git - bamtools.git/blob - bamtools_coverage.h
Reorganization of toolkit. Split subtools out to own headers. Added custom getopt...
[bamtools.git] / bamtools_coverage.h
1 // ***************************************************************************
2 // bamtools_coverage.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 coverage statistics for a single BAM file 
9 //
10 // ** Expand to multiple?? 
11 //
12 // ***************************************************************************
13
14 #ifndef BAMTOOLS_COVERAGE_H
15 #define BAMTOOLS_COVERAGE_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 BamCoverageHelp(void) { 
26     std::cerr << std::endl;
27     std::cerr << "usage:\tbamtools coverage [--in BAM file]" << std::endl;
28     std::cerr << "\t-i, --in\tInput BAM file to generate coverage stats\t[default=stdin]" << std::endl;
29     std::cerr << std::endl;
30     return 0;
31 }
32
33 int RunBamCoverage(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('i', "in", &inputFilename);
40     
41     if ( !options.parse() ) return BamCoverageHelp();
42     if ( inputFilename.empty() ) { inputFilename = "stdin"; }
43     
44 //     // open our BAM reader
45 //     BamReader reader;
46 //     reader.Open(inputFilename);
47     
48     // generate coverage stats
49     std::cerr << "Generating coverage 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_COVERAGE_H