Skip to content

Commit

Permalink
Bug fixes (#36)
Browse files Browse the repository at this point in the history
* fixed bug that would cause crash in qpcr mode if -a = 0

* added end overlap logging and negative value error

* changed version number

* typo
  • Loading branch information
jonas-fuchs authored Apr 2, 2024
1 parent aba45b0 commit c155730
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion varvamp/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""Tool to design amplicons for highly variable virusgenomes"""
_program = "varvamp"
__version__ = "1.1.1"
__version__ = "1.1.2"
7 changes: 5 additions & 2 deletions varvamp/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,11 @@ def shared_workflow(args, log_file):
# estimate threshold or number of ambiguous bases if args were not supplied
if args.threshold is None or args.n_ambig is None:
args.threshold, args.n_ambig = param_estimation.get_parameters(preprocessed_alignment, args, log_file)
if args.mode == "qpcr" and args.n_ambig >= 1 and args.pn_ambig is None:
args.pn_ambig = args.n_ambig - 1
if args.mode == "qpcr" and args.pn_ambig is None:
if args.n_ambig == 0:
args.pn_ambig = 0
if args.n_ambig > 0:
args.pn_ambig = args.n_ambig - 1
with open(log_file, "a") as f:
print(f"Automatic parameter selection set -pa {args.pn_ambig}.", file=f)

Expand Down
4 changes: 3 additions & 1 deletion varvamp/scripts/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def raise_arg_errors(args, log_file):
if args.mode == "qpcr":
if args.pn_ambig < 0:
raise_error(
"number of ambiguous characters in the qPCR probe cannot be 0.",
"number of ambiguous characters in the qPCR probe cannot be negative.",
log_file,
exit=True
)
Expand Down Expand Up @@ -283,6 +283,7 @@ def confirm_config(args, log_file):
"QPRIMER_DIFF",
"QPROBE_TEMP_DIFF",
"QPROBE_DISTANCE",
"END_OVERLAP",
"QAMPLICON_LENGTH",
"QAMPLICON_GC",
"QAMPLICON_DEL_CUTOFF"
Expand Down Expand Up @@ -379,6 +380,7 @@ def confirm_config(args, log_file):
("max base penalty", config.PRIMER_MAX_BASE_PENALTY),
("primer permutation penalty", config.PRIMER_PERMUTATION_PENALTY),
("qpcr flanking primer difference", config.QPRIMER_DIFF),
("probe and primer end overlap", config.END_OVERLAP),
("qpcr deletion size still considered for deltaG calculation", config.QAMPLICON_DEL_CUTOFF),
("maximum difference between primer and blast db", config.BLAST_MAX_DIFF),
("multiplier of the maximum length for non-specific amplicons", config.BLAST_SIZE_MULTI),
Expand Down

0 comments on commit c155730

Please sign in to comment.