Skip to content

Commit

Permalink
Fix align_trim unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
BioWilko committed Nov 28, 2024
1 parent 58de91d commit 125dc07
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tests/align_trim_unit_test.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# align_trim_unit_test.py contains unit tests for alignment trimming
import os
import pysam
import pytest
from types import SimpleNamespace

from artic import align_trim
from artic import utils
Expand Down Expand Up @@ -92,6 +92,10 @@ def test_trim():

def testRunner(seg, expectedCIGAR):

global args

args = SimpleNamespace(verbose=False)

# get the nearest primers to the alignment segment
p1 = align_trim.find_primer(primerScheme, seg.reference_start, "+")
p2 = align_trim.find_primer(primerScheme, seg.reference_end, "-")
Expand All @@ -114,7 +118,7 @@ def testRunner(seg, expectedCIGAR):

# trim the forward primer
try:
align_trim.trim(seg, p1_position, False, False)
align_trim.trim(seg, p1_position, False)
except Exception as e:
raise Exception(
"problem soft masking left primer in {} (error: {})".format(
Expand All @@ -132,7 +136,7 @@ def testRunner(seg, expectedCIGAR):

# trim the reverse primer
try:
align_trim.trim(seg, p2_position, True, False)
align_trim.trim(seg, p2_position, True)
except Exception as e:
raise Exception(
"problem soft masking right primer in {} (error: {})".format(
Expand Down

0 comments on commit 125dc07

Please sign in to comment.