Skip to content

Commit

Permalink
fix: Improve error message when unsorted bam file
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianMichelsen committed Sep 21, 2022
1 parent 3c949be commit 1d53682
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/metaDMG/fit/serial.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,11 @@ def run_command_helper(config: Config, command: str):

if "ERROR: We require files to be sorted by readname, will exit" in line:
logger.debug(line)
s = f"The alignment file ({config['bam']}) has to be sorted by filename. "
s = (
f"\n\nThe alignment file has to be sorted by filename. "
+ f"\nUse samtools sort -n to sort the file: "
+ f"'samtools sort -n {config['bam']}' \n"
)
raise metadamageError(s)

# continue running and logging
Expand Down

0 comments on commit 1d53682

Please sign in to comment.