1 #ifndef VIENNA_RNA_PACKAGE_SEQUENCE_H
2 #define VIENNA_RNA_PACKAGE_SEQUENCE_H
3 
4 /**
5  *  @file sequence.h
6  *  @brief  Functions and data structures related to sequence representations
7  *  @ingroup utils, alphabet_utils
8  */
9 
10 /**
11  *  @addtogroup alphabet_utils
12  *  @{
13  */
14 
15 
16 /** @brief Typename for nucleotide sequence representation data structure #vrna_sequence_s */
17 typedef struct vrna_sequence_s vrna_seq_t;
18 
19 typedef struct vrna_alignment_s vrna_msa_t;
20 
21 #include <ViennaRNA/fold_compound.h>
22 
23 
24 #define VRNA_SEQUENCE_RNA       1U
25 
26 #define VRNA_SEQUENCE_DNA       2U
27 
28 /**
29  *  @brief  A enumerator used in #vrna_sequence_s to distinguish different nucleotide sequences
30  */
31 typedef enum {
32   VRNA_SEQ_UNKNOWN,   /**< @brief Nucleotide sequence represents an Unkown type */
33   VRNA_SEQ_RNA,       /**< @brief Nucleotide sequence represents an RNA type */
34   VRNA_SEQ_DNA        /**< @brief Nucleotide sequence represents a DNA type */
35 } vrna_seq_type_e;
36 
37 
38 /**
39  *  @brief  Data structure representing a nucleotide sequence
40  */
41 struct vrna_sequence_s {
42   vrna_seq_type_e type;       /**< @brief The type of sequence */
43   char            *name;
44   char            *string;    /**< @brief The string representation of the sequence */
45   short           *encoding;  /**< @brief The integer representation of the sequence */
46   short           *encoding5;
47   short           *encoding3;
48   unsigned int    length;     /**< @brief The length of the sequence */
49 };
50 
51 
52 struct vrna_alignment_s {
53   unsigned int  n_seq;
54   vrna_seq_t          *sequences;
55   char                **gapfree_seq;
56   unsigned int        *gapfree_size;  /* for MAF alignment coordinates */
57   unsigned long long  *genome_size;     /* for MAF alignment coordinates */
58   unsigned long long  *start;           /* for MAF alignment coordinates */
59   unsigned char       *orientation;     /* for MAF alignment coordinates */
60   unsigned int        **a2s;
61 };
62 
63 
64 vrna_seq_t *
65 vrna_sequence(const char    *string,
66               unsigned int  options);
67 
68 
69 int
70 vrna_sequence_add(vrna_fold_compound_t  *fc,
71                   const char            *string,
72                   unsigned int          options);
73 
74 
75 int
76 vrna_sequence_remove(vrna_fold_compound_t *fc,
77                      unsigned int         i);
78 
79 
80 void
81 vrna_sequence_remove_all(vrna_fold_compound_t *fc);
82 
83 
84 void
85 vrna_sequence_prepare(vrna_fold_compound_t *fc);
86 
87 
88 int
89 vrna_sequence_order_update(vrna_fold_compound_t *fc,
90                            const unsigned int   *order);
91 
92 
93 int
94 vrna_msa_add( vrna_fold_compound_t      *fc,
95               const char                **alignment,
96               const char                **names,
97               const unsigned char       *orientation,
98               const unsigned long long  *start,
99               const unsigned long long  *genome_size,
100               unsigned int              options);
101 
102 
103 /**
104  *  @}
105  */
106 
107 #endif
108