hey there this is vineet from bioinformatica in this video we are going to discuss about the global sequence alignment and the working of the needle manuals algorithm we will also learn how to align two sequences globally so without further ado let's get started so in bioinformatics we generally deal with two types of sequences mainly dna or rna which are nothing but the sequences of nucleotide bases and proteins which are sequences of amino acids now why do we perform sequence alignment in simple words we can say sequence alignment is the most efficient and simple way to
determine the functional relationships the structural relationships and the evolutionary relationship between the sequences you can learn more about the sequences and alignment techniques by watching our previous videos by clicking on this i button and you can also watch it by clicking on the link given in the description below we can broadly divide the alignment methods into two types that are the global alignment and the local alignment here we are discussing some of the features of the global and local alignment the global alignment tries to align the entire sequences with each other while the local alignment
only aligned these reasons having the highest similarities the global alignment aligned all letters from the query sequences and the target sequence while the local alignment align substring of the target sequence with substring of the query sequence so the global alignment is more suitable for close related sequences while the local alignment is more suitable for divergent or distantly related sequences the most common global alignment algorithm is needleman and owns and the commonly used local alignment algorithm is smith-waterman algorithm in this video we are going to study about global alignment hopefully you have watched our previous videos
on sequence alignment and have some basic knowledge about the scoring matrices and about the rewards and penalties overall the needleman owns and smith waterman algorithms are based on dynamic programming in dynamic programming we take a large complicated problem then break the problem into smaller and simpler sub problems which are relatively much easier to solve then again derive the required optimal solution from the solutions of those sub problems required steps in the dynamic programming all dynamic programming algorithms including needleman owns follows some general steps that are initialization metric spelling and transparent in this video we are
going to align two sequences manually using needleman owns algorithm we have also a step-by-step video tutorial on how to create needleman owns algorithm for global sequence alignment using python if you are interested in programming make sure to check that video by clicking on this i button for a better understanding of this algorithm the link to the video is also given in the description below so here we are aligning two sequences the first sequence is a d g c d and the second sequence is a g c d at first we will create a matrix of
n plus 1 into m plus one side where m is the length of the first sequence and one is for the first blank column and n is the length of the second sequence and the one is for this first row after creating the blank matrix now we are ready for the first step that is the initialization step in the initialization step we will fill the first row and the first column with progressive gap penalties that is we start with 0 and as we proceed right words in the row we will be adding cap penalties in
each step so when we move from 0 to a we will have a gap penalty added to 0 so the value become -2 after the addition again moving from a to t the value become -4 then it has become -6 minus 8 and minus 10 and so on you get the point so similarly we will fill the first column also again starting from 0 and all the way up to t now our initialization step is completed and we are now ready for the matrix failing step so now we will assign the value to the green
box to assign the value to the green box we will first take the value from the left neighbor that is -2 as we know for any vertical or horizontal movement we will be adding cap penalties to it in this case the gap penalty is minus 2 so the value become -4 after the addition let us keep the value noted after that we will take the value from the upper neighbor that is -2 and again for the vertical movement we will add the cap analytic to it so the value again become minus 4 after the addition
after noting the value now we are going to take the value from the diagonal neighbor that is 0. we know from the previous videos that for diagonal movement we may have either matching reward or mismatching penalty to check this we will compare the letters in the two sequences that corresponds to the box in this case this is a and a so it is a match and we will add the matching reward to the value of the diagonal neighbor so we will get 1. now we have to take the maximum value among these three values here
in this case it is 1 so we will put 1 in the green box after that we will proceed to the next box now we will repeat the steps that we have implemented on this last box so again we take the value from the left neighbor that is 1 and add gap penalty to it so we will get minus one then we will also take the upper neighbor and add the cap penalty to it as well so it will become minus six again as in the last box we will take the value from the diagonal
box now check if the corresponding letters are same or not in this case these letters are a and t so this is a mismatch so we will be adding mismatch penalty to the value and the value will become -3 among minus 1 minus 3 and minus 6 minus 1 is larger so we'll take -1 and add it to the green box i think you get the point the video will be too long if i fill every box one by one so try to fill the metrics by yourself by using the steps we have discussed and
check if you can fill the matrix correctly or not after filling the matrix now we can proceed to the next step that is the traceback we will begin the traceback strap from the right bottom corner of the matrix where the highest value lies and continue tracing back up to the upper left corner from where we have started the metric spelling process it is a relatively simpler process we just have to trace the arrows back which lead us to the end corner there is also a less time consuming trick which works fine as well if the
letters corresponding to the box are same the traceback will go diagonally if the letters are not matched the traceback will go towards the highest valued neighbor in the first box the corresponding letters are matched so it will go diagonally for the second and third box the letters are not matched so the traceback will go towards the highest neighbor so let's start the traceback we will start from the right bottom corner the corresponding letters are t and t so it is a match so the arrow will go diagonally here the corresponding letters are c and c
so it will go diagonally again here we got g and g that is a match so the arrow will go diagonally again but now we got the corresponding letters that are t and a so it is a mismatch so we have to look for the highest valued neighbor here the neighbors are 1 minus 2 and minus 4. among these 3 one have the highest value so we will discard the remaining two and the traceback will proceed towards one here again we got a match that is a and a so the dressback will go diagonally this
is where most of the students get confused for writing the alignment we have to consider only the arrows not the values it is a good practice to write the aligned sequences from right to left so now understand how to recognize the match mismatch and gap a diagonal trace back arrow from the higher value to lower value is mh if the arrow is from lower value to higher value or from same value to same value it will be a mismatch and the most obvious one if the traceback arrow is vertical or horizontal that will be a
gap so finally these are our aligned sequences hope this video helped you to learn something here are some example sequences that you can try yourself it would be great if you post your results in the comment section below as mentioned earlier you can also watch the video on how to create a python program to solve the global alignment problem using needleman owns algorithm any like comment share and subscription would be highly appreciated it will motivate us to create more interesting videos this is beneath and you are watching bioinformatica and as always thanks for watching