ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/gclib/tophat_cpp/segments.h
Revision: 29
Committed: Tue Aug 2 21:24:54 2011 UTC (8 years, 10 months ago) by gpertea
File size: 1483 byte(s)
Log Message:
adding tophat source work

Line User Rev File contents
1 gpertea 29 /*
2     * segments.h
3     * TopHat
4     *
5     * Created by Cole Trapnell on 2/11/09.
6     * Copyright 2009 __MyCompanyName__. All rights reserved.
7     *
8     */
9     #include <vector>
10     #include <map>
11     #include "bwt_map.h"
12    
13     enum eREAD
14     {
15     READ_DONTCARE = 0,
16     READ_LEFT,
17     READ_RIGHT
18     };
19    
20     enum ePOINT_DIR
21     {
22     POINT_DIR_DONTCARE = 0,
23     POINT_DIR_LEFT,
24     POINT_DIR_RIGHT,
25     POINT_DIR_BOTH
26     };
27    
28     struct RefSeg
29     {
30     RefSeg() :
31     ref_id(0),
32     points_where(POINT_DIR_DONTCARE),
33     antisense(false),
34     read(READ_DONTCARE),
35     left(0),
36     right(0),
37     support_read("")
38     {}
39    
40     RefSeg(uint32_t i, ePOINT_DIR p, bool antisense, eREAD read, int l, int r, const string& support_read = "") :
41     ref_id(i),
42     points_where(p),
43     antisense(antisense),
44     read(read),
45     left(l),
46     right(r),
47     support_read(support_read)
48     {}
49    
50     bool operator<(const RefSeg& rhs) const
51     {
52     if (ref_id != rhs.ref_id)
53     return ref_id < rhs.ref_id;
54     if (left != rhs.left)
55     return left < rhs.left;
56     if (right != rhs.right)
57     return right < rhs.right;
58     return false;
59     }
60    
61     bool operator==(const RefSeg& rhs) const
62     {
63     return (ref_id == rhs.ref_id &&
64     left == rhs.left &&
65     right == rhs.right &&
66     points_where == rhs.points_where &&
67     antisense == rhs.antisense &&
68     read == rhs.read &&
69     support_read == rhs.support_read);
70     }
71    
72     uint32_t ref_id;
73     ePOINT_DIR points_where;
74     bool antisense;
75     eREAD read;
76     int left;
77     int right;
78    
79     string support_read;
80     };