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

CC BY-SA 4.0
2020-05-15T13:03:35.813Z
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.
Sarah
CC BY-SA 4.0
2020-05-15T13:05:15.440Z
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!
Sarah
CC BY-SA 4.0
2020-05-18T05:26:48.150Z
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 ( https://academic.oup.com/bioinformatics/article-abstract/35/9/1613/5106166?redirectedFrom=fulltext). 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.
thomas duge de bernonville
CC BY-SA 4.0
2020-05-15T06:56:00.797Z
2020-05-15T06:56:00.797Z
thomas duge de bernonville
<p>I am struggling with using NCBI's standalone blast, particularly the blastn feature.</p>

<p>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.</p>

<p>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.</p>

<p>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.</p>

<p>Thanks so much for lending your time and expertise!</p>

<blast><blastn>
Standalone Blast+; Automating searches, Blastn formatting, interpretation
# Standalone Blast+; Automating searches, Blastn formatting, interpretation

(Asked by: username_0 on 2020-05-14)

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!

**Tags:** blast, blastn

---

## 1 answers

### Answer by username_1 on 2020-05-15. Score: 2

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.

> **Comments:**
> **username_0**: 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.  
> **username_0**: 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!  
> **username_1**: 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 ( https://academic.oup.com/bioinformatics/article-abstract/35/9/1613/5106166?redirectedFrom=fulltext). 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.  

---

