src/carnac.h File Reference

File tha contains functions for the carnac mangement. More...

#include <stdio.h>
#include "types.h"

Include dependency graph for carnac.h:

This graph shows which files directly or indirectly include this file:


Defines

#define CARNAC_ENERGY_REGEX   "energy -?[0-9]+.[0-9]+e(-|[+])[0-9]+"
 Define the regular expression matching energy in carnac results.
#define ARNICA_SELECTED_STEMS_REGEX   "([0-9]?[0-9]* stems)"
 Define the regular expression matching the number of stems in arnica results.
#define CARNAC_SELECTED_STEMS_REGEX   "[0-9]?[0-9]* selected stems"
 Define the regular expression matching the number of stems in carnac results.

Functions

int call_carnac (const p_sequence *seqs, const int nb_seqs)
 Function used to execute carnac on all sequences provided and get the results.
char * read_line (FILE *fd, int *nb)
 Function used to read a file and returns the string read and the number of char read.
int init_carnac ()
 Function used to initialize the call of carnac.
int carnac_individual_energy (const char *output)
 Function used to read the results of carnac.
int write_raw (FILE *output, const p_sequence *seqs, const int nb)
 Function used to write sequences in a file.
int write_fasta_seq (FILE *output, const p_sequence *seqs, const int nb)
 Function used to write sequences in a file in fasta format.
int file_exists (const char *file)
 Function used to test if a file exists.
void destroy_regex ()
 Function used to destroy the regular expression selected.

Detailed Description

File tha contains functions for the carnac mangement.

Header file for the carnac management.

Author:
Benjamin Grenier-Boley <benjamin.grenier-boley@inria.fr>
Version:
1.02
Date:
September 2008
This file wil define all functions for the use of carnac as a selecting parameter

Function Documentation

int call_carnac ( const p_sequence seqs,
const int  nb_seqs 
)

Function used to execute carnac on all sequences provided and get the results.

Parameters:
[in] seqs : the array of sequences
[in] nb_seqs : the number of sequences to compare
Returns:
an integer representing the result of carnac matched by the wanted regular expression or -1 if an error occured
Function that will execute carnac on all sequences, get the results and return them

Parameters:
[in] seqs : the array of sequences
[in] nb_seqs : the number of sequences to compare
Returns:
an integer representing the result of carnac matched by the wanted regular expression
Function that will execute carnac on all sequences, get the results and return them

References _ERROR, DESTROY, ERROR_, and NEW.

int carnac_individual_energy ( const char *  output  ) 

Function used to read the results of carnac.

Parameters:
[in] output : the location of the carnac result
Returns:
an integer corresponding to the result matched by the regular expression used (eg number of stems found)
Function that will read the carnac results depending on the regular expression used

References _ERROR, DESTROY, ERROR_, NEW, read_file(), and RENEW.

void destroy_regex (  ) 

Function used to destroy the regular expression selected.

Function that will destroy the regular expression

References DESTROY.

int file_exists ( const char *  file  ) 

Function used to test if a file exists.

Parameters:
[in] file : the file to test
Returns:
an integer :
1 -> the file exists 0 -> the file doesn't exist
Function that will test the existence of a file

int init_carnac (  ) 

Function used to initialize the call of carnac.

Returns:
an integer :
1 -> an error occured
0 -> no error
Function that will initialize the call of the caranc software

References _ERROR, ARNICA_SELECTED_STEMS_REGEX, CARNAC_SELECTED_STEMS_REGEX, ERROR_, and NEW.

char* read_line ( FILE *  fd,
int *  nb 
)

Function used to read a file and returns the string read and the number of char read.

Parameters:
[in] fd : the file descriptor
[in] nb : the number of char read
Returns:
the string read
Function that will read the file and returns the both string read and its length

References _ERROR, ERROR_, NEW, and RENEW.

int write_fasta_seq ( FILE *  output,
const p_sequence seqs,
const int  nb 
)

Function used to write sequences in a file in fasta format.

Parameters:
[in] output : the file where to write
[in] seqs : the sequences to write
[in] nb : the number of sequences to write
Returns:
an integer :
1,2 -> an error occured 0 -> no error
Function that will write the provided sequences in the wanted file in the fasta format

int write_raw ( FILE *  output,
const p_sequence seqs,
const int  nb 
)

Function used to write sequences in a file.

Parameters:
[in] output : the file where to write
[in] seqs : the sequences to write
[in] nb : the number of sequences to write
Returns:
an integer :
1 -> an error occured 0 -> no error
Function that will write the provided sequences in the wanted file


Generated on Mon Sep 22 16:34:09 2008 for matt_ygraph by  doxygen 1.5.5