Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* update

* black

---------

Co-authored-by: Michiel de Hoon <[email protected]>
  • Loading branch information
mdehoon and Michiel de Hoon authored Nov 19, 2024
1 parent b9dd9cf commit e70e660
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions Bio/Blast/_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -860,11 +860,14 @@ def _end_query_frame(self, name):
pass
elif program in ("blastx", "tblastx") and query_frame in (-3, -2, -1, 1, 2, 3):
pass
elif program in ("blastp", "tblastn", "rpsblast") and query_frame == 0:
elif (
program in ("blastp", "tblastn", "rpsblast", "psiblast")
and query_frame == 0
):
pass
else:
raise ValueError(
f"unexpected value {query_frame} in tag <Hsp_query-frame> for program {self._program}"
f"unexpected value {query_frame} in tag <Hsp_query-frame> for program {program}"
)
self._hsp.query_frame = query_frame
self._characters = ""
Expand All @@ -874,20 +877,13 @@ def _end_hit_frame(self, name):
program = self._program
if program in ("blastn", "megablast") and hit_frame in (-1, 1):
pass
elif program in ("blastp", "blastx", "rpsblast") and hit_frame == 0:
elif program in ("blastp", "blastx", "rpsblast", "psiblast") and hit_frame == 0:
pass
elif program in ("tblastn", "tblastx") and hit_frame in (
-3,
-2,
-1,
1,
2,
3,
):
elif program in ("tblastn", "tblastx") and hit_frame in (-3, -2, -1, 1, 2, 3):
pass
else:
raise ValueError(
f"unexpected value {hit_frame} in tag <Hsp_hit-frame> for program {self._program}"
f"unexpected value {hit_frame} in tag <Hsp_hit-frame> for program {program}"
)
self._hsp.hit_frame = hit_frame
self._characters = ""
Expand Down Expand Up @@ -1005,7 +1001,7 @@ def _end_hsp(self, name):
target_seq_data = {target_length - target_end: target_seq_data}
seq = Seq(target_seq_data, target_length)
target.seq = seq.reverse_complement()
elif program in ("blastp", "blastx", "rpsblast"):
elif program in ("blastp", "blastx", "rpsblast", "psiblast"):
target_start = hsp.hit_from - 1
target_end = hsp.hit_to
coordinates[0, :] += target_start
Expand Down

0 comments on commit e70e660

Please sign in to comment.