Skip to content

Commit

Permalink
Fix wrong variable
Browse files Browse the repository at this point in the history
  • Loading branch information
veghp committed Apr 25, 2024
1 parent 913ce99 commit 244e5a2
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions seqreport/SeqCollection.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,14 @@ def calculate_values(self):
self.repeat_seq = []
self.reverse_complement_seq = []
for index, record in enumerate(self.sequences[:-1]):
for other_record in self.sequences[index+1:]:
for other_record in self.sequences[index + 1 :]:
if record.id == other_record.id:
self.repeat_names += [record.id]
if record.seq == other_record.seq:
self.repeat_seq += [(record.id, other_record.id)]
if record.seq == other_record.seq.reverse_complement():
self.reverse_complement_seq += [(record.id, other_record.id)]

self.repeat_names = list(set(self.repeat_names))

# For the PDF report:
Expand Down Expand Up @@ -151,16 +151,22 @@ def calculate_values(self):
for record in self.sequences:
count_in_plan = all_rows.count(record.id)
if count_in_plan > 1: # we count re-use savings only
self.total_savings += len(record.seq) * (count_in_plan - 1) # ignore first synthesis
self.total_savings += len(record.seq) * (
count_in_plan - 1
) # ignore first synthesis
self.savings_list += [record.id]
# else we don't have any savings from the sequence.
if count_in_plan < 1: # also find the ones not in the assembly plan
self.not_in_plan += [record.id]
self.total_cost_savings = self.total_savings * self.cost_per_base # ignore cost / seq
self.total_cost_savings = round(self.total_cost_savings) # (in)accuracy is fine for our purposes
self.total_cost_savings = (
self.total_savings * self.cost_per_base
) # ignore cost / seq
self.total_cost_savings = round(
self.total_cost_savings
) # (in)accuracy is fine for our purposes
# For the PDF report:
self.savings_list_text = " ; ".join(self.savings_list)
self.not_in_plan_text = " ; ".join(self.savings_list)
self.not_in_plan_text = " ; ".join(self.not_in_plan)
else:
self.savings_list_text = ""
self.not_in_plan_text = ""
Expand Down

0 comments on commit 244e5a2

Please sign in to comment.