Written and maintained by CASRAI Editorial Board
Last updated
EMBOSS Needle (the needle program in the EMBOSS package) aligns two sequences from end to end using the Needleman-Wunsch algorithm and reports the best global alignment under a set gap-penalty and substitution-matrix scheme. This page is for researchers who want to know what it does, what its defaults are, how a gap is scored, and when another tool fits better. Facts below come from the EMBOSS 6.6 program documentation and EMBL-EBI Job Dispatcher documentation, read 2026-11-07.
What EMBOSS Needle is
Needle performs a global pairwise alignment: it aligns two sequences over their entire length rather than only their best-matching region. It uses dynamic programming (the Needleman-Wunsch algorithm, published by Needleman and Wunsch in 1970, J Mol Biol 48, 443-453) and scores gaps with an opening and an extension penalty. The EMBOSS documentation says it works best for closely related sequences.
Who runs it and what it covers
EMBOSS is the software package; needle is one of its programs. EMBL-EBI hosts it as a web tool and web service in its Job Dispatcher, where it is listed in the Pairwise Sequence Alignment category beside Stretcher, Water, Matcher and LALIGN. The Job Dispatcher is described in Madeira et al., Nucleic Acids Research 2024 (doi 10.1093/nar/gkae241), which says its tools are available through web applications and APIs and are integrated into UniProt and InterPro.
Needle takes protein or nucleotide input. Its default scoring matrix is EBLOSUM62 for proteins and EDNAFULL for DNA and RNA.
How to use it
The steps below follow the program documentation for the command-line needle.
- Name the two sequences to align. The documentation’s example is
needle tsw:hba_human tsw:hbb_human, which aligns two human hemoglobin chains. - Let the program prompt for the remaining values, or add
-autoto skip the prompts and accept defaults. - Set the gap penalties if the defaults do not suit your data:
-gapopen(default 10.0, range 1.0 to 100.0) and-gapextend(default 0.5, range 0.0 to 10.0). - Choose the output format with the alignment-format option. The default is
srspair; others includepair,markx0tomarkx3,markx10,match,sam,bam,score,fasta,msfandclustal. See SAM vs BAM vs CRAM if you choose a binary alignment format. - Read the result file, which by default carries the extension
.needle.
If the second input file holds several sequences, each is aligned against the first. For batch work through EMBL-EBI, the Job Dispatcher documentation describes REST/HTTPS access with an OpenAPI (Swagger) interface and example clients in Python, Perl and Java. Submit no more than 30 jobs at a time, wait for results before sending more, and supply a valid email address; excessive use falls under the EMBL-EBI Terms of Use.
Worked example: what a gap costs
The documentation gives the cost of a gap of n positions as gapopen + (n – 1) × gapextend. With the defaults, a one-position gap costs 10.0 and a three-position gap costs 10.0 + 2 × 0.5 = 11.0. Opening a gap is expensive and lengthening it is cheap, so the aligner prefers one long gap to several short ones. End-gap penalties are off by default (the -endweight option, with -endopen 10.0 and -endextend 0.5 if enabled), so overhanging ends are not penalised unless you turn that on.
Strengths and limits
- Strength: it considers the full length of both sequences, which suits sequences expected to be homologous end to end.
- Strength: every scoring parameter is exposed, so results are reproducible when you record them.
- Limit: memory use scales with the product of the two sequence lengths, so it is impractical for genome-sized sequences. The documentation recommends Stretcher if you run out of memory.
- Limit: a global alignment of unrelated or partly related sequences is forced to align regions that do not correspond. The documentation says needle suits closely related sequences.
Alternatives
| Tool | What the sources say |
|---|---|
| Needle | Needleman-Wunsch global alignment of two sequences over their full length. |
| Stretcher | The program the Needle documentation recommends when Needle runs out of memory. |
| Water, Matcher, LALIGN | Listed in the same Pairwise Sequence Alignment category of the Job Dispatcher; see each tool’s own documentation for its method. |
Biopython PairwiseAligner |
In-code alternative inside Python; see our Biopython guide. |
| Multiple-sequence aligners | A different task (three or more sequences); see multiple sequence alignment tools compared. |
Aligning two sequences is also a routine step after sequencing; see the Sanger sequencing guide for the upstream workflow.
FAQ
What does EMBOSS Needle do?
It produces a global, end-to-end alignment of two sequences with the Needleman-Wunsch algorithm and reports the alignment and score.
What are the default gap penalties?
Gap open 10.0 and gap extend 0.5, with end-gap penalties off by default.
Which scoring matrix does Needle use by default?
EBLOSUM62 for protein and EDNAFULL for DNA and RNA.
What can I use if Needle runs out of memory?
The EMBOSS documentation points to Stretcher for that case.
How do I cite it?
The documentation’s citation is Needleman SB, Wunsch CD (1970) J Mol Biol 48, 443-453 for the algorithm. For the EMBL-EBI services, cite Madeira et al. (2024), Nucleic Acids Research, doi 10.1093/nar/gkae241.
Sources
- EMBOSS 6.6 needle documentation: emboss.sourceforge.net/apps/release/6.6/emboss/apps/needle.html (read 2026-11-07).
- EMBL-EBI Job Dispatcher web services documentation: ebi.ac.uk/jdispatcher/docs/webservices (read 2026-11-07).
- EMBL-EBI Job Dispatcher 2024 article announcement: ebi.ac.uk/jdispatcher/blog/2024-04-25-narws-2024 (read 2026-11-07).







