ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/gclib/tophat_cpp/fragments.h
Revision: 135
Committed: Mon Dec 12 22:28:38 2011 UTC (8 years, 10 months ago) by gpertea
File size: 1700 byte(s)
Log Message:
wip - SplicedSAMHitFactory() still not implemented

Line User Rev File contents
1 gpertea 29 #ifndef FRAGMENTS_H
2     #define FRAGMENTS_H
3     /*
4     * fragments.h
5     * TopHat
6     *
7     * Created by Cole Trapnell on 1/14/09.
8     * Copyright 2009 Cole Trapnell. All rights reserved.
9     *
10     */
11    
12     #include "bwt_map.h"
13     #include "align_status.h"
14    
15     typedef BowtieHit FragmentAlignment;
16    
17     struct FragmentAlignmentGrade
18     {
19     FragmentAlignmentGrade()
20     {
21 gpertea 135 //edit_dist = 0;
22 gpertea 29 num_alignments = 0;
23     status = AlignStatus();
24     }
25    
26     FragmentAlignmentGrade(const BowtieHit& h1, const JunctionSet& gtf_junctions)
27     {
28     status = AlignStatus(h1, gtf_junctions);
29 gpertea 135 //edit_dist = h1.edit_dist();
30 gpertea 29 num_alignments = 1;
31     }
32    
33     FragmentAlignmentGrade& operator=(const FragmentAlignmentGrade& rhs)
34     {
35     status = rhs.status;
36 gpertea 135 //edit_dist = rhs.edit_dist;
37 gpertea 29 num_alignments = rhs.num_alignments;
38    
39     return *this;
40     }
41    
42     // Returns true if rhs is a "happier" alignment for the ends of this insert
43     // than this InsertStatus.
44    
45     bool operator<(const FragmentAlignmentGrade& rhs)
46     {
47 gpertea 135 // -- Geo: check this
48     //if (status != rhs.status)
49 gpertea 29 return status < rhs.status;
50    
51 gpertea 135 //return rhs.edit_dist < edit_dist;
52 gpertea 29 }
53    
54     AlignStatus status;
55 gpertea 135 //int edit_dist;
56 gpertea 29 int num_alignments; // number of equally good alignments for this fragment
57     };
58    
59     typedef vector<pair<FragmentAlignmentGrade, vector<FragmentAlignment*> > > BestFragmentAlignmentTable;
60    
61     void best_fragment_mappings(uint64_t refid,
62     const string& name,
63     HitList& hits1_in_ref,
64     ReadTable& it,
65     BestFragmentAlignmentTable& best_status_for_fragments);
66    
67     void accept_best_hits(BestFragmentAlignmentTable& best_status_for_fragments);
68     void accept_unique_hits(BestFragmentAlignmentTable& best_status_for_fragments);
69    
70     #endif