RNAlib-2.2.0-RC2
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 
146 #include <stdio.h>
147 
149 
157 void vrna_structure_print_hx( const char *seq,
158  const char *db,
159  float energy,
160  FILE *file);
161 
171 void vrna_structure_print_ct( const char *seq,
172  const char *db,
173  float energy,
174  const char *identifier,
175  FILE *file);
176 
184 void vrna_structure_print_bpseq(const char *seq,
185  const char *db,
186  FILE *file);
187 
188 #if WITH_JSON_SUPPORT
189 
190 void vrna_structure_print_json( const char *seq,
191  const char *db,
192  double energy,
193  const char *identifier,
194  FILE *file);
195 
196 #endif
197 
262 unsigned int vrna_read_fasta_record(char **header,
263  char **sequence,
264  char ***rest,
265  FILE *file,
266  unsigned int options);
267 
268 /* @brief Extract a dot-bracket structure string from (multiline)character array
269  *
270  * This function extracts a dot-bracket structure string from the 'rest' array as
271  * returned by vrna_read_fasta_record() and returns it. All occurences of comments within the
272  * 'lines' array will be skipped as long as they do not break the structure string.
273  * If no structure could be read, this function returns NULL.
274  *
275  * @see vrna_read_fasta_record()
276  *
277  * @param lines The (multiline) character array to be parsed
278  * @param length The assumed length of the dot-bracket string (passing a value < 1 results in no length limit)
279  * @param option Some options which may be passed to alter the behavior of the function, use 0 for no options
280  * @return The dot-bracket string read from lines or NULL
281  */
282 char *vrna_extract_record_rest_structure( const char **lines,
283  unsigned int length,
284  unsigned int option);
285 
301 void vrna_extract_record_rest_constraint( char **cstruc,
302  const char **lines,
303  unsigned int option);
304 
317 int vrna_read_SHAPE_file( const char *file_name,
318  int length,
319  double default_value,
320  char *sequence,
321  double *values);
322 
334 plist *vrna_read_constraints_file(const char *filename,
335  unsigned int length,
336  unsigned int options);
337 
338 #ifdef VRNA_BACKWARD_COMPAT
339 
340 /* @brief Extract a dot-bracket structure string from (multiline)character array
341  *
342  * @deprecated This function is deprecated! Use vrna_extract_record_rest_structure() as a replacment.
343  */
344 DEPRECATED(char *extract_record_rest_structure( const char **lines,
345  unsigned int length,
346  unsigned int option));
347 
354 DEPRECATED(unsigned int read_record(char **header,
355  char **sequence,
356  char ***rest,
357  unsigned int options));
358 
359 
360 DEPRECATED(unsigned int get_multi_input_line(char **string, unsigned int options));
361 
362 #endif
363 
368 #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.