ModDotPlot 1.0.0__tar.gz → 1.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. {moddotplot-1.0.0/src/ModDotPlot.egg-info → moddotplot-1.0.1}/PKG-INFO +2 -2
  2. {moddotplot-1.0.0 → moddotplot-1.0.1}/README.md +1 -1
  3. {moddotplot-1.0.0 → moddotplot-1.0.1}/pyproject.toml +1 -1
  4. {moddotplot-1.0.0 → moddotplot-1.0.1/src/ModDotPlot.egg-info}/PKG-INFO +2 -2
  5. {moddotplot-1.0.0 → moddotplot-1.0.1}/src/moddotplot/annotations.py +20 -1
  6. {moddotplot-1.0.0 → moddotplot-1.0.1}/src/moddotplot/const.py +1 -1
  7. {moddotplot-1.0.0 → moddotplot-1.0.1}/src/moddotplot/moddotplot.py +1 -1
  8. {moddotplot-1.0.0 → moddotplot-1.0.1}/tests/test_annotation_track.py +18 -0
  9. {moddotplot-1.0.0 → moddotplot-1.0.1}/tests/test_cli_runtime.py +36 -0
  10. {moddotplot-1.0.0 → moddotplot-1.0.1}/LICENSE +0 -0
  11. {moddotplot-1.0.0 → moddotplot-1.0.1}/LICENSE.ntHash +0 -0
  12. {moddotplot-1.0.0 → moddotplot-1.0.1}/THIRD_PARTY_LICENSES.md +0 -0
  13. {moddotplot-1.0.0 → moddotplot-1.0.1}/setup.cfg +0 -0
  14. {moddotplot-1.0.0 → moddotplot-1.0.1}/setup.py +0 -0
  15. {moddotplot-1.0.0 → moddotplot-1.0.1}/src/ModDotPlot.egg-info/SOURCES.txt +0 -0
  16. {moddotplot-1.0.0 → moddotplot-1.0.1}/src/ModDotPlot.egg-info/dependency_links.txt +0 -0
  17. {moddotplot-1.0.0 → moddotplot-1.0.1}/src/ModDotPlot.egg-info/entry_points.txt +0 -0
  18. {moddotplot-1.0.0 → moddotplot-1.0.1}/src/ModDotPlot.egg-info/requires.txt +0 -0
  19. {moddotplot-1.0.0 → moddotplot-1.0.1}/src/ModDotPlot.egg-info/top_level.txt +0 -0
  20. {moddotplot-1.0.0 → moddotplot-1.0.1}/src/moddotplot/__init__.py +0 -0
  21. {moddotplot-1.0.0 → moddotplot-1.0.1}/src/moddotplot/__main__.py +0 -0
  22. {moddotplot-1.0.0 → moddotplot-1.0.1}/src/moddotplot/_nthash.cpp +0 -0
  23. {moddotplot-1.0.0 → moddotplot-1.0.1}/src/moddotplot/color_palettes.py +0 -0
  24. {moddotplot-1.0.0 → moddotplot-1.0.1}/src/moddotplot/estimate_identity.py +0 -0
  25. {moddotplot-1.0.0 → moddotplot-1.0.1}/src/moddotplot/interactive.py +0 -0
  26. {moddotplot-1.0.0 → moddotplot-1.0.1}/src/moddotplot/native_render.py +0 -0
  27. {moddotplot-1.0.0 → moddotplot-1.0.1}/src/moddotplot/optional_dependencies.py +0 -0
  28. {moddotplot-1.0.0 → moddotplot-1.0.1}/src/moddotplot/parse_fasta.py +0 -0
  29. {moddotplot-1.0.0 → moddotplot-1.0.1}/src/moddotplot/plot_summary.py +0 -0
  30. {moddotplot-1.0.0 → moddotplot-1.0.1}/src/moddotplot/static_plots.py +0 -0
  31. {moddotplot-1.0.0 → moddotplot-1.0.1}/tests/test_algorithms.py +0 -0
  32. {moddotplot-1.0.0 → moddotplot-1.0.1}/tests/test_cli_integration.py +0 -0
  33. {moddotplot-1.0.0 → moddotplot-1.0.1}/tests/test_direction_cli.py +0 -0
  34. {moddotplot-1.0.0 → moddotplot-1.0.1}/tests/test_direction_plot.py +0 -0
  35. {moddotplot-1.0.0 → moddotplot-1.0.1}/tests/test_entrypoints.py +0 -0
  36. {moddotplot-1.0.0 → moddotplot-1.0.1}/tests/test_fasta_parser.py +0 -0
  37. {moddotplot-1.0.0 → moddotplot-1.0.1}/tests/test_grid.py +0 -0
  38. {moddotplot-1.0.0 → moddotplot-1.0.1}/tests/test_interactive_annotations.py +0 -0
  39. {moddotplot-1.0.0 → moddotplot-1.0.1}/tests/test_interactive_export.py +0 -0
  40. {moddotplot-1.0.0 → moddotplot-1.0.1}/tests/test_interactive_parser.py +0 -0
  41. {moddotplot-1.0.0 → moddotplot-1.0.1}/tests/test_issue53_memory_safe_plotting.py +0 -0
  42. {moddotplot-1.0.0 → moddotplot-1.0.1}/tests/test_modimizer_vectorization.py +0 -0
  43. {moddotplot-1.0.0 → moddotplot-1.0.1}/tests/test_native_full_plot.py +0 -0
  44. {moddotplot-1.0.0 → moddotplot-1.0.1}/tests/test_native_render.py +0 -0
  45. {moddotplot-1.0.0 → moddotplot-1.0.1}/tests/test_native_sequence_sketches.py +0 -0
  46. {moddotplot-1.0.0 → moddotplot-1.0.1}/tests/test_nthash.py +0 -0
  47. {moddotplot-1.0.0 → moddotplot-1.0.1}/tests/test_optional_dependencies.py +0 -0
  48. {moddotplot-1.0.0 → moddotplot-1.0.1}/tests/test_packaging_metadata.py +0 -0
  49. {moddotplot-1.0.0 → moddotplot-1.0.1}/tests/test_plot_fonts.py +0 -0
  50. {moddotplot-1.0.0 → moddotplot-1.0.1}/tests/test_plot_summary.py +0 -0
  51. {moddotplot-1.0.0 → moddotplot-1.0.1}/tests/test_sketch_cache.py +0 -0
  52. {moddotplot-1.0.0 → moddotplot-1.0.1}/tests/test_sparse_containment.py +0 -0
  53. {moddotplot-1.0.0 → moddotplot-1.0.1}/tests/test_static_customization.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ModDotPlot
