-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathh_common.h
115 lines (87 loc) · 6.2 KB
/
h_common.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#ifndef H_COMMON_H_
#define H_COMMON_H_
#include "h_struct.h"
#include "common.h"
#include "Result.hh"
//Hosna: June 22, 2007
// #define PS_penalty = 960 //exterior pseudoloop initiation penalty (9.6 Kcal/mol)
// #define PSM_penalty 1500 //penalty for introducing pseudoknot inside a multiloop (15 Kcal/mol)
// #define PSP_penalty 1500 //penalty for introducing pseudoknot inside a pseudoloop (15 Kcal/mol)
// #define PB_penalty 20 //band penalty (0.2 Kcal/mol)
// #define PUP_penalty 10 //penalty for an un-paired base in a pseudoloop or a band (0.1 Kcal/mol)
// #define PPS_penalty 10 //penalty for nested closed region inside either a pseudoloop or a multiloop that spans a band(0.1 Kcal/mol)
// #define a_penalty 340 //penalty for introducing a multiloop (3.4 Kcal/mol)
// #define b_penalty 40 //penalty for base pair in a multiloop (0.4 Kcal/mol)
// #define c_penalty 0 //penalty for un-paired base in a multi-loop
// #define e_stP_penalty 0.83 // e_stP = 0.83 * e_s
// #define e_intP_penalty 0.83 // e_intP = 0.83 * e_int
// #define ap_penalty 340 //penalty for introducing a multiloop that spans a band (3.4 Kcal/mol)
// #define bp_penalty 40 //base pair penalty for a multiloop that spans a band (0.4 Kcal/mol)
// #define cp_penalty 0 //penalty for unpaired base in a multiloop that spans a band
#define P_WMB 'R'
#define P_VP 'D'
#define P_VPP 'E'
#define P_WI 'G'
#define P_BE 'J'
#define P_WIP 'L'
#define P_WMBP 'T'
#define P_V 'A' // This case is only for the cases that we have some pairings in input structure that are not valid in terms of simfold restrictions
#define NOT_COVERED -1
#define STACK_EMPTY -1 // originally this value is 0, which I think is wrong! Hosna, March 8, 2012
#define RESTRICTED_UNPAIR -1
#define FREE_TO_PAIR -2
// Hosna, March 19, 2012
// the original value of the matrices should be set to -INF and then be changed to their correct value
#define MINUS_INF -1600000 // a very small value (minus infinity)
#define RUN_METHOD_ALL 0
#define RUN_METHOD_1 1
#define RUN_METHOD_2 2
#define RUN_METHOD_3 3
#define RUN_METHOD_4 4
void detect_original_pairs_arcs(char *structure, int *p_table, int *arc_table);
void detect_original_PKed_pairs(char *structure, int *p_table);
double compute_h_sensitivity (char *ref_structure, char *pred_structure);
double compute_h_ppv (char *ref_structure, char *pred_structure);
void h_fill_data_structures_with_new_parameters (char *filename);
void h_fill_data_structures_with_new_parameters (double *param);
int h_create_string_params();
// Hosna: helper function to fill in the weakly_closed array
void detect_weakly_closed(h_str_features *fres, int *weakly_closed, int nb_nucleotides, int *index);
// Hosna: helper function to fill in the not_paired_all array
void detect_not_paired_all(h_str_features *fres, int *not_paired_all, int nb_nucleotides, int *index);
// Hosna: this function fills the bs table which keeps track of
// bs and Bs for each i and l
void detect_border_bs(h_str_features *fres, int** border_bs, int nb_nucleotides);
// Hosna: this function filld the bps table which keeps track of
// b' and B' for each l and j
void detect_border_bps(h_str_features *fres, int** border_bps, int nb_nucleotides);
void h_init (stack_ds *st);
void h_push (stack_ds *st, int el);
int h_pop (stack_ds *st);
// Hosna June 26, 2007
// I need functions to convert str_features to h_str_features and the other way around
h_str_features *convert_str_features_to_h_str_features(str_features *f);
str_features *convert_h_str_features_to_str_features(h_str_features *f);
void detect_h_structure_features (char *structure, h_str_features *f);
void print_emodel(energy_model *model);
//kevin:
double hfold_interacting_emodel(char *sequence, char *restricted, char *structure, std::vector<energy_model> &energy_models);
double method3_emodel(char *sequence, char *restricted, char *structure, std::vector<energy_model> *energy_models);
void obtainRelaxedStems(char* G1, char* G2, char* Gresult); //---------------------------------------this function is suppose to be the same as the one in Hfold_iterative, if any changes are made, please change that one too--------------------
int paired_structure(int i, int j, int *pair_index, int length); //---------------------------------------this function is suppose to be the same as the one in Hfold_iterative, if any changes are made, please change that one too--------------------
double hfold_pkonly_emodel(char *sequence, char *restricted, char *structure, std::vector<energy_model> *energy_models);
//kevin 19 july
void find_disjoint_substructure(char* structure, std::vector< std::pair<int,int> > &pair_vector); //---------------------------------------this function is suppose to be the same as the one in Hfold_iterative, if any changes are made, please change that one too--------------------
void simfold_emodel(char *sequence, char *restricted, char *structure, std::vector<energy_model> *energy_models);
double method4_emodel(char *sequence, char *restricted, char *structure, std::vector<energy_model> *energy_models);
//keivn 24 july
void remove_structure_intersection(char* G1, char* G0, char* G_p); //---------------------------------------this function is suppose to be the same as the one in Hfold_iterative, if any changes are made, please change that one too--------------------
double method2_emodel(char *sequence, char *restricted, char *structure, std::vector<energy_model> *energy_models);
double method1_emodel(char *sequence, char *restricted, char *structure, std::vector<energy_model> *energy_models);
int is_empty_structure(char* input_structure, char* output_structure); //---------------------------------------this function is suppose to be the same as the one in Hfold_iterative, if any changes are made, please change that one too--------------------
//kevin 30 Aug 2017
int is_invalid_restriction(char* restricted_structure, char* current_structure); //---------------------------------------this function is suppose to be the same as the one in Hfold_iterative, if any changes are made, please change that one too--------------------
//kevin 27 Sept 2017
//comparison function for hotspot so we can use it when sorting
bool compare_result_ptr(Result* a, Result* b);
#endif /*H_COMMON_H_*/