Thank you, Siva. Your comment is really helpful.
Hi everyone,
Could anyone explain in a little bit more details what's the difference for the options max_target_seqs and num_alignments. If I only want the top hit, how to do in BLAST setting?
Thank you very much!
1 answer
It depends on what value you set for the option outfmt (options range from 0 to 12) and you can only use either one of the max_target_seqs or num_alignments options.
If you want only one hit:
- If you set
outfmtto any option <=4, set both-num_descriptionsand-num_alignmentsto 1 - If you set
outfmtto any option >4, set-max_target_seqsto 1
I hope you are aware that if you want only the top hit and if your query sequence is in the database you are searching against ('nr' for example), your query sequence might be the top hit.
I am afraid that is not what max_target_seqs does: https://academic.oup.com/bioinformatics/advance-article/doi/10.1093/bioinformatics/bty833/5106166
See https://blastedbio.blogspot.com/2018/11/blast-max-alignment-limits-repartee-one.html and https://blastedbio.blogspot.com/2018/11/blast-max-alignment-limits-repartee-two.html for more details - all of -max_target_seqs, -num_descriptions and -num_alignments set an internal limit during the search as well as limiting the output.
and this is a reply from NCBI that the way blast works in case max_target_seqs set to 1 as proposed in this letter is not true. It seems that blast reports the first best hit found in the database ONLY in the case where e-value and bit score from multiple hits are the same which is why they recommend setting this parameter to at least 5 and then do the filtering. I don't know what is the chance you have 2 hits with these values being exactly the same, but if this is not the case, the reported hit is indeed the best hit considering all hits found in the database. Please someone correct me if I got it wrong. :)
https://academic.oup.com/bioinformatics/article/35/15/2699/5259186
Log in to answer this question.