Skip to content

Commit

Permalink
Add constants for fwd and rev strands
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisAta committed May 24, 2024
1 parent 14a2902 commit 9ebdc23
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@

from mgnify_pipelines_toolkit.constants.var_region_coordinates import REGIONS_16S_BACTERIA, REGIONS_16S_ARCHAEA, REGIONS_18S

STRAND_FWD = "fwd"
STRAND_REV = "rev"

def parse_args():
parser = argparse.ArgumentParser()

Expand All @@ -46,7 +49,7 @@ def get_amp_region(beg, strand, model):
region_beg = region_coords[0]
beg_diff = region_beg - beg

if strand == "fwd":
if strand == STRAND_FWD:
if beg_diff > 0:
return region
else:
Expand Down Expand Up @@ -92,9 +95,9 @@ def main():
strand = ""

if "F" in primer_name:
strand = "fwd"
strand = STRAND_FWD
elif "R" in primer_name:
strand = "rev"
strand = STRAND_REV

amp_region = get_amp_region(beg, strand, model)
primer_seq = str(fasta_dict[primer_name].seq)
Expand Down

0 comments on commit 9ebdc23

Please sign in to comment.