<p>The results you'd get are the same as with any other NCBI BLAST+ tools, python does not compute it.</p>
<p>Biopython can run a blast query <code>qblast</code> on the internet or locally. To make it run locally you need to install blast tools on your machine and biopython will launch it as a subprocess. Here you can find the pertinent information: <a href="https://biopython.org/docs/dev/Tutorial/chapter_blast.html#running-blast-locally" rel="nofollow noreferrer">https://biopython.org/docs/dev/Tutorial/chapter_blast.html#running-blast-locally</a></p>
<p>Filtering data is as much a burden as it is important. Depending on your question you want to answer. Some people prefer a low e-value. The score is however affected by the length of the sequence since the number of matches is bigger, more details here: <a href="https://www.nlm.nih.gov/ncbi/workshops/2023-08_BLAST_evol/blast_score.html" rel="nofollow noreferrer">https://www.nlm.nih.gov/ncbi/workshops/2023-08_BLAST_evol/blast_score.html</a></p>

CC BY-SA 4.0
2024-03-21T11:56:12.713Z
2024-03-21T16:31:17.643Z
2024-03-21T16:31:17.643Z
3nrique0
<p>Can someone explain how the score is calculated for <a href="https://biopython.org/docs/latest/api/Bio.Blast.Record.html#Bio.Blast.Record.Description" rel="nofollow noreferrer">Bio.Blast.Record.Description</a>?  For example, if <code>Record.Description.num_alignments</code> is &gt;1, is <code>Record.Description.score</code> simply the sum of the alignment scores for the description's hit?  Can alignments overlap?  How does the score of a given alignment deal with the scores of overlapping HSPs in that alignment?</p>
<p>I'm getting the <code>Blast.Record</code> object via <a href="https://biopython.org/docs/latest/api/Bio.Blast.NCBIXML.html#Bio.Blast.NCBIXML.parse" rel="nofollow noreferrer">NCBIXML.parse()</a>, and would like to rely on the description data as much as possible to remove the need for code that parses the <a href="https://biopython.org/docs/latest/api/Bio.Blast.Record.html#Bio.Blast.Record.Alignment" rel="nofollow noreferrer">Record.Alignments</a> objects, but I'm a nervous including things when I don't know exactly how they were created.</p>
<p>Cheers!
Tim</p>

<phylogenetics><python><blastp>
How are BLAST record scores calculated in biopython
# How are BLAST record scores calculated in biopython

(Asked by: username_0 on 2022-08-19)

Can someone explain how the score is calculated for [Bio.Blast.Record.Description](https://biopython.org/docs/latest/api/Bio.Blast.Record.html#Bio.Blast.Record.Description)? For example, if `Record.Description.num_alignments` is >1, is `Record.Description.score` simply the sum of the alignment scores for the description's hit? Can alignments overlap? How does the score of a given alignment deal with the scores of overlapping HSPs in that alignment?

I'm getting the `Blast.Record` object via [NCBIXML.parse()](https://biopython.org/docs/latest/api/Bio.Blast.NCBIXML.html#Bio.Blast.NCBIXML.parse), and would like to rely on the description data as much as possible to remove the need for code that parses the [Record.Alignments](https://biopython.org/docs/latest/api/Bio.Blast.Record.html#Bio.Blast.Record.Alignment) objects, but I'm a nervous including things when I don't know exactly how they were created.

Cheers!
Tim

**Tags:** phylogenetics, python, blastp

---

## 1 answers

### Answer by username_1 on 2024-03-21. Score: 1

The results you'd get are the same as with any other NCBI BLAST+ tools, python does not compute it.

Biopython can run a blast query `qblast` on the internet or locally. To make it run locally you need to install blast tools on your machine and biopython will launch it as a subprocess. Here you can find the pertinent information: <https://biopython.org/docs/dev/Tutorial/chapter_blast.html#running-blast-locally>

Filtering data is as much a burden as it is important. Depending on your question you want to answer. Some people prefer a low e-value. The score is however affected by the length of the sequence since the number of matches is bigger, more details here: <https://www.nlm.nih.gov/ncbi/workshops/2023-08_BLAST_evol/blast_score.html>


---

