RNAlib-2.4.3
aln_util.h
Go to the documentation of this file.
1 #ifndef VIENNA_RNA_PACKAGE_ALN_UTIL_H
2 #define VIENNA_RNA_PACKAGE_ALN_UTIL_H
3 
4 #ifdef VRNA_WARN_DEPRECATED
5 # ifdef __GNUC__
6 # define DEPRECATED(func) func __attribute__ ((deprecated))
7 # else
8 # define DEPRECATED(func) func
9 # endif
10 #else
11 # define DEPRECATED(func) func
12 #endif
13 
26 typedef struct vrna_pinfo_s vrna_pinfo_t;
27 
28 
29 #define VRNA_ALN_DEFAULT 0U
30 #define VRNA_ALN_RNA 1U
31 #define VRNA_ALN_DNA 2U
32 #define VRNA_ALN_UPPERCASE 4U
33 #define VRNA_ALN_LOWERCASE 8U
34 
40 #define VRNA_MEASURE_SHANNON_ENTROPY 1U
41 
42 /* make this interface backward compatible with RNAlib < 2.2.0 */
43 #define VRNA_BACKWARD_COMPAT
44 
45 
46 #ifdef VRNA_BACKWARD_COMPAT
47 
48 /* the following typedefs are for backward compatibility only */
49 
54 typedef struct vrna_pinfo_s pair_info;
55 
56 #endif
57 
59 
70 struct vrna_pinfo_s {
71  unsigned i;
72  unsigned j;
73  float p;
74  float ent;
75  short bp[8];
76  char comp;
77 };
78 
79 
86 int
87 vrna_aln_mpi(const char **alignment);
88 
89 
103 vrna_pinfo_t *
105  const char *structure,
106  double threshold);
107 
108 
109 int *
110 vrna_aln_pscore(const char **alignment,
111  vrna_md_t *md);
112 
113 
127 char **
128 vrna_aln_slice(const char **alignment,
129  unsigned int i,
130  unsigned int j);
131 
132 
138 void
139 vrna_aln_free(char **alignment);
140 
141 
150 char **
151 vrna_aln_uppercase(const char **alignment);
152 
153 
162 char **
163 vrna_aln_toRNA(const char **alignment);
164 
165 
179 char **
180 vrna_aln_copy(const char **alignment,
181  unsigned int options);
182 
183 
198 float *
199 vrna_aln_conservation_struct(const char **alignment,
200  const char *structure,
201  const vrna_md_t *md);
202 
203 
221 float *
222 vrna_aln_conservation_col(const char **alignment,
223  const vrna_md_t *md_p,
224  unsigned int options);
225 
226 
227 #ifdef VRNA_BACKWARD_COMPAT
228 
229 DEPRECATED(int read_clustal(FILE *clust,
230  char *AlignedSeqs[],
231  char *names[]));
232 
233 
234 DEPRECATED(char *consensus(const char *AS[]));
235 
236 
237 DEPRECATED(char *consens_mis(const char *AS[]));
238 
239 
240 DEPRECATED(char *get_ungapped_sequence(const char *seq));
241 
242 
254 DEPRECATED(int get_mpi(char *Alseq[],
255  int n_seq,
256  int length,
257  int *mini));
258 
259 /*
260  #############################################################
261  # some helper functions that might be useful in the library #
262  #############################################################
263  */
264 
279 DEPRECATED(void encode_ali_sequence(const char *sequence,
280  short *S,
281  short *s5,
282  short *s3,
283  char *ss,
284  unsigned short *as,
285  int circ));
286 
287 
303 DEPRECATED(void alloc_sequence_arrays(const char **sequences,
304  short ***S,
305  short ***S5,
306  short ***S3,
307  unsigned short ***a2s,
308  char ***Ss,
309  int circ));
310 
311 
326 DEPRECATED(void free_sequence_arrays(unsigned int n_seq,
327  short ***S,
328  short ***S5,
329  short ***S3,
330  unsigned short ***a2s,
331  char ***Ss));
332 
333 #endif
334 
340 #endif
int vrna_aln_mpi(const char **alignment)
Get the mean pairwise identity in steps from ?to?(ident)
char ** vrna_aln_toRNA(const char **alignment)
Create a copy of an alignment where DNA alphabet is replaced by RNA alphabet.
char ** vrna_aln_copy(const char **alignment, unsigned int options)
Make a copy of a multiple sequence alignment.
void alloc_sequence_arrays(const char **sequences, short ***S, short ***S5, short ***S3, unsigned short ***a2s, char ***Ss, int circ)
Allocate memory for sequence array used to deal with aligned sequences.
int get_mpi(char *Alseq[], int n_seq, int length, int *mini)
Get the mean pairwise identity in steps from ?to?(ident)
unsigned j
nucleotide position j
Definition: aln_util.h:72
A base pair info structure.
Definition: aln_util.h:70
The most basic data structure required by many functions throughout the RNAlib.
Definition: fold_compound.h:130
char ** vrna_aln_uppercase(const char **alignment)
Create a copy of an alignment with only uppercase letters in the sequences.
float * vrna_aln_conservation_col(const char **alignment, const vrna_md_t *md_p, unsigned int options)
Compute nucleotide conservation in an alignment.
The data structure that contains the complete model details used throughout the calculations.
Definition: model.h:189
void free_sequence_arrays(unsigned int n_seq, short ***S, short ***S5, short ***S3, unsigned short ***a2s, char ***Ss)
Free the memory of the sequence arrays used to deal with aligned sequences.
vrna_pinfo_t * vrna_aln_pinfo(vrna_fold_compound_t *vc, const char *structure, double threshold)
Retrieve an array of vrna_pinfo_t structures from precomputed pair probabilities. ...
float * vrna_aln_conservation_struct(const char **alignment, const char *structure, const vrna_md_t *md)
Compute base pair conservation of a consensus structure.
void vrna_aln_free(char **alignment)
Free memory occupied by a set of aligned sequences.
unsigned i
nucleotide position i
Definition: aln_util.h:71
char comp
1 iff pair is in mfe structure
Definition: aln_util.h:76
float p
Probability.
Definition: aln_util.h:73
char ** vrna_aln_slice(const char **alignment, unsigned int i, unsigned int j)
Slice out a subalignment from a larger alignment.
float ent
Pseudo entropy for .
Definition: aln_util.h:74
void encode_ali_sequence(const char *sequence, short *S, short *s5, short *s3, char *ss, unsigned short *as, int circ)
Get arrays with encoded sequence of the alignment.
The Basic Fold Compound API.
int circ
backward compatibility variable.. this does not effect anything
short bp[8]
Frequencies of pair_types.
Definition: aln_util.h:75