#include <math.h>
#include <ctype.h>
#include "alignment.h"
#include "macros.h"
#include "io.h"
#include "options.h"
#include "blast_interface.h"
#include "sequence.h"
#include "aln_matrices.h"
Defines | |
#define | PROG_DYN_LINEAR_INDEX_REF(Ii, Jj) ((Ii)+((Jj)*(length_ref + 1))) |
Macros that obtains the index in the alignment array according to the positions on sequence I (the reference) and sequence J. | |
#define | PROG_DYN_LINEAR_INDEX(Ii, Jj) ((Ii)+((Jj)*(length_seq1 + 1))) |
Macros that obtains the index in the alignment array according to the positions on sequence I and sequence J. | |
#define | GAPOPEN -10.0 |
Macros that defines the cost of a gap opening. | |
#define | GAPEXT -0.5 |
Macros that defines the cost of a gap extension. | |
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. |
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.
[in] | seq1 | : the first sequence |
[in] | seq2 | : the second structure |
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.
[in] | a | : first alignment to compare |
[in] | b | : second alignment to compare |
[in] | a | : first alignment to compare |
[in] | b | : second alignment to compare |
Referenced by complete_alignments_attributes().
void complete_alignments_attributes | ( | alignment_info_array * | al_info, | |
sequence_array * | seqs | |||
) |
This function will complete all missing attributes.
[in,out] | al_info | : the array of alignments that will be updated |
[in] | seqs | : array of seqences that contains all information on sequences |
[in,out] | al_info | : the array of alignments that will be updated |
[in] | seqs | : array of seqences that contains all information on sequences |
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.
[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 |
[in,out] | al1 | : the p_alignment_info where to copy |
[in] | al2 | : the p_alignment_info to copy |
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.
[in,out] | al | : the p_alignment_info to destroy |
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.
[in] | m | : the main object containng all needed information |
[in,out] | nr_array | : the non redundant array of alignments |
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.
[in] | alignment | : the alignment |
[in] | interval | : the interval |
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.
[in] | alignment | : the alignment |
[in] | interval | : the interval |
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.
[in,out] | m | : the main structure that will contain the information |
[in,out] | m | : the main structure that will updated |
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.
[in] | refseq | : the reference sequence |
[in,out] | query | : the query structure |
[in] | refseq | : the reference sequence |
[in,out] | query | : the query structure |
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().