forked from sim82/papara_nt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathblast_partassign.h
85 lines (54 loc) · 1.69 KB
/
blast_partassign.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#ifndef __blast_partassign_h
#define __blast_partassign_h
#include <string>
#include <iostream>
#include <vector>
#include <map>
namespace papara {
template<typename pvec_t, typename seq_tag>
class references;
template<typename seq_tag>
class queries;
}
namespace partassign {
struct blast_hit {
std::string qs_name;
std::string ref_name;
int qs_start;
int qs_end;
int ref_start;
int ref_end;
float bit_score;
// std::string bit_score;
// double evalue;
};
class partition {
public:
partition() : start(-1), end(-1) {}
int start;
int end;
std::string gene_name;
};
// static bool not_space( char x ) {
// return !isspace(x); // doing the same with pre-c++11 functional is ridiculus
// }
blast_hit next_hit( std::istream &is );
partition next_partition( std::istream &is );
class part_assignment {
public:
part_assignment( std::istream &blast_out, std::istream &part_file ) ;
// const partassign::partition &partition( const std::string &name ) const ;
const blast_hit &get_blast_hit( const std::string &qs_name ) const;
const std::vector<partassign::partition> &partitions() const {
return partitions_;
}
private:
std::vector<partassign::partition> partitions_;
//std::map<std::string,int> assignments_;
std::map<std::string,partassign::blast_hit> hits_;
};
template<typename pvec_t, typename seq_tag>
std::vector<std::pair<size_t,size_t> > resolve_qs_bounds( papara::references<pvec_t,seq_tag> &refs, papara::queries<seq_tag> &qs, const partassign::part_assignment &part_assign );
std::pair<size_t,size_t> partition_bounds( std::istream &is, const std::string &name );
}
#endif