Skip to content

Commit

Permalink
Fix function to calc editing efficiency where there are no reads
Browse files Browse the repository at this point in the history
  • Loading branch information
CodingBash committed Jan 29, 2024
1 parent c1afb13 commit 250bafb
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ ENV PATH="${VENV}/bin:$PATH"

# Install from PyPI
RUN pip install --upgrade pip
RUN pip install crispr-ambiguous-mapping==0.0.140
RUN pip install crispr-ambiguous-mapping==0.0.141
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
from typing import Counter as CounterType

def calculate_average_editing_frequency(total_mutation_counter: CounterType) -> float:
editing_efficiency = (sum(total_mutation_counter.values()) - total_mutation_counter[0])/sum(total_mutation_counter.values())
return editing_efficiency
total_editing_counts = (sum(total_mutation_counter.values()) - total_mutation_counter[0])
total_counts = sum(total_mutation_counter.values())
if total_counts > 0:
editing_efficiency = total_editing_counts/total_counts
return editing_efficiency
else:
return 0
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion crispr-ambiguous-mapping/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "crispr-ambiguous-mapping"
version = "0.0.140"
version = "0.0.141"
description = ""
authors = ["Basheer Becerra <[email protected]>"]
readme = "README.md"
Expand Down

0 comments on commit 250bafb

Please sign in to comment.