Skip to content

Commit 777f5f5

Browse files
authored
Merge pull request #52 from Becksteinlab/skip-no-samples
let cluster.ProcessProtein.reprocess() skip residues with insufficient Gibbs samples
2 parents 17f970f + 63843fc commit 777f5f5

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,17 @@ The rules for this file:
1515
* YYYY-MM-DD date format (following ISO 8601)
1616
* accompany each entry with github issue/PR number (Issue #xyz)
1717
-->
18+
## [1.1.4] - unpublished
19+
20+
### Authors
21+
* @orbeckst
22+
23+
### Fixed
24+
* Have cluster.ProcessProtein.reprocess() record "no result" if
25+
the gibbs.Gibbs.process_gibbs() step fails due to insufficient
26+
number of samples. Otherwise `python -m cluster` fails to process
27+
whole proteins.
28+
1829
## [1.1.3] - 2025-09-11
1930

2031
### Authors

basicrta/cluster.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,22 @@ def _single_residue(self, adir, process=False):
7575
# Total skip interval = g.g * g.gskip, giving niter // (g.g * g.gskip) independent samples
7676
g.gskip = ggskip # process every g.g * g.gskip samples from full chain
7777
g.burnin = self.burnin
78-
g.process_gibbs()
79-
tau = g.estimate_tau()
78+
try:
79+
g.process_gibbs()
80+
except ValueError:
81+
# HACK: triggered when we do not have enough samples for clustering
82+
# TODO: make sure elsewhere that we do not save pickle files
83+
# with insufficient data
84+
# TODO: use a logger and say that we failed for this residue even though
85+
# sampler data was (supposedly) available
86+
result = None
87+
tau = [0, 0, 0]
88+
else:
89+
tau = g.estimate_tau()
90+
else:
91+
tau = g.estimate_tau()
8092
else:
93+
# if the pkl files do not exist
8194
result = None
8295
tau = [0, 0, 0]
8396

0 commit comments

Comments
 (0)