Skip to content

Commit

Permalink
Fix error messages and change mappy preset
Browse files Browse the repository at this point in the history
  • Loading branch information
rrwick committed Jun 29, 2022
1 parent 95fd412 commit 71f1731
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions scripts/polypolish_human_readable.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,11 @@ def parse_args():
def check_inputs(args):
check_python_version()
if not pathlib.Path(args.before).is_file():
quit_with_error(f'Error: all required options (--in1, --in2, --out1, --out2) must have '
'unique values')
if args.padding <= 0 or args.padding >= 100:
quit_with_error('Error: the value of --low must be greater than 0 and less than 100')
quit_with_error(f'Error: {args.before} is not a file')
if not pathlib.Path(args.after).is_file():
quit_with_error(f'Error: {args.after} is not a file')
if args.padding <= 0 or args.padding >= 1000:
quit_with_error('Error: the value of --padding must be greater than 0 and less than 1000')


def starting_message(args):
Expand Down Expand Up @@ -273,7 +274,7 @@ def get_cigar(before_seq, after_seq, aligner):


def get_cigar_with_mappy(before_seq, after_seq):
a = mappy.Aligner(seq=after_seq, preset='asm20')
a = mappy.Aligner(seq=after_seq, preset='map-ont')
for result in a.map(before_seq):
full_length_query = (result.q_st == 0 and result.q_en == len(before_seq))
full_length_ref = (result.r_st == 0 and result.r_en == len(after_seq))
Expand Down

0 comments on commit 71f1731

Please sign in to comment.