You're currently learning a lecture from the course: 


Prerequisite Terminologies

In order to have thorough understanding of the main topic, you should have the basic concept of the following terms:

Multiple Sequence Alignment (MSA)
Pairwise Sequence Alignment.
Clustal Omega




Hamsa Ehsan


Needle is an alignment tool used by Bioinformaticians. It is a pairwise alignment tool; design to write the optimal global alignment. It’s one of the sub-software/tool which is available in EMBOSS.

  • Pairwise Sequence Alignment

It is the process of finding similar regions between two biological sequences, which could point towards evolutionary, functional and structural relationships between those sequences.

  • Needleman-Wunsch Algorithm

This algorithm was developed by Saul B. Needleman and Christian D. It is an optimal matching algorithm used in bioinformatics, for the comparison of biological sequences. What it actually does is that it breaks a larger problem into smaller problems and find the solutions for the smaller problems so an optimal solution can be found out for the larger problem.

This is how you can fill the scores within the matrix which is plotted against two sequences and if:

  • Two residues at  ith and jth  position are same, then the matching score would be (S(i,j)= 1)

  • Two residues at  ith and jth  position are not same, then the mismatch score would be (S(i,j)= -1 )

  • Gap score or penalty would be assumed 0 or any negative integer.

Note: The scores of match, mismatch and gap can be user-defined, provided the gap penalty should be negative or zero.

To find the maximum score of each cell, it is required to know the neighboring scores (diagonal, left and right) of the current position. From the assumed values, add the match or mismatch (assumed) score to the diagonal value. Similarly, add the gap score to the other neighboring values. Thus, we can obtain three different values, from that take the maximum among them and fill the ith and jth position with the score obtained.

Overall the equation can be shown in the following manner:

Mi,j = Maximum[M(i-1,j-1)+S(i,j),M(i,j-1)+w,M(i-1,j)+w]

[If this is a bit hard to understand, we would recommend you to read this and have more information about Filling the Matrix and back tracking]

Global Alignment Vs Local Alignment

There is a very general difference between global and local alignment.

1st.  Global Alignment

2nd. Local Alignment

In Global Alignment, end to end sequence alignment take place.

In Local Alignment, your query is matched with the portion of your reference sequence.

The length of both sequences is about the same.

The length of both sequences varies greatly.

Gaps are in higher quantity if the query and the reference sequences are quite dissimilar.

Gaps can be introduced in local alignment.

Global Alignment Example


|  |  | | |  | |  | | | |          |  |  |  |  | | |       | |  | |  | | | |  |  |  | |  | | |  | |  |  | |  |  |


Local Alignment Example


|    |  | |    |  |  | |  |  |      |  |  | |  | | |  | |  |  |  | |  |  |



  • Go to the webserver of Needle which you can access from here.

  • Once it opens, you need to go through some steps to submit your query.

  • STEP 1 is to ‘Enter your protein sequences’, where you can to select the pair, either it is Protein or DNA.

  • You have to upload or paste your two sequences (Protein/DNA) in the given two boxes below. [one in each]

       Note: They should be about the same length as you’re doing the global alignment.

  • STEP 2 is where you have to ‘Set your pairwise alignment options’.

  • In this step, you determine the output format; there are many of the formats from which you can choose or keep the default option (‘pair’ format).

      [Default Setting usually fulfill the needs of most users]

  • From the ‘More Options’, you can customize your result as per your need.

  • STEP 3 is to ‘submit your job’, just click on the Submit.

  • Your result will show up, which you can analyze.

  • The result you can observe would consist of Gap Opening, Extent, End opening and more with their scores.

  • Same as the penalty is counted; The longer the gap is extended, the larger the penalty will be provided.

  • If you scroll below, you can see some information that is readable by humans, it contains ID, length, identity, similarity, gaps, score.

  • You can analyze the alignment sequences. [for that watch our video on Clustal Omega]

  • Now, ‘Score’, ‘Similarity’, ‘Identity’ are what determine if those two sequences are closely related or not.

       [Make sure your sequence alignment have lesser gaps to get the similar sequences]


Two sequences are closely related if, after their pairwise alignment, they have lesser gaps and high identity score. [and Similarity score in case of Proteins].


In this video, we got to do Global Alignment through EMBOSS Needle. We saw how the Needleman-Wunsch Algorithm works and how it forms the matrix and track the optimum sequence.

File(s) Section

If a particular file is required for this video, and was discussed in the lecture, you can download it by clicking the button below.

Get in touch with us

Tel: +44 7518 945488


  • Black Instagram Icon
  • Facebook


4 Mann Island, Liverpool, Merseyside, United Kingdom

Qurtaba Heights, Islamabad, Pakistan

© Copyright 2020 BioCode Ltd. - All rights reserved.