Skip to content

Commit

Permalink
Throw an error if blastn fails with non-zero exit code
Browse files Browse the repository at this point in the history
  • Loading branch information
kriskiil committed Dec 17, 2024
1 parent 863d453 commit 828a571
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bifrost_chewbbaca/rule__blast_genecall.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ def run_blastn_and_parse(query_fa, db, assembly_sequences,log):

# Run BLASTN and stream output
with subprocess.Popen(blastn_cmd, stdout=subprocess.PIPE, text=True, stderr=open(log.err_file, "w+")) as proc:
for line in proc.stdout:
stdout = proc.communicate()
if proc.returncode != 0:
raise RuntimeError(f"Command {" ".join(blastn_cmd)} failed with code {proc.returncode}.\nCheck the logs in {log.err_file}")
for line in stdout:
# Parse the BLAST output line into a dictionary
cols = line.strip().split("\t")
record = {
Expand Down

0 comments on commit 828a571

Please sign in to comment.