RNAlib-2.4.17
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 
26 typedef struct vrna_fc_s vrna_fold_compound_t;
27 
46 typedef void (vrna_callback_free_auxdata)(void *data);
47 
67 typedef void (vrna_callback_recursion_status)(unsigned char status,
68  void *data);
69 
76 #define VRNA_STATUS_MFE_PRE (unsigned char)1
77 
84 #define VRNA_STATUS_MFE_POST (unsigned char)2
85 
91 #define VRNA_STATUS_PF_PRE (unsigned char)3
92 
98 #define VRNA_STATUS_PF_POST (unsigned char)4
99 
100 
101 #include <ViennaRNA/model.h>
102 #include <ViennaRNA/params/basic.h>
103 #include <ViennaRNA/sequence.h>
104 #include <ViennaRNA/dp_matrices.h>
107 #include <ViennaRNA/grammar.h>
110 
111 #ifdef VRNA_WITH_SVM
112 #include <ViennaRNA/zscore.h>
113 #endif
114 
115 
119 typedef enum {
123 
124 
137 struct vrna_fc_s {
149  unsigned int length;
150  int cutpoint;
154  unsigned int *strand_number;
155  unsigned int *strand_order;
156  unsigned int *strand_start;
157  unsigned int *strand_end;
159  unsigned int strands;
160  vrna_seq_t *nucleotides;
161  vrna_msa_t *alignment;
162 
171  int *iindx;
172  int *jindx;
185  void *auxdata;
200  /* data structure to adjust additional structural domains, such as G-quadruplexes */
203  /* data structure to adjust additional contributions to unpaired stretches, e.g. due to protein binding */
206  /* auxiliary (user-defined) extension to the folding grammar */
207  vrna_gr_aux_t *aux_grammar;
208 
213 #ifndef VRNA_DISABLE_C11_FEATURES
214  /* C11 support for unnamed unions/structs */
215  union {
216  struct {
217 #endif
218 
223  char *sequence;
230  short *sequence_encoding2;
231  char *ptype;
253 #ifndef VRNA_DISABLE_C11_FEATURES
254  /* C11 support for unnamed unions/structs */
255 };
256 struct {
257 #endif
258 
263  char **sequences;
267  unsigned int n_seq;
270  char *cons_seq;
273  short *S_cons;
276  short **S;
279  short **S5;
282  short **S3;
285  char **Ss;
286  unsigned int **a2s;
287  int *pscore;
290  int **pscore_local;
300  int oldAliEn;
301 
305 #ifndef VRNA_DISABLE_C11_FEATURES
306 };
307 };
308 #endif
309 
316  unsigned int maxD1;
317  unsigned int maxD2;
318  short *reference_pt1;
319  short *reference_pt2;
321  unsigned int *referenceBPs1;
322  unsigned int *referenceBPs2;
323  unsigned int *bpdist;
325  unsigned int *mm1;
326  unsigned int *mm2;
339  char **ptype_local;
340 #ifdef VRNA_WITH_SVM
341  vrna_zsc_dat_t zscore_data;
342 #endif
343 
347 };
348 
349 
350 /* the definitions below should be used for functions that return/receive/destroy fold compound data structures */
351 
355 #define VRNA_OPTION_DEFAULT 0U
356 
363 #define VRNA_OPTION_MFE 1U
364 
371 #define VRNA_OPTION_PF 2U
372 
376 #define VRNA_OPTION_HYBRID 4U
377 
387 #define VRNA_OPTION_EVAL_ONLY 8U
388 
392 #define VRNA_OPTION_WINDOW 16U
393 
432 vrna_fold_compound(const char *sequence,
433  const vrna_md_t *md_p,
434  unsigned int options);
435 
436 
475 vrna_fold_compound_comparative(const char **sequences,
476  vrna_md_t *md_p,
477  unsigned int options);
478 
479 
481 vrna_fold_compound_comparative2(const char **sequences,
482  const char **names,
483  const unsigned char *orientation,
484  const unsigned long long *start,
485  const unsigned long long *genome_size,
486  vrna_md_t *md_p,
487  unsigned int options);
488 
489 
491 vrna_fold_compound_TwoD(const char *sequence,
492  const char *s1,
493  const char *s2,
494  vrna_md_t *md_p,
495  unsigned int options);
496 
497 
498 int
499 vrna_fold_compound_prepare(vrna_fold_compound_t *fc,
500  unsigned int options);
501 
502 
510 void
512 
513 
531 void
533  void *data,
535 
536 
552 void
555 
556 
561 #endif
vrna_fc_s::reference_pt2
short * reference_pt2
A pairtable of the second reference structure.
Definition: fold_compound.h:319
vrna_fc_s::matrices
vrna_mx_mfe_t * matrices
The MFE DP matrices.
Definition: fold_compound.h:165
vrna_fold_compound_comparative
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.
vrna_fc_s::exp_params
vrna_exp_param_t * exp_params
The precomputed free energy contributions as Boltzmann factors
Definition: fold_compound.h:169
vrna_fc_s::S
short ** S
Numerical encoding of the sequences in the alignment.
Definition: fold_compound.h:276
vrna_alignment_s
Definition: sequence.h:52
vrna_fc_s::sc
vrna_sc_t * sc
The soft constraints for usage in structure prediction and evaluation.
Definition: fold_compound.h:245
vrna_fc_s::maxD1
unsigned int maxD1
Maximum allowed base pair distance to first reference.
Definition: fold_compound.h:316
vrna_fc_s::maxD2
unsigned int maxD2
Maximum allowed base pair distance to second reference.
Definition: fold_compound.h:317
vrna_fc_s::strand_end
unsigned int * strand_end
The end (last) position of a particular strand within the current concatenated sequence.
Definition: fold_compound.h:157
model.h
The model details data structure and its corresponding modifiers.
hard.h
Functions and data structures for handling of secondary structure hard constraints.
vrna_fc_s::window_size
int window_size
window size for local folding sliding window approach
Definition: fold_compound.h:338
vrna_hc_s
The hard constraints data structure.
Definition: hard.h:367
vrna_fc_s::ptype
char * ptype
Pair type array.
Definition: fold_compound.h:231
vrna_fc_s::reference_pt1
short * reference_pt1
A pairtable of the first reference structure.
Definition: fold_compound.h:318
vrna_mx_mfe_s
Minimum Free Energy (MFE) Dynamic Programming (DP) matrices data structure required within the vrna_f...
Definition: dp_matrices.h:46
vrna_fc_s::referenceBPs1
unsigned int * referenceBPs1
Matrix containing number of basepairs of reference structure1 in interval [i,j].
Definition: fold_compound.h:321
vrna_fc_s::sequence_encoding
short * sequence_encoding
Numerical encoding of the input sequence.
Definition: fold_compound.h:226
vrna_fc_s::S_cons
short * S_cons
Numerical encoding of the consensus sequence.
Definition: fold_compound.h:273
grammar.h
Implementations for the RNA folding grammar.
vrna_param_s
The datastructure that contains temperature scaled energy parameters.
Definition: basic.h:57
vrna_fc_s::bpdist
unsigned int * bpdist
Matrix containing base pair distance of reference structure 1 and 2 on interval [i,...
Definition: fold_compound.h:323
vrna_fold_compound_free
void vrna_fold_compound_free(vrna_fold_compound_t *fc)
Free memory occupied by a vrna_fold_compound_t.
vrna_fc_s::exp_matrices
vrna_mx_pf_t * exp_matrices
The PF DP matrices
Definition: fold_compound.h:166
vrna_fc_s::sequences
char ** sequences
The aligned sequences.
Definition: fold_compound.h:263
vrna_fc_s::cons_seq
char * cons_seq
The consensus sequence of the aligned sequences.
Definition: fold_compound.h:270
vrna_sequence_s
Data structure representing a nucleotide sequence.
Definition: sequence.h:41
vrna_fc_s::jindx
int * jindx
DP matrix accessor
Definition: fold_compound.h:172
vrna_fc_s::S3
short ** S3
Sl[s][i] holds next base 3' of i in sequence s.
Definition: fold_compound.h:282
VRNA_FC_TYPE_COMPARATIVE
@ VRNA_FC_TYPE_COMPARATIVE
Definition: fold_compound.h:121
dp_matrices.h
Functions to deal with standard dynamic programming (DP) matrices.
vrna_fc_s::scs
vrna_sc_t ** scs
A set of soft constraints (for each sequence in the alignment)
Definition: fold_compound.h:297
vrna_fc_s::domains_struc
vrna_sd_t * domains_struc
Additional structured domains.
Definition: fold_compound.h:201
sequence.h
Functions and data structures related to sequence representations ,.
vrna_sc_s
The soft constraints data structure.
Definition: soft.h:171
vrna_fold_compound_add_callback
void vrna_fold_compound_add_callback(vrna_fold_compound_t *fc, vrna_callback_recursion_status *f)
Add a recursion status callback to the vrna_fold_compound_t.
vrna_fc_s::auxdata
void * auxdata
A pointer to auxiliary, user-defined data.
Definition: fold_compound.h:185
structured_domains.h
This module provides interfaces that deal with additional structured domains in the folding grammar.
soft.h
Functions and data structures for secondary structure soft constraints.
vrna_fc_s::strand_number
unsigned int * strand_number
The strand number a particular nucleotide is associated with.
Definition: fold_compound.h:154
vrna_fold_compound_add_auxdata
void vrna_fold_compound_add_auxdata(vrna_fold_compound_t *fc, void *data, vrna_callback_free_auxdata *f)
Add auxiliary data to the vrna_fold_compound_t.
vrna_exp_param_s
The data structure that contains temperature scaled Boltzmann weights of the energy parameters.
Definition: basic.h:103
vrna_fc_s::S5
short ** S5
S5[s][i] holds next base 5' of i in sequence s.
Definition: fold_compound.h:279
vrna_fc_s::pscore_local
int ** pscore_local
Precomputed array of pair types expressed as pairing scores.
Definition: fold_compound.h:290
vrna_fc_s::strand_order
unsigned int * strand_order
The strand order, i.e. permutation of current concatenated sequence.
Definition: fold_compound.h:155
vrna_fc_s::hc
vrna_hc_t * hc
The hard constraints data structure used for structure prediction.
Definition: fold_compound.h:163
vrna_fc_s::mm2
unsigned int * mm2
Maximum matching matrix, reference struct 2 disallowed.
Definition: fold_compound.h:326
vrna_fc_s::domains_up
vrna_ud_t * domains_up
Additional unstructured domains.
Definition: fold_compound.h:204
vrna_fc_s::ptype_pf_compat
char * ptype_pf_compat
ptype array indexed via iindx
Definition: fold_compound.h:240
vrna_fc_s::pscore_pf_compat
short * pscore_pf_compat
Precomputed array of pair types expressed as pairing scores indexed via iindx.
Definition: fold_compound.h:293
vrna_mx_pf_s
Partition function (PF) Dynamic Programming (DP) matrices data structure required within the vrna_fol...
Definition: dp_matrices.h:204
vrna_fc_s::cutpoint
int cutpoint
The position of the (cofold) cutpoint within the provided sequence. If there is no cutpoint,...
Definition: fold_compound.h:150
vrna_md_s
The data structure that contains the complete model details used throughout the calculations.
Definition: model.h:180
vrna_fc_s
The most basic data structure required by many functions throughout the RNAlib.
Definition: fold_compound.h:137
vrna_fc_s::strand_start
unsigned int * strand_start
The start position of a particular strand within the current concatenated sequence.
Definition: fold_compound.h:156
unstructured_domains.h
Functions to modify unstructured domains, e.g. to incorporate ligands binding to unpaired stretches.
vrna_fc_s::pscore
int * pscore
Precomputed array of pair types expressed as pairing scores.
Definition: fold_compound.h:287
VRNA_FC_TYPE_SINGLE
@ VRNA_FC_TYPE_SINGLE
Definition: fold_compound.h:120
vrna_fc_s::referenceBPs2
unsigned int * referenceBPs2
Matrix containing number of basepairs of reference structure2 in interval [i,j].
Definition: fold_compound.h:322
vrna_fc_s::length
unsigned int length
The length of the sequence (or sequence alignment)
Definition: fold_compound.h:149
vrna_gr_aux_s
Definition: grammar.h:53
vrna_fc_s::free_auxdata
vrna_callback_free_auxdata * free_auxdata
A callback to free auxiliary user data whenever the fold_compound itself is free'd.
Definition: fold_compound.h:189
vrna_callback_recursion_status
void() vrna_callback_recursion_status(unsigned char status, void *data)
Callback to perform specific user-defined actions before, or after recursive computations.
Definition: fold_compound.h:67
vrna_unstructured_domain_s
Data structure to store all functionality for ligand binding.
Definition: unstructured_domains.h:228
vrna_fc_s::n_seq
unsigned int n_seq
The number of sequences in the alignment.
Definition: fold_compound.h:267
vrna_fc_type_e
vrna_fc_type_e
An enumerator that is used to specify the type of a vrna_fold_compound_t.
Definition: fold_compound.h:119
vrna_callback_free_auxdata
void() vrna_callback_free_auxdata(void *data)
Callback to free memory allocated for auxiliary user-provided data.
Definition: fold_compound.h:46
vrna_fc_s::params
vrna_param_t * params
The precomputed free energy contributions for each type of loop.
Definition: fold_compound.h:168
vrna_structured_domains_s
Definition: structured_domains.h:26
vrna_fold_compound
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_fc_s::mm1
unsigned int * mm1
Maximum matching matrix, reference struct 1 disallowed.
Definition: fold_compound.h:325
vrna_fc_s::ptype_local
char ** ptype_local
Pair type array (for local folding)
Definition: fold_compound.h:339
vrna_fc_s::sequence
char * sequence
The input sequence string.
Definition: fold_compound.h:223
vrna_fc_s::stat_cb
vrna_callback_recursion_status * stat_cb
Recursion status callback (usually called just before, and after recursive computations in the librar...
Definition: fold_compound.h:180
vrna_fc_s::type
const vrna_fc_type_e type
The type of the vrna_fold_compound_t.
Definition: fold_compound.h:142
vrna_fc_s::iindx
int * iindx
DP matrix accessor
Definition: fold_compound.h:171
basic.h
Functions to deal with sets of energy parameters.