Skip to content

Commit 3df86bb

Browse files
kbryanhsuclaude
andcommitted
Fix evaluate mode: reverse-complement user-provided reverse primer
The prepare_pset_fasta rule wrote user-provided reverse primers as-is, but the pipeline expects them stored as the RC (matching the convention used by the generate command). This caused all primer-target pairs to fail the amplicon length check in prepare-input, producing 0 output. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent fca1b98 commit 3df86bb

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

workflows/Snakefile.example

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,12 +373,16 @@ rule prepare_pset_fasta:
373373
shutil.copyfile(src, out)
374374

375375
# case 2: direct for / rev → generate
376+
# The reverse primer must be stored as RC to match the convention
377+
# used by the 'generate' command (tiled from the RC of the target).
376378
else:
377379
for_seq = config["for"]
378380
rev_seq = config["rev"]
381+
comp = str.maketrans("ACGTacgt", "TGCAtgca")
382+
rev_seq_rc = rev_seq.translate(comp)[::-1]
379383

380384
with open(out, "w") as f:
381-
f.write(f">1_for\n{for_seq}\n>1_rev\n{rev_seq}\n")
385+
f.write(f">1_for\n{for_seq}\n>1_rev\n{rev_seq_rc}\n")
382386

383387
ids = check_ids(out)
384388

workflows/Snakefile.template

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,12 +373,16 @@ rule prepare_pset_fasta:
373373
shutil.copyfile(src, out)
374374

375375
# case 2: direct for / rev → generate
376+
# The reverse primer must be stored as RC to match the convention
377+
# used by the 'generate' command (tiled from the RC of the target).
376378
else:
377379
for_seq = config["for"]
378380
rev_seq = config["rev"]
381+
comp = str.maketrans("ACGTacgt", "TGCAtgca")
382+
rev_seq_rc = rev_seq.translate(comp)[::-1]
379383

380384
with open(out, "w") as f:
381-
f.write(f">1_for\n{for_seq}\n>1_rev\n{rev_seq}\n")
385+
f.write(f">1_for\n{for_seq}\n>1_rev\n{rev_seq_rc}\n")
382386

383387
ids = check_ids(out)
384388

0 commit comments

Comments
 (0)