LZGraphs 2.1.0__tar.gz → 2.1.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 (57) hide show
  1. {lzgraphs-2.1.0 → lzgraphs-2.1.1}/PKG-INFO +1 -1
  2. {lzgraphs-2.1.0 → lzgraphs-2.1.1}/src/LZGraphs/__init__.py +9 -1
  3. {lzgraphs-2.1.0 → lzgraphs-2.1.1}/src/LZGraphs/graphs/amino_acid_positional.py +4 -8
  4. {lzgraphs-2.1.0 → lzgraphs-2.1.1}/src/LZGraphs/graphs/lz_graph_base.py +655 -80
  5. {lzgraphs-2.1.0 → lzgraphs-2.1.1}/src/LZGraphs/graphs/naive.py +1 -3
  6. {lzgraphs-2.1.0 → lzgraphs-2.1.1}/src/LZGraphs/graphs/nucleotide_double_positional.py +5 -7
  7. {lzgraphs-2.1.0 → lzgraphs-2.1.1}/src/LZGraphs/metrics/__init__.py +8 -0
  8. lzgraphs-2.1.1/src/LZGraphs/metrics/pgen_distribution.py +351 -0
  9. {lzgraphs-2.1.0 → lzgraphs-2.1.1}/src/LZGraphs/mixins/random_walk.py +8 -11
  10. {lzgraphs-2.1.0 → lzgraphs-2.1.1}/src/LZGraphs.egg-info/PKG-INFO +1 -1
  11. {lzgraphs-2.1.0 → lzgraphs-2.1.1}/src/LZGraphs.egg-info/SOURCES.txt +4 -0
  12. {lzgraphs-2.1.0 → lzgraphs-2.1.1}/tests/test_aap_lzgraph.py +15 -24
  13. lzgraphs-2.1.1/tests/test_analytical_distribution.py +481 -0
  14. lzgraphs-2.1.1/tests/test_lzpgen_distribution.py +262 -0
  15. {lzgraphs-2.1.0 → lzgraphs-2.1.1}/tests/test_naive_lzgraph.py +14 -16
  16. {lzgraphs-2.1.0 → lzgraphs-2.1.1}/tests/test_ndp_lzgraph.py +14 -22
  17. lzgraphs-2.1.1/tests/test_simulate.py +225 -0
  18. {lzgraphs-2.1.0 → lzgraphs-2.1.1}/CHANGELOG.md +0 -0
  19. {lzgraphs-2.1.0 → lzgraphs-2.1.1}/CONTRIBUTING.md +0 -0
  20. {lzgraphs-2.1.0 → lzgraphs-2.1.1}/LICENSE +0 -0
  21. {lzgraphs-2.1.0 → lzgraphs-2.1.1}/MANIFEST.in +0 -0
  22. {lzgraphs-2.1.0 → lzgraphs-2.1.1}/README.md +0 -0
  23. {lzgraphs-2.1.0 → lzgraphs-2.1.1}/pyproject.toml +0 -0
  24. {lzgraphs-2.1.0 → lzgraphs-2.1.1}/requirements.txt +0 -0
  25. {lzgraphs-2.1.0 → lzgraphs-2.1.1}/setup.cfg +0 -0
  26. {lzgraphs-2.1.0 → lzgraphs-2.1.1}/src/LZGraphs/bag_of_words/__init__.py +0 -0
  27. {lzgraphs-2.1.0 → lzgraphs-2.1.1}/src/LZGraphs/bag_of_words/bow_encoder.py +0 -0
  28. {lzgraphs-2.1.0 → lzgraphs-2.1.1}/src/LZGraphs/exceptions/__init__.py +0 -0
  29. {lzgraphs-2.1.0 → lzgraphs-2.1.1}/src/LZGraphs/graphs/__init__.py +0 -0
  30. {lzgraphs-2.1.0 → lzgraphs-2.1.1}/src/LZGraphs/graphs/edge_data.py +0 -0
  31. {lzgraphs-2.1.0 → lzgraphs-2.1.1}/src/LZGraphs/graphs/graph_operations.py +0 -0
  32. {lzgraphs-2.1.0 → lzgraphs-2.1.1}/src/LZGraphs/metrics/convenience.py +0 -0
  33. {lzgraphs-2.1.0 → lzgraphs-2.1.1}/src/LZGraphs/metrics/diversity.py +0 -0
  34. {lzgraphs-2.1.0 → lzgraphs-2.1.1}/src/LZGraphs/metrics/entropy.py +0 -0
  35. {lzgraphs-2.1.0 → lzgraphs-2.1.1}/src/LZGraphs/metrics/saturation.py +0 -0
  36. {lzgraphs-2.1.0 → lzgraphs-2.1.1}/src/LZGraphs/mixins/__init__.py +0 -0
  37. {lzgraphs-2.1.0 → lzgraphs-2.1.1}/src/LZGraphs/mixins/gene_logic.py +0 -0
  38. {lzgraphs-2.1.0 → lzgraphs-2.1.1}/src/LZGraphs/mixins/gene_prediction.py +0 -0
  39. {lzgraphs-2.1.0 → lzgraphs-2.1.1}/src/LZGraphs/py.typed +0 -0
  40. {lzgraphs-2.1.0 → lzgraphs-2.1.1}/src/LZGraphs/utilities/__init__.py +0 -0
  41. {lzgraphs-2.1.0 → lzgraphs-2.1.1}/src/LZGraphs/utilities/decomposition.py +0 -0
  42. {lzgraphs-2.1.0 → lzgraphs-2.1.1}/src/LZGraphs/utilities/helpers.py +0 -0
  43. {lzgraphs-2.1.0 → lzgraphs-2.1.1}/src/LZGraphs/utilities/misc.py +0 -0
  44. {lzgraphs-2.1.0 → lzgraphs-2.1.1}/src/LZGraphs/visualization/__init__.py +0 -0
  45. {lzgraphs-2.1.0 → lzgraphs-2.1.1}/src/LZGraphs/visualization/visualize.py +0 -0
  46. {lzgraphs-2.1.0 → lzgraphs-2.1.1}/src/LZGraphs.egg-info/dependency_links.txt +0 -0
  47. {lzgraphs-2.1.0 → lzgraphs-2.1.1}/src/LZGraphs.egg-info/requires.txt +0 -0
  48. {lzgraphs-2.1.0 → lzgraphs-2.1.1}/src/LZGraphs.egg-info/top_level.txt +0 -0
  49. {lzgraphs-2.1.0 → lzgraphs-2.1.1}/tests/test_base_class_methods.py +0 -0
  50. {lzgraphs-2.1.0 → lzgraphs-2.1.1}/tests/test_bow_encoder.py +0 -0
  51. {lzgraphs-2.1.0 → lzgraphs-2.1.1}/tests/test_diversity_theory.py +0 -0
  52. {lzgraphs-2.1.0 → lzgraphs-2.1.1}/tests/test_graph_operations.py +0 -0
  53. {lzgraphs-2.1.0 → lzgraphs-2.1.1}/tests/test_metrics.py +0 -0
  54. {lzgraphs-2.1.0 → lzgraphs-2.1.1}/tests/test_new_features.py +0 -0
  55. {lzgraphs-2.1.0 → lzgraphs-2.1.1}/tests/test_pgen_fixes.py +0 -0
  56. {lzgraphs-2.1.0 → lzgraphs-2.1.1}/tests/test_serialization.py +0 -0
  57. {lzgraphs-2.1.0 → lzgraphs-2.1.1}/tests/test_utilities.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: LZGraphs
