RNAlib-2.2.0-RC3
file_formats.h
Go to the documentation of this file.
1 #ifndef VIENNA_RNA_PACKAGE_FILE_FORMATS_H
2 #define VIENNA_RNA_PACKAGE_FILE_FORMATS_H
3 
4 #ifdef __GNUC__
5 #define DEPRECATED(func) func __attribute__ ((deprecated))
6 #else
7 #define DEPRECATED(func) func
8 #endif
9 
10 /* make this interface backward compatible with RNAlib < 2.2.0 */
11 #define VRNA_BACKWARD_COMPAT
12 
24 #include <stdio.h>
25 
27 
35 void vrna_structure_print_hx( const char *seq,
36  const char *db,
37  float energy,
38  FILE *file);
39 
49 void vrna_structure_print_ct( const char *seq,
50  const char *db,
51  float energy,
52  const char *identifier,
53  FILE *file);
54 
62 void vrna_structure_print_bpseq(const char *seq,
63  const char *db,
64  FILE *file);
65 
66 #if WITH_JSON_SUPPORT
67 
68 void vrna_structure_print_json( const char *seq,
69  const char *db,
70  double energy,
71  const char *identifier,
72  FILE *file);
73 
74 #endif
75 
140 unsigned int vrna_read_fasta_record(char **header,
141  char **sequence,
142  char ***rest,
143  FILE *file,
144  unsigned int options);
145 
146 /* @brief Extract a dot-bracket structure string from (multiline)character array
147  *
148  * This function extracts a dot-bracket structure string from the 'rest' array as
149  * returned by vrna_read_fasta_record() and returns it. All occurences of comments within the
150  * 'lines' array will be skipped as long as they do not break the structure string.
151  * If no structure could be read, this function returns NULL.
152  *
153  * @see vrna_read_fasta_record()
154  *
155  * @param lines The (multiline) character array to be parsed
156  * @param length The assumed length of the dot-bracket string (passing a value < 1 results in no length limit)
157  * @param option Some options which may be passed to alter the behavior of the function, use 0 for no options
158  * @return The dot-bracket string read from lines or NULL
159  */
160 char *vrna_extract_record_rest_structure( const char **lines,
161  unsigned int length,
162  unsigned int option);
163 
179 void vrna_extract_record_rest_constraint( char **cstruc,
180  const char **lines,
181  unsigned int option);
182 
195 int vrna_read_SHAPE_file( const char *file_name,
196  int length,
197  double default_value,
198  char *sequence,
199  double *values);
200 
212 plist *vrna_read_constraints_file(const char *filename,
213  unsigned int length,
214  unsigned int options);
215 
216 #ifdef VRNA_BACKWARD_COMPAT
217 
218 /* @brief Extract a dot-bracket structure string from (multiline)character array
219  *
220  * @deprecated This function is deprecated! Use vrna_extract_record_rest_structure() as a replacment.
221  */
222 DEPRECATED(char *extract_record_rest_structure( const char **lines,
223  unsigned int length,
224  unsigned int option));
225 
232 DEPRECATED(unsigned int read_record(char **header,
233  char **sequence,
234  char ***rest,
235  unsigned int options));
236 
237 
238 DEPRECATED(unsigned int get_multi_input_line(char **string, unsigned int options));
239 
240 #endif
241 
246 #endif
void vrna_structure_print_ct(const char *seq, const char *db, float energy, const char *identifier, FILE *file)
Print a secondary structure as connect table.
void vrna_structure_print_hx(const char *seq, const char *db, float energy, FILE *file)
Print a secondary structure as helix list.
unsigned int read_record(char **header, char **sequence, char ***rest, unsigned int options)
Get a data record from stdin.
this datastructure is used as input parameter in functions of PS_dot.h and others ...
Definition: data_structures.h:45
int vrna_read_SHAPE_file(const char *file_name, int length, double default_value, char *sequence, double *values)
Read data from a given SHAPE reactivity input file.
unsigned int vrna_read_fasta_record(char **header, char **sequence, char ***rest, FILE *file, unsigned int options)
Get a (fasta) data set from a file or stdin.
void vrna_structure_print_bpseq(const char *seq, const char *db, FILE *file)
Print a secondary structure in bpseq format.
plist * vrna_read_constraints_file(const char *filename, unsigned int length, unsigned int options)
Read constraints from an input file.
void vrna_extract_record_rest_constraint(char **cstruc, const char **lines, unsigned int option)
Extract a hard constraint encoded as pseudo dot-bracket string.