RNAlib-2.2.0
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 DEPRECATION_WARNINGS
5 # ifdef __GNUC__
6 # define DEPRECATED(func) func __attribute__ ((deprecated))
7 # else
8 # define DEPRECATED(func) func
9 # endif
10 #else
11 # define DEPRECATED(func) func
12 #endif
13 
14 /* make this interface backward compatible with RNAlib < 2.2.0 */
15 #define VRNA_BACKWARD_COMPAT
16 
28 #include <stdio.h>
29 
31 
39 void vrna_file_helixlist( const char *seq,
40  const char *db,
41  float energy,
42  FILE *file);
43 
67 void vrna_file_connect( const char *seq,
68  const char *db,
69  float energy,
70  const char *identifier,
71  FILE *file);
72 
80 void vrna_file_bpseq( const char *seq,
81  const char *db,
82  FILE *file);
83 
84 #if WITH_JSON_SUPPORT
85 
95 void vrna_file_json(const char *seq,
96  const char *db,
97  double energy,
98  const char *identifier,
99  FILE *file);
100 
101 #endif
102 
167 unsigned int vrna_file_fasta_read_record(char **header,
168  char **sequence,
169  char ***rest,
170  FILE *file,
171  unsigned int options);
172 
173 /* @brief Extract a dot-bracket structure string from (multiline)character array
174  *
175  * This function extracts a dot-bracket structure string from the 'rest' array as
176  * returned by vrna_file_fasta_read_record() and returns it. All occurences of comments within the
177  * 'lines' array will be skipped as long as they do not break the structure string.
178  * If no structure could be read, this function returns NULL.
179  *
180  * @see vrna_file_fasta_read_record()
181  *
182  * @param lines The (multiline) character array to be parsed
183  * @param length The assumed length of the dot-bracket string (passing a value < 1 results in no length limit)
184  * @param option Some options which may be passed to alter the behavior of the function, use 0 for no options
185  * @return The dot-bracket string read from lines or NULL
186  */
187 char *vrna_extract_record_rest_structure( const char **lines,
188  unsigned int length,
189  unsigned int option);
190 
206 void vrna_extract_record_rest_constraint( char **cstruc,
207  const char **lines,
208  unsigned int option);
209 
222 int vrna_file_SHAPE_read( const char *file_name,
223  int length,
224  double default_value,
225  char *sequence,
226  double *values);
227 
239 vrna_plist_t *vrna_file_constraints_read( const char *filename,
240  unsigned int length,
241  unsigned int options);
242 
243 #ifdef VRNA_BACKWARD_COMPAT
244 
245 /* @brief Extract a dot-bracket structure string from (multiline)character array
246  *
247  * @deprecated This function is deprecated! Use vrna_extract_record_rest_structure() as a replacment.
248  */
249 DEPRECATED(char *extract_record_rest_structure( const char **lines,
250  unsigned int length,
251  unsigned int option));
252 
259 DEPRECATED(unsigned int read_record(char **header,
260  char **sequence,
261  char ***rest,
262  unsigned int options));
263 
264 
265 DEPRECATED(unsigned int get_multi_input_line(char **string, unsigned int options));
266 
267 #endif
268 
273 #endif
unsigned int vrna_file_fasta_read_record(char **header, char **sequence, char ***rest, FILE *file, unsigned int options)
Get a (fasta) data set from a file or stdin.
vrna_plist_t * vrna_file_constraints_read(const char *filename, unsigned int length, unsigned int options)
Read constraints from an input file.
void vrna_file_json(const char *seq, const char *db, double energy, const char *identifier, FILE *file)
Print a secondary structure in jsonformat.
void vrna_file_connect(const char *seq, const char *db, float energy, const char *identifier, FILE *file)
Print a secondary structure as connect table.
unsigned int read_record(char **header, char **sequence, char ***rest, unsigned int options)
Get a data record from stdin.
void vrna_file_helixlist(const char *seq, const char *db, float energy, FILE *file)
Print a secondary structure as helix list.
int vrna_file_SHAPE_read(const char *file_name, int length, double default_value, char *sequence, double *values)
Read data from a given SHAPE reactivity input file.
this datastructure is used as input parameter in functions of PS_dot.h and others ...
Definition: data_structures.h:163
void vrna_file_bpseq(const char *seq, const char *db, FILE *file)
Print a secondary structure in bpseq format.
void vrna_extract_record_rest_constraint(char **cstruc, const char **lines, unsigned int option)
Extract a hard constraint encoded as pseudo dot-bracket string.