NCBI Gene BLAST: Step-by-Step Tutorial
By Dr. Zubair Khalid, DVM, MS, PhD ·

By the end of this tutorial you will be able to pull a gene sequence out of the NCBI Gene database, paste it into the NCBI BLAST web interface, choose the correct program and database, run the search, and read the result table without guessing what the numbers mean. You will also know when to use BLASTn instead of BLASTp, why an E-value of 0 is not a bug, and how to save a search so you can reproduce it later.
You need three things: a web browser, an internet connection, and a gene you care about. Everything else in this walkthrough uses the public NCBI BLAST service at blast.ncbi.nlm.nih.gov and the NCBI Gene resource at ncbi.nlm.nih.gov/gene. No installation, no command line, no cloud account.
The worked example throughout is the human tumor protein p53 gene, TP53. It is a good teaching case because it is heavily annotated, it has well-characterized homologs across vertebrates, and its transcript variants will force you to think about which sequence you are actually searching.
What BLAST actually does
BLAST stands for Basic Local Alignment Search Tool. It finds local regions of similarity between a query sequence and every sequence in a database, then scores each match and attaches a statistical significance value. The algorithm is a heuristic: it seeds alignments from short exact or near-exact word matches, extends them, and joins high-scoring segments. That design is why BLAST is fast enough to search databases with millions of sequences, and also why it can miss very distant homologs that share no good seed.
The BLAST family has been the canonical sequence similarity search tool in genomics for decades, largely because of its statistical framework, and it remains the reference point against which faster aligners are benchmarked [1]. Modern alternatives such as Lambda3 target protein, nucleotide, and bisulfite-converted searches with comparable or better speed [1], and approximate membership structures such as PAC push scalability to collections of tens of thousands of samples [2]. For a single gene against a reference database, though, NCBI BLAST is still the right tool, and it is the one with the most complete annotation behind each hit.
BLASTn versus BLASTp
This distinction causes more confusion than any other part of the interface.
BLASTn compares a nucleotide query against a nucleotide database. It is the correct choice when you have a DNA or RNA sequence and you want to find similar DNA or RNA sequences. Use it to check whether a transcript is novel, to find the genomic locus a read came from, to confirm a primer or amplicon, or to identify a gene from a fragment.
BLASTp compares a protein query against a protein database. Use it when you have an amino acid sequence and you want functional or evolutionary relatives. Protein searches are far more sensitive across long evolutionary distances because the genetic code is redundant and protein sequences change more slowly than the DNA that encodes them.
Two hybrid programs sit between them. blastx translates a nucleotide query in all six reading frames and searches a protein database, which is what you want for an unannotated genomic fragment. tblastn takes a protein query and searches a translated nucleotide database, which is what you want when you have a protein and only raw genome assemblies to search.
The practical rule: if your sequence is a coding gene and you care about homology across species, run BLASTp on the protein product. If you care about the exact nucleotide sequence, run BLASTn. This tutorial uses BLASTn because the goal is to trace a specific gene sequence, but the interpretation section applies to both.
Step 1: Retrieve the gene sequence from NCBI Gene
Open ncbi.nlm.nih.gov/gene and type TP53 into the search box. The top result for human is Gene ID 7157.
The Gene record is a hub, not a sequence. It links to the genomic coordinates, the RefSeq transcripts, the RefSeq protein, PubMed citations, and pathway data. You have to decide which of those you want before you can BLAST anything.
For a nucleotide search you have two sensible choices:
- The mRNA transcript, for example the RefSeq accession NM_000546.6. This is the spliced, mature transcript. Searching it tells you which transcripts in other organisms are most similar.
- The genomic region, for example NG_017013.2, which includes introns and regulatory sequence. Searching this against the nt database will return genomic hits with introns, which makes alignments messier.
For this walkthrough, use the mRNA.
In the Gene record, scroll to the "mRNA and Protein(s)" section and click the NM_ accession. That takes you to the Nucleotide record. On that page, click "FASTA" to get the plain sequence in FASTA format. It looks like this:
>NM_000546.6 Homo sapiens tumor protein p53 (TP53), transcript variant 1, mRNA
ACTTGTCATGGCGACTGTCCAGCTTTGTGCCAGGAGCCTCGCAGGGGTTGATGGGATTGGGGTTTTCCCCTCCCA
TGTGCTCAAGACTGGCGCTAAAAGTTTTGAGCTTCTCAAAAGTCTAGAGCCACCGTCCAGGGAGCAGGTAGCTGC
TGGGCTCCGGGGACACTTTGCGTTCGGGCTGGGAGCGTGCTTTCCACGACGGTGACACGCTTCCCTGGATTGGCA
...
Copy the entire block, header line included. BLAST will strip the header, but keeping it makes your saved record self-documenting.
A caution about transcript variants. TP53 has multiple RefSeq transcripts that differ at the 5-prime end and in internal exons. If you pick variant 1 and your question is about variant 2, your hits will still be strong but the alignment start coordinates will look wrong. Check the "This variant" section of the Nucleotide record before you commit.
Step 2: Open BLAST and choose the program
Go to blast.ncbi.nlm.nih.gov. You will see a grid of program tiles. Click "Nucleotide BLAST" for BLASTn.
The form has four things you must set:
- Enter Query Sequence. Paste your FASTA. The box accepts multiple queries but for a tutorial, use one.
- Choose Search Set. This is the database.
- Program Selection. This defaults to "Highly similar sequences (megablast)" and offers "Somewhat similar sequences (blastn)" and the discontiguous megablast option.
- BLAST button at the bottom.
Choosing the database
The nt database is the standard non-redundant nucleotide collection. It aggregates GenBank, RefSeq, EMBL, DDBJ, PDB nucleotide records, and more, and it is the default for a reason: it is the broadest single nucleotide target NCBI offers.
Other options and when they matter:
- refseq_rna restricts the search to curated RefSeq transcripts. Cleaner hits, fewer draft genomes, better for cross-species transcript comparison.
- refseq_genomes restricts to reference and representative assemblies. Good when you want a genomic location and do not want thousands of near-identical strain records.
- Human genomic plus transcript (GRCh38) is a targeted human search. Useful for checking whether a sequence maps to the human genome.
- Nucleotide collection (nr/nt) is the same as nt.
For a first pass on a well-annotated human gene, nt is fine. If your hit list comes back cluttered with unannotated environmental clones, rerun against refseq_rna.
Choosing the megablast versus blastn program
Megablast is optimized for high-identity matches, typically above roughly 95 percent identity, and it is much faster because it uses a long word size. It is the right default for "find this exact sequence or something very close."
The plain blastn program uses a shorter word size and a more permissive scoring scheme. It is slower and it will find more distant matches. If your first megablast run returns nothing, or only hits above 98 percent identity when you expected a broader family, switch to "Somewhat similar sequences (blastn)."
This is the single most common reason a beginner concludes "there are no homologs" when there are. The default is tuned for speed and near-identity, not for sensitivity.
Step 3: Run the search
Click BLAST. A results page opens immediately with a job identifier and a status. Small queries against nt typically finish in under a minute. Large queries or a busy server can take several minutes. The page polls automatically.
When it completes, you get a page with four main regions:
- A graphic summary showing the query coordinates and colored bars for hits.
- Descriptions, a one-line-per-hit table sorted by score.
- Alignments, the actual pairwise alignments.
- Taxonomy, a breakdown of hits by organism.
The Descriptions table is where you do most of your reading. Here is a worked example of what a TP53 BLASTn result looks like, with representative values:
| Column | Meaning | Example value |
|---|---|---|
| Description | Subject sequence title and organism | Homo sapiens tumor protein p53 (TP53), transcript variant 1, mRNA |
| Scientific Name | Source organism | Homo sapiens |
| Max Score | Highest alignment score for that subject | 4832 |
| Total Score | Sum of scores across all alignments to that subject | 4832 |
| Query Cover | Percent of your query covered by the alignment | 100% |
| E value | Expected number of hits this good by chance | 0.0 |
| Per. Ident | Percent identity over the aligned region | 100.000% |
| Acc. Len | Length of the subject sequence | 2512 |
| Accession | Subject identifier | NM_000546.6 |
A second row might show a chimpanzee TP53 transcript at 99.4 percent identity with an E-value of 0.0, and a third a mouse Trp53 transcript at around 85 percent identity with an E-value of 0.0 but a query cover of maybe 78 percent because of length differences.
Step 4: Read the output fields correctly
E-value
The E-value is the expected number of alignments scoring at least as well as the observed one, in a database of this size, if the sequences were random. It is a function of the score, the database size, and the query length.
An E-value of 0 is not literally zero. It means the expected count is smaller than the smallest number the display can show, typically below about 1e-180. Report it as "0.0" or "less than 1e-179," not as proof of identity.
Rules of thumb for a nucleotide search against nt:
- E-value of 0 or below 1e-50: very strong. Almost certainly a true homolog or the same gene.
- E-value between 1e-5 and 1e-50: strong enough to pursue, but check identity and coverage before you call it a homolog.
- E-value between 1 and 1e-5: weak. Could be a conserved domain, a repeat, or noise.
- E-value above 1: not significant on its own.
The 1e-5 threshold is a convention, not a law. It is a reasonable screening cutoff for a first pass, and it is what most published pipelines use as a floor.
One important caveat: BLAST E-values are not perfectly calibrated. A careful evaluation of blastp showed that the reported E-values can be significantly conservative in some cases and too liberal in others, meaning some hits are more significant than reported and some are less [3]. Treat the E-value as a strong guide, not an oracle. The same paper proposes resampling from a null distribution of random optimal alignments as a more reliable alternative, and notes that this approach works with any reasonable scoring scheme [3]. For routine work, the standard E-value is fine. For borderline calls, do not over-trust the third significant figure.
A related subtlety: when your query is itself in the database, the top hit is a self-match with an E-value of 0, which distorts any downstream comparison across queries. Regularizing the E-value to account for self-matching improves clustering and subset selection in database-scale applications [4]. If you are comparing E-values across many queries, exclude self-hits first.
Percent identity
Percent identity is the fraction of aligned positions that are identical. It tells you how similar the aligned region is, not how much of the gene you captured.
- Above 95 percent: same gene, closely related organism, or a recent duplication.
- 70 to 95 percent: clear homolog, diverged.
- 30 to 70 percent: homologous region, possibly only a domain. Verify with coverage and alignment inspection.
- Below 30 percent: nucleotide alignments at this level are usually not meaningful. Switch to a protein search.
Query coverage
Query coverage is the percentage of your query length that participates in the alignment. This is the field beginners skip and should not.
High identity with low coverage is a trap. A 100 percent identity hit covering 12 percent of your query is a conserved repeat or a shared domain, not a homolog of the whole gene. A 75 percent identity hit covering 95 percent of your query is a much better biological answer.
For a full-length transcript query, expect query coverage near 100 percent for true orthologs. Coverage in the 40 to 70 percent range usually means the subject is a partial sequence, a different isoform, or a related but distinct gene.
Bit score
The bit score is the raw alignment score normalized so it can be compared across searches. It is derived from the raw score, the substitution matrix, and the gap penalties. Higher is better, and unlike the E-value it does not depend on database size.
Use the bit score when you want to rank hits from two different BLAST runs against different databases. Use the E-value when you want to know whether a single hit is significant. The bit score is the more stable number, the E-value is the more interpretable one.
Max score versus total score
Max score is the best single alignment between your query and that subject. Total score sums all alignments. If total score is much larger than max score, the subject has multiple separate regions matching your query, which often indicates a repeat or a multi-domain protein rather than a single ortholog.
The decision path
The workflow below shows the choices that determine whether you get a useful answer.
flowchart TD
A[Get sequence from NCBI Gene] --> B{DNA or protein}
B -->|DNA| C[BLASTn against nt]
B -->|Protein| D[BLASTp against nr]
C --> E{Any hits}
D --> E
E -->|No| F[Switch to more sensitive program]
F --> C
E -->|Yes| G[Check E value]
G --> H[Check query coverage]
H --> I[Check percent identity]
I --> J{All three acceptable}
J -->|Yes| K[Record hit and save search]
J -->|No| L[Inspect alignment manually]
Step 5: Inspect the alignment, not just the table
Click the accession of your top non-self hit. The Alignments section shows the actual paired sequences with a midline indicating matches, mismatches, and gaps.
Three things to look for:
- Where the alignment starts and ends relative to your query. A hit that covers only the 3-prime untranslated region is not evidence of gene-level homology.
- Whether gaps cluster. A single long gap in the middle often means a different isoform or an assembly artifact.
- Whether mismatches are spread evenly or concentrated. Concentrated mismatches in one region suggest a domain swap or a chimeric assembly.
For a coding gene, also check the reading frame. If your nucleotide alignment has insertions or deletions whose lengths are not multiples of three, the two sequences are probably not both coding for the same protein, or one of them has a sequencing error.
Step 6: Save and reproduce your search
The results page has a "Download" menu. Use it.
- "Hit table (CSV)" gives you the Descriptions table as a spreadsheet.
- "Alignments (FASTA)" gives you the subject sequences that aligned.
- "Save search strategies" under the "Formatting options" and the job link at the top let you return to the same result page later.
The job URL contains a request identifier. Bookmark it. NCBI retains results for a limited period, so if you need a permanent record, download the CSV and the alignment file and store them with your notes.
Record four things in your lab notebook: the query accession and version, the database name and the date you searched, the program and word size, and the E-value cutoff you used. Databases grow, and an E-value from 2024 will not match the same search run in 2026 because the database is larger and the E-value scales with database size.
Common Mistakes and Limitations
Assuming E-value 0 means identical. It means the expected count is below the display floor. Check percent identity separately.
Ignoring query coverage. A short, perfect match is often a repeat, not a homolog. Always read coverage alongside identity.
Leaving megablast on when you need sensitivity. Megablast is tuned for high identity. For distant homologs, switch to blastn with the "Somewhat similar sequences" option, and consider a protein-level search instead.
Low-complexity regions inflating scores. Sequences rich in a few residues, such as poly-A tails, poly-glutamine tracts, proline-rich regions, and simple repeats, produce high-scoring alignments that have nothing to do with homology. BLAST applies a low-complexity filter by default (DUST for nucleotides, SEG for proteins) and you should leave it on. If you turn it off to chase a hit, expect the score to be inflated. This is a well-known source of false positives in nucleotide searches, and it is the reason a short repetitive query can return hundreds of "significant" hits with no biological meaning.
Trusting the default word size for divergent queries. The default megablast word size is long. Dropping to the blastn program shortens it and increases sensitivity at the cost of runtime.
Searching the wrong molecule. Running BLASTn on a protein sequence, or vice versa, produces either an error or nonsense. Check whether your FASTA is nucleotides or amino acids before you submit.
Comparing E-values across different databases. E-values depend on database size. An E-value of 1e-20 against a small custom database is not equivalent to 1e-20 against nt.
Over-trusting borderline E-values. As noted above, blastp E-values can be conservative or liberal depending on the case [3]. For hits near your cutoff, inspect the alignment and consider an orthogonal method.
Forgetting that BLAST is a local aligner. It reports the best local regions, not a global alignment. Two sequences can share a strong local match and still be unrelated overall.
Assuming the top hit is the correct annotation. The top hit is the most similar sequence, which may be misannotated, a fragment, or a predicted protein with no experimental support. Cross-check against a curated resource.
Not accounting for database growth. The public sequence archives are expanding rapidly, with the Sequence Read Archive alone having reached tens of petabytes and doubling every two years [2]. A search that returned 50 hits in 2020 may return 500 today, most of them near-duplicates from new assemblies. Deduplicate by species or by accession prefix when you summarize.
Frequently Asked Questions
What is the difference between BLASTn and BLASTp?
BLASTn compares nucleotides to nucleotides and BLASTp compares proteins to proteins. Use BLASTn for DNA or RNA sequences and BLASTp for amino acid sequences, especially when you need sensitivity across long evolutionary distances.
Why is my E-value 0?
An E-value of 0 means the expected number of equally good random hits is below the smallest value the display can show. It indicates an extremely strong match, not a literal probability of zero.
What E-value should I use as a cutoff?
An E-value below 1e-5 is a common screening threshold for nucleotide searches, and values of 0 or below 1e-50 indicate very strong hits. The cutoff should depend on your question, and borderline hits deserve manual inspection.
What does query coverage tell me that percent identity does not?
Query coverage tells you how much of your query is involved in the alignment, while percent identity tells you how similar the aligned region is. High identity with low coverage usually means a shared domain or repeat rather than a full-length homolog.
Why did my search return no hits?
The most common cause is that megablast, the default program, is tuned for high-identity matches. Switch to the blastn program with "Somewhat similar sequences" selected, or run a protein-level search if your query is coding.
Can low-complexity sequence create false hits?
Yes. Repetitive and low-complexity regions produce high-scoring alignments that are not evidence of homology. Leave the default DUST and SEG filters on, and treat any hit that survives only because you disabled filtering with suspicion.
How do I save a BLAST result permanently?
Download the hit table as CSV and the alignments as FASTA from the Download menu, and record the query accession, database name, program, and date. Bookmarking the job URL works only for as long as NCBI retains the result.
Does a strong BLAST hit prove the genes are orthologs?
No. A strong hit proves sequence similarity, which is evidence of homology, but orthology requires additional evidence such as reciprocal best hits, synteny, or phylogenetic analysis. The top hit can also be a misannotated or fragmentary record.
Related Articles
- Ncbi Gene
- BLAST NCBI Search: A Practical Guide to Sequence Similarity
- How to Design Primers for qPCR Using NCBI Primer-BLAST
- Ncbi Gene Database
- How to Perform Gene Ontology (GO) Enrichment Analysis in R: A Step-by-Step Tutorial Using clusterProfiler
- How to Use a Microscope: Step-by-Step Brightfield Tutorial for Beginners
- Pivot Table in Excel: Step-by-Step Tutorial
Further Reading
- Protein structure database search and evolutionary classification.
- PearMODB: a multiomics database for pear (Pyrus) genomics, genetics and breeding study.
Sources
- Lambda3: homology search for protein, nucleotide, and bisulfite-converted sequences.
- Scalable sequence database search using partitioned aggregated Bloom comb trees.
- A BLAST from the past: revisiting blastp's E-value.
- Toward the regularization of E value from BLAST similarity search into a dissimilarity measure as distance function, and the metrication of protein sequence space.