The change in this PR is simple: in rescore_isolated_domain(), if p7_Decoding() returns eslERANGE*, then the bg model is returned to its original form via a call to reparameterize_model() before rescore_isolated_domain() returns an eslFAIL status. Previously, it just returned the eslFAIL status without recovering bg, so that all subsequent work was done with a wrong (and highly biased) bg.
(the eslERANGE result is assumed to mean that the target appears to be repetitive garbage, see Sean's comment in the code)
I've tested this on thousands of highly-repetitive models and sequences found in the raw data for a new Dfam release, and it works as expected: the rare eslERANGE result is handled gracefully (bg model is reset as it should be, subsequent work proceeds as normal).
I've also tested on a few hundred repetitive models/sequences against the unmasked human genome (i.e. tandem repeat regions not masked). In these runs, I have not seen any instances of the eslERANGE result from p7_Decoding(). Considering the repetitiveness of the queries, I expect in-the-wild occurrence of this bug to be quite low.
The change in this PR is simple: in rescore_isolated_domain(), if p7_Decoding() returns eslERANGE*, then the bg model is returned to its original form via a call to reparameterize_model() before rescore_isolated_domain() returns an eslFAIL status. Previously, it just returned the eslFAIL status without recovering bg, so that all subsequent work was done with a wrong (and highly biased) bg.
I've tested this on thousands of highly-repetitive models and sequences found in the raw data for a new Dfam release, and it works as expected: the rare eslERANGE result is handled gracefully (bg model is reset as it should be, subsequent work proceeds as normal).
I've also tested on a few hundred repetitive models/sequences against the unmasked human genome (i.e. tandem repeat regions not masked). In these runs, I have not seen any instances of the eslERANGE result from p7_Decoding(). Considering the repetitiveness of the queries, I expect in-the-wild occurrence of this bug to be quite low.