structs.h
1.96 KB
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
#ifndef NUPACK_SHARED_STRUCTS_H
#define NUPACK_SHARED_STRUCTS_H
#include "constants.h"
#ifdef __cplusplus
extern "C" {
#endif
/* ************************ */
// Macros
// C compiler needs this! DO NOT REMOVE! JZ
#ifndef MIN
#define MIN(x,y) (((x)<(y)) ? (x) : (y))
#endif
//This macro returns the min of x,y, regardless of type
#ifndef MAX
#define MAX(x,y) (((x)>(y)) ? (x) : (y))
#endif
/* ****************************** */
//fold struct describes a secondary structure and sequence
typedef struct{
int *seq; //the sequence
int seqlength; //sequence length
int *pairs; //array indicating what is paired with what (see nsStarPairsOrParens)
int *pknots; //similar to pairs, but indicates ends of pseudoknots
int *fixedBases; //this is used in design code only, and restricts the identity of a postion
int *isNicked; //indicates if a position is right before the end of a strand
int nStrands; //number of strands in a multi-stranded complex
} fold;
//paramter sets. DNA, RNA are mfold 2.3 parameters that allow for temperature dependence
//RNA37 is the mfold3.0 parameter set which is only good at 37C. COUNT sets energies to zero,
//so that the "partition function" is simply a count of the number of possible structures
enum parameter_set { DNA, RNA, RNA37, USE_SPECIFIED_PARAMETERS_FILE, COUNT};
enum { FALSE, TRUE};
//oneDnaStruct and dnaStructures are used for enumerating sequences
typedef struct {
int *theStruct; //describes what is paired to what
DBL_TYPE error; //accumulated error (from the mfe) for a structure
DBL_TYPE correctedEnergy; //actual energy of a structure
int slength;
//(accounting for symmetry).
} oneDnaStruct;
typedef struct {
oneDnaStruct *validStructs;
int nStructs; //# of structures stored
int nAlloc; //# of structures allocated
int seqlength;
DBL_TYPE minError; //minimum deviation from mfe for all seqs
//in validStructs
} dnaStructures;
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif // NUPACK_SHARED_STRUCTS_H