RNAlib-2.6.3
 
Loading...
Searching...
No Matches
fold_compound.h
Go to the documentation of this file.
1#ifndef VIENNA_RNA_PACKAGE_FOLD_COMPOUND_H
2#define VIENNA_RNA_PACKAGE_FOLD_COMPOUND_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
39
58typedef void (*vrna_auxdata_free_f)(void *data);
59
60
61typedef int (*vrna_auxdata_prepare_f)(vrna_fold_compound_t *fc,
62 void *data,
63 unsigned int event,
64 void *event_data);
65
66
72DEPRECATED(typedef void (vrna_callback_free_auxdata)(void *data),
73 "Use vrna_auxdata_free_f instead!");
74
93typedef void (*vrna_recursion_status_f)(unsigned char status,
94 void *data);
95
96DEPRECATED(typedef void (vrna_callback_recursion_status)(unsigned char status,
97 void *data),
98 "Use vrna_recursion_status_f instead!");
99
100
107#define VRNA_STATUS_MFE_PRE (unsigned char)1
108
115#define VRNA_STATUS_MFE_POST (unsigned char)2
116
122#define VRNA_STATUS_PF_PRE (unsigned char)3
123
129#define VRNA_STATUS_PF_POST (unsigned char)4
130
131
132#include <ViennaRNA/model.h>
134#include <ViennaRNA/sequence.h>
138#include <ViennaRNA/grammar.h>
141
142#ifdef VRNA_WITH_SVM
143#include <ViennaRNA/zscore.h>
144#endif
145
146
150typedef enum {
154
155
168struct vrna_fc_s {
180 unsigned int length;
181#ifndef VRNA_DISABLE_BACKWARD_COMPATIBILITY
182 DEPRECATED(int cutpoint,
183 "Use strand_* members instead");
187#endif
188 unsigned int *strand_number;
189 unsigned int *strand_order;
190 unsigned int *strand_order_uniq;
191 unsigned int *strand_start;
192 unsigned int *strand_end;
194 unsigned int strands;
206 int *iindx;
207 int *jindx;
220 void *auxdata;
235 /* data structure to adjust additional structural domains, such as G-quadruplexes */
238 /* data structure to adjust additional contributions to unpaired stretches, e.g. due to protein binding */
241 /* auxiliary (user-defined) extension to the folding grammar */
248#ifndef VRNA_DISABLE_C11_FEATURES
249 /* C11 support for unnamed unions/structs */
250 union {
251 struct {
252#endif
253
258 char *sequence;
265 short *encoding5;
266 short *encoding3;
267
268 short *sequence_encoding2;
269
270
271 char *ptype;
293#ifndef VRNA_DISABLE_C11_FEATURES
294 /* C11 support for unnamed unions/structs */
295};
296struct {
297#endif
298
303 char **sequences;
307 unsigned int n_seq;
310 char *cons_seq;
313 short *S_cons;
316 short **S;
319 short **S5;
322 short **S3;
325 char **Ss;
326 unsigned int **a2s;
327 int *pscore;
340 int oldAliEn;
341
345#ifndef VRNA_DISABLE_C11_FEATURES
346};
347};
348#endif
349
356 unsigned int maxD1;
357 unsigned int maxD2;
361 unsigned int *referenceBPs1;
362 unsigned int *referenceBPs2;
363 unsigned int *bpdist;
365 unsigned int *mm1;
366 unsigned int *mm2;
379 char **ptype_local;
380#ifdef VRNA_WITH_SVM
381 vrna_zsc_dat_t zscore_data;
382#endif
383
387};
388
389
390/* the definitions below should be used for functions that return/receive/destroy fold compound data structures */
391
395#define VRNA_OPTION_DEFAULT 0U
396
403#define VRNA_OPTION_MFE (1 << 0)
404
411#define VRNA_OPTION_PF (1 << 1)
412
416#define VRNA_OPTION_HYBRID (1 << 2)
417
427#define VRNA_OPTION_EVAL_ONLY (1 << 3)
428
432#define VRNA_OPTION_WINDOW (1 << 4)
433
434
435#define VRNA_OPTION_F5 (1 << 5)
436#define VRNA_OPTION_F3 (1 << 6)
437#define VRNA_OPTION_WINDOW_F5 (VRNA_OPTION_WINDOW | VRNA_OPTION_F5)
438#define VRNA_OPTION_WINDOW_F3 (VRNA_OPTION_WINDOW | VRNA_OPTION_F3)
439
478vrna_fold_compound(const char *sequence,
479 const vrna_md_t *md_p,
480 unsigned int options);
481
482
521vrna_fold_compound_comparative(const char **sequences,
522 vrna_md_t *md_p,
523 unsigned int options);
524
525
527vrna_fold_compound_comparative2(const char **sequences,
528 const char **names,
529 const unsigned char *orientation,
530 const unsigned long long *start,
531 const unsigned long long *genome_size,
532 vrna_md_t *md_p,
533 unsigned int options);
534
535
537vrna_fold_compound_TwoD(const char *sequence,
538 const char *s1,
539 const char *s2,
540 vrna_md_t *md_p,
541 unsigned int options);
542
543
544int
545vrna_fold_compound_prepare(vrna_fold_compound_t *fc,
546 unsigned int options);
547
548
556void
558
559
577void
579 void *data,
581
582
598void
601
602
607#endif
Functions to deal with standard dynamic programming (DP) matrices.
Implementations for the RNA folding grammar.
Definition sequence.h:52
Data structure representing a nucleotide sequence.
Definition sequence.h:41
Data structure to store all functionality for ligand binding.
Definition unstructured_domains.h:281
Minimum Free Energy (MFE) Dynamic Programming (DP) matrices data structure required within the vrna_f...
Definition dp_matrices.h:47
Partition function (PF) Dynamic Programming (DP) matrices data structure required within the vrna_fol...
Definition dp_matrices.h:207
The data structure that contains temperature scaled Boltzmann weights of the energy parameters.
Definition basic.h:110
The datastructure that contains temperature scaled energy parameters.
Definition basic.h:57
vrna_auxdata_free_f free_auxdata
A callback to free auxiliary user data whenever the fold_compound itself is free'd.
Definition fold_compound.h:224
vrna_msa_t * alignment
Set of alignments.
Definition fold_compound.h:196
unsigned int * mm1
Maximum matching matrix, reference struct 1 disallowed.
Definition fold_compound.h:365
int * pscore
Precomputed array of pair types expressed as pairing scores.
Definition fold_compound.h:327
unsigned int * referenceBPs2
Matrix containing number of basepairs of reference structure2 in interval [i,j].
Definition fold_compound.h:362
vrna_param_t * params
The precomputed free energy contributions for each type of loop.
Definition fold_compound.h:203
void * auxdata
A pointer to auxiliary, user-defined data.
Definition fold_compound.h:220
unsigned int * strand_number
The strand number a particular nucleotide is associated with.
Definition fold_compound.h:188
char ** ptype_local
Pair type array (for local folding)
Definition fold_compound.h:379
unsigned int maxD2
Maximum allowed base pair distance to second reference.
Definition fold_compound.h:357
const vrna_fc_type_e type
The type of the vrna_fold_compound_t.
Definition fold_compound.h:173
unsigned int * strand_order
The strand order, i.e. permutation of current concatenated sequence.
Definition fold_compound.h:189
char * ptype
Pair type array.
Definition fold_compound.h:271
unsigned int maxD1
Maximum allowed base pair distance to first reference.
Definition fold_compound.h:356
vrna_gr_aux_t * aux_grammar
Additional decomposition grammar rules.
Definition fold_compound.h:242
vrna_ud_t * domains_up
Additional unstructured domains.
Definition fold_compound.h:239
int * jindx
DP matrix accessor
Definition fold_compound.h:207
unsigned int * mm2
Maximum matching matrix, reference struct 2 disallowed.
Definition fold_compound.h:366
unsigned int * strand_start
The start position of a particular strand within the current concatenated sequence.
Definition fold_compound.h:191
unsigned int * bpdist
Matrix containing base pair distance of reference structure 1 and 2 on interval [i,...
Definition fold_compound.h:363
unsigned int n_seq
The number of sequences in the alignment.
Definition fold_compound.h:307
unsigned int * referenceBPs1
Matrix containing number of basepairs of reference structure1 in interval [i,j].
Definition fold_compound.h:361
vrna_exp_param_t * exp_params
The precomputed free energy contributions as Boltzmann factors
Definition fold_compound.h:204
short ** S5
S5[s][i] holds next base 5' of i in sequence s.
Definition fold_compound.h:319
char * ptype_pf_compat
ptype array indexed via iindx
Definition fold_compound.h:280
vrna_seq_t * nucleotides
Set of nucleotide sequences.
Definition fold_compound.h:195
char * sequence
The input sequence string.
Definition fold_compound.h:258
short * reference_pt2
A pairtable of the second reference structure.
Definition fold_compound.h:359
unsigned int length
The length of the sequence (or sequence alignment)
Definition fold_compound.h:180
char ** sequences
The aligned sequences.
Definition fold_compound.h:303
short * sequence_encoding
Numerical encoding of the input sequence.
Definition fold_compound.h:261
short * reference_pt1
A pairtable of the first reference structure.
Definition fold_compound.h:358
short * S_cons
Numerical encoding of the consensus sequence.
Definition fold_compound.h:313
unsigned int * strand_end
The end (last) position of a particular strand within the current concatenated sequence.
Definition fold_compound.h:192
vrna_zsc_dat_t zscore_data
Data structure with settings for z-score computations.
Definition fold_compound.h:381
short * pscore_pf_compat
Precomputed array of pair types expressed as pairing scores indexed via iindx.
Definition fold_compound.h:333
vrna_sd_t * domains_struc
Additional structured domains.
Definition fold_compound.h:236
vrna_sc_t ** scs
A set of soft constraints (for each sequence in the alignment)
Definition fold_compound.h:337
char * cons_seq
The consensus sequence of the aligned sequences.
Definition fold_compound.h:310
vrna_sc_t * sc
The soft constraints for usage in structure prediction and evaluation.
Definition fold_compound.h:285
vrna_mx_mfe_t * matrices
The MFE DP matrices.
Definition fold_compound.h:200
vrna_hc_t * hc
The hard constraints data structure used for structure prediction.
Definition fold_compound.h:198
unsigned int strands
Number of interacting strands.
Definition fold_compound.h:194
int ** pscore_local
Precomputed array of pair types expressed as pairing scores.
Definition fold_compound.h:330
int window_size
window size for local folding sliding window approach
Definition fold_compound.h:378
int cutpoint
The position of the (cofold) cutpoint within the provided sequence. If there is no cutpoint,...
Definition fold_compound.h:183
short ** S
Numerical encoding of the sequences in the alignment.
Definition fold_compound.h:316
vrna_recursion_status_f stat_cb
Recursion status callback (usually called just before, and after recursive computations in the librar...
Definition fold_compound.h:215
unsigned int * strand_order_uniq
The strand order array where identical sequences have the same ID.
Definition fold_compound.h:190
short ** S3
Sl[s][i] holds next base 3' of i in sequence s.
Definition fold_compound.h:322
vrna_mx_pf_t * exp_matrices
The PF DP matrices
Definition fold_compound.h:201
int * iindx
DP matrix accessor
Definition fold_compound.h:206
vrna_fc_type_e
An enumerator that is used to specify the type of a vrna_fold_compound_t.
Definition fold_compound.h:150
void vrna_fold_compound_free(vrna_fold_compound_t *fc)
Free memory occupied by a vrna_fold_compound_t.
void vrna_fold_compound_add_callback(vrna_fold_compound_t *fc, vrna_recursion_status_f f)
Add a recursion status callback to the vrna_fold_compound_t.
void() vrna_callback_free_auxdata(void *data)
Callback to free memory allocated for auxiliary user-provided data.
Definition fold_compound.h:73
void(* vrna_auxdata_free_f)(void *data)
Callback to free memory allocated for auxiliary user-provided data.
Definition fold_compound.h:58
vrna_fold_compound_t * vrna_fold_compound(const char *sequence, const vrna_md_t *md_p, unsigned int options)
Retrieve a vrna_fold_compound_t data structure for single sequences and hybridizing sequences.
vrna_fold_compound_t * vrna_fold_compound_comparative(const char **sequences, vrna_md_t *md_p, unsigned int options)
Retrieve a vrna_fold_compound_t data structure for sequence alignments.
void vrna_fold_compound_add_auxdata(vrna_fold_compound_t *fc, void *data, vrna_auxdata_free_f f)
Add auxiliary data to the vrna_fold_compound_t.
void(* vrna_recursion_status_f)(unsigned char status, void *data)
Callback to perform specific user-defined actions before, or after recursive computations.
Definition fold_compound.h:93
@ VRNA_FC_TYPE_SINGLE
Definition fold_compound.h:151
@ VRNA_FC_TYPE_COMPARATIVE
Definition fold_compound.h:152
The most basic data structure required by many functions throughout the RNAlib.
Definition fold_compound.h:168
Definition grammar.h:57
The hard constraints data structure.
Definition hard.h:373
The data structure that contains the complete model details used throughout the calculations.
Definition model.h:245
The soft constraints data structure.
Definition soft.h:214
Functions and data structures for handling of secondary structure hard constraints.
The model details data structure and its corresponding modifiers.
Functions to deal with sets of energy parameters.
Functions and data structures related to sequence representations ,.
Functions and data structures for secondary structure soft constraints.
This module provides interfaces that deal with additional structured domains in the folding grammar.
Definition structured_domains.h:26
Functions to modify unstructured domains, e.g. to incorporate ligands binding to unpaired stretches.