The first function will implement the method ComputeAlignment: Alignment functionsįor the second part, the alignment matrix returned by compute_alignment_matrix will be used to compute global and local alignments of two sequences seq_x and seq_y. If global_flag is False, each entry is computed using the method described in above, but with the modification: Whenever Algorithm ComputeGlobalAlignmentScores computes a value to assign to S, if the computed value is negative, the algorithm instead assigns 0 to S. If global_flag is True the algorithm will use: The function computes and returns the alignment matrix for seq_x and seq_y. compute_alignment_matrix(seq_x, seq_y, scoring_matrix, global_flag): Takes as input two sequences seq_x and seq_y whose elements share a common alphabet with the scoring matrix scoring_matrix.The function computes either a global alignment matrix or a local alignment matrix depending on the value of global_flag. The second function computes an alignment matrix using the method ComputeGlobalAlignmentScores. One final note for build_scoring_matrix is that, although an alignment with two matching dashes is not allowed, the scoring matrix should still include an entry for two dashes (which will never be used). Finally, the score for the remaining off-diagonal entries is off_diag_score. The score for the remaining diagonal entries is diag_score. The score for any entry indexed by one or more dashes is dash_score. The function returns a dictionary of dictionaries whose entries are indexed by pairs of characters in alphabet plus ’-’. build_scoring_matrix(alphabet, diag_score, off_diag_score, dash_score): Takes as input a set of characters alphabet and three scores diag_score, off_diag_score, and dash_score.The first function builds a scoring matrix as a dictionary of dictionaries. The first two functions that you will implement compute a common class of scoring matrices and compute the alignment matrix for two provided sequences, respectively. DNA sequence alignment analysis Matrices and functionsįor this project, two types of matrices will be used: alignment matrices and scoring matrices.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |