Skip to content

Commit

Permalink
Merge pull request #37 from sanjaynagi/fix-bug-06-07-23
Browse files Browse the repository at this point in the history
fix bug in designPrimers()
  • Loading branch information
sanjaynagi committed Jul 6, 2023
2 parents 4c94db6 + 639019f commit 3c1b3fb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion AgamPrimer/AgamPrimer.py
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ def designPrimers(

if assay_type != "probe":
# check if primer3 has returned any primers
if int(primer_dict["PRIMER_PAIR_EXPLAIN"][-1]) == 0:
if int(extract_trailing_digits(primer_dict["PRIMER_PAIR_EXPLAIN"])):
print(
f"No primers found for {assay_name}. For cDNA primers, this is more likely to occur if the target contains only one exon-exon junction. see troubleshooting below for more information. We suggest relaxing the primer parameters \n"
)
Expand Down Expand Up @@ -796,6 +796,16 @@ def designPrimers(
return (primer_df, blat_df)


def extract_trailing_digits(string):
import re

match = re.search(r"\d+$", string)
if match:
return match.group(0)
else:
return None


def _get_primer_arrays(contig, gdna_pos, sample_sets, assay_type, sample_query=None):
if any(item in assay_type for item in ["gDNA", "probe"]):
span_str = f"{contig}:{gdna_pos.min()}-{gdna_pos.max()}"
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "AgamPrimer"
version = "0.6.3"
version = "0.6.4"
description = "A package to design primers in Anopheles gambiae whilst considering genetic variation with malariagen_data"
authors = [
"Sanjay Nagi <sanjay.nagi@lstmed.ac.uk>",
Expand Down

0 comments on commit 3c1b3fb

Please sign in to comment.