Functions that are responsible for reading and printing input, arguments and other stuff. More...
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include "structs.h"
Go to the source code of this file.
Functions | |
char * | get_line (FILE *fp) |
Read a line from a file. | |
struct gotoh_arguments | gotoh_readArguments (int argc, char *argv[]) |
Read the command line arguments. | |
struct gotoh_settings | gotoh_readSettings (gotoh_arguments ga) |
Initialize settings. | |
struct gotoh_motifSingle | gotoh_readMotifSingle (char *file) |
Read a motif into a data structure. | |
struct gotoh_motif | gotoh_readMotif2sided (char *file, gotoh_settings cfg) |
Read a 2-sided motif into a data structure. | |
struct gotoh_arguments | gotoh_initArguments () |
Initialize the arguments struct. | |
struct gotoh_settings | gotoh_initSettings () |
Initialize the settings struct. | |
void | gotoh_printArguments (gotoh_arguments ga) |
Print arguments struct. | |
void | gotoh_printSettings (gotoh_settings gs) |
Print settings struct. | |
void | gotoh_printMotifSingle (struct gotoh_motifSingle m) |
Print the input motif. | |
void | gotoh_printMotif (struct gotoh_motif m) |
Print the input Motif (2-sided). | |
void | usage () |
Print usage information. | |
void | version () |
Print version information. | |
void | gotoh_freeArguments (gotoh_arguments ga) |
Free arguments struct. | |
void | gotoh_freeSettings (gotoh_settings gs) |
Free settings struct. | |
void | gotoh_freeMotifSingle (gotoh_motifSingle gm) |
Free struct for motif. | |
void | gotoh_freeMotif (gotoh_motif gm) |
Free struct for 2-sided motif. | |
void | gotoh_Error (char *msg, int v) |
Print error message and exit program. | |
void | gotoh_Warning (char *msg, int v) |
Print warning to stderr, continue program. |
Functions that are responsible for reading and printing input, arguments and other stuff.
This file contains functions that read arguments and settings, prints them. There are functions that initialize and free necessary structs.
char * get_line | ( | FILE * | fp | ) |
Read a line from a file.
fp
Filepointer to an opended (at least for reading) file.The function get_line() reads a line of arbitrary length from the file pointed to by fp
. The file should be opened (at least) for reading before calling get_line().
void gotoh_Error | ( | char * | msg, | |
int | v | |||
) |
Print error message and exit program.
msg
Message as string v
Verbose valuePrint error message and exit program.
void gotoh_freeArguments | ( | gotoh_arguments | ga | ) |
Free arguments struct.
ga
Struct containing the command line arguments. void gotoh_freeMotif | ( | gotoh_motif | gm | ) |
Free struct for 2-sided motif.
gm
Struct containing all motif information void gotoh_freeMotifSingle | ( | gotoh_motifSingle | gm | ) |
Free struct for motif.
gm
Struct containing all motif information void gotoh_freeSettings | ( | gotoh_settings | gs | ) |
Free settings struct.
gs
Struct for settings gotoh_arguments gotoh_initArguments | ( | ) | [read] |
Initialize the arguments struct.
gotoh_settings gotoh_initSettings | ( | ) | [read] |
Initialize the settings struct.
void gotoh_printArguments | ( | gotoh_arguments | ga | ) |
Print arguments struct.
ga
Struct for command line arguments void gotoh_printMotif | ( | struct gotoh_motif | m | ) |
Print the input Motif (2-sided).
m
Struct containing all motif information void gotoh_printMotifSingle | ( | struct gotoh_motifSingle | m | ) |
Print the input motif.
m
Struct containing all motif information void gotoh_printSettings | ( | gotoh_settings | gs | ) |
Print settings struct.
gs
Struct for settings struct gotoh_arguments gotoh_readArguments | ( | int | argc, | |
char * | argv[] | |||
) | [read] |
Read the command line arguments.
argc
Number of command line arguments argv
Array containing the command line argumentsgotoh_readArguments() reads the command line arguments and initializes the program respectively. If something is wrong with the input help messages are returned and the program exits.
struct gotoh_motif gotoh_readMotif2sided | ( | char * | file, | |
gotoh_settings | cfg | |||
) | [read] |
Read a 2-sided motif into a data structure.
file
The filename of the file containing the motif as frequency patterns with list of paired positions. cfg
Struct containing the configuration settingsgotoh_readMotif2sided() reads the frequency patterns of both sides of the motif and the corresponding base pair information. For details on the format see scripts/reformat.pl
.
struct gotoh_motifSingle gotoh_readMotifSingle | ( | char * | file | ) | [read] |
Read a motif into a data structure.
file
The filename of the file containing the motif as frequency pattern.gotoh_readMotifSingle() reads the frequency pattern of the query motif into a datastruct. Additionally, it stores min and max values for each column of the motif as well as the information content.
struct gotoh_settings gotoh_readSettings | ( | gotoh_arguments | ga | ) | [read] |
Initialize settings.
ga
Struct containing the command line arguments.gotoh_readSettings() parses the command line arguments, checks the validity of each parameter and exits the program if something is wrong with the parameters.
void gotoh_Warning | ( | char * | msg, | |
int | v | |||
) |
Print warning to stderr, continue program.
msg
Message as string v
Verbose valuePrint warning to stderr, continue program.