3
- Version: 2.1.0
3
+ Version: 2.1.1
4
4
  Summary: An Implementation of LZ76 Based Graphs for Repertoire Representation and Analysis
5
5
  Author-email: Thomas Konstantinovsky <thomaskon90@gmail.com>
6
6
  Maintainer-email: Thomas Konstantinovsky <thomaskon90@gmail.com>
@@ -1,4 +1,4 @@
1
- __version__ = "2.1.0"
1
+ __version__ = "2.1.1"
2
2
 
3
3
  # =============================================================================
4
4
  # Graph classes
@@ -63,6 +63,11 @@ from .metrics.saturation import NodeEdgeSaturationProbe
63
63
  # =============================================================================
64
64
  from .metrics.convenience import compare_repertoires
65
65
 
66
+ # =============================================================================
67
+ # Metrics - PGen Distribution
68
+ # =============================================================================
69
+ from .metrics.pgen_distribution import LZPgenDistribution, compare_lzpgen_distributions
70
+
66
71
  # =============================================================================
67
72
  # Utilities
68
73
  # =============================================================================
@@ -163,6 +168,9 @@ __all__ = [
163
168
  'NodeEdgeSaturationProbe',
164
169
  # Convenience
165
170
  'compare_repertoires',
171
+ # PGen distribution
172
+ 'LZPgenDistribution',
173
+ 'compare_lzpgen_distributions',
166
174
  # Utilities
167
175
  'generate_kmer_dictionary',
168
176
  'lempel_ziv_decomposition',
@@ -1,5 +1,4 @@
1
1
  import logging
2
- import re
3
2
  import time
4
3
  from typing import List, Tuple, Union, Optional, Generator
5
4
 
@@ -10,7 +9,7 @@ from tqdm.auto import tqdm
10
9
 
11
10
  from .lz_graph_base import LZGraphBase
12
11
  from ..utilities.decomposition import lempel_ziv_decomposition
13
- from ..utilities.misc import window, choice
12
+ from ..utilities.misc import window
14
13
  from ..exceptions import (
15
14
  EmptyDataError,
16
15
  MissingColumnError,
@@ -146,11 +145,8 @@ class AAPLZGraph(LZGraphBase):
146
145
 
147
146
  # Additional map derivations
148
147
  self.edges_list = None
149
- self._derive_terminal_state_map()
150
- self.verbose_driver(7, verbose)
151
148
  self._derive_stop_probability_data()
152
- self.verbose_driver(8, verbose)
153
- self.verbose_driver(5, verbose)
149
+ self.verbose_driver(9, verbose)
154
150
 
155
151
  # Optionally compute the PGEN for each sequence
156
152
  if calculate_trainset_pgen:
@@ -301,8 +297,8 @@ class AAPLZGraph(LZGraphBase):
301
297
  """
302
298
  Given a sub-pattern that might look like "ABC_10", extract only the amino acids ("ABC").
303
299
  """
304
- match = re.search(r'[A-Z]+', base)
305
- return match.group(0) if match else ""
300
+ idx = base.rfind('_')
301
+ return base[:idx] if idx > 0 else base
306
302
 
307
303
  def _decomposed_sequence_generator(
308
304
  self,