I am struggling with using NCBI's standalone blast, particularly the blastn feature.

I have a large number of nucleotide sequences that I want to use blastn to ID. The goal is to retrieve information from the blast program and eventually import this information to excel. I want to know the capabilities of, or the easiest way, to format the output. I am running a remote search to NCBI's nucleotide database and want to filter and organize the information retrieved as much as possible. The ultimate goal is automate a way to run a remote search to NCBI's nucleotide database, and to work with the results in excel.

I am extremely new to this and struggling to find the best path. From what I can gather, many prefer using external programs, scripts, parsers, interpreters etc to organize their results. I am okay with doing this as well, but would still like to format the output of my blastn search as much as possible beforehand. It is returning a lot of data to me that I don't need.

Can I automate this in excel, and just use VBA/macros to further organize my data? It seems some people prefer to just import the output text file to a spreadsheet and work from there. I have also seen options like BioEdit, eutilities, APIs... I'm not sure which route I should invest my time into figuring out.

Thanks so much for lending your time and expertise!


1 Answer 1


You just have to change the output format using the -outfmt parameter. To have an output in a tabular format just use -outfmt 6. The resulting table have 12 columns containing the following informations queryacc subjectacc pident length mismatch gapopen querystart queryend subjectstart subjectend evalue bitscore. You may restrict the number of hits per query using -max_target_seqs 5 for example.

  • $\begingroup$ Hey Thomas, thanks for the reply. I found some of these features previously but unfortunately it does not include nearly everything I want to include. The specifiers are missing some crucial information, and I would like to use more filtering options if possible. I want to somehow write something that will choose the best choice based on my criteria (probably a lot of if, else statements) to ultimately have 1 best choice for each query. I have over 30,000 queries, so I really want to minimize the amount of data that is returned to me. $\endgroup$
    – Sarah
    May 15, 2020 at 13:03
  • $\begingroup$ I haven't found a way to have the query sequence returned in my output, nor the binomial of the subject. Since I will be having so much data returned to me, what is the best option I can use for choosing the best choice based on my criteria? Like setting thresholds and if/then statements. Also, unfortunately many of the default specifiers included for that format are not necessary for me, and many bits of info that I do want returned don't seem to have specifiers.. Its very confusing! $\endgroup$
    – Sarah
    May 15, 2020 at 13:05
  • $\begingroup$ Hi @Sarah, I recommend you to keep the output format as a tabular separated file. You may use a -max_target_seqs 1 but it is not recommended for large searches ( academic.oup.com/bioinformatics/article-abstract/35/9/1613/…). I think you should think about using R for example to further process your output table a write a loop to get the best hit for each and integrate if/else loops. Then you should use the blastdbcmd to get the subject or query sequence. $\endgroup$ May 18, 2020 at 5:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.