3
- Version: 1.0.0
3
+ Version: 1.0.1
4
4
  Author: Michael Schatz, Adam Phillippy
5
5
  Author-email: Alex Sweeten <alex.sweeten@nih.gov>
6
6
  Maintainer-email: Alex Sweeten <alex.sweeten@nih.gov>
@@ -140,7 +140,7 @@ Finally, confirm that the installation completed correctly and that your version
140
140
  | | | | (_) | (_| | | |__| | (_) | |_ | | | | (_) | |_
141
141
  |_| |_|\___/ \__,_| |_____/ \___/ \__| |_| |_|\___/ \__|
142
142
 
143
- v1.0.0
143
+ v1.0.1
144
144
 
145
145
  usage: moddotplot [-h] [--quiet] [{static,interactive}] ...
146
146
 
@@ -84,7 +84,7 @@ Finally, confirm that the installation completed correctly and that your version
84
84
  | | | | (_) | (_| | | |__| | (_) | |_ | | | | (_) | |_
85
85
  |_| |_|\___/ \__,_| |_____/ \___/ \__| |_| |_|\___/ \__|
86
86
 
87
- v1.0.0
87
+ v1.0.1
88
88
 
89
89
  usage: moddotplot [-h] [--quiet] [{static,interactive}] ...
90
90
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "ModDotPlot"
7
- version = "1.0.0"
7
+ version = "1.0.1"
8
8
  requires-python = ">=3.10,<3.15"
9
9
  dependencies = [
10
10
  "pandas",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ModDotPlot
3
- Version: 1.0.0
3
+ Version: 1.0.1
4
4
  Author: Michael Schatz, Adam Phillippy
5
5
  Author-email: Alex Sweeten <alex.sweeten@nih.gov>
6
6
  Maintainer-email: Alex Sweeten <alex.sweeten@nih.gov>
@@ -140,7 +140,7 @@ Finally, confirm that the installation completed correctly and that your version
140
140
  | | | | (_) | (_| | | |__| | (_) | |_ | | | | (_) | |_
141
141
  |_| |_|\___/ \__,_| |_____/ \___/ \__| |_| |_|\___/ \__|
142
142
 
143
- v1.0.0
143
+ v1.0.1
144
144
 
145
145
  usage: moddotplot [-h] [--quiet] [{static,interactive}] ...
146
146
 
@@ -17,11 +17,30 @@ BED_COLUMNS = [
17
17
  ]
18
18
 
19
19
 
20
+ def _ucsc_directive_rows(filepath):
21
+ """Return zero-based rows containing UCSC ``track`` or ``browser`` lines."""
22
+
23
+ rows = []
24
+ with open(filepath, "r", encoding="utf-8") as bed_file:
25
+ for line_number, line in enumerate(bed_file):
26
+ fields = line.lstrip().split(maxsplit=1)
27
+ if fields and fields[0] in {"track", "browser"}:
28
+ rows.append(line_number)
29
+ return rows
30
+
31
+
20
32
  def read_annotation_bed(filepath):
21
33
  """Read the BED3-BED9 subset used by ModDotPlot annotations."""
22
34
 
23
35
  try:
24
- dataframe = pd.read_csv(filepath, sep="\t", comment="#", header=None, dtype=str)
36
+ dataframe = pd.read_csv(
37
+ filepath,
38
+ sep="\t",
39
+ comment="#",
40
+ header=None,
41
+ dtype=str,
42
+ skiprows=_ucsc_directive_rows(filepath),
43
+ )
25
44
  except pd.errors.EmptyDataError:
26
45
  return pd.DataFrame(columns=BED_COLUMNS[:3])
27
46
 
@@ -1,4 +1,4 @@
1
- VERSION = "1.0.0"
1
+ VERSION = "1.0.1"
2
2
  DIRECTION_COLORS = {"Forward": "#2166AC", "Reverse": "#D01C8B"}
3
3
  COLS = [
4
4
  "#query_name",
@@ -650,7 +650,7 @@ def _apply_static_config(args, config):
650
650
  else:
651
651
  args.fasta = config.get("fasta")
652
652
  args.load = config.get("load")
653
- args.bed = config.get("bed")
653
+ args.bed = config.get("bed", args.bed)
654
654
 
655
655
  # Distance matrix commands
656
656
  args.kmer = config.get("kmer", args.kmer)
@@ -51,6 +51,24 @@ def test_read_annotation_bed_accepts_bed3_through_bed9(
51
51
  assert dataframe.loc[0, "end"] == 20
52
52
 
53
53
 
54
+ def test_read_annotation_bed_ignores_ucsc_directives(tmp_path):
55
+ bed_path = tmp_path / "annotations.bed"
56
+ bed_path.write_text(
57
+ 'track name="annotations" visibility=2 itemRgb="On"\n'
58
+ "browser position chr1:1-100\n"
59
+ "# comment\n"
60
+ "chr1\t10\t20\tfeature\t0\t+\t10\t20\t12,34,56\n"
61
+ )
62
+
63
+ dataframe = read_annotation_bed(bed_path)
64
+
65
+ assert len(dataframe) == 1
66
+ assert dataframe.loc[0, "chrom"] == "chr1"
67
+ assert dataframe.loc[0, "start"] == 10
68
+ assert dataframe.loc[0, "end"] == 20
69
+ assert dataframe.loc[0, "itemRgb"] == "12,34,56"
70
+
71
+
54
72
  @pytest.mark.parametrize(
55
73
  "record",
56
74
  [
@@ -490,6 +490,42 @@ def test_static_config_accepts_sequence_selection():
490
490
  assert args.sequence == ["chr1", "chr2"]
491
491
 
492
492
 
493
+ def test_static_config_preserves_cli_bed_when_config_omits_bed():
494
+ args = cli.get_parser().parse_args(
495
+ [
496
+ "static",
497
+ "--config",
498
+ "plot.json",
499
+ "--fasta",
500
+ "sequence.fa",
501
+ "--bed",
502
+ "provided.bed",
503
+ ]
504
+ )
505
+
506
+ cli._apply_static_config(args, {"identity": 90})
507
+
508
+ assert args.bed == "provided.bed"
509
+
510
+
511
+ def test_static_config_bed_overrides_cli_bed():
512
+ args = cli.get_parser().parse_args(
513
+ [
514
+ "static",
515
+ "--config",
516
+ "plot.json",
517
+ "--fasta",
518
+ "sequence.fa",
519
+ "--bed",
520
+ "provided.bed",
521
+ ]
522
+ )
523
+
524
+ cli._apply_static_config(args, {"bed": "configured.bed"})
525
+
526
+ assert args.bed == "configured.bed"
527
+
528
+
493
529
  def test_static_config_preserves_explicit_input_and_output_paths():
494
530
  args = cli.parse_args(
495
531
  [
File without changes
File without changes
File without changes
File without changes