src/sequence.c File Reference

File that defines all functions related to sequences. More...

#include <ctype.h>
#include "sequence.h"
#include "options.h"
#include "sequence_interface.h"
#include "io.h"
#include "macros.h"

Include dependency graph for sequence.c:


Functions

void get_sequences (sequence_array *array_of_seqs)
 Function used to retrieve sequences contained in the fasta file and reference file.
void destroy_sequence (p_sequence s)
 Function used to destroy a p_sequence structure.
int is_present_array_sequence (char *seq_name_to_find, sequence_array *array_of_seqs)
 Function used to retrieve the index of a sequence according to its name.
void get_real_length_sequence (p_sequence seq)
 Function used to calculate the real length of a sequence.
char get_complementary_base (char nucleotide)
 Function used to get the complementary nucleotide.
void complete_sequences_attributes (sequence_array *array_of_seqs)
 Function used to complete some missing attributes in the sequence array.

Detailed Description

File that defines all functions related to sequences.

Author:
Benjamin Grenier-Boley <benjamin.grenier-boley@inria.fr>
Version:
1.02
Date:
September 2008
This file will define all fucntions related to sequences

Function Documentation

void complete_sequences_attributes ( sequence_array array_of_seqs  ) 

Function used to complete some missing attributes in the sequence array.

Parameters:
[in,out] array_of_seqs : the array containing all sequences and that will be updated
This function will complete the species attribute when possible, put in uppercase the sequence when needed and replace the spaces in the sequence name by a "_"

Parameters:
[in,out] : array_of_seqs : the array containing all sequences and that will be updated
This function will complete the species attribute when possible, put in uppercase the sequence when needed and replace the spaces in the sequence name by a "_"

References DESTROY, sequence_array::nb_seqs, NEW, RENEW, and sequence_array::seqs.

Referenced by main().

void destroy_sequence ( p_sequence  s  ) 

Function used to destroy a p_sequence structure.

Parameters:
[in,out] s : the p_sequence to destroy
This function will destroy all allocated memory for a p_sequence structure

References DESTROY.

Referenced by destroy_main_structure().

char get_complementary_base ( char  nucleotide  ) 

Function used to get the complementary nucleotide.

Parameters:
[in] nucleotide : the nucleotide to get its complementary
Returns:
the complementary nucleotide
This function will return the complementary nucleotide of the one given If bad nucleotide return 'N'

Parameters:
[in] nucleotide : the nucleotide to get its complementary
Returns:
the complementary nucleotide
This function will return the complementary nucleotide of the one given

References _ERROR, and ERROR_.

Referenced by complete_set_sequences().

void get_real_length_sequence ( p_sequence  seq  ) 

Function used to calculate the real length of a sequence.

Parameters:
[in,out] seq : the reference sequence
This function will calculate the real length of a sequence(all nucleotides except N)

Referenced by get_sequences().

void get_sequences ( sequence_array array_of_seqs  ) 

Function used to retrieve sequences contained in the fasta file and reference file.

Function used to retrieve sequences contained in the fasta file.

Parameters:
[in,out] array_of_seqs : the array of sequences that will be updated with sequences contained in the fasta file
This function will use the sequence parser to retrieve the sequences in the fasta file

References _ERROR, char_array::chars, DESTROY, ERROR_, free_flex_mem(), get_real_length_sequence(), char_array::nb_chars, sequence_array::nb_seqs, NEW, OPTS_file, OPTS_file_array, OPTS_ref_file, RENEW, sequence_array::seqs, sequence_file_name, sequence_nb_errors, sequence_result, sequenceparse(), and sequencerestart().

Referenced by main().

int is_present_array_sequence ( char *  seq_name_to_find,
sequence_array array_of_seqs 
)

Function used to retrieve the index of a sequence according to its name.

Parameters:
[in] seq_name_to_find : the name to search for
[in] array_of_seqs : the array of sequences
Returns:
the index in the sequence array or -1 if it wasn't found
This function will search through the array of sequences for the name and return its idnex or -1 if it wasn't found

References sequence_array::nb_seqs, and sequence_array::seqs.

Referenced by complete_alignments_attributes().


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