-
Notifications
You must be signed in to change notification settings - Fork 3
/
profillic-hmmer.hpp
72 lines (63 loc) · 2.71 KB
/
profillic-hmmer.hpp
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
/**
* \file profillic-hmmer.hpp
* \brief Minor modifications necessary to compile profillic mods in c++
* \details
* Had to change hmmer3/easel/esl_msa.h, where keyword "new" was being used as an
* argument name in a predeclaration for esl_msa_Copy (..). It now reads:
* \code
* extern int esl_msa_Copy (const ESL_MSA *msa, ESL_MSA *_new);
* \endcode
*/
#ifndef __GALOSH_PROFILLICHMMER_HPP__
#define __GALOSH_PROFILLICHMMER_HPP__
// HMMoC-BFloat-Algebra:
#include "Algebra.hpp"
/// TAH 2/12 solving some circular reference problems by forward declaring DynamicProgramming
namespace galosh {
template <typename ResidueType,
typename ProbabilityType,
typename ScoreType,
typename MatrixValueType>
class DynamicProgramming;
template <typename ResidueType,
typename ProbabilityType,
typename ScoreType,
typename MatrixValueType>
class AlignmentProfileAccessor;
}
// Galosh:
#include "Profile.hpp"
using galosh::ProfileTreeRoot;
/* ////////////// For profillic-hmmer ////////////////////////////////// */
// Stuff we needed to modify in order to compile it in c++:
// NOTE I had to change hmmer3/easel/esl_msa.h, where keyword "new" was being used as an argument name in a predeclaration for esl_msa_Copy (..). It now reads:
//extern int esl_msa_Copy (const ESL_MSA *msa, ESL_MSA *_new);
#define ESL_ALLOC_CPP(arg_type, p, size) do { \
if ( ( (p) = ( static_cast<arg_type *>( malloc(size)) ) ) == NULL) { \
status = eslEMEM;\
esl_exception(eslEMEM, FALSE, __FILE__, __LINE__, "malloc of size %d failed", size); \
goto ERROR;\
}} while (0)
#define ESL_RALLOC_CPP(arg_type, p, tmp, newsize) do { \
if ((p) == NULL) { \
(tmp) = ( static_cast<arg_type *>( malloc(newsize) ) ); \
} else { (tmp) = static_cast<arg_type *>(realloc((p), (newsize))); } \
if ((tmp) != NULL) (p) = static_cast<arg_type *>(tmp);\
else {\
status = eslEMEM;\
esl_exception(eslEMEM, FALSE, __FILE__, __LINE__, "realloc for size %d failed", newsize);\
goto ERROR;\
}} while (0)
#define ESL_REALLOC_CPP(arg_type, p, newsize) do { \
void *esltmpp;\
if ((p) == NULL) { (esltmpp) = static_cast<arg_type *>( malloc(newsize) ); } \
else { (esltmpp) = static_cast<arg_type *>( realloc((p), (newsize)) ); } \
if ((esltmpp) != NULL) (p) = static_cast<arg_type *>(esltmpp);\
else {\
status = eslEMEM;\
esl_exception(eslEMEM, FALSE, __FILE__, __LINE__, "realloc for size %d failed", newsize);\
goto ERROR;\
}} while (0)
//
/* ////////////// End profillic-hmmer ////////////////////////////////// */
#endif // __GALOSH_PROFILLICHMMER_HPP__