Skip to content

Commit

Permalink
Merge pull request #27 from marbl/develop
Browse files Browse the repository at this point in the history
v0.8.4 Release
  • Loading branch information
alexsweeten authored Jun 13, 2024
2 parents cc2e3a1 + 069cc23 commit 24a0917
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 13 deletions.
4 changes: 2 additions & 2 deletions 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.3"
version = "0.8.4"
requires-python = ">= 3.7"
dependencies = [
"pysam",
Expand All @@ -16,7 +16,7 @@ dependencies = [
"mmh3",
"tk",
"setproctitle",
"numpy==1.26.4"
"numpy"
]
authors = [
{name = "Alex Sweeten", email = "[email protected]"},
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.3"
VERSION = "0.8.4"
COLS = [
"#query_name",
"query_start",
Expand Down
26 changes: 19 additions & 7 deletions src/moddotplot/moddotplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,9 @@ def main():

# Throw error if compare only selected with one sequence.
if len(k_list) < 2 and args.compare_only:
print(f"Error: Can't create a comparative plot with only one sequence")
print(
f"Error: Can't create a comparative plot with only one sequence. Please re-run without --compare-only."
)
sys.exit(2)

# -----------LAUNCH INTERACTIVE MODE-----------
Expand Down Expand Up @@ -910,7 +912,7 @@ def main():
axes_labels=args.axes_ticks,
)

# -----------COMPUTE COMAPRATIVE PLOTS-----------
# -----------COMPUTE COMPARATIVE PLOTS-----------
# 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
Expand All @@ -937,16 +939,26 @@ def main():
smaller_seq = sequences[j][1]
larger_length = len(larger_seq)
smaller_length = len(smaller_seq)
larger_seq_name = sequences[i][0]
smaller_seq_name = sequences[j][0]
# Houston we have a problem
if larger_length < smaller_length:
smaller_seq = sequences[i][1]
larger_seq = sequences[j][1]
larger_length = len(larger_seq)
smaller_length = len(smaller_seq)
larger_seq_name = sequences[j][0]
smaller_seq_name = sequences[i][0]
print(
f"Computing pairwise identity matrix for {sequences[i][0]} and {sequences[j][0]}... \n"
f"Computing pairwise identity matrix for {larger_seq_name} and {smaller_seq_name}... \n"
)
# TODO: Logging here
# print(f"\tSparsity value s: {seq_sparsity}\n")
print(
f"\tSequence length {sequences[i][0]}: {larger_length + args.kmer - 1}\n"
f"\tSequence length {larger_seq_name}: {larger_length + args.kmer - 1}\n"
)
print(
f"\tSequence length {sequences[j][0]}: {smaller_length + args.kmer - 1}\n"
f"\tSequence length {smaller_seq_name}: {smaller_length + args.kmer - 1}\n"
)
print(f"\tWindow size w: {win}\n")
print(f"\tModimizer sketch size: {expectation}\n")
Expand All @@ -955,8 +967,8 @@ def main():
pair_mat = createPairwiseMatrix(
larger_length,
smaller_length,
sequences[i][1],
sequences[j][1],
larger_seq,
smaller_seq,
win,
seq_sparsity,
args.delta,
Expand Down
3 changes: 0 additions & 3 deletions src/moddotplot/static_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,6 @@ def make_dot(sdf, title_name, palette, palette_orientation, colors, breaks, xlim
breaks = [float(number) for number in breaks]
if not xlim:
xlim = 0
else:
breaks = [float(number) for number in breaks]
hexcodes = []
new_hexcodes = []
if palette in DIVERGING_PALETTES:
Expand Down Expand Up @@ -403,7 +401,6 @@ def create_plots(
sdf, palette, palette_orientation, custom_colors, custom_breakpoints
)

print(xlim)
if is_pairwise:
heatmap = make_dot(
sdf,
Expand Down

0 comments on commit 24a0917

Please sign in to comment.