Skip to content

Commit

Permalink
Close #7 by accepting a few missing bases in a primer.
Browse files Browse the repository at this point in the history
Also search for 250 bases from each end.
  • Loading branch information
donkirkby committed Apr 26, 2021
1 parent ceac503 commit 67ae775
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion gene_splicer/primer_finder.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def find_primers(
# The sequence type, can be either 'contigs' or 'conseqs'
seqtype,
sample_size=50,
extended_length=200,
extended_length=250,
force_all_proviral=False):
proviral_helper = ProviralHelper(force_all_proviral=force_all_proviral)
errors = PrimerFinderErrors()
Expand Down
11 changes: 3 additions & 8 deletions gene_splicer/primer_finder_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,13 @@ def find_longest_primer(self):
else:
hxb2_start_offset = 0
hxb2_end_offset = 0
# Minus min_primer_length because the smallest primer we want to try looking for is min_primer_length nucleotides
# Minus min_primer_length because the smallest primer we want to try
# looking for is min_primer_length nucleotides
for i in range(len(self.primer) - self.min_primer_length):
# print('i', i)
primer_substring = None

# If fwd
if self.direction == 'fwd':
primer_substring = self.primer[i:]
hxb2_start_offset += 1

# If rev
elif self.direction == 'rev':
if i == 0:
primer_substring = self.primer[:]
Expand Down Expand Up @@ -96,9 +92,8 @@ def validate(self):
return
elif len(self.sample_primer) >= 7:
self.is_valid = True
if len(self.sample_primer) == self.primer_length:
if len(self.sample_primer) >= self.primer_length - 3:
self.is_full_length = True
# TODO: I should probably check that if the primer is not full length, that the start index is 0 for fwd and is len-1 for rev
return
else:
sample_slice, hxb2_slice = self.get_slices()
Expand Down

0 comments on commit 67ae775

Please sign in to comment.