This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Why does Blast report a different alignment when using the -m8 option

I really need to know why when I do a blast with the option -m8, I have different results (different % identities, and gaps). example..

normal

>tr|Q3T560|Q3T560_9GAMM Arsenite transporter ATPase-like protein OS=Acidithiobacillus caldus
              GN=arsA1 PE=4 SV=1
          Length = 612
 Score =  612 bits (1577), Expect = 0.0,   Method: Compositional matrix adjust.
 Identities = 329/546 (<strong>60%</strong>), Positives = 400/546 (73%), Gaps = 5/546 (0%)

Query: 372511 RVLLVSTDPASNVGQVFGTDIGNHITQIGQVSGLEALEIDPEAAAEDYRERIIGPIRSTL 372570
              ++LLVSTDPASNVGQVF  +IGN IT I  V+GL ALEIDP+ AA+ YRERI+GP+R  L
Sbjct: 38     KILLVSTDPASNVGQVFSQEIGNKITTISTVAGLSALEIDPQQAAQQYRERIVGPVRGAL 97

Query: 372571 PEKALNSIKEQLSGACTTEIAAFDEFTALLTDPELIERYDHIVFDTAPTGHTIRLLKLPG 372630

with -m8 option

# BLASTP 2.2.25 [Feb-01-2011]
# Query:
# Database: /home/biolinux/Desktop/fasta/ars/arsenic_db_3.fasta
# Fields: Query id, Subject id, % identity, alignment length, mismatches, gap openings, q. start, q. end, s. start, s. end, e-value, bit score
1_0    tr|Q3T560|Q3T560_9GAMM    63.55    546    194    4    372511    373052    38    582    0.0     612

In "normal" I have 60% of identities and 5 gaps, but when I put -m8 option I have 63.55% identities and 4 gaps..

Any reason?

blast

2 answers

I couldn't find legacy blast 2.2.26 release notes but this is from 2.2.26+:

ChangeLog:
-----------------------------
* 2.2.26 release.
..
Bug fixes:
..
* The percent identity calculation was wrong if the best-hit algorithm was used.

So, the most likely reason is that 2.2.25 had a bug related to -m8 output and percent identity.

Perfect way to spell out: please use the most recent version to report bugs.

how i can know what version i am using?

probably blastp -version.

biolinux@biolinux-PC[biolinux] blastp -version                                                                                        [ 2:45PM]
blastp: 2.2.28+
Package: blast 2.2.28, build May  2 2013 18:07:25
biolinux@biolinux-PC[biolinux]

I don't know why, on the header of my blast appears BLASTP 2.2.25 [Feb-01-2011]

What was the command that you ran that generated the problem in your OP?

blastall -p blastp -d database.fasta -i sequence.fasta -m8 >out

That is not the same program as blastp, which explains the different versions. The blastall program is a part of the legacy blast tools. Try again with the blastp command and see if the results differ.

This command invokes legacy blast, but you also seem to have blast+ installed ...

I put

blastp -db database.fasta -query query.fasta -out out.fasta

and appears this...

Warning: (1431.1) CFastaReader: Ignoring invalid residue 8 at line 112004, position 4
Warning: (1431.1) CFastaReader: Ignoring invalid residue 6 at line 112004, position 5
Warning: (1431.1) CFastaReader: Ignoring invalid residue 1 at line 112004, position 6
Warning: (1431.1) CFastaReader: Ignoring invalid residue 4 at line 112005, position 0
Warning: (1431.1) CFastaReader: Ignoring invalid residue 2 at line 112005, position 1
Warning: (1431.1) CFastaReader: Ignoring invalid residue 4 at line 112005, position 2
Warning: (1431.1) CFastaReader: Ignoring invalid residue 6 at line 112005, position 3
Warning: (1431.1) CFastaReader: Ignoring invalid residue 9 at line 112005, position 4
Warning: (1431.1) CFastaReader: Ignoring invalid residue 2 at line 112005, position 5

and keep going.....

that it's normal?

aps, and I am using a gbk query, I mean.. query.gbk, that care?

Your fasta file is improperly formatted, check that there are no invalid characters present in the sequence entry under each fasta header.

Is it really necessary to be a FASTA file?, or can be other like a GBK file?

Fasta, Gi or NCBI accession.

I apply the formatdb command...

or it's the makeformatdb command?

You may want to double check the documentation:

http://www.ncbi.nlm.nih.gov/guide/howto/run-blast-local/

Use the BLAST+ makeblastdb program (or formatdb in the legacy BLAST package) to convert a FASTA-formatted local file into a BLAST database.

It seems that you're trying to blast one fasta file against another. Note that is deprecated, you want to use makeblastdb. If that doesn't work, check that the sequence entries in your query file do not contain any invalid characters.

although one does the database, the blast is always performed against fasta file database.

Log in to answer this question.