1 |
#ifndef DELETIONS_H |
2 |
#define DELETIONS_H |
3 |
/* |
4 |
* deletions.h |
5 |
* TopHat |
6 |
* |
7 |
* Created by Ryan Kelley on 11/09/2010 |
8 |
* |
9 |
*/ |
10 |
|
11 |
#include <cstdio> |
12 |
#include <vector> |
13 |
#include <string> |
14 |
#include <set> |
15 |
#include <iostream> |
16 |
#include <fstream> |
17 |
#include <cstring> |
18 |
#include <seqan/sequence.h> |
19 |
#include <seqan/find.h> |
20 |
#include <seqan/file.h> |
21 |
|
22 |
#include "bwt_map.h" |
23 |
#include "junctions.h" |
24 |
using namespace std; |
25 |
|
26 |
typedef Junction Deletion; |
27 |
struct DeletionStats |
28 |
{ |
29 |
DeletionStats() : left_extent(0), right_extent(0), supporting_hits(0) {} |
30 |
|
31 |
DeletionStats& merge_with(const DeletionStats& other) |
32 |
{ |
33 |
if (this == &other) |
34 |
return *this; |
35 |
|
36 |
left_extent = max(left_extent, other.left_extent); |
37 |
right_extent = max(right_extent, other.right_extent); |
38 |
supporting_hits += other.supporting_hits; |
39 |
|
40 |
return *this; |
41 |
} |
42 |
|
43 |
int left_extent; |
44 |
int right_extent; |
45 |
int supporting_hits; |
46 |
}; |
47 |
|
48 |
typedef std::map<Deletion, DeletionStats> DeletionSet; |
49 |
|
50 |
void deletions_from_alignment(const BowtieHit& spliced_alignment, DeletionSet& junctions); |
51 |
void deletions_from_spliced_hit(const BowtieHit& bh, vector<pair<Deletion, DeletionStats> >& deletions); |
52 |
void print_deletions(FILE* deletions_out, const DeletionSet& deletions, RefSequenceTable& ref_sequences); |
53 |
void merge_with(DeletionSet& deletions, const DeletionSet& other); |
54 |
|
55 |
#endif |