| 
0
 | 
     1 /*****************************************************************************
 | 
| 
 | 
     2   closestBed.h
 | 
| 
 | 
     3 
 | 
| 
 | 
     4   (c) 2009 - Aaron Quinlan
 | 
| 
 | 
     5   Hall Laboratory
 | 
| 
 | 
     6   Department of Biochemistry and Molecular Genetics
 | 
| 
 | 
     7   University of Virginia
 | 
| 
 | 
     8   aaronquinlan@gmail.com
 | 
| 
 | 
     9 
 | 
| 
 | 
    10   Licenced under the GNU General Public License 2.0 license.
 | 
| 
 | 
    11 ******************************************************************************/
 | 
| 
 | 
    12 #ifndef CLOSESTBED_H
 | 
| 
 | 
    13 #define CLOSESTBED_H
 | 
| 
 | 
    14 
 | 
| 
 | 
    15 #include "bedFile.h"
 | 
| 
 | 
    16 #include <vector>
 | 
| 
 | 
    17 #include <iostream>
 | 
| 
 | 
    18 #include <fstream>
 | 
| 
 | 
    19 
 | 
| 
 | 
    20 using namespace std;
 | 
| 
 | 
    21 
 | 
| 
 | 
    22 //************************************************
 | 
| 
 | 
    23 // Class methods and elements
 | 
| 
 | 
    24 //************************************************
 | 
| 
 | 
    25 class BedClosest {
 | 
| 
 | 
    26 
 | 
| 
 | 
    27 public:
 | 
| 
 | 
    28 
 | 
| 
 | 
    29     // constructor
 | 
| 
 | 
    30     BedClosest(string &bedAFile, string &bedBFile, 
 | 
| 
 | 
    31                bool sameStrand, bool diffStrand, string &tieMode, 
 | 
| 
 | 
    32                bool reportDistance, bool signDistance, string &strandedDistMode,
 | 
| 
 | 
    33                bool ignoreOverlaps);
 | 
| 
 | 
    34 
 | 
| 
 | 
    35     // destructor
 | 
| 
 | 
    36     ~BedClosest(void);
 | 
| 
 | 
    37 
 | 
| 
 | 
    38     // find the closest feature in B to A
 | 
| 
 | 
    39     void FindClosestBed();
 | 
| 
 | 
    40 
 | 
| 
 | 
    41 private:
 | 
| 
 | 
    42 
 | 
| 
 | 
    43     // data
 | 
| 
 | 
    44     string _bedAFile;
 | 
| 
 | 
    45     string _bedBFile;
 | 
| 
 | 
    46     string _tieMode;
 | 
| 
 | 
    47     bool   _sameStrand;
 | 
| 
 | 
    48     bool   _diffStrand;
 | 
| 
 | 
    49     bool   _reportDistance;
 | 
| 
 | 
    50     bool   _signDistance;
 | 
| 
 | 
    51     string _strandedDistMode;
 | 
| 
 | 
    52     bool   _ignoreOverlaps;
 | 
| 
 | 
    53 
 | 
| 
 | 
    54     BedFile *_bedA, *_bedB;
 | 
| 
 | 
    55 
 | 
| 
 | 
    56     // methods
 | 
| 
 | 
    57     void reportNullB();
 | 
| 
 | 
    58     void FindWindowOverlaps(BED &, vector<BED> &);
 | 
| 
 | 
    59 
 | 
| 
 | 
    60 };
 | 
| 
 | 
    61 #endif /* CLOSEST_H */
 |