Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
kvdomingo committed Feb 18, 2020
2 parents 5109ad1 + 944328f commit 53b5720
Showing 1 changed file with 39 additions and 2 deletions.
41 changes: 39 additions & 2 deletions pdcli/primerclass.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,43 @@ def substitution(self, sequence, mutation_type, target, replacement, start_posit
valid_length = sc.check_sequence_length(self.length_range)
if valid_gc and valid_temp and valid_ends and valid_length:
valid_primers.append(candidate)
elif self.primer_mode == 'overlapping':
valid_primers = []
forseq = list(sequence)
revseq = list(sequence)[::-1]
seqlen = len(replacement)
forseq[start_position-1] = replacement
for f5 in range(8,self.flank5_range[1]):
for f3 in range(*self.flank3_range):
if abs(f5 - f3) > 1 and self.center_mutation:
continue
candidate1 = forseq[start_position-1-f5 : start_position-1]
candidate3 = list(replacement)
candidate2 = forseq[start_position+seqlen-1 : start_position+seqlen+f3]
candidate = candidate1 + candidate3 + candidate2
candidate = ''.join(candidate)
if len(candidate) == 0:
continue
sc = SequenceChecks(candidate)
valid_gc = sc.check_gc_content(self.gc_range)
valid_temp = sc.check_Tm(self.Tm_range)
valid_ends = sc.check_ends_gc(self.terminate_gc)
valid_length = sc.check_sequence_length(self.length_range)
if valid_gc and valid_temp and valid_ends and valid_length:
valid_primers.append(candidate)
valid_reverse = []
for primers in valid_primers:
start = sequence.find(primers)
end = start + len(primers)
primer_length = revseq[start:end]
sc = SequenceChecks(primers)
valid_gc = sc.check_gc_content(self.gc_range)
valid_temp = sc.check_Tm(self.Tm_range)
valid_ends = sc.check_ends_gc(self.terminate_gc)
valid_length = sc.check_sequence_length(self.length_range)
if valid_gc and valid_temp and valid_ends and valid_length:
valid_reverse.append(primers)

else:
pass
if len(valid_primers) > 0:
Expand All @@ -166,7 +203,7 @@ def deletion(self, sequence, mutation_type, target, replacement, start_position,
seq = list(sequence)
for f5 in range(*self.flank5_range):
for f3 in range(*self.flank3_range):
if abs(f5 - f3) > 1:
if abs(f5 - f3) > 1 and self.center_mutation:
continue
candidate1 = seq[start_position-1-f5 : start_position-1]
candidate2 = seq[start_position+seqlen-1 : start_position+seqlen+f3]
Expand Down Expand Up @@ -197,7 +234,7 @@ def insertion(self, sequence, mutation_type, target, replacement, start_position
seq[start_position-1] = replacement
for f5 in range(*self.flank5_range):
for f3 in range(*self.flank3_range):
if abs(f5 - f3) > 1:
if abs(f5 - f3) > 1 and self.center_mutation:
continue
candidate1 = seq[start_position-1-f5 : start_position-1]
candidate3 = list(replacement)
Expand Down

0 comments on commit 53b5720

Please sign in to comment.