Skip to content

Commit

Permalink
Fix Start size standardized status in mtgrasp_summary.py, error messa…
Browse files Browse the repository at this point in the history
…ging for no mitochondrial sequence assembled. (#25)
  • Loading branch information
lcoombe authored Jun 5, 2024
1 parent 8e1d8b6 commit 318eb4d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions mtgrasp.smk
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ mtgrasp_version = 'v1.1.3'
import os.path
import shlex
import subprocess
import sys
import math
from Bio import SeqIO

Expand Down Expand Up @@ -109,13 +110,14 @@ def check_blast_tsv(filename):
with open(filename, 'r') as file:
lines = file.readlines()
if len(lines) == 1:
print("No mitochondrial sequence found.")
exit(0)
print("No mitochondrial sequence found, exiting.", file=sys.stderr)
print("No mitochondrial sequence found.", file=sys.stdout)
sys.exit(0)
else:
print("Mitochondrial sequence(s) found")
except FileNotFoundError:
print(f"File '{filename}' not found.")
exit(1)
sys.exit(1)

out_dir = current_dir + config["out_dir"]

Expand Down
4 changes: 2 additions & 2 deletions mtgrasp_summarize.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ def get_assembly_metrics(fasta):
standardization_status = "StartSite_Strand_Standardized"
elif "StartSite" in fasta_header and "Strand" not in fasta_header:
standardization_status = "StartSite_Standardized"
elif "StartSite" not in fasta_header and "Strand" not in fasta_header:
standardization_status = "StartSite_Standardized"
elif "StartSite" not in fasta_header and "Strand" in fasta_header:
standardization_status = "Strand_Standardized"
else:
standardization_status = "Non-Standardized"
else:
Expand Down

0 comments on commit 318eb4d

Please sign in to comment.