src/alignment.h File Reference

Header file that defines all functions related to alignments. More...

#include "types.h"

Include dependency graph for alignment.h:

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


Functions

int compare_sort_pos (const void *a, const void *b)
 Function used to compare two alignments according to the starting position on the reference.
void destroy_alignment (p_alignment_info al)
 Function used to destroy a p_alignment_info structure.
void copy_alignment (p_alignment_info al1, p_alignment_info al2)
 Function used to copy one alignment into another.
void read_alignments_files (p_matt_ygraph m)
 This function will read the alignments file and get the the information within.
void complete_alignments_attributes (alignment_info_array *al_info, sequence_array *seqs)
 This function will complete all missing attributes.
int is_ref_intersect (p_alignment_info alignment, p_interval interval)
 This function that tells if the alignment overlap on the reference sequence for the interval given.
int get_length_ref_intersect (p_alignment_info alignment, p_interval interval)
 This function will return the length of the intersection on the reference sequence for the alignment and the interval given.
void small_in_large (char *refseq, p_interval_query query)
 This function will align the query sequence against the reference one using a small in large algorithm.
float aln (p_interval_query seq1, p_interval_query seq2)
 This function will align the first sequence against the second one and return the identity.
void eliminate_redundancy_species (p_matt_ygraph m, alignment_info_array *nr_array)
 This function will eliminate redundancy in alignments according to the reference positions.

Detailed Description

Header file that defines all functions related to alignments.

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

Function Documentation

float aln ( p_interval_query  seq1,
p_interval_query  seq2 
)

This function will align the first sequence against the second one and return the identity.

Parameters:
[in] seq1 : the first sequence
[in] seq2 : the second structure
Returns:
A float repreenting the identity bewteen the 2 sequences
This function will align the 2 sequences using a semi-global alignment and return the identity

References _ERROR, DESTROY, ERROR_, GAPEXT, GAPOPEN, GET_IUPAC_INDICE, iupac_full, NEW, and PROG_DYN_LINEAR_INDEX.

Referenced by maxi_clique_search(), and search_naive_clique().

int compare_sort_pos ( const void *  a,
const void *  b 
)

Function used to compare two alignments according to the starting position on the reference.

Parameters:
[in] a : first alignment to compare
[in] b : second alignment to compare
Function will compare two alignments according to the starting position on the reference and sort the array of alignments

Parameters:
[in] a : first alignment to compare
[in] b : second alignment to compare
Returns:
-1 if "a" starts on the reference before "b", 0 if equal and -1 otherwise
Function will compare two alignments according to the starting position on the reference and sort the array of alignments

Referenced by complete_alignments_attributes().

void complete_alignments_attributes ( alignment_info_array al_info,
sequence_array seqs 
)

This function will complete all missing attributes.

Parameters:
[in,out] al_info : the array of alignments that will be updated
[in] seqs : array of seqences that contains all information on sequences
This function will complete all missing attributes like the strand, it will also invert start pos and end pos for minus strand in order to have always an interval in the same way, it will also check the subject / query name : the reference name will be put into the query fields and finally, it will complete the index attributes that link that array with the sequence array. It will also sort the array according to the position on the reference sequence

Parameters:
[in,out] al_info : the array of alignments that will be updated
[in] seqs : array of seqences that contains all information on sequences
This function will complete all missing attributes like the strand, it will also invert start pos and end pos for minus strand in order to have always an interval in the same way, it will also check the subject / query name : the reference name will be put into the query fields and finally, it will complete the index attributes that link that array with the sequence array

References _ERROR, alignment_info_array::al_info, compare_sort_pos(), DESTROY, ERROR_, is_present_array_sequence(), alignment_info_array::nb_al_info, NEW, and sequence_array::seqs.

Referenced by main().

void copy_alignment ( p_alignment_info  al1,
p_alignment_info  al2 
)

Function used to copy one alignment into another.

Parameters:
[in,out] al1 : the p_alignment_info that will be filled with the information of the second alignment
[in] al2 : the p_alignment_info to copy
This function will copy every attribute of the second alignment structure into the first one

Parameters:
[in,out] al1 : the p_alignment_info where to copy
[in] al2 : the p_alignment_info to copy
This function will copy every attribute of the second alignment structure into the first one

References NEW.

Referenced by eliminate_redundancy_species(), and read_alignments_files().

void destroy_alignment ( p_alignment_info  al  ) 

Function used to destroy a p_alignment_info structure.

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

References DESTROY.

Referenced by calculate_nb_al_function(), destroy_main_structure(), and read_alignments_files().

void eliminate_redundancy_species ( p_matt_ygraph  m,
alignment_info_array nr_array 
)

This function will eliminate redundancy in alignments according to the reference positions.

Parameters:
[in] m : the main object containng all needed information
[in,out] nr_array : the non redundant array of alignments
This function will eliminate redundancy in alignments according to the reference positions by merging overlapped alignments in the same species

References alignment_info_array::al_info, copy_alignment(), MAX, MIN, alignment_info_array::nb_al_info, NEW, and RENEW.

Referenced by calculate_nb_al_function().

int get_length_ref_intersect ( p_alignment_info  alignment,
p_interval  interval 
)

This function will return the length of the intersection on the reference sequence for the alignment and the interval given.

Parameters:
[in] alignment : the alignment
[in] interval : the interval
Returns:
the length of the intersection
This function will compare positions on the reference sequence for the alignment and positions of the interval given and calculate the length of the intersection

Referenced by get_sets_of_sequences().

int is_ref_intersect ( p_alignment_info  alignment,
p_interval  interval 
)

This function that tells if the alignment overlap on the reference sequence for the interval given.

Parameters:
[in] alignment : the alignment
[in] interval : the interval
Returns:
1 if they overlap, 0 otherwise
This function will compare position on the reference sequence for the alignment and those in the interval and check if they intersect

Referenced by get_sets_of_sequences().

void read_alignments_files ( p_matt_ygraph  m  ) 

This function will read the alignments file and get the the information within.

Parameters:
[in,out] m : the main structure that will contain the information
This function will be used to extract all information on alignments files in blast tabular format by using the parser

Parameters:
[in,out] m : the main structure that will updated
This function will be used to extract all information on alignments files in blast tabular format

References _ERROR, blast_file_name, blast_nb_errors, blast_result, blastparse(), blastrestart(), char_array::chars, copy_alignment(), DESTROY, destroy_alignment(), ERROR_, char_array::nb_chars, NEW, OPTS_alignments, OPTS_verbose, print_verbose_end_alignments_file(), print_verbose_start_alignments_file(), and RENEW.

Referenced by main().

void small_in_large ( char *  refseq,
p_interval_query  query 
)

This function will align the query sequence against the reference one using a small in large algorithm.

Parameters:
[in] refseq : the reference sequence
[in,out] query : the query structure
This function will align the query sequence against the reference one using a small in large algorithm. It will complete the id_ref attribute and refine its positions by updateing its positions and sequence

Parameters:
[in] refseq : the reference sequence
[in,out] query : the query structure
This function will align the query sequence against the reference one using a small in large algorithm. It will complete the id_ref attribute and refine its positions

References _ERROR, DESTROY, ERROR_, GAPEXT, GAPOPEN, GET_IUPAC_INDICE, iupac_full, NEW, OPTS_max_id, OPTS_min_id, and PROG_DYN_LINEAR_INDEX_REF.

Referenced by compare_all_against_ref().


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