RNAlib-2.3.1
|
Functions dealing with file formats for RNA sequences, structures, and alignments. More...
Files | |
file | commands.h |
Parse and apply different commands that alter the behavior of secondary structure prediction and evaluation. | |
file | file_formats.h |
Read and write different file formats for RNA sequences, structures. | |
file | file_formats_msa.h |
Functions dealing with file formats for Multiple Sequence Alignments (MSA) | |
file | file_utils.h |
Several utilities for file handling. | |
file | ribo.h |
Parse RiboSum Scoring Matrices for Covariance Scoring of Alignments. | |
Macros | |
#define | VRNA_FILE_FORMAT_MSA_CLUSTAL 1U |
Option flag indicating ClustalW formatted files. More... | |
#define | VRNA_FILE_FORMAT_MSA_STOCKHOLM 2U |
Option flag indicating Stockholm 1.0 formatted files. More... | |
#define | VRNA_FILE_FORMAT_MSA_FASTA 4U |
Option flag indicating FASTA (Pearson) formatted files. More... | |
#define | VRNA_FILE_FORMAT_MSA_MAF 8U |
Option flag indicating MAF formatted files. More... | |
#define | VRNA_FILE_FORMAT_MSA_DEFAULT |
Option flag indicating the set of default file formats. More... | |
#define | VRNA_FILE_FORMAT_MSA_NOCHECK 4096U |
Option flag to disable validation of the alignment. More... | |
#define | VRNA_FILE_FORMAT_MSA_UNKNOWN 8192U |
Return flag of vrna_file_msa_detect_format() to indicate unknown or malformatted alignment. More... | |
Functions | |
int | vrna_file_msa_read (const char *filename, char ***names, char ***aln, char **id, char **structure, unsigned int options) |
Read a multiple sequence alignment from file. More... | |
int | vrna_file_msa_read_record (FILE *fp, char ***names, char ***aln, char **id, char **structure, unsigned int options) |
Read a multiple sequence alignment from file handle. More... | |
unsigned int | vrna_file_msa_detect_format (const char *filename, unsigned int options) |
Detect the format of a multiple sequence alignment file. More... | |
void | vrna_file_copy (FILE *from, FILE *to) |
Inefficient `cp'. | |
char * | vrna_read_line (FILE *fp) |
Read a line of arbitrary length from a stream. More... | |
int | vrna_mkdir_p (const char *path) |
Recursivly create a directory tree. | |
char * | vrna_basename (const char *path) |
Extract the filename from a file path. | |
char * | vrna_dirname (const char *path) |
Extract the directory part of a file path. | |
typedef struct vrna_command_s | vrna_cmd_t |
Typename for the command repesenting data structure vrna_command_s. | |
void | vrna_file_helixlist (const char *seq, const char *db, float energy, FILE *file) |
Print a secondary structure as helix list. More... | |
Functions dealing with file formats for RNA sequences, structures, and alignments.
#define VRNA_FILE_FORMAT_MSA_CLUSTAL 1U |
#include <ViennaRNA/file_formats_msa.h>
Option flag indicating ClustalW formatted files.
#define VRNA_FILE_FORMAT_MSA_STOCKHOLM 2U |
#include <ViennaRNA/file_formats_msa.h>
Option flag indicating Stockholm 1.0 formatted files.
#define VRNA_FILE_FORMAT_MSA_FASTA 4U |
#include <ViennaRNA/file_formats_msa.h>
Option flag indicating FASTA (Pearson) formatted files.
#define VRNA_FILE_FORMAT_MSA_MAF 8U |
#include <ViennaRNA/file_formats_msa.h>
Option flag indicating MAF formatted files.
#define VRNA_FILE_FORMAT_MSA_DEFAULT |
#include <ViennaRNA/file_formats_msa.h>
Option flag indicating the set of default file formats.
#define VRNA_FILE_FORMAT_MSA_NOCHECK 4096U |
#include <ViennaRNA/file_formats_msa.h>
Option flag to disable validation of the alignment.
#define VRNA_FILE_FORMAT_MSA_UNKNOWN 8192U |
#include <ViennaRNA/file_formats_msa.h>
Return flag of vrna_file_msa_detect_format() to indicate unknown or malformatted alignment.
void vrna_file_helixlist | ( | const char * | seq, |
const char * | db, | ||
float | energy, | ||
FILE * | file | ||
) |
#include <ViennaRNA/file_formats.h>
Print a secondary structure as helix list.
seq | The RNA sequence |
db | The structure in dot-bracket format |
energy | Free energy of the structure in kcal/mol |
file | The file handle used to print to (print defaults to 'stdout' if(file == NULL) ) |
int vrna_file_msa_read | ( | const char * | filename, |
char *** | names, | ||
char *** | aln, | ||
char ** | id, | ||
char ** | structure, | ||
unsigned int | options | ||
) |
#include <ViennaRNA/file_formats_msa.h>
Read a multiple sequence alignment from file.
This function reads the (first) multiple sequence alignment from an input file. The read alignment is split into the sequence id/name part and the actual sequence information and stored in memory as arrays of ids/names and sequences. If the alignment file format allows for additional information, such as an ID of the entire alignment or consensus structure information, this data is retrieved as well and made available. The options
parameter allows to specify the set of alignment file formats that should be used to retrieve the data. If 0 is passed as option, the list of alignment file formats defaults to VRNA_FILE_FORMAT_MSA_DEFAULT.
Currently, the list of parsable multiple sequence alignment file formats consists of:
options
parameter.filename | The name of input file that contains the alignment |
names | An address to the pointer where sequence identifiers should be written to |
aln | An address to the pointer where aligned sequences should be written to |
id | An address to the pointer where the alignment ID should be written to (Maybe NULL) |
structure | An address to the pointer where consensus structure information should be written to (Maybe NULL) |
options | Options to manipulate the behavior of this function |
int vrna_file_msa_read_record | ( | FILE * | fp, |
char *** | names, | ||
char *** | aln, | ||
char ** | id, | ||
char ** | structure, | ||
unsigned int | options | ||
) |
#include <ViennaRNA/file_formats_msa.h>
Read a multiple sequence alignment from file handle.
Similar to vrna_file_msa_read(), this function reads a multiple sequence alignment from an input file handle. Since using a file handle, this function is not limited to the first alignment record, but allows for looping over all alignments within the input.
The read alignment is split into the sequence id/name part and the actual sequence information and stored in memory as arrays of ids/names and sequences. If the alignment file format allows for additional information, such as an ID of the entire alignment or consensus structure information, this data is retrieved as well and made available. The options
parameter allows to specify the alignment file format used to retrieve the data. A single format must be specified here, see vrna_file_msa_detect_format() for helping to determine the correct MSA file format.
Currently, the list of parsable multiple sequence alignment file formats consists of:
options
parameter.fp | The file pointer the data will be retrieved from |
names | An address to the pointer where sequence identifiers should be written to |
aln | An address to the pointer where aligned sequences should be written to |
id | An address to the pointer where the alignment ID should be written to (Maybe NULL) |
structure | An address to the pointer where consensus structure information should be written to (Maybe NULL) |
options | Options to manipulate the behavior of this function |
unsigned int vrna_file_msa_detect_format | ( | const char * | filename, |
unsigned int | options | ||
) |
#include <ViennaRNA/file_formats_msa.h>
Detect the format of a multiple sequence alignment file.
This function attempts to determine the format of a file that supposedly contains a multiple sequence alignment (MSA). This is useful in cases where a MSA file contains more than a single record and therefore vrna_file_msa_read() can not be applied, since it only retrieves the first. Here, one can try to guess the correct file format using this function and then loop over the file, record by record using one of the low-level record retrieval functions for the corresponding MSA file format.
filename | The name of input file that contains the alignment |
options | Options to manipulate the behavior of this function |
char* vrna_read_line | ( | FILE * | fp | ) |
#include <ViennaRNA/file_utils.h>
Read a line of arbitrary length from a stream.
Returns a pointer to the resulting string. The necessary memory is allocated and should be released using free() when the string is no longer needed.
fp | A file pointer to the stream where the function should read from |