Skip to content

Commit

Permalink
Merge pull request #37 from marbl/hotfix
Browse files Browse the repository at this point in the history
Hotfix
  • Loading branch information
alexsweeten authored Oct 4, 2024
2 parents 97c84e9 + 18c30ac commit 2d0adb3
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "ModDotPlot"
version = "0.8.7"
version = "0.8.8"
requires-python = ">= 3.7"
dependencies = [
"pysam",
Expand Down
2 changes: 1 addition & 1 deletion src/moddotplot/const.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION = "0.8.7"
VERSION = "0.8.8"
COLS = [
"#query_name",
"query_start",
Expand Down
34 changes: 17 additions & 17 deletions src/moddotplot/moddotplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -922,29 +922,13 @@ def main():
# TODO: Optimize computations so that largest sequence doesn't need to be redone all the time
if (args.compare or args.compare_only) and len(sequences) > 1:
# Set window size to args.window. Otherwise, set it to n/resolution
win = args.window
res = args.resolution
if args.window:
res = math.ceil(len(sequences[0][1]) / args.window)
else:
win = math.ceil(len(sequences[0][1]) / args.resolution)
if win < args.modimizer:
args.modimizer = win

seq_sparsity = round(win / args.modimizer)
if seq_sparsity <= args.modimizer:
seq_sparsity = 2 ** int(math.log2(seq_sparsity))
else:
seq_sparsity = 2 ** (int(math.log2(seq_sparsity - 1)) + 1)
expectation = round(win / seq_sparsity)

if args.grid:
grid_vals = []

for i in range(len(sequences)):
larger_seq = sequences[i][1]

for j in range(i + 1, len(sequences)):
larger_seq = sequences[i][1]
smaller_seq = sequences[j][1]
larger_length = len(larger_seq)
smaller_length = len(smaller_seq)
Expand All @@ -958,6 +942,22 @@ def main():
smaller_length = len(smaller_seq)
larger_seq_name = sequences[j][0]
smaller_seq_name = sequences[i][0]

win = args.window
res = args.resolution
if args.window:
res = math.ceil(smaller_length / args.window)
else:
win = math.ceil(smaller_length / args.resolution)
if win < args.modimizer:
args.modimizer = win

seq_sparsity = round(win / args.modimizer)
if seq_sparsity <= args.modimizer:
seq_sparsity = 2 ** int(math.log2(seq_sparsity))
else:
seq_sparsity = 2 ** (int(math.log2(seq_sparsity - 1)) + 1)
expectation = round(win / seq_sparsity)
print(
f"Computing pairwise identity matrix for {larger_seq_name} and {smaller_seq_name}... \n"
)
Expand Down

0 comments on commit 2d0adb3

Please sign in to comment.