LZGraphs 2.3.0__tar.gz → 2.3.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.
- {lzgraphs-2.3.0 → lzgraphs-2.3.1}/PKG-INFO +1 -1
- {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/__init__.py +1 -1
- {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/graphs/edge_data.py +11 -0
- {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/mixins/bayesian_posterior.py +12 -2
- {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs.egg-info/PKG-INFO +1 -1
- {lzgraphs-2.3.0 → lzgraphs-2.3.1}/CHANGELOG.md +0 -0
- {lzgraphs-2.3.0 → lzgraphs-2.3.1}/CONTRIBUTING.md +0 -0
- {lzgraphs-2.3.0 → lzgraphs-2.3.1}/LICENSE +0 -0
- {lzgraphs-2.3.0 → lzgraphs-2.3.1}/MANIFEST.in +0 -0
- {lzgraphs-2.3.0 → lzgraphs-2.3.1}/README.md +0 -0
- {lzgraphs-2.3.0 → lzgraphs-2.3.1}/pyproject.toml +0 -0
- {lzgraphs-2.3.0 → lzgraphs-2.3.1}/requirements.txt +0 -0
- {lzgraphs-2.3.0 → lzgraphs-2.3.1}/setup.cfg +0 -0
- {lzgraphs-2.3.0 → lzgraphs-2.3.1}/setup.py +0 -0
- {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/_fast_walk.c +0 -0
- {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/bag_of_words/__init__.py +0 -0
- {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/bag_of_words/bow_encoder.py +0 -0
- {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/constants.py +0 -0
- {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/exceptions/__init__.py +0 -0
- {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/graphs/__init__.py +0 -0
- {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/graphs/amino_acid_positional.py +0 -0
- {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/graphs/graph_operations.py +0 -0
- {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/graphs/lz_graph_base.py +0 -0
- {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/graphs/naive.py +0 -0
- {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/graphs/nucleotide_double_positional.py +0 -0
- {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/metrics/__init__.py +0 -0
- {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/metrics/convenience.py +0 -0
- {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/metrics/diversity.py +0 -0
- {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/metrics/entropy.py +0 -0
- {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/metrics/pgen_distribution.py +0 -0
- {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/metrics/saturation.py +0 -0
- {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/mixins/__init__.py +0 -0
- {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/mixins/gene_logic.py +0 -0
- {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/mixins/gene_prediction.py +0 -0
- {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/mixins/graph_topology.py +0 -0
- {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/mixins/lzpgen_distribution.py +0 -0
- {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/mixins/random_walk.py +0 -0
- {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/mixins/serialization.py +0 -0
- {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/mixins/walk_analysis.py +0 -0
- {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/py.typed +0 -0
- {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/utilities/__init__.py +0 -0
- {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/utilities/decomposition.py +0 -0
- {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/utilities/helpers.py +0 -0
- {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/utilities/misc.py +0 -0
- {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/visualization/__init__.py +0 -0
- {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs/visualization/visualize.py +0 -0
- {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs.egg-info/SOURCES.txt +0 -0
- {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs.egg-info/dependency_links.txt +0 -0
- {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs.egg-info/requires.txt +0 -0
- {lzgraphs-2.3.0 → lzgraphs-2.3.1}/src/LZGraphs.egg-info/top_level.txt +0 -0
- {lzgraphs-2.3.0 → lzgraphs-2.3.1}/tests/test_aap_lzgraph.py +0 -0
- {lzgraphs-2.3.0 → lzgraphs-2.3.1}/tests/test_abundance.py +0 -0
- {lzgraphs-2.3.0 → lzgraphs-2.3.1}/tests/test_analytical_distribution.py +0 -0
- {lzgraphs-2.3.0 → lzgraphs-2.3.1}/tests/test_base_class_methods.py +0 -0
- {lzgraphs-2.3.0 → lzgraphs-2.3.1}/tests/test_bow_encoder.py +0 -0
- {lzgraphs-2.3.0 → lzgraphs-2.3.1}/tests/test_diversity_theory.py +0 -0
- {lzgraphs-2.3.0 → lzgraphs-2.3.1}/tests/test_flexible_input.py +0 -0
- {lzgraphs-2.3.0 → lzgraphs-2.3.1}/tests/test_graph_operations.py +0 -0
- {lzgraphs-2.3.0 → lzgraphs-2.3.1}/tests/test_lzpgen_distribution.py +0 -0
- {lzgraphs-2.3.0 → lzgraphs-2.3.1}/tests/test_metrics.py +0 -0
- {lzgraphs-2.3.0 → lzgraphs-2.3.1}/tests/test_naive_lzgraph.py +0 -0
- {lzgraphs-2.3.0 → lzgraphs-2.3.1}/tests/test_ndp_lzgraph.py +0 -0
- {lzgraphs-2.3.0 → lzgraphs-2.3.1}/tests/test_new_features.py +0 -0
- {lzgraphs-2.3.0 → lzgraphs-2.3.1}/tests/test_pgen_fixes.py +0 -0
- {lzgraphs-2.3.0 → lzgraphs-2.3.1}/tests/test_serialization.py +0 -0
- {lzgraphs-2.3.0 → lzgraphs-2.3.1}/tests/test_simulate.py +0 -0
- {lzgraphs-2.3.0 → lzgraphs-2.3.1}/tests/test_utilities.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: LZGraphs
|
|
3
|
-
Version: 2.3.
|
|
3
|
+
Version: 2.3.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>
|
|
@@ -87,6 +87,17 @@ class EdgeData:
|
|
|
87
87
|
if self.j_genes[j_gene] <= 0:
|
|
88
88
|
del self.j_genes[j_gene]
|
|
89
89
|
|
|
90
|
+
def copy(self):
|
|
91
|
+
"""Create a shallow copy of this EdgeData (fast, no pickle)."""
|
|
92
|
+
new = EdgeData.__new__(EdgeData)
|
|
93
|
+
new.count = self.count
|
|
94
|
+
new._weight = self._weight
|
|
95
|
+
new.v_genes = dict(self.v_genes)
|
|
96
|
+
new.j_genes = dict(self.j_genes)
|
|
97
|
+
new._vsum = self._vsum
|
|
98
|
+
new._jsum = self._jsum
|
|
99
|
+
return new
|
|
100
|
+
|
|
90
101
|
def merge(self, other):
|
|
91
102
|
"""Merge another EdgeData into this one (for graph union).
|
|
92
103
|
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import copy
|
|
2
2
|
|
|
3
|
+
import networkx as nx
|
|
4
|
+
|
|
3
5
|
from ..graphs.edge_data import EdgeData
|
|
4
6
|
|
|
5
7
|
|
|
@@ -47,9 +49,17 @@ class BayesianPosteriorMixin:
|
|
|
47
49
|
seq_list, abd_list = self._parse_posterior_input(sequences, abundances)
|
|
48
50
|
ind_counts = self._extract_counts_for_posterior(seq_list, abd_list)
|
|
49
51
|
|
|
50
|
-
# 2. Create a lightweight copy
|
|
52
|
+
# 2. Create a lightweight copy with a fast graph clone
|
|
53
|
+
# (avoids copy.deepcopy which does 51M recursive calls on large graphs)
|
|
51
54
|
posterior = copy.copy(self)
|
|
52
|
-
|
|
55
|
+
g = self.graph
|
|
56
|
+
new_g = nx.DiGraph()
|
|
57
|
+
new_g.add_nodes_from(g.nodes())
|
|
58
|
+
new_g.add_edges_from(
|
|
59
|
+
(a, b, {'data': g[a][b]['data'].copy()})
|
|
60
|
+
for a, b in g.edges()
|
|
61
|
+
)
|
|
62
|
+
posterior.graph = new_g
|
|
53
63
|
|
|
54
64
|
# Deep copy mutable dicts that will be modified
|
|
55
65
|
posterior.initial_state_counts = dict(self.initial_state_counts)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: LZGraphs
|
|
3
|
-
Version: 2.3.
|
|
3
|
+
Version: 2.3.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>
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|