blastn is a command-line tool in Linux that is part of the BLAST (Basic Local Alignment Search Tool) suite of tools for searching and comparing sequence databases. It is used to perform nucleotide-nucleotide searches, which involve comparing a query nucleotide sequence to a database of nucleotide sequences to find similar or related sequences.
blastn is commonly used in bioinformatics and molecular biology to identify homologous or related sequences in genomic or transcriptomic data, or to search for specific nucleotide sequences in large databases.
To use blastn, you will need to have the blastn package installed on your Linux system. You can install blastn using the package manager for your specific distribution of Linux, or you can download and install the latest version of the BLAST suite from the NCBI (National Center for Biotechnology Information) website.
Once blastn is installed, you can use it to perform a nucleotide-nucleotide search by running the blastn command followed by the appropriate options and arguments. For example, to search for a specific nucleotide sequence in a database of nucleotide sequences using a custom scoring matrix, you could use the following command:
# blastn -query my_sequence.fa -db nucleotide_database.fa -matrix custom_matrix.txt
blastn supports a variety of command-line options that allow you to customize the search parameters, such as the database to use, the output format, or the filtering options. You can use these options to fine-tune the search to suit your needs.
blastn Command Examples
1. Align two or more sequences using megablast (default), with the e-value threshold of 1e-9, pairwise output format (default):
# blastn -query query.fa -subject subject.fa -evalue 1e-9
2. Align two or more sequences using blastn:
# blastn -task blastn -query query.fa -subject subject.fa
3. Align two or more sequences, custom tabular output format, output to file:
# blastn -query query.fa -subject subject.fa -outfmt '6 qseqid qlen qstart qend sseqid slen sstart send bitscore evalue pident' -out output.tsv
4. Search nucleotide databases using a nucleotide query, 16 threads (CPUs) to use in the BLAST search, with a maximum number of 10 aligned sequences to keep:
# blastn -query query.fa -db path/to/blast_db -num_threads 16 -max_target_seqs 10
5. Search the remote non-redundant nucleotide database using a nucleotide query:
# blastn -query query.fa -db nt -remote
6. Display help (use `-help` for detailed help):
# blastn -h