- Database similarity searching is a fundamental technique in bioinformatics used to identify biological sequences that resemble a query DNA, RNA, or protein sequence within a large biological database. It allows researchers to compare newly obtained sequences with previously characterized sequences and discover potential genes, proteins, functional domains, evolutionary relationships, and biological roles. Instead of comparing two sequences manually or performing exhaustive alignment against every database entry, specialized search algorithms identify promising matches efficiently and provide statistical measures to help evaluate their significance.
- Biological sequence databases contain millions or billions of nucleotide and protein records from different organisms, including humans, animals, plants, fungi, bacteria, archaea, and viruses. Important resources include GenBank, the European Nucleotide Archive (ENA), the DNA Data Bank of Japan (DDBJ), RefSeq, UniProt, and specialized organism-specific databases. Database similarity searching connects newly generated sequence data with this accumulated biological knowledge.
- A query sequence is the DNA, RNA, or protein sequence submitted for comparison. The database contains reference sequences against which the query is searched. The search program identifies regions of similarity and reports matching database entries, alignment coordinates, sequence identity, alignment length, gaps, query coverage, bit scores, and E-values. These results help researchers determine whether a query resembles a known gene, transcript, protein, or conserved sequence region.
- Database similarity searching is based on the principle that sequences with a common evolutionary origin may retain similar nucleotide or amino acid patterns. Mutations, insertions, deletions, and evolutionary divergence can change sequences over time, but important functional regions may remain conserved. Detecting these conserved regions can provide evidence of sequence relationships and help predict biological functions.
- Similarity does not necessarily mean that two sequences are identical. DNA sequences may differ by nucleotide substitutions and insertions or deletions, while proteins may contain conservative amino acid substitutions that preserve biochemical properties. Protein similarity searches therefore use substitution matrices such as PAM and BLOSUM to evaluate amino acid replacements according to their evolutionary plausibility.
- Database similarity searching is commonly performed using local alignment methods. Local alignment identifies the most similar regions between a query and a database sequence without requiring the entire sequences to match. This is particularly useful because a query may share only a conserved domain or functional region with a database entry. Local alignment can identify such regions even when the remaining portions of the sequences are unrelated or highly divergent.
- The major steps in database similarity searching include selecting an appropriate database, preparing the query sequence, choosing a suitable search program, defining search parameters, executing the search, evaluating the resulting alignments, and interpreting the biological significance of the matches. The choice of database and search algorithm is important because different resources contain different types of sequences, levels of annotation, and degrees of redundancy.
- The first step is selecting the appropriate sequence database. Nucleotide databases are used when searching DNA or RNA sequences against known nucleotide records. Protein databases are used when searching amino acid sequences against known proteins. Reference databases such as RefSeq provide curated or computationally annotated reference records, while broader archival databases contain submitted sequence records from many sources. UniProt provides protein sequence and functional information, including reviewed Swiss-Prot records and unreviewed TrEMBL records.
- Database selection should reflect the biological question. For example, a researcher studying a newly sequenced bacterial gene may search a nucleotide database to identify similar genes or a protein database after translating the coding sequence. A protein query may be searched against a curated protein database to identify related proteins with functional annotations. A researcher studying a particular organism may prefer a taxonomically restricted database to reduce irrelevant matches and improve interpretation.
- Several sequence similarity search programs are available. The Basic Local Alignment Search Tool (BLAST) is among the most widely used tools. It uses heuristic search strategies to identify local sequence similarities efficiently. Different BLAST programs are designed for different combinations of query and database sequence types.
- BLASTN compares a nucleotide query against a nucleotide database. It is commonly used for identifying DNA sequences, comparing genes, searching nucleotide records, and examining possible sequence contamination. BLASTP compares a protein query against a protein database and is widely used for protein identification, functional annotation, and evolutionary studies.
- BLASTX translates a nucleotide query into protein sequences in its possible reading frames and compares the translated products against a protein database. It is particularly useful when the nucleotide sequence may contain an unknown coding region. TBLASTN compares a protein query against a nucleotide database translated in its possible reading frames. TBLASTX translates both the nucleotide query and nucleotide database sequences before comparison, allowing protein-level similarities to be detected between nucleotide records.
- A simplified comparison of commonly used BLAST programs is shown below:
| Program | Query | Database | Main purpose |
| BLASTN | Nucleotide | Nucleotide | DNA or RNA sequence comparison |
| BLASTP | Protein | Protein | Protein similarity searching |
| BLASTX | Translated nucleotide | Protein | Identify possible protein matches from nucleotide queries |
| TBLASTN | Protein | Translated nucleotide | Search nucleotide databases for protein-level matches |
| TBLASTX | Translated nucleotide | Translated nucleotide | Compare nucleotide sequences at the protein level |
- BLAST works through a heuristic seed-and-extend strategy. It initially identifies short matching words or seed regions between the query and database sequences. Promising matches are then extended to generate longer alignments. Candidate alignments are evaluated using a scoring system, and statistically significant results are reported. This approach makes BLAST much faster than performing a full dynamic programming alignment between the query and every database sequence.
- The sensitivity and speed of a BLAST search depend on parameters such as word size, scoring matrix, gap penalties, filtering, and the expected threshold for reporting matches. Smaller word sizes may detect weaker similarities but can increase computational requirements and the number of candidate matches. Larger word sizes can improve speed but may miss more distant relationships. The appropriate settings depend on the sequence type and research objective.
- Another widely used similarity search program is FASTA. The FASTA family of programs uses sequence search strategies to identify regions of similarity between a query and database entries. It is used for nucleotide and protein sequence searches and provides alignment statistics for evaluating candidate matches. FASTA is also associated with the FASTA sequence file format, but the sequence format and the similarity search program are distinct concepts.
- DIAMOND is a fast protein sequence search tool designed for large-scale comparisons. It provides BLAST-compatible search modes and is commonly used in metagenomics, protein annotation, and large protein database searches. Its speed makes it useful when analysing extensive datasets, although search sensitivity and parameter choices should be considered for distant relationships.
- MMseqs2 is another powerful sequence search and clustering system. It supports large-scale protein and nucleotide searches, sequence clustering, and profile-based analyses. It is widely used in metagenomics, protein family analysis, and large biological sequence collections. Its performance depends on the selected search mode, sensitivity settings, database size, and computational resources.
- For detecting distant protein relationships, profile-based methods can be more sensitive than ordinary pairwise similarity searching. A position-specific scoring matrix (PSSM) describes the frequency or scoring preference of amino acids at individual positions in a protein family alignment. PSI-BLAST uses iterative searches to build and refine a position-specific profile from related sequences. The profile can then identify additional sequences that may be too divergent to detect using a single conventional BLASTP search.
- Profile hidden Markov models (profile HMMs) provide another approach to detecting protein families and conserved domains. They model position-specific residue patterns, insertions, and deletions using probabilistic states. HMMER is widely used for searching profile HMM databases and identifying protein families. Resources such as Pfam and InterPro provide domain and family information that can support functional interpretation.
- A database similarity search typically begins with a sequence in FASTA format. A nucleotide query may look like:
>query_dna
ATGGCTAGCTAGCTAGGCTAACGTTAGC
A protein query may look like:
>query_protein
MKTAYIAKQRQISFVKSHFSRQ
- The sequence should be checked before searching. Researchers should verify that the sequence is in the correct orientation, contains appropriate nucleotide or amino acid symbols, and does not include formatting errors. For nucleotide queries, ambiguous bases and low-quality regions may affect search results. For protein queries, unexpected stop symbols, incomplete translations, and incorrect reading frames should be investigated.
- BLAST can be used through the NCBI web interface or through command-line tools. The web interface allows users to paste a sequence or upload a FASTA file, select a database, choose search parameters, and examine the results interactively. Command-line BLAST is useful for reproducible workflows and large-scale searches.
- A typical BLASTN command for searching a nucleotide sequence against a nucleotide database is:
blastn \
-query query.fasta \
-db nt \
-out blast_results.txt \
-evalue 1e-5
A typical BLASTP command for searching a protein sequence against a protein database is:
blastp \
-query protein.fasta \
-db nr \
-out protein_results.txt \
-evalue 1e-5
- These examples assume that the required BLAST database is available locally or accessible through the selected BLAST configuration. Database names and availability depend on the installation and database setup.
- Researchers can also create local BLAST databases using downloaded nucleotide or protein FASTA files. The makeblastdb utility prepares a searchable database:
makeblastdb \
-in reference_sequences.fasta \
-dbtype nucl \
-out local_nucleotide_db
For a protein database:
makeblastdb \
-in reference_proteins.fasta \
-dbtype prot \
-out local_protein_db
- The resulting database can be searched using BLASTN or BLASTP, depending on its sequence type. Local databases are particularly useful when working with private datasets, organism-specific reference collections, restricted computing environments, or reproducible research workflows.
- BLAST results contain several important statistical and alignment measures. Percentage identity describes the proportion of aligned positions containing identical residues. Alignment length indicates the number of positions in the reported alignment. Query coverage describes how much of the query sequence is represented by the alignment or by the reported high-scoring segment pairs, depending on the selected output field. Gaps represent positions introduced to account for insertions and deletions.
- The raw alignment score is calculated using the selected scoring matrix and gap penalties. The bit score is a normalized score that allows more meaningful comparisons across searches. A higher bit score generally indicates a stronger alignment. The E-value estimates the number of alignments with an equivalent or better score expected by chance in the search space. Smaller E-values provide stronger statistical evidence that a match is unlikely to have arisen by chance under the statistical model.
- The E-value is affected by the alignment score and the size of the database search space. A match with a particular bit score may have a different E-value when searched against databases of different sizes. Therefore, researchers should consider database size and composition when comparing search results. An E-value is not the probability that two sequences are unrelated; it is an expected count of chance alignments meeting the specified score threshold.
- A typical BLAST tabular output can be generated using the following command:
blastp \
-query protein.fasta \
-db local_protein_db \
-out results.tsv \
-outfmt “6 qseqid sseqid pident length mismatch gapopen qstart qend sstart send evalue bitscore qcovs”
- The output contains query and subject identifiers, percentage identity, alignment length, mismatches, gap openings, alignment coordinates, E-value, bit score, and query coverage per subject. These fields allow researchers to filter and interpret results programmatically. Coverage definitions should be checked carefully because different BLAST output fields summarize individual alignment segments or combined high-scoring segment pairs differently.
- The following Python example uses Biopython to read a FASTA query and prepare a BLAST search using the NCBI BLAST command-line program. It assumes that BLAST+ is installed and that the required database is available.
from Bio import SeqIO
from Bio.Blast.Applications import NcbiblastpCommandline
query_file = “protein.fasta”
database = “local_protein_db”
output_file = “blast_results.xml”
record = SeqIO.read(query_file, “fasta”)
blastp_cline = NcbiblastpCommandline(
query=query_file,
db=database,
evalue=1e-5,
outfmt=5,
out=output_file
)
stdout, stderr = blastp_cline()
print(“Query ID:”, record.id)
print(“BLAST search completed.”)
- This example executes BLASTP and saves the results in XML format. Biopython can subsequently parse the XML output for alignment statistics and matching sequence identifiers. For new workflows, researchers should also consider using supported command-line interfaces and documented APIs appropriate to their installed software versions.
- Database similarity searching has many important applications in genome annotation. Newly sequenced genomic regions can be compared against known nucleotide and protein records to identify candidate genes and coding sequences. Similarity to characterized genes may provide evidence about possible function, while comparison with reference genomes can help identify conserved regions and evolutionary relationships. However, similarity-based annotation should be supported by appropriate evidence, especially when transferring functional descriptions between related but distinct proteins.
- In transcriptomics, similarity searching can help identify transcripts, characterize expressed genes, and compare sequences from different tissues or organisms. BLASTX can be useful when a nucleotide transcript has an uncertain coding frame but may encode a protein related to a known database entry. Searches against transcript and protein databases can also help identify potential contamination or unexpected sequence origins.
- In proteomics, protein similarity searching is widely used to identify unknown proteins, characterize domains, and investigate functional relationships. Mass spectrometry may identify peptides that can be mapped to protein sequences, after which protein databases are used to interpret the results. Similarity searches can also identify conserved catalytic residues, binding regions, and protein family membership. Functional predictions should nevertheless be supported by domain architecture, conserved motifs, experimental evidence, and biological context.
- In evolutionary biology, database searching helps identify homologous genes and proteins across species. Conserved sequences may indicate functional or structural constraints, while sequence differences can provide information about evolutionary divergence. Similarity searches are often used to collect related sequences for subsequent multiple sequence alignment and phylogenetic analysis. However, a database match alone does not establish a reliable phylogenetic relationship; orthology, paralogy, sequence quality, and taxonomic sampling must also be considered.
- In metagenomics, similarity searching helps identify organisms and genes in complex microbial communities. Sequencing reads or assembled contigs can be compared against nucleotide and protein databases to identify taxonomic groups and potential functional capabilities. Tools such as DIAMOND and MMseqs2 are particularly useful for large-scale protein searches. Results depend strongly on database representation, sequence quality, and the presence of reference sequences from related organisms.
- Database similarity searching is also used in pathogen identification, comparative genomics, molecular diagnostics research, gene family analysis, and the study of conserved biological pathways. It can help identify sequences related to known viruses, bacteria, or other organisms and support the investigation of potentially important genes. In clinical applications, however, sequence similarity alone is not sufficient for diagnosis or clinical interpretation; validated methods and appropriate evidence standards are required.
- Despite its usefulness, database similarity searching has several limitations. A database may not contain a sufficiently close reference sequence, particularly for organisms that have not been extensively studied. A sequence may therefore produce no significant match even when it encodes a functional gene or protein. Conversely, a highly similar sequence may have a different biological role due to changes in important functional residues, domain structure, expression, or cellular context.
- Database redundancy can also affect search results. The same or very similar sequence may appear in multiple records, making it difficult to distinguish independent biological evidence from repeated submissions. Some records may be incomplete, incorrectly annotated, or based on predicted rather than experimentally validated functions. Researchers should examine accession identifiers, record descriptions, evidence annotations, source organisms, and database documentation before assigning biological meaning to a match.
- Low-complexity regions and repetitive sequences may produce misleading similarities. These regions often contain repeated or compositionally biased patterns that can match many unrelated sequences. Search programs may use masking or filtering to reduce such effects, but filtering can also remove biologically meaningful regions in some analyses. Researchers should understand the filtering settings and inspect important matches when necessary.
- Another limitation is the distinction between homology and similarity. Homology refers to shared evolutionary ancestry and is not expressed as a percentage. Sequence similarity is measurable through identity, substitution scores, and alignment statistics. Two sequences with significant similarity may be homologous, but the strength of that inference depends on alignment length, coverage, statistical significance, conserved features, and biological context. A short high-identity match does not automatically establish that two complete sequences share a common evolutionary origin.
- Reproducible database similarity searching requires documenting the query sequence, database name and release or retrieval date, search program and version, scoring matrix, gap penalties, E-value threshold, filtering options, and other relevant parameters. For local searches, the database source and construction procedure should also be recorded. These details allow other researchers to repeat the analysis and understand differences between search results.
- Database similarity searching connects newly generated biological sequences with existing sequence knowledge. BLAST, FASTA, DIAMOND, MMseqs2, PSI-BLAST, and HMMER provide complementary approaches for identifying sequence relationships at different levels of similarity and computational scale. By selecting appropriate databases, search programs, and parameters, and by interpreting alignment statistics alongside biological evidence, researchers can use similarity searching to support gene identification, protein characterization, genome annotation, evolutionary analysis, and many other bioinformatics applications.