Skip to content

Commit

Permalink
Expose some bwa indel parameters through the off-target checker.
Browse files Browse the repository at this point in the history
  • Loading branch information
tfenne committed Nov 20, 2024
1 parent ebc72f7 commit a1ef886
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
5 changes: 5 additions & 0 deletions prymer/offtarget/bwa.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ def __init__(
max_mismatches_in_seed: int = 3,
max_gap_opens: int = 0,
max_gap_extensions: int = -1,
min_indel_to_end_distance: int = 3,
seed_length: int = 20,
reverse_complement: bool = False,
include_alt_hits: bool = False,
Expand All @@ -248,6 +249,8 @@ def __init__(
max_gap_opens: the maximum number of gap opens allowed in the full query sequence
max_gap_extensions: the maximum number of gap extensions allowed in the full query
sequence
min_indel_to_end_distance: do not place an indel within this many bp of the ends of
the query sequence
seed_length: the length of the seed region
reverse_complement: reverse complement each query sequence before alignment
include_alt_hits: if true include hits to references with names ending in _alt,
Expand Down Expand Up @@ -288,6 +291,8 @@ def __init__(
f"{max_gap_opens}",
"-e",
f"{max_gap_extensions}",
"-i",
f"{min_indel_to_end_distance}",
"-l",
f"{seed_length}",
"-k",
Expand Down
12 changes: 11 additions & 1 deletion prymer/offtarget/offtarget_detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,9 @@ def __init__(
three_prime_region_length: int,
max_mismatches_in_three_prime_region: int,
max_mismatches: int,
max_amplicon_size: int,
max_gap_opens: int = 0,
max_gap_extends: int = -1,
max_amplicon_size: int = 1000,
min_primer_pair_hits: int = 1,
cache_results: bool = True,
threads: Optional[int] = None,
Expand Down Expand Up @@ -201,6 +203,12 @@ def __init__(
three_prime_region_length
max_mismatches: the maximum number of mismatches allowed in the full length primer
(including any in the three prime region)
max_gap_opens: the maximum number of gaps (insertions or deletions) allowable in an
alignment of a oligo to the reference
max_gap_extends: the maximum number of gap extensions allowed; extending a gap
beyond a single base costs 1 gap extension. Can be set to -1 to allow
unlimited extensions up to max diffs (aka max mismatches), while disallowing
"long gaps".
max_amplicon_size: the maximum amplicon size to consider amplifiable
cache_results: if True, cache results for faster re-querying
threads: the number of threads to use when invoking bwa
Expand All @@ -220,6 +228,8 @@ def __init__(
seed_length=three_prime_region_length,
max_mismatches_in_seed=max_mismatches_in_three_prime_region,
max_mismatches=max_mismatches,
max_gap_opens=max_gap_opens,
max_gap_extensions=max_gap_extends,
max_hits=max_primer_hits,
)
self._max_primer_hits = max_primer_hits
Expand Down

0 comments on commit a1ef886

Please sign in to comment.