RNAlib-2.4.5
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 # if defined(__clang__)
6 # define DEPRECATED(func, msg) func __attribute__ ((deprecated("", msg)))
7 # elif defined(__GNUC__)
8 # define DEPRECATED(func, msg) func __attribute__ ((deprecated(msg)))
9 # else
10 # define DEPRECATED(func, msg) func
11 # endif
12 #else
13 # define DEPRECATED(func, msg) func
14 #endif
15 
28 typedef struct vrna_pinfo_s vrna_pinfo_t;
29 
30 
31 #define VRNA_ALN_DEFAULT 0U
32 #define VRNA_ALN_RNA 1U
33 #define VRNA_ALN_DNA 2U
34 #define VRNA_ALN_UPPERCASE 4U
35 #define VRNA_ALN_LOWERCASE 8U
36 
42 #define VRNA_MEASURE_SHANNON_ENTROPY 1U
43 
44 #ifndef VRNA_DISABLE_BACKWARD_COMPATIBILITY
45 
46 /* the following typedefs are for backward compatibility only */
47 
52 typedef struct vrna_pinfo_s pair_info;
53 
54 #endif
55 
57 
68 struct vrna_pinfo_s {
69  unsigned i;
70  unsigned j;
71  float p;
72  float ent;
73  short bp[8];
74  char comp;
75 };
76 
77 
84 int
85 vrna_aln_mpi(const char **alignment);
86 
87 
101 vrna_pinfo_t *
103  const char *structure,
104  double threshold);
105 
106 
107 int *
108 vrna_aln_pscore(const char **alignment,
109  vrna_md_t *md);
110 
111 
125 char **
126 vrna_aln_slice(const char **alignment,
127  unsigned int i,
128  unsigned int j);
129 
130 
136 void
137 vrna_aln_free(char **alignment);
138 
139 
148 char **
149 vrna_aln_uppercase(const char **alignment);
150 
151 
160 char **
161 vrna_aln_toRNA(const char **alignment);
162 
163 
177 char **
178 vrna_aln_copy(const char **alignment,
179  unsigned int options);
180 
181 
196 float *
197 vrna_aln_conservation_struct(const char **alignment,
198  const char *structure,
199  const vrna_md_t *md);
200 
201 
219 float *
220 vrna_aln_conservation_col(const char **alignment,
221  const vrna_md_t *md_p,
222  unsigned int options);
223 
224 
225 #ifndef VRNA_DISABLE_BACKWARD_COMPATIBILITY
226 
227 DEPRECATED(int read_clustal(FILE *clust,
228  char *AlignedSeqs[],
229  char *names[]),
230  "Use vrna_file_msa_read() and vrna_file_msa_read_record() instead");
231 
232 
233 DEPRECATED(char *consensus(const char *AS[]),
234  "");
235 
236 
237 DEPRECATED(char *consens_mis(const char *AS[]),
238  "");
239 
240 
241 DEPRECATED(char *get_ungapped_sequence(const char *seq),
242  "");
243 
244 
256 DEPRECATED(int get_mpi(char *Alseq[],
257  int n_seq,
258  int length,
259  int *mini),
260  "Use vrna_aln_mpi() instead");
261 
262 /*
263  #############################################################
264  # some helper functions that might be useful in the library #
265  #############################################################
266  */
267 
282 DEPRECATED(void encode_ali_sequence(const char *sequence,
283  short *S,
284  short *s5,
285  short *s3,
286  char *ss,
287  unsigned short *as,
288  int circ),
289  "This function is obsolete");
290 
291 
307 DEPRECATED(void alloc_sequence_arrays(const char **sequences,
308  short ***S,
309  short ***S5,
310  short ***S3,
311  unsigned short ***a2s,
312  char ***Ss,
313  int circ),
314  "This function is obsolete");
315 
316 
331 DEPRECATED(void free_sequence_arrays(unsigned int n_seq,
332  short ***S,
333  short ***S5,
334  short ***S3,
335  unsigned short ***a2s,
336  char ***Ss),
337  "This fucntion is obsolete");
338 
339 #endif
340 
346 #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:70
A base pair info structure.
Definition: aln_util.h:68
The most basic data structure required by many functions throughout the RNAlib.
Definition: fold_compound.h:131
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:177
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:69
char comp
1 iff pair is in mfe structure
Definition: aln_util.h:74
float p
Probability.
Definition: aln_util.h:71
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:72
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:73