19 #ifndef ROSTLAB_BLAST_RESULT_H 20 #define ROSTLAB_BLAST_RESULT_H 25 #include <rostlab/aux_functions.h> 45 static const size_t noidx =
static_cast<size_t>(-1);
47 round(
size_t __oneline_idx = 0,
size_t __oneline_cnt = 0,
size_t __hit_idx = 0,
size_t __hit_cnt = 0,
size_t __oneline_new_idx = noidx,
size_t __oneline_new_cnt = 0 ) : oneline_idx( __oneline_idx), oneline_cnt(__oneline_cnt), hit_idx( __hit_idx ), hit_cnt(__hit_cnt), oneline_new_idx(__oneline_new_idx), oneline_new_cnt(__oneline_new_cnt){}
57 eNoCompositionBasedStats = 0,
58 eCompositionBasedStats = 1,
59 eCompositionMatrixAdjust = 2,
60 eCompoForceFullMatrixAdjust = 3,
96 hsp(
double __bit_score = 0,
size_t __raw_score = 0 ) : bit_score(__bit_score), raw_score(__raw_score), e_value(0), method(eNoCompositionBasedStats), identities(0), positives(0), gaps(0), q_frame(32), s_frame(32),
97 q_start(0), q_end(0), s_start(0), s_end(0){}
107 inline static std::string
112 case eCompositionBasedStats:
113 return "Composition-based stats";
break;
114 case eCompositionMatrixAdjust:
115 return "Compositional matrix adjust";
break;
117 std::stringstream ss; ss << __m;
return ss.str();
122 inline static ECompoAdjustModes
125 if( __m.size() > 0 && __m[ __m.size()-1 ] ==
'.' ) __m.resize( __m.size()-1 );
130 if( __m.size() >= 12 )
132 if( __m[11] ==
'-' )
return eCompositionBasedStats;
133 if( __m[11] ==
'a' )
return eCompositionMatrixAdjust;
135 return eNoCompositionBasedStats;
148 hit(
const std::string& __name =
"",
const std::string& __desc =
"",
size_t __length = 0 ) : name(__name), desc(__desc), length(__length) {}
159 oneline(
const std::string& __name =
"",
const std::string& __desc =
"",
double __bit_score = 0,
double __e_value = 0 ) : name(__name), desc(__desc), bit_score(__bit_score), e_value(__e_value){}
160 oneline(
const hit& __h ) : name(__h.name), desc(__h.desc), bit_score(__h.hsps.at(0).bit_score), e_value(__h.hsps.at(0).e_value){}
168 std::vector<std::string>
171 std::vector<rostlab::blast::round>
186 std::vector<rostlab::blast::oneline>
191 std::vector<rostlab::blast::hit>
196 result() : empty(true), q_length(0), db_nseq(0), db_nletter(0), converged(false) {}
201 operator bool()
const {
return !empty; }
228 ", s_frame = " << (
int)__r.
s_frame <<
", q_start = " << __r.
q_start <<
", q_ali = " << __r.
q_ali <<
", q_end = " << __r.
q_end <<
", match_line = " << __r.
match_line <<
229 ", s_start = " << __r.
s_start <<
", s_ali = " << __r.
s_ali <<
", s_end = " << __r.
s_end;
237 __os <<
"n = " << __r.
name <<
" d = " << __r.
desc <<
" Length = " << __r.
length <<
" " << __r.
hsps;
246 " letters)\n\nDatabase: " << __r.
db_name <<
" " << __r.
db_nseq <<
" sequences; " << __r.
db_nletter <<
" total letters\n\none-line desc: " << __r.
onelines <<
"\n\n" <<
247 ( __r.
converged ?
"CONVERGED!\n\n" :
"" ) <<
"hits: " << __r.
hits <<
"\n\n" << __r.
tail;
253 #endif // ROSTLAB_BLAST_RESULT_H
int8_t q_frame
Query frame.
bool converged
Indicates that the search has converged.
static ECompoAdjustModes methfromstr(std::string __m)
Translate method description to mode code.
size_t oneline_idx
Index of first one-line description of this round in vector of all one-line descriptions.
size_t db_nletter
Number of letters in database.
std::string q_strand
Query strand [Plus|Minus].
size_t oneline_new_cnt
Count of one-line descriptions for sequences not found previously.
size_t q_length
Query length.
double bit_score
Bit score.
std::string q_desc
Query description.
size_t db_nseq
Number of sequences in database.
std::string match_line
Match line.
round(size_t __oneline_idx=0, size_t __oneline_cnt=0, size_t __hit_idx=0, size_t __hit_cnt=0, size_t __oneline_new_idx=noidx, size_t __oneline_new_cnt=0)
std::vector< std::string > references
Blast result for one query.
static const size_t noidx
size_t hit_cnt
Count of hits in round.
int8_t s_frame
Subject frame.
std::string q_ali
Query alignment string.
hit(const std::string &__name="", const std::string &__desc="", size_t __length=0)
oneline(const std::string &__name="", const std::string &__desc="", double __bit_score=0, double __e_value=0)
std::basic_ostream< YYChar > & operator<<(std::basic_ostream< YYChar > &ostr, const position &pos)
Intercept output stream redirection.
size_t s_end
Subject end (1-based).
std::string s_strand
Subject strand [Plus|Minus].
std::vector< rostlab::blast::round > rounds
Vector of iterated blast round information.
size_t s_start
Subject start (1-based).
size_t q_start
Query start (1-based).
hsp(double __bit_score=0, size_t __raw_score=0)
size_t q_end
Query end (1-based).
size_t hit_idx
Index of first hit of this round in vector of all hits.
size_t length
Full length of subject sequence.
ECompoAdjustModes
An collection of constants that specify all permissible modes of composition adjustment.
High-scoring segment pair.
std::string tail
Tail part of blast result as a long string.
size_t oneline_new_idx
Index of first one-line description of sequences not found previously in this round. noidx if there is no such, i.e. in case there are no new sequences in this round.
std::string db_name
Database name.
static std::string methodstr(const ECompoAdjustModes __m)
Translate method code to string.
Data specific to an iterated blast round.
std::string s_ali
Subject alignment string.
std::vector< rostlab::blast::hit > hits
Vector of all hits.
std::string q_name
Query name.
std::vector< rostlab::blast::oneline > onelines
Vector of all one-line descriptions.
std::string blast_version
size_t oneline_cnt
Count of one-line descriptions in round.