This is a test version of Biostars. For the public version, visit https://www.biostars.org.
E value > 1

Hi everybody,

For a bit of context I'm blasting sequences using Bio.Blast for Bio python. The reason I'm posting today is because I came across a strange result today, After querying a sequence posted below I received the following e-value: 9.35185. This is to my understanding not usable e-value as it is superior to 1. I've linked the code used below as it may be human error. Any idea to why this might be happening would be greatly appreciated.

def query(sequence : str):
"""
:param sequence:
:return: Query_id , accession_code, description, organism,
score , e-value, identities,

"""

print(f"Querying {sequence}")

#   query NCBI database and parse out the resulting HTML file
results_handle = NCBIWWW.qblast(program="blastx", database="nr",
                                sequence=sequence)
blast_records = NCBIXML.parse(results_handle)
blast_record = next(blast_records)

#recover query identification code
query_id = blast_record.query_id

#Loop through resulting hits
for alignment in blast_record.alignments:

    #Find accession_code (2), description (3), organism from hit (4)
    name = re.search(pattern=r'(\|([.\w\d]*)\|)(.*?)(\[(.*?)\])',
                     string=alignment.title).group(2, 3, 5)
    accession_code = name[0]
    description = name[1]
    organism = name[2]
    print(name)

    #loop through HSP from alignment (n)
    for hsp in alignment.hsps:
        hit_score = hsp.score
        escore = hsp.expect
        bits = hsp.bits
        print(f'hitscore {hit_score},evalue {escore},bits {bits}')
return

sequence used: GACCTTTTGTTCCCACGCGCAGGGAGTCGCCCTGTCTCCAACTGAACAAGTTGTTCAGTTGCTTCATCCCGGTGACGTCCTAAAATGTCTGTAGAAACTTCCGCCGGGTGGCGCCTGGGCGGAAAGGAAAAGGGCCTGGCTCCTCCAAGATGGTTGGTTGGCAAAGACCCCATCGGAAGGAGACCAGACCCGTGAACAAGTCCAGTGTACCACCGAGCGAGCGTAGTGCCAAGGAGATTGAGGCGCTTTTGGATGCCGAGCGCCAGGAGGGCGAGAACCTGCTCAGCAGCTTGTTCCGCGG

biopython bioblast

1 answer

An e-value for a BLAST query gives the number of matches (or better) you would expect to see, by chance, for a given query in the context of a given database-- so it can take on any number from zero on up. It's basically the score scaled to take into account the database, since with a larger database you'd expect to see a match by chance much more easily than with a smaller database, all else being equal.

It's not a p-value, so there's no particular significance for having a number above or below 1, but you can see intuitively how the two are connected: e-value going up and up corresponds to p-value approaching 100%. (I keep it straight in my mind with e-value meaning expected match number and p-value meaning probability of a by-chance match.)

In your case, if you see an e-value anywhere near 1, let alone above 1, it means it's very likely for you to see a match by chance alone. If there's a more limited and specific database you can query for your use case other than nr, and you get the same match, you'll see that e-value go down. It'd odd, though, when I try blastx on the web BLAST with that query I see no matches at all (and blastn against nt just gives tiny snippets). What is your query sequence? Or is that the question you're trying to answer in the first place?

Some NCBI text on this:

Log in to answer this